cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Jim1236
Pilgrim

Tutorial to uninstall old version and then install new version in single installation

Hi,

Could anyone provide steps to uninstall old version and then install new version during installation?
I just couldn't get this up where it keep prompts me error from the situation below:

With package code, product version changed, product code and upgrade remain unchanged.
It gives me error "Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel."

With package code, product code, and product version changed, upgrade code remain unchanged.
It gives me error "A newer version of this application is already installed on this computer. If you wish to install this version, please uninstall the newer version first. Click OK to exit the wizard."

My setting for the Upgrade settings are as below:
Small/Minor Upgrade Settings
- Disable

Major Upgrade Settings
- Completely uninstall old setup before installing new setup
- Products sharing my Upgrade code.
- Min version : Blank
- Include Min version : No
- Max version : ***ALL_VERSIONS***
- Include Max version : No
- Detect Only : Yes
- Detect Property : ISFOUNDNEWERPRODUCTVERSION

Any idea what should I do so that i can just uninstall the previous installed version if found and then continue to install new version in a single installation?
Labels (1)
0 Kudos
13 Replies
Flexera tjohnson1
Flexera

Re: Tutorial to uninstall old version and then install new version in single installation

The second scenario is the correct setup but you made the mistake of editing the prevent downgrade item instead of creating a new major upgrade item. The prevent downgrade item is used to check for higher versions but since you changed it to earlier versions you are seeing the message when you normally wouldn't.

Prevent Downgrade item: http://helpnet.flexerasoftware.com/installshield20helplib/installshield20helplib_CSH.htm#helplibrary...
Creating a Major Upgrade: https://flexeracommunity.force.com/customer/articles/en_US/INFO/Q211822
0 Kudos
Jim1236
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

tjohnson1 wrote:
The second scenario is the correct setup but you made the mistake of editing the prevent downgrade item instead of creating a new major upgrade item. The prevent downgrade item is used to check for higher versions but since you changed it to earlier versions you are seeing the message when you normally wouldn't.

Prevent Downgrade item: http://helpnet.flexerasoftware.com/installshield20helplib/installshield20helplib_CSH.htm#helplibrary...
Creating a Major Upgrade: https://flexeracommunity.force.com/customer/articles/en_US/INFO/Q211822



I don't get you what does it mean i edited the Prevent Downgrade Item?
What setting did i changed where i can't really trigger the installer to uninstall the previous version?
0 Kudos
DLee65
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

Select Media > Upgrades
Expand the tree for '+ Upgrade Windows Installer Setup' if it is not already expanded.
Select this top tree item and view the settings. This controls how the uninstall works. For me I completely uninstall the old setup before installing a new setup because there are some unversioned files that I find problematic with the second option. But the second option is faster. It is worth testing to see if it will work for you.
You want to add a new entry here if it does not already exist. The default entry for Prevent downgrades is inserted when you create a new project and is ONLY for detecting a newer version. Do not modify this entry, create a new one using a right click on the top of the tree and select option for a new major upgrade item.
I have an entry for "NewUpgradeForCurrentProject" (note that the name is not important, it just helps me to identify it)
On the Common Tab select the option 'Products sharing my upgrade code'. NOTE: Never change your upgrade code for an active product. Only change your product code and product version and package code.
You can specify a range of version numbers to include or select 'Any earlier version'.
Double check the advanced tab - these should be automatically set for you based on your settings on Common. Note that by default Maximum Version is set to ***ALL_VERSIONS***. This is because when your project builds, InstallShield will inject the current Product Version here.
Set a Detect Property here. You can use this detect property to specify a message to display like notifying the consumer that the current version will be uninstalled. However, it is not necessary to do this. I don't but I just wanted to point out that you can use this property to control the text on a particular dialog, for instance the welcome dialog.

It can take a little bit to better understand the upgrade process. MSDN has some great articles on the upgrades. When you have a chance do a search for MSDN major upgrade and also MSDN windows installer patches. It will help in the long run because you will better understand what options are available to you.
0 Kudos
DLee65
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

I just read your post again.

One thing to note is that for a major upgrade, which involves the uninstall process you desire, you MUST change the product code.
We see the message you indicated during internal testing because I do not alter the product code for each build, just at the start of the build cycle. So QA must manually uninstall the previous version in this case. However, they are required to test upgrade from a previous release where the package code has changed.

The configuration that you described is a minor upgrade scenario.
0 Kudos
Jim1236
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

Ya, the problem i faced now is that user has to manually uninstall the previous version and then only proceed to install the new version.
This is to be avoided for user experience purposes.

I attempt to create a major upgrade, and somehow it is successful now where the previous version is uninstalled first and the new version will be installed.
Somehow the process is something like a normal new installation where i just need to double click the executable, and it will undergo a normal new installation.
When the new installation progress takes place, i noticed that the previous version is being uninstall silently without notifying the user.
I need to show user that the previous version will be uninstall via a message.
Does the Detect Property you mentioned is used for the message box I needed?
I need to do it with a InstallScript? or could you advise me a proper way of doing this?
0 Kudos
Jim1236
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

I've got it to work where it detects any existing earlier version, it will uninstall it and install the new version.
Then what if it detects any existing advanced version, is it possible to make it to uninstall first and then install the new version using the Major Upgrade?
Which means i just want it to uninstall any existing version regardless of the version and the proceed with the new installation. is this possible?
0 Kudos
DLee65
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

It is certainly possible.
When you create a new MSI installer package in InstallShield a default entry is added to the upgrade table.

Under Media check 'Upgrades'
Look under 'Upgrade Windows Installer Setup'. Read through the Upgrades View help documentation on the right.
Look for the ISPreventDowngrade entry.
Note that if you look at the Advanced settings, this is a 'Detect Only' option. Basically it will detect if a version exists newer than the version displayed in the UI. If one does exist it sets the property ISFOUNDNEWERPRODUCTVERSION, what you do with this property is up to you. In the InstallExecuteSequence there is a custom action that uses this property, ISPreventDowngrade.

I think you can achieve what you want by deleting the ISPreventDowngrade entry in the Upgrades view. Hopefully the info above helps you better understand how all of this fits together. Smiley Happy
0 Kudos
Jim1236
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

DLee65 wrote:
It is certainly possible.
When you create a new MSI installer package in InstallShield a default entry is added to the upgrade table.

Under Media check 'Upgrades'
Look under 'Upgrade Windows Installer Setup'. Read through the Upgrades View help documentation on the right.
Look for the ISPreventDowngrade entry.
Note that if you look at the Advanced settings, this is a 'Detect Only' option. Basically it will detect if a version exists newer than the version displayed in the UI. If one does exist it sets the property ISFOUNDNEWERPRODUCTVERSION, what you do with this property is up to you. In the InstallExecuteSequence there is a custom action that uses this property, ISPreventDowngrade.

I think you can achieve what you want by deleting the ISPreventDowngrade entry in the Upgrades view. Hopefully the info above helps you better understand how all of this fits together. Smiley Happy


Hi Lee,

So your saying without any upgrade entry in the Upgrades View, it will also uninstall the existing version automatically during the installation?
Or i still need to create new entry and get the right configuration to achieve the end result?
0 Kudos
DLee65
Pilgrim

Re: Tutorial to uninstall old version and then install new version in single installation

I would try creating an entry that leaves the max value empty. I am sure you require an entry in the Upgrade table to accomplish what you require.
Enter your minimum version, such as 1.0.0

Make sure that your upgrade code has not changed during the history of your product, if so add the previous upgrade codes that are eligible for upgrade.
0 Kudos