Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

Conditions of Custom Actions Used in MSI

Updated: 11 Jun 2007 | 6 comments
WiseUser's picture
0 0 Votes
Login to vote

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.

  1. Action run only during Install
    Condition: NOT Installed AND NOT PATCH
  2. Action only runs during removal of MSI
    Condition: REMOVE
  3. Action runs during Install and repair
    Condition: NOT REMOVE
  4. Action runs during Install and remove
    Condition: There must be no condition
  5. Action calls EXE installed by MSI
    Condition:NOT Installed AND NOT PATCH
  6. Run on initial installation only:
    NOT Installed
  7. Run on initial install or when repair is selected.
    NOT Installed OR MaintenanceMode="Modify"
  8. Run when being uninstalled from command line or add / remove menu.
    REMOVE~="All" OR MaintenanceMode="Remove"

Comments

rpfenninger's picture
10
Jun
2007
0 Votes 0
Login to vote

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].

Harsh Mokal's picture
11
Jun
2007
0 Votes 0
Login to vote

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 =~

R-Vijay's picture
09
Aug
2007
0 Votes 0
Login to vote

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

gr's picture
13
Dec
2007
0 Votes 0
Login to vote

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

piyushnasa's picture
30
May
2008
0 Votes 0
Login to vote

$ 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/

piyushnasa's picture
12
Aug
2008
0 Votes 0
Login to vote

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/