cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AcuoMEC
Level 3

Upgrading InstallShieldX to InstallShield2008

I am upgrading an InstallScript MSI project from InstallShieldX to InstallShield2008. In X I used events OnMoving and OnMoved to execute several functions. This worked great in X but failed in 2008. I found an upgrade document and converted the OnMoving function into export prototype MyOnMoving(HWND) and added it as a "Deferred execution in system context" Custom Action after InstallInitialize as detailed in the document. It executes but MsiGetProperty returns all properties as "". I no longer have access to the global Property variables and MsiEvaluateCondition fails with the error Invalid handle or conditional expression syntax error. The same steps were used to convert OnMoved to MyOnMoved.

I need to execute the functions to set and revoke registry, service and folder security for the product being installed. I assumed using the HWND passed to MyOnMoving would give me access to the global properties I set using MsiSetProperty earlier in the installer. I had easy access to these global properties in InstallShieldX. Do I need to export the other functions? Any suggestions?
Labels (1)
0 Kudos
(2) Replies
DebbieL
Level 17

InstallScript functions that are called as InstallScript custom actions no longer have access to global variables and pointers. As a result, if you need to store a value across multiple InstallScript custom action calls, you must use some external mechanism such as the registry, Windows Installer properties, or an external data file to store the information between calls.

If you choose to use Windows Installer properties in deferred, commit, or rollback InstallScript custom actions, see the guidelines in the "Windows Installer Properties and Deferred, Commit, and Rollback InstallScript Custom Actions" section of the following help topic:
Upgrading InstallShield 11.5 or Earlier InstallScript MSI Projects

I hope that helps.
0 Kudos
AcuoMEC
Level 3

Thanks for the quick reply. I found some links which helped and was able to get the install working but priority changes have kept me off this project.

I changed my InstallScript functions called in OnInstalled and similiar events to custom actions: I modified the code to export prototype and added them to the Custom Action list, immediate execution. I inserted them after InstallFinalize and they seem to be working again.This may not be the best way to do it but I needed to get the installer working ASAP.

The documentation said to change them to Defered Execution in System Context but you have to pass all the properties in CustomActionData and parse them back out, use the registry to pass parameters or some other method to get the modified properties.

I found the following helpfull links after much searching:

http://community.installshield.com/showthread.php?t=169870
http://community.installshield.com/showthread.php?t=167564
0 Kudos