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: Installscript MSI - Can i allow downgrades?
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
‎May 12, 2015
02:21 PM
Installscript MSI - Can i allow downgrades?
Im trying to figure out how to ALLOW the user to downgrade from lets say version '5.10.5.4' to '5.10.3.1'
I have been looking at the Upgrade table in the direct editor and i cannot see how this is being detected.
I also looked for the Custom Action called ISPreventDowngrade but im not seeing it either
I have been looking at the Upgrade table in the direct editor and i cannot see how this is being detected.
I also looked for the Custom Action called ISPreventDowngrade but im not seeing it either
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2015
07:13 PM
PlinyElder wrote:
Im trying to figure out how to ALLOW the user to downgrade from lets say version '5.10.5.4' to '5.10.3.1'
I have been looking at the Upgrade table in the direct editor and i cannot see how this is being detected.
I also looked for the Custom Action called ISPreventDowngrade but im not seeing it either
ISPreventDowngrade is a "type 19" custom action, meaning that it forces a fatal error, then displays an error message (or just writes to the Event Log if running unattended), and exits the install. It is set up to detect newer versions by using the Upgrade table.
The Upgrade table defines the search condition(s) for the MSI that you're trying to detect. InstallShield sets it to check for it's own UpgradeCode and look for any version newer than the current version. If it finds one that is newer, it sets a Property named ISFOUNDNEWERPRODUCTVERSION. So the ISPreventDowngrade custom action is set to only run if the Propertry ISFOUNDNEWERPRODUCTVERSION exists (because otherwise a newer version wasn't found).
The Upgrade table is where the detection of newer (or older) versions takes place. It can also be used to detect unreleated MSI's such as Adobe Reader or MS Office. So if you create a transform file (for example) and change the condition on ISPreventDowngrade to 0 instead of ISFOUNDNEWERPRODUCTVERSION, you'll be able to downgrade because it will skip the custom action. And if you change the ISPreventDowngrade condition to 1, you'll find it impossible to ever install because you'll get the type 19 custom action error always telling you that a newer version is installed (even if one isn't).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
09:11 AM
Thanks for the information Evan, so in the case of an Installscript project, there is no Upgrade table. How is that handled in this case?
**EDIT**
I found the solution in pure Installscript. Its under the OnUpdateUIBefore()
**EDIT**
I found the solution in pure Installscript. Its under the OnUpdateUIBefore()
// Check whether the update is older than the currently installed version.
if( nResult = VERSION_COMPARE_RESULT_OLDER ) then
szMsg = SdLoadString( IDS_IFX_ERROR_UPDATE_NOT_APPROPRIATE );
SdSubstituteProductInfo( szMsg );
MessageBox( szMsg, SEVERE );
abort;
endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2015
02:39 PM
PlinyElder,
I looked through the help for the InstallScript setup package options and I do not see a way to 'downgrade' newer versions without requiring users to first uninstall the existing product.
If you happen to know the 'newer' version you might get away with using the Release Wizard and on the update page specify 'version specific' and specify the 'newer' versions. But if you want this to affect any possible 'newer' version then i suspect your users will be required to uninstall first.
The other option is to see if you can intercept the process with the 'OnAppSearch' event. To expose this event in your InstallScript view select 'Before Move Data' from the first drop down box, then select OnAppSearch on the next. The default text added to this states the following:
Unfortunately I have not generated an InstallScript setup for deployment for years and this is a bit rusty for me.
I wonder if you can detect the newer versions of the application and if found, uninstall the app. I am not certain how this works with InstallScript because traditionally you require a response file for the setup to do things silently. If your UI can vary depending on context then a response file will be very difficult to implement. 😞
I looked through the help for the InstallScript setup package options and I do not see a way to 'downgrade' newer versions without requiring users to first uninstall the existing product.
If you happen to know the 'newer' version you might get away with using the Release Wizard and on the update page specify 'version specific' and specify the 'newer' versions. But if you want this to affect any possible 'newer' version then i suspect your users will be required to uninstall first.
The other option is to see if you can intercept the process with the 'OnAppSearch' event. To expose this event in your InstallScript view select 'Before Move Data' from the first drop down box, then select OnAppSearch on the next. The default text added to this states the following:
//---------------------------------------------------------------------------
// OnAppSearch
//
// The OnAppSearch event is called after OnBegin and can be used to search
// for previous versions of the current application. This event is called
// only when the setup is running in first install mode.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------
Unfortunately I have not generated an InstallScript setup for deployment for years and this is a bit rusty for me.
I wonder if you can detect the newer versions of the application and if found, uninstall the app. I am not certain how this works with InstallScript because traditionally you require a response file for the setup to do things silently. If your UI can vary depending on context then a response file will be very difficult to implement. 😞
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)