/build/static/layout/Breadcrumb_cap_w.png

Execute Deferred and Properties

Hi all,
I have the following problem: I need to read properties from the MSI and do stuff with them in Execute Deferred (so as to get elevated priviledges).
I've followed the following procedure:
http://www.installshield.com/news/newsletter/0308-articles/CustomActionData.asp
and it works fine, for the property used in the document, however I can't seem to get it to read / set any other properties.
Specifically, I'm trying to store the SourceDir Property, as need to use this in a vbs in execute deferred.

I am able to use session.property("SourceDir") in Execute Immediate, and return that property in an embedded vbs, but can't seem to use SourceDir in a set property custom action (as per document above.)

any help much appreciated

0 Comments   [ + ] Show comments

Answers (7)

Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
2
Remember that the "ResolveSource" action should be run before the "SourceDir" property will be available. If you are successfully reading this within the "immediate" sequence, then that should not be your issue.

Try this "set property" action as your "Immediate" action:

Action: Test Action
Type: 51
Source: Testing123
Target: [SourceDir]

This action must be after "CostInitialize" and "ResolveSource", but before "InstallFinalize".

Try this "embedded VBScript" action as your "Deferred" Action:

Action: Testing123
Type: 1062
Source:
Target: Msgbox Property("CustomActionData")



Remember that property names are case-sensitive.
Posted by: DuncanPaul 19 years ago
Orange Belt
0
brilliant, that'll be it, I hadn't clicked that it relied on resolvesource. have deleted it out of frustration, but I'm sure you'd hit the nail with the package there. thanks
Posted by: MSIMaker 19 years ago
2nd Degree Black Belt
0
Well done WiseUser.....rated for 2 points with that one.
Posted by: DuncanPaul 19 years ago
Orange Belt
0
yeah that was a nice catch,.. so while the fatbrains are on a roll..

the actual reason I need to do this, is so can include in a merge module to allow us to add it to any msi, and have it do these actions. Problem I now have is that I can't seem to name the property correctly:

In my MSM I give the VBScipt CA a name, but when include module to an msi it appends the package code guid of the merge module to the CA name (in the msi). I imagine this is so you can identify where properties come from, but the issue is that I then have to, in the merge module, in the set property CA in execute immediate, set the correct property name, ie Testing123.{packageguid}.
Problem is this is too long for the field.

any suggestions much appreciated.

-- update, this turned out to be an issue with the field formatting in wise, so couldn't fit the propertyname.guid in the field, I edited it in Orca and was no problem. only issue is that if you then edit the wsm in wise again, and recompile, it truncates it. ugly.
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
ORIGINAL: MSIMaker

Well done WiseUser.....rated for 2 points with that one.


Thanks Jim!
Posted by: DuncanPaul 19 years ago
Orange Belt
0
OK, so, sorry to revive an old post, but has come back in a new way...

Does anyone know how vbscript Custom actions resolve paths? I have an issue with a vbs ca that works outside the msi, works inside the msi against a local path, but doesn't work if the path is non local. It seems to behave the same whether is UNC or a mapped drive, or even subst'd. I've also checked that long paths locally, with spaces etc in them still work.

I've debugged the script and it appears to encapsulate the path in 3 sets of quotes when it stores it, but if you message box the variable out it strips these quotes. I think this is what is messing it up in the embedded custom action, as I use the path to do a FolderExists(path) and its acutally doing FolderExists("""path""")

any thoughts much appreciated..

.. update, I know have you all on edge of seats... UNC path will work to local drive, but not to remote drive. weird. have seen this issue before, but can't find the post.
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
OK, the only thing I can think of is instead of encapsulating the long path (with spaces) in quotes, try using CHR(34), which is a quote.

eg:

CHR(34) & "C:\Program Files\Application Name\Version Number" & CHR(34)
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ