This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Problem with MsiGetProperty
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 12, 2008
01:01 AM
Problem with MsiGetProperty
I am in an installscript MSI project.
I defined under "System Search" an additional property MY_PROPERTY which contains a path read from the registry.
I read this property in the OnFirstUIBefore method in Setup.Rul without a problem:
nSize = MAX_PATH;
MsiGetProperty( ISMSI_HANDLE, "MY_PROPERTY", sPath, nSize);
This works great.
However, I specified a method myfeature_Installed (accessed from Move Dara -> myfeature, Installed) which comes into featureevents.rul. In this method, I would need to get this property as well, but:
nSize = MAX_PATH;
MsiGetProperty( ISMSI_HANDLE, "MY_PROPERTY", sPath, nSize);
this MsiGetProperty returns an empty sPath and nSize is 0.
Why can't I readout this property in after the installation? What other possibility do I have to read this property?
I defined under "System Search" an additional property MY_PROPERTY which contains a path read from the registry.
I read this property in the OnFirstUIBefore method in Setup.Rul without a problem:
nSize = MAX_PATH;
MsiGetProperty( ISMSI_HANDLE, "MY_PROPERTY", sPath, nSize);
This works great.
However, I specified a method myfeature_Installed (accessed from Move Dara -> myfeature, Installed) which comes into featureevents.rul. In this method, I would need to get this property as well, but:
nSize = MAX_PATH;
MsiGetProperty( ISMSI_HANDLE, "MY_PROPERTY", sPath, nSize);
this MsiGetProperty returns an empty sPath and nSize is 0.
Why can't I readout this property in after the installation? What other possibility do I have to read this property?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 12, 2008
09:01 AM
I'm not sure, but it may be due to the changes in the scripting engine with IS 12. OnInstalled is now called directly from the script instead of as a custom action in the MSI, so I'm not sure if it has access to MSI properties. You might want to dig through the IS help documentation on upgrading from 11.5 and earlier to 12 to see if you can find that out for sure what the sequencing of the event handlers is with regards to the MSI.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 12, 2008
09:23 AM
Thank you Kathy
I have finally solved the problem. Instead of putting my code into OnInstalled, I created a InstallScript Custom Action and call it during the installation. It seems to work.
I have finally solved the problem. Instead of putting my code into OnInstalled, I created a InstallScript Custom Action and call it during the installation. It seems to work.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)