Discussion:
[WiX-users] Automatic remove of older version
marric01
2010-09-30 19:44:04 UTC
Permalink
Hi,

I made an installer with WIX 3.5 that deploy things for a BI Solution.

When I have a new version of my WIX Installer, and the client run the
installer (MSI), can it automatically uninstall any older version installed
on the PC and start the installation of the new version ? It is something
possible ? Any suggestion on how to do this (or some link on web) ?

I don't want the message saying that theres is another older version on the
PC and it got to be uninstall before installing the new one. I never need to
Update things ... I always have to remove everything and install it back
with new components.

I tried this (see code bellow) but it keep saying that another version is
installed and that I have to remove it from Add/Remove Program

<Product Id="725fca14-3120-4e13-a782-90dec57b59b3" Name="AQ_SPU_CUBE"
Language="1036" Version="2.0.0" Manufacturer="AQ_SPU_CUBE"
UpgradeCode="002d3b98-f6be-4e8e-b6ae-4848ff009b46" Codepage="1252">
<Package InstallerVersion="200" Compressed="yes" />

<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />


<Upgrade Id="002d3b98-f6be-4e8e-b6ae-4848ff009b46">
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND"
Minimum="1.0.0" IncludeMinimum="yes"
Maximum="3.0.0" IncludeMaximum="no" />
</Upgrade>

<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
....
</InstallExecuteSequence>



Thanks Richard
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Automatic-remove-of-older-version-tp5589138p5589138.html
Sent from the wix-users mailing list archive at Nabble.com.
Chris Lord
2010-09-30 21:34:44 UTC
Permalink
Richard

Here's some help on doing upgrades

http://blogs.technet.com/b/alexshev/archive/2008/02/15/from-msi-to-wix-part-8-major-upgrade.aspx

Looking at your code, I think you may have sequenced
RemoveExistingProducts in the wrong place.
It either needs to be

<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
</InstallExecuteSequence>

or

<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence>

The first option removes all the files regardless then installs the
newer versions. The second only removes those files that have changed
between the two. I believe there are pros and cons to using one method
over the other but I am not the person to tell you what they are (I use
the first option in my installs).

You also need to make sure your product code changes from version to
version but the upgrade code must remain constant through all versions.

You can also use the verbose log during an install to see what's going
on. The output can seem a bit cryptic initially but it can help debug
the problems.

Finally, you might want to consider adding a check to prevent people
downgrading. The link I sent has information on how to do that.

Hope that helps

Chris
Post by marric01
Hi,
I made an installer with WIX 3.5 that deploy things for a BI Solution.
When I have a new version of my WIX Installer, and the client run the
installer (MSI), can it automatically uninstall any older version installed
on the PC and start the installation of the new version ? It is something
possible ? Any suggestion on how to do this (or some link on web) ?
I don't want the message saying that theres is another older version on the
PC and it got to be uninstall before installing the new one. I never need to
Update things ... I always have to remove everything and install it back
with new components.
I tried this (see code bellow) but it keep saying that another version is
installed and that I have to remove it from Add/Remove Program
<Product Id="725fca14-3120-4e13-a782-90dec57b59b3" Name="AQ_SPU_CUBE"
Language="1036" Version="2.0.0" Manufacturer="AQ_SPU_CUBE"
UpgradeCode="002d3b98-f6be-4e8e-b6ae-4848ff009b46" Codepage="1252">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Upgrade Id="002d3b98-f6be-4e8e-b6ae-4848ff009b46">
<UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND"
Minimum="1.0.0" IncludeMinimum="yes"
Maximum="3.0.0" IncludeMaximum="no" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
....
</InstallExecuteSequence>
Thanks Richard
fiordean dacian
2010-10-01 08:32:01 UTC
Permalink
That's called a major upgrade. You need to change the product id for your newer installer as well as the version.

You also have to say that you want previous version uninstalled. You have 2 options:

1. Use an Upgrade element like explained here. Remember to schedule RemoveExistingProducts action.
http://www.tramontana.co.hu/wix/lesson4.php#4.1

or

2. As you use WiX3, you can use instead of Upgrade the MajorUpgrade element; in this case you don't have to specify RemoveExistingProducts, the "MajorUpgrade" element available in WiX will do it for you.

I hope it works.


--- On Thu, 9/30/10, marric01 <***@ssss.gouv.qc.ca> wrote:

From: marric01 <***@ssss.gouv.qc.ca>
Subject: [WiX-users] Automatic remove of older version
To: wix-***@lists.sourceforge.net
Date: Thursday, September 30, 2010, 10:44 PM


Hi,

I made an installer with WIX 3.5 that deploy things for a BI Solution.

When I have a new version of my WIX Installer, and the client run the
installer (MSI), can it automatically uninstall any older version installed
on the PC and start the installation of the new version ? It is something
possible ? Any suggestion on how to do this (or some link on web) ?

I don't want the message saying that theres is another older version on the
PC and it got to be uninstall before installing the new one. I never need to
Update things ... I always have to remove everything and install it back
with new components.

I tried this (see code bellow) but it keep saying that another version is
installed and that I have to remove it from Add/Remove Program

<Product Id="725fca14-3120-4e13-a782-90dec57b59b3" Name="AQ_SPU_CUBE"
Language="1036" Version="2.0.0" Manufacturer="AQ_SPU_CUBE"
UpgradeCode="002d3b98-f6be-4e8e-b6ae-4848ff009b46" Codepage="1252">
    <Package InstallerVersion="200" Compressed="yes"  />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />


    <Upgrade Id="002d3b98-f6be-4e8e-b6ae-4848ff009b46">
      <UpgradeVersion OnlyDetect="no" Property="PREVIOUSFOUND"
        Minimum="1.0.0" IncludeMinimum="yes"
        Maximum="3.0.0" IncludeMaximum="no" />
    </Upgrade>

    <InstallExecuteSequence>
      <RemoveExistingProducts Before="InstallInitialize" />
....
</InstallExecuteSequence>



Thanks Richard
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Automatic-remove-of-older-version-tp5589138p5589138.html
Sent from the wix-users mailing list archive at Nabble.com.
marric01
2010-10-01 12:49:14 UTC
Permalink
Hi

Thanks to all of you for the help. I was not changing my product ID lol
thats why its was always saying that a newer version was installed.

But I found that this is not doing the same uninstall that Add/Remove
Program do. I have many custom action that create things (SQL Server
Database, Analysis Services OLAP Cube, Intergration Services Packages). I
have coded custom action to Create all those components and some so delete
them.

Maybe my <InstallExecuteSequence> is not well coded ? What I would like to
do is to execute the 2 Remove and 2 Delete custom action when the installer
detect a new version. Anyone can help ? I work well at the moment when using
uninstall from Add/Remove program.

<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
<Custom Action="CA_writePasswordInRegistry" After="InstallFinalize"
Overridable="yes">NOT Installed</Custom>
<Custom Action="ConfigureWebApp" After="InstallFinalize"
Overridable="yes">NOT Installed</Custom>
<Custom Action="CreateDW" After="InstallFinalize"
Overridable="yes">NOT Installed</Custom>
<Custom Action="DeploySSAS" After="CreateDW" Overridable="yes">NOT
Installed</Custom>
<Custom Action="DeploySSIS" After="DeploySSAS" Overridable="yes">NOT
Installed</Custom>
<Custom Action="CreateSQLJob" After="DeploySSIS" Overridable="yes">NOT
Installed</Custom>
<Custom Action="CA_readValueInRegistry" After="InstallFinalize"
Overridable="yes" >Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="DeleteSQLJob" After="CA_readValueInRegistry"
Overridable="yes" >Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="RemoveSSIS" After="DeleteSQLJob" Overridable="yes"
Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="RemoveSSAS" After="RemoveSSIS" Overridable="yes"
Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="DeleteDW" After="RemoveSSAS" Overridable="yes"
Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
<Custom Action="MakeWepApp20" After="InstallFinalize">ASPNETREGIIS AND
NOT Installed</Custom>
</InstallExecuteSequence>
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Automatic-remove-of-older-version-tp5589138p5591217.html
Sent from the wix-users mailing list archive at Nabble.com.
marric01
2010-10-01 15:32:04 UTC
Permalink
Ok, its working now, I had to change the InstallSequence too

<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
<Custom Action="CA_writePasswordInRegistry" After="InstallFinalize"
Overridable="yes">NOT Installed</Custom>
<Custom Action="ConfigureWebApp" After="InstallFinalize"
Overridable="yes">NOT Installed</Custom>
<Custom Action="CreateDW" After="InstallFinalize"
Overridable="yes">NOT Installed</Custom>
<Custom Action="DeploySSAS" After="CreateDW" Overridable="yes">NOT
Installed</Custom>
<Custom Action="DeploySSIS" After="DeploySSAS" Overridable="yes">NOT
Installed</Custom>
<Custom Action="CreateSQLJob" After="DeploySSIS" Overridable="yes">NOT
Installed</Custom>

<Custom Action="CA_readValueInRegistry" After="InstallFinalize"
Overridable="yes" >Installed</Custom>
<Custom Action="DeleteSQLJob" After="CA_readValueInRegistry"
Overridable="yes" >Installed</Custom>
<Custom Action="RemoveSSIS" After="DeleteSQLJob" Overridable="yes"
Post by marric01
Installed</Custom>
<Custom Action="RemoveSSAS" After="RemoveSSIS" Overridable="yes"
Post by marric01
Installed</Custom>
<Custom Action="DeleteDW" After="RemoveSSAS" Overridable="yes"
Post by marric01
Installed</Custom>
<Custom Action="MakeWepApp20" After="InstallFinalize">ASPNETREGIIS AND
NOT Installed</Custom>
</InstallExecuteSequence>
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Automatic-remove-of-older-version-tp5589138p5591850.html
Sent from the wix-users mailing list archive at Nabble.com.
Loading...