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
- :
- Custom Actions Not Executing in UPDATE
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
‎Mar 28, 2012
05:33 PM
Custom Actions Not Executing in UPDATE
I have several custom actions that execute correctly during a first install. Each calls an InstallScript function that checks a condition and sets a property.
These do not seem to execute if the installer detects that it shoud be an update. ???
They are all marked for Immediate Execution and exist in the Install UI Sequence.
Something I'm missing ??
Thanks.
PS - this is an InstallScript MSI project implemented with 2012
These do not seem to execute if the installer detects that it shoud be an update. ???
They are all marked for Immediate Execution and exist in the Install UI Sequence.
Something I'm missing ??
Thanks.
PS - this is an InstallScript MSI project implemented with 2012
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 29, 2012
02:56 AM
What do you have as Install (UI/Exec) Condition for those Custom Actions?
You can try to set the condition to 1 so they will be always executed whether is install, repair, modify, upgrade, etc.
You can try to set the condition to 1 so they will be always executed whether is install, repair, modify, upgrade, etc.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2012
12:19 PM
Thanks for the suggestion. I set the condition to 1, but the behavior does not change.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2012
03:21 PM
This is a limitation imposed by Windows Installer due to the architecture of InstallScript MSI projects. In an InstallScript MSI project, the InstallScript engine manually opens the MSI package to run the UI sequence through calling the MsiDoAction API for any actions that could normally run (because InstallScript serves as an external UI handler to the MSI package being installed, UI sequence actions would normally never run). In order to accomplish this through MSI APIs when the product is already installed and the package code has changed (i.e. running an upgrade) the InstallScript engine passes the MSIOPENPACKAGEFLAGS_IGNOREMACHINESTATE to the MsiOpenPackageEx API to avoid an error in opening the package normally. Per the MsiOpenPackageEx documentation:
Since InstallScript custom actions are launched from a DLL, these actions will not run in situations where the product code does not change but the package code does change (small updates, minor upgrades) if sequenced in the UI sequence.
In order to get this script code to run during all scenarios, it should be moved to a script event (such as OnBegin) or the custom action should be sequenced in the install execute sequence.
Note that if dwOptions is MSIOPENPACKAGEFLAGS_IGNOREMACHINESTATE or 1, MsiOpenPackageEx ignores the current machine state when creating the product handle.
...
The restricted handle created by using MsiOpenPackageEx with MSIOPENPACKAGEFLAGS_IGNOREMACHINESTATE only permits execution of dialogs, a subset of the standard actions, and custom actions that set properties ( Custom Action Type 35, Custom Action Type 51, and Custom Action Type 19). The restricted handle prevents the use of custom actions that run Dynamic-Link Libraries, Executable Files or Scripts.
Since InstallScript custom actions are launched from a DLL, these actions will not run in situations where the product code does not change but the package code does change (small updates, minor upgrades) if sequenced in the UI sequence.
In order to get this script code to run during all scenarios, it should be moved to a script event (such as OnBegin) or the custom action should be sequenced in the install execute sequence.