cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Dean_H
Level 7

How to always remove previous version of software

I have a InstallScript MSI project that I want to always remove any previous version of the software prior to installing the new bits, what is the easiest way to accomplish this task?
Labels (1)
0 Kudos
(8) Replies
RobertDickau
Flexera Alumni

You might want to look into creating a "major upgrade".
0 Kudos
Dean_H
Level 7

Robert,

I understand the major upgrade, but we make several daily fully automated internal builds every day and I would like to always uninstall to avoid issues that come with file versioning ect, and I don't wnat to make every version a Major build so is there another way to accomplish this task?
0 Kudos
Fyodor
Level 3

Hi,
If I understand you correctly you build several daily builds for your full application. But I am in doubt that every of this build goes to the customer and therefore must be installed on each other. It looks like QA builds.
Consider using Virtual PC or VMWare with saved states. This will reduce overhead of developing special installation flow.

Regards

Fyodor.
0 Kudos
Dean_H
Level 7

I do use VM Ware, but we actually make many builds daily because changes are made to the bits in our code and each of these changes are made into a build and then tested. In an effort to try and avoid some of the issues that come from upgrading, I want to always remove the previous version, so I'm looking for an easy way to do this. I have created the following function, but I'm not sure where in the script to put it so it does this before posting the message that an older version id present, do you whant to upgrade

function RemoveTriosGUID()
STRING szKey;
NUMBER nResult;
begin
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{0680E88C-2498-41A2-B198-832E7ED5C35D}";
if (RegDBKeyExist (szKey) > 0) then
UninstallApplication ("{0680E88C-2498-41A2-B198-832E7ED5C35D}", "/uninst", LAAW_OPTION_WAIT) ;
DeleteDir (TARGETDIR, ALLCONTENTS);
DeleteDir (WINDISK + "\\Program Files\\InstallShield Installation Information\\{0680E88C-2498-41A2-B198-832E7ED5C35D}", ALLCONTENTS);
DeleteProgramFolder ("TA Instruments TRIOS");

endif;
end;
0 Kudos
Fyodor
Level 3

Hi Dean,
I still do not understand, sorry.
Presume you have the computer intended for your software. After installing it you have working copy of your program. Now QA discovers a bug, RND fixes it and you build new installation. From now you have two options: first is to uninstall old build (manually or automatically) meaning returning the computer to the state before first installation and then installing the new build. The second option is to revert VMWare state (snapshot) taken before installation of the first build.
The second scenario does not prevent from developing Major Upgrade but it dramatically reduce time for testing since reverting state takes 2 - 4 minutes only.

Regards

Fyodor.
0 Kudos
Dean_H
Level 7

Your missing the point, I'm just looking for a way to always remove any previous version if it exists without having to always make the verion a major version
0 Kudos
Dean_H
Level 7

I found a relative easy way to accomplish the task of forcing the installation to always delete any previous version of the software by doing the folllowing:
1) Under Media\Upgrades, on the Common Tab, set the following:
a) Small\Minor Upgrades, select the option Disable
b) Major Upgrades, select option to Completely Uninstall
2) Change the Product Code GUID
0 Kudos
Gvarma
Level 7

Dean H wrote:
I found a relative easy way to accomplish the task of forcing the installation to always delete any previous version of the software by doing the folllowing:
1) Under Media\Upgrades, on the Common Tab, set the following:
a) Small\Minor Upgrades, select the option Disable
b) Major Upgrades, select option to Completely Uninstall
2) Change the Product Code GUID


Or you could find out PRODUCT CODE for your application that you intend to uninstall/install then in Onbegin sequence use LaunchAppAndWait to run your setup.exe with /u .

This way everytime you installation is run , your code will look for existence of PRODUCTCODE and if found it will always be uninstalled first irrrespective of what version your client has installed **You will have to keep the same productcode everytime you make changes to your installation, and also will have to use RegDBFindKey (or something similar) to look for your PRODUCTCODE under unstallation in registry.

HTH
0 Kudos