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
- :
- Re: Determine install/uninstall in custom action
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
‎Feb 14, 2008
04:44 AM
Determine install/uninstall in custom action
I am in an InstallScript MSI project. I have defined an installscript and a custom action which uses this script.
The script is called as well during installing as during uninstall. The behaviour of the script would need to be different depending on (un)install.
How do I check within such a script if he feature is being installed or uninstalled?
The script is called as well during installing as during uninstall. The behaviour of the script would need to be different depending on (un)install.
How do I check within such a script if he feature is being installed or uninstalled?
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 14, 2008
04:52 AM
You can retrieve properties using somthing like:
Depending on the exact conditions that you want you can do something like:
session.property("PROPERTYNAME")
Depending on the exact conditions that you want you can do something like:
If session.property("REMOVE")="ALL"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 14, 2008
07:03 AM
I found a way to determine if I am installing or uninstalling.
I added in the installscript method of the custom action:
if MAINTENANCE then
MessageBox("Uninstall", INFORMATION);
endif;
if !MAINTENANCE then
MessageBox("Install", INFORMATION);
endif;
But, InstallShield behaves not quite as expected:
- when installing, I get in the MessageBox: Uninstall
- when uninstalling, I get in the MessageBox: Install
I thought MAINTENANCE is active when installing, but it seems it is active when uninstalling...
I added in the installscript method of the custom action:
if MAINTENANCE then
MessageBox("Uninstall", INFORMATION);
endif;
if !MAINTENANCE then
MessageBox("Install", INFORMATION);
endif;
But, InstallShield behaves not quite as expected:
- when installing, I get in the MessageBox: Uninstall
- when uninstalling, I get in the MessageBox: Install
I thought MAINTENANCE is active when installing, but it seems it is active when uninstalling...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 14, 2008
07:42 AM
Apologies I didnt see you wanted Installscript.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 14, 2008
10:48 AM
You should read manual on MAINTENANCE variable, which says: "This system variable is set to TRUE if your installation program is running in maintenance mode, or set to FALSE for a first-time installation.". According to this you will have correct script:
But the opposite is not true. If you have set MAINTENANCE variable, it doesn't mean user uninstalls the product. It means whatever it says user in maintenance mode which includes different types, such as MODIFY, REPAIR and REMOVEALL. You will be interesting in REMOVEALL type only if you need to identify uninstallation.
Hope this helps.
if (!MAINTENANCE) then
MessageBox("Install First Time", INFORMATION);
endif;
But the opposite is not true. If you have set MAINTENANCE variable, it doesn't mean user uninstalls the product. It means whatever it says user in maintenance mode which includes different types, such as MODIFY, REPAIR and REMOVEALL. You will be interesting in REMOVEALL type only if you need to identify uninstallation.
Hope this helps.