cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tcom36
Level 7

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?
Labels (1)
0 Kudos
2 Replies
KathyMorey
Level 10

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.
0 Kudos
tcom36
Level 7

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.
0 Kudos