Need help with a deployment.

I would like to first say thank-you in advance for any help you may provide here.

I am not sure if this is the proper location to post this but...

How do I get the MSinstaller to remove a previous version of an application and install the latest version without adding additional application listings in the registry?

The project details are below.

Using Visual Studio 2005 I am working with a C# non web solution using the single solution model, the solution has multiple project components that are ultimatly built into an msi file that utilizes a bootstrapper setup.exe with dependencies of .Net and SQL Server 2005 Express.

Below are the Properties settings for the deployment.

Setup:Deployment Project Properties

AddRemoveProgramsIcon

(None)

Author

Company

Description

The Project

DetectNewerInstalledVersion

TRUE

InstallAllUsers

TRUE

Keywords

Blah…

Localization

English (US)

Manufacturer

Company

ManufacturerUrl

www.

PostBuildEvent

PreBuildEvent

ProductCode

{TheProductCode}

ProductName

Product

RemovePreviousVersions

TRUE

RunPostBuildEvent

On successful build

SearchPath

Subject

Product

SupportPhone

SupportUrl

www.

TargetPlatform

x86

Title

The Project

UpgradeCode

{TheUpgradeCode}

Version

0.1.0002

Todate, I have been manually incrementing the program component versions manually and not incrementing the installer's version number. Which left its Product code and version number unchanged. All of the previous installations installed fine but required we use the Control Panel (Add & Remove Programs) to remove the previous installation before installing the latest revision.

Before I built the most recent revision I wanted to address this and make sure that the installer removed the previous installation (version 0.1.0001) and installed the latest (version 0.1.0002).

So after a bit of reading and searches I concluded that I needed to increase the installers version number and also change the Product Code. I did both of these and left the UpgradeCode untouched. I proceeded to build the project successfully.

I was concerned that making this change to the product code might add a seond listing of the application in the registry.

I installed the project running the bootstrapper setup.exe to a successful completion. I went to control panel (Add & Remove Programs) to check if there was an extra listing for it and found there was.

How do I keep this from happening?

Again, thank-you in advance for any help on this.

[20386 byte] By [Scott_Lawrence] at [2007-12-23]
# 1
Hi Scott,

I moved your thread to the deployment projects forum. You might have a better chance of having it answered here.

Cheers,
Adrigo.

AdrigoGallus at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 2

Thank-you, as I mentioned I was not sure if it was placed in the correct forum.

Scott

Scott_Lawrence at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 3
RemovePreviousVersions does not work with versions less than 1.0. Otherwise your project settings look fine, assuming the UpgradeCode for your new setup is the same as the previous setup and the ProductCode is different.
PhilDWilson at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 4

Thank-you for you response. I did what you suggest and after changing the version number to be higher than 1.0.0, I still have two entries for the program show up in the Add & Remove program list.

Below are the Updated Properties settings for the deployment.

Setup:Deployment Project Properties

AddRemoveProgramsIcon

(None)

Author

Company

Description

The Project

DetectNewerInstalledVersion

TRUE

InstallAllUsers

TRUE

Keywords

Blah…

Localization

English (US)

Manufacturer

Company

ManufacturerUrl

www.

PostBuildEvent

PreBuildEvent

ProductCode

{TheProductCode}

ProductName

Product

RemovePreviousVersions

TRUE

RunPostBuildEvent

On successful build

SearchPath

Subject

Product

SupportPhone

SupportUrl

www.

TargetPlatform

x86

Title

The Project

UpgradeCode

{TheUpgradeCode}

Version

1.0.3

Do you have any additional insight as to why this is?

Scott_Lawrence at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 5

The rules to make this work are:

Both versions of the VS setup projects must be 1.0 or greater (this is VS-specific).

The later setup project must have a higher version.

The ProductCodes must be different.

The UpgradeCodes must be identical.

Both must have been installed Everyone or Just me. If the original setup was Just me, an Everyone (InstallAllUsers=True) will not upgrade it, and vice versa.

PhilDWilson at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 6
Hi,

Even i'm having the same issue. I'm using Visual Studio 2003. When the set up is installed as "Everyone" and when Version upgrade takes place th e default option is "Just Me". So the system couldn't uninstall the previous version properly from "EveryOne" (ie for all users) and install the newer Version as Just Me ( for the paticular user) .Therefore two entries are found in Control panel -Add & remove program list.

In Visual studio 2003 i dont have the property InstallAllUsers. Is there any way to address this issue. When Version upgrade takes place it should install as "Everyone" when the previous version is installed as "Everyone" and vice Versa.

Giller at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 7

You'd have to edit the MSI file with Orca (install from Orca.msi in the Platform SDK).

In the Property table, change the value of FolderForm_AllUsers from ME to ALL, and add ALLUSERS (case-sensitive) as a new property with a value of 1. If you search for FolderForm_AllUsers you'll find stuff about this. It sets the default to be as if Everyone was selected. This might help too:

http://www.aspfree.com/c/a/VB.NET/Building-an-MSI-File-Visual-Studio-and-Orca/5/

PhilDWilson at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 8
Hi i tried the way u mentioned. The url given given is very useful. I was able to make "Every One" as

default. But the system failed to do version upgrade as expected. I

have few doubts abt this version upgrade , it would be very helpful if i

get the answer.

Say i have admin privileges and installed the Version 1.00.0001 as

"Every One". Now i log in into another User who does not have admin

privilege. I try to upgrade the version 1.00.0002 as "Every one". ie i

want the version 1.00.0002 to be available to every one even though i

dont have the admin privilege. Is it possible to do this.

Will the version upgrade uninstall the version 1.00.0001 (which is

installed by the admin as "Every One") and then install the newer

version 1.00.0002 for all users ie as "Every One" (by the user who does

not have the admin privileges).

Pls help me as i'm almost fed up trying all the possible options to

make it work. Also tell me where i can get detail idea abt the set up

package and its limitations. Also wat privileges do "Every One" and "Just Me" require.

Giller at 2007-8-30 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...