cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jimmyshaker
Level 2

Two things for a n00b

I'm working on a Basic MSI using InstallShield 2008 Pro.

Two things that I have left to do with this is package is:

1) On installation, if a specific registry key exists, I want the package to abort with a message stating "Program A seems to be installed, please remove Program A first before installing this package."

2) On removal, AND ONLY REMOVAL, if a specific registry key or file exists, I want the package to abort with a message stating, "Program B is installed. Remove Program B first before removing this package."

I've used a launch condition to search for a specific registry key, but I can only get the package to abort only if the registry key doesn't exist.

How do I get to do it the other way and have it just look on a removal?

Thanks in advance,
js.
Labels (1)
0 Kudos
(3) Replies
Kelter
Level 10

1) On installation, if a specific registry key exists, I want the package to abort with a message stating "Program A seems to be installed, please remove Program A first before installing this package."


Use a system search to store a value under that particular key to a property. Let's say the property is called PROGA_INSTALLED. In a launch condition, use the condition
PROGA_INSTALLED=""
and set the message for when this is false. (ie: when the reg entry exists)

2) On removal, AND ONLY REMOVAL, if a specific registry key or file exists, I want the package to abort with a message stating, "Program B is installed. Remove Program B first before removing this package."

Use a system search to store a value under this key to a property...lets say PROGB_INSTALLED. Create an Error (type 19) CA. Schedule it after LaunchConditions in both the UI and EXE sequences, but schedule it to only run once. Set the condition to PROGB_INSTALLED and assign it an appropriate message.

Enjoy!
0 Kudos
jimmyshaker
Level 2

Kelter wrote:

Use a system search to store a value under this key to a property...lets say PROGB_INSTALLED. Create an Error (type 19) CA. Schedule it after LaunchConditions in both the UI and EXE sequences, but schedule it to only run once. Set the condition to PROGB_INSTALLED and assign it an appropriate message.

Enjoy!


I followed (at least I think I did :confused:) your steps above. I could never get it to do what I wanted it to do (check for a registry key only on uninstall and abort if registry key exists). It just seems to ignore it altogether.

I set up the System Search using a registry key path with PROGB_INSTALLED as the property.

This is what I have set up for the CA Type 19 Error:

Error Message: Blah blah blah
Return Processing: Synchronous (Check exit code)
In-Script Execution: Immediate Execution
Execution Scheduling: Execute only once
Install UI Sequence: After LaunchConditions
Install UI Condition: PROGB_INSTALLED
Install Exec Sequence: After LaunchConditions
Install Exec Condition: PROGB_INSTALLED

Did I miss something? Remember, I'm a total n00b to all this.

Thanks for your help!
js.
0 Kudos
Kelter
Level 10

The system search shouldn't be only running on uninstall...i'm not quite sure how you'd do that, actually... Perhaps I should have said that the condition on the type 19 CA should have been

PROGB_INSTALLED AND REMOVE.

Take a look at the msilog for clues and detailed information about what happened in the installation. If you are running from an msi, you can use the commandline

.msi /lv logfile.log

or if you are calling from setup.exe, use

setup.exe /v"/lv logfile.log"

these logs are handy for checking the values of properties, execution of CAs, etc...
0 Kudos