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
- :
- Re: passing properties between immediate execution CA's
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
‎Dec 29, 2008
11:55 AM
passing properties between immediate execution CA's
I have an immediate customaction that must execute after UI ExecuteAction that requires the value of INSTALLDIR.
I've created MyInstallDir installscript function and interted it after CostFinalize. It calls MsiSetProperty(hMSI, "INSTALLDIR", INSTALLDIR); Debug shows that INSTALLDIR Property is correct, and MsiSetproperty returns Error_Success.
The "After UI ExecuteAction" CA calls MsiGetProperty(hMSI, "CustomActionData", szInstallDir, MAX_PATH);
However szInstallDir is Null.
What needs to be done so that the "After UI ExecuteAction" CA obtains the correct INSTALLDIR value?
Thanks for your help.
I've created MyInstallDir installscript function and interted it after CostFinalize. It calls MsiSetProperty(hMSI, "INSTALLDIR", INSTALLDIR); Debug shows that INSTALLDIR Property is correct, and MsiSetproperty returns Error_Success.
The "After UI ExecuteAction" CA calls MsiGetProperty(hMSI, "CustomActionData", szInstallDir, MAX_PATH);
However szInstallDir is Null.
What needs to be done so that the "After UI ExecuteAction" CA obtains the correct INSTALLDIR value?
Thanks for your help.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 29, 2008
04:59 PM
The CustomActionData property is used with custom actions sequenced in the install execute sequence with an in-script execution setting of a deferred type. Any action sequenced after ExecuteAction would imply the action is in the install UI sequence, so the INSTALLDIR property can be read directly.
Note that to correctly change INSTALLDIR after CostFinalize and ensure the Directory entry and any sub-entries are re-resolved, the MsiSetTargetPath API should be used instead of MsiSetProperty. If the action were sequenced before CostFinalize, MsiSetProperty would be correct.
Note that to correctly change INSTALLDIR after CostFinalize and ensure the Directory entry and any sub-entries are re-resolved, the MsiSetTargetPath API should be used instead of MsiSetProperty. If the action were sequenced before CostFinalize, MsiSetProperty would be correct.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 29, 2008
06:50 PM
Thanks very much for the response.
2 questions in follow-up.
I placed the immediate custom action CA after UI ExecutiveAction because it does a msiexec. I had made it deferred (and between InstallInitialize and InstallFinalize), but the msiexec would not execute due to one already active. Is there a way to make it deferred? In that event, what is the sequencing?
If the CA is after UI ExecutiveAction, what is the API for rollback in case something fails?
Thanks again.
2 questions in follow-up.
I placed the immediate custom action CA after UI ExecutiveAction because it does a msiexec. I had made it deferred (and between InstallInitialize and InstallFinalize), but the msiexec would not execute due to one already active. Is there a way to make it deferred? In that event, what is the sequencing?
If the CA is after UI ExecutiveAction, what is the API for rollback in case something fails?
Thanks again.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 30, 2008
11:12 AM
A custom action that launches msiexec.exe to run another installation would need to be sequenced in the install UI sequence. Custom actions in the UI sequence cannot be deferred, they can only be immediate execution. Sequencing after ExecuteAction should be fine.
Since the parent installation is already committed on the machine after ExecuteAction runs, there is no way to perform a rollback if a child install from a custom action fails. Due to this limitation (and the limitation of only being able to run another MSI installation from the UI sequence), Windows Installer 4.5 provides installation chaining support. Chaining allows multiple MSI packages to be installed from one package (including in a silent install) and provides the overall installation with transaction support, meaning if one of the installations fails, everything will be rolled back and removed from the machine. More information on installation chaining can be found in the Overview of Multiple-Package Installations that Use Transaction Processing help doc.
Since the parent installation is already committed on the machine after ExecuteAction runs, there is no way to perform a rollback if a child install from a custom action fails. Due to this limitation (and the limitation of only being able to run another MSI installation from the UI sequence), Windows Installer 4.5 provides installation chaining support. Chaining allows multiple MSI packages to be installed from one package (including in a silent install) and provides the overall installation with transaction support, meaning if one of the installations fails, everything will be rolled back and removed from the machine. More information on installation chaining can be found in the Overview of Multiple-Package Installations that Use Transaction Processing help doc.