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

Run custom Action during Install and Modify, but not on Upgrade? (IS2009, Basic MSI)

I have a Basic MSI Setup which does some file modifications (plain-text config file, no XML unfortunately) which has to receive a few values entered by the user.
This is done using InstallScript called at the end of the Exec Sequence, "After InstallFinalize" - this works in general.

Now I noticed that something is wrong during Upgrades...the values are supposed to be entered by the user, while the Upgrade does not ask for any input. As a result, the config file was overwritten with its default values - this should be disabled.

After some playing around (someone suggested "AND RESUME" over here), it seems I even broken it for Modify and Install itself, because the condition never applies now.

This is what I have right now:
Function Name          | ModifyConfig
Return Processing | Synchronous
In-Script Execution | Immediate Execution
Execution Scheduling | Always execute
Install Exec Sequence | After InstallFinalize
Install Exec Condition | (&Server = 3 OR !Server = 3) AND NOT RESUME AND NOT PATCH AND NOT REMOVE

Server is the Feature which triggers the config file modification; it should run when Server is either to be installed (in case of &Server = 3, applies to Installation) or already installed (in case of !Server = 3, applies to Modify).
Adding this Resume/Patch/Remove thing apparently broke it afterwards (by chance, it does apply to Upgrade scenarios since the latter 3 conditions just evaluate to false, by coincidence doing what i want).

Some testing revealed that Resume/RESUME and Patch/PATCH are not set (or not evaluating to true; unless they use some other casing) when doing either Upgrade or Modify.

Since the condition is obviously wrong, could anyone shed some light on how it should be done correctly?
Labels (1)
0 Kudos
(1) Reply
BhaaLseN
Level 3

Guess a lot of Trial&Error ever leads to some solution, the one way or the other.

Here's what I did for now:
- Defined a new Property "IS_UPGRADE" (must be all upper-case for some reason, using "IsUpgrade" does not work), initialized to 1 by default.
- Set the Property to 0 in case of InstallWelcome and MaintenanceWelcome, but leave it 1 when _IsMaintenance = "Remove" (since NOT REMOVE does not work either)
- Changed the condition to "(&Server = 3 OR !Server = 3) AND (IS_UPGRADE = 0)".

Either way, I'm still wondering if IS provides any built-in properties for that, its a bit odd that I seem to have to define those things myself. Any Docs on that, anywhere?
0 Kudos