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
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)
Please log in to answer
Posted by:
WiseUser
19 years ago
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.
Try this "set property" action as your "Immediate" 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:
Type: 1062
Source:
Target: Msgbox Property("CustomActionData")
Remember that property names are case-sensitive.
Posted by:
DuncanPaul
19 years ago
Posted by:
DuncanPaul
19 years ago
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.
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
Posted by:
DuncanPaul
19 years ago
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.
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.