Revenera Documentation site will be unavailable on July 2nd due to scheduled maintenance. For more information see the status dashboard.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sbrown
Level 6

Set install to remove old install

This is something I have never been able to get my head around.
I have an IS2011 Basic MSI project.

My QA dept does not want to have to uninstall every day, new build daily, Builds are automated using VS2010 and a Deployment sln file.(TFS builds the sln) What do i need to do in the ism and/or build process so taht when a new msi is run, by double clicking the msi file, so that it will uninstall the current version then install the new version?
Labels (1)
0 Kudos
4 Replies
ElenaN
Level 6

How about making each daily build as Major Upgrade?

Schedule RemoveExistingProducts action between the InstallValidate action and the InstallInitialize action. In this case, the installer removes the old applications entirely before installing the new applications.

And make TFS team build generate new ProductCode for msi for every build.
0 Kudos
ktbrownusa
Level 3

When creating a major upgrade that forces a complete uninstall, you have to change the product code AND the product version. Also, remember that the product version has to be a significant change, meaning the first three digits; ie: A.B.C.D (either A,B or C have to change).

I have run into these more than once. What you will find when you just change the Product Version is two entries in the Add/Remove Programs in the Control Panel.

We have many Engineering builds and run into this issue all the time. I'm looking now for a solution to ALWAYS uninstall the product no matter what solution as we speak. If I find it, I'll come back here and post the solution.

For definitions see http://kb.flexerasoftware.com/doc/Helpnet/installshield12helplib/MajorMinorSmall.htm

-Kevin
0 Kudos
DebbieL
Level 17

You might want to have the QA department consider using VMware or something similar. They could save snapshots that represent what end users' environments look like, and then install new builds on those images. When a new build is ready, they simply revert to the original snapshot and then run the new build.
0 Kudos
Shuttledude
Level 7

Another possibility is to write a C# application "Auto_Uninstaller.exe" that automatically removes specified applications. You could invoke Auto_Uninstaller.exe before installing your new, fresh build.

The code would look something like this:

[CODE]private void Uninstall_All_Apps()
{
// ====================================
// *** UNINSTALL ALL BASIC MSI APPS ***
// ====================================

// Declare and fill a string array with the names of the apps
// that were installed via basic msi.
// *** NOT for InstallScript msi apps! -- fails, and breaks them!
string[] BasicMSIproductInstalls = new string[]
{ "My Product Name 1",
"My Product Name 2",
"etc."
};

// loop through and delete the applications
foreach (string app in BasicMSIproductInstalls)
{
// Create the uninstall process.
Process proc = new Process();
proc.StartInfo.FileName = "msiexec.exe";
proc.StartInfo.Arguments = "/uninstall" + " " + app + " " + "/qb";
// Start the process.
proc.Start();
// Wait
proc.WaitForInputIdle();
proc.WaitForExit();
// Release resources.
proc.Close();
}
}
[/CODE]

You could modify this to load the application String array with names from a *.txt file, which would change as apps are added or deleted. Read the *.txt file from a known network location.
0 Kudos