Conditions of Custom Actions Used in MSI
Updated: 11 Jun 2007 | 6 comments
This tip actually covers several conditions and how they are used. It does not cover every situation but it should be able to guide you in the right direction to find the set of conditions you need for your solution with Wise installation products. These Conditions can vary for InstallShield-based applications.
These conditons can be used in custom actions, in Tables, and Component installations.
You can execute a custom action or make the component install using conditions as per the requirement.
- Action run only during Install
Condition: NOT Installed AND NOT PATCH - Action only runs during removal of MSI
Condition: REMOVE - Action runs during Install and repair
Condition: NOT REMOVE - Action runs during Install and remove
Condition: There must be no condition - Action calls EXE installed by MSI
Condition:NOT Installed AND NOT PATCH - Run on initial installation only:
NOT Installed - Run on initial install or when repair is selected.
NOT Installed OR MaintenanceMode="Modify" - Run when being uninstalled from command line or add / remove menu.
REMOVE~="All" OR MaintenanceMode="Remove"
Blog Entry Filed Under:
The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments
Wrong Condition
As far as I can see, there's a mistake in Condition No. 3:
To let an action run during install and remove, you can not set the condition to NOT REMOVE (as it won't run during remove that way).
However, an action with this condition will run on install and [b]repair[/b].
Apart from above mention
Apart from above mention condition there can be user defined condition. Example Any user defined PUBLIC property can be a condition over Custom Action. Example if packager set a Property using APPSearch Table / System Search. This can be set as a property for custom Action.
One more thing like to add is in condition 8, I guess there is a Typo error, it should be
REMOVE~="All"
as ~= is used for case sensitivity not =~
Difference between Execute immediate / Execute Deferred
Immediate
Custom actions, can be sequenced anywhere within any of the sequence tables
Custom actions have access to the Installation database
Custom actions can only run in the User Context
Custom actions should never modify the system state. i.e. should not run in elevated context
Deferred
Custom actions can be sequenced only between the InstallInitialize and InstallFinalize actions in the sequence tables
Custom actions doesn’t have access to the Installation database
Custom actions can run both in the context of the user and elevated using the system context.
Custom actions can modify the system state.i.e can be run in elevated context.
Microsoft MVP [Setup-Deploy]
Weblog: www.msigeek.com
Condition for Updates
Hi,
I have 2 update patches for my setup. I want a custom action to run during the first time install and during Patch01. But if Patch01 is already installed I don't want the custom action to run during the Patch02. What would the condition be?
Thanks
$ sign in the condition
Can you please elaborate what are "$" sign used for in the Condition of Custom Actions. We can see these in Custom Actions of Vendor MSI.
Thanks
Piyush Nasa Altiris Certified Professional (ACP)
http://msiworld.blogspot.com/
One more condition
I came across one more condition which might be helpful to all.
If you want your CA to run only if it is upgrading a previous version then you can put the UPGRADE_1 (Upgrade property) in the condition.
Hope this is helpful.
Piyush Nasa Altiris Certified Professional (ACP)
http://msiworld.blogspot.com/
Would you like to reply?
Login or Register to post your comment.