Upgrade code failing for silent installs

6 messages Options
Embed this post
Permalink
Neil Sleightholm

Upgrade code failing for silent installs

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

This is not strictly a WiX problem but I thought someone here may know the answer.

 

If I build v1.1.0 of an MSI with a unique ProductCode and PackageCode and then build v1.2.0 with a new ProductCode and PackageCode. Both packages contain the same UpgradeCode and the following upgrade element:

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

If I install v1.1.0 and then v1.2.0 everything is fine and the package upgrades. If I then run v1.1.0 I see the message that a newer version is installed. Now for the problem, if I install v1.1.0 silently (using /passive or /qb) v1.1.0 is installed so I end up with both versions displayed in Add/Remove programs.

 

Is this something I am doing wrong or am I misunderstanding how MSIs work?

 

Thanks

 

Neil

 

Neil Sleightholm
X2 Systems Limited
[hidden email]

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Wilson, Phil

Re: Upgrade code failing for silent installs

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Maybe the silent install is bypassing the UI where you set the ALLUSERS property to per-system. So you’re ending up with the default, a per-user install, and that goes on side by side with the per-system one. Something like that anyway.  Another thing that might be happening is that you don’t have the FindRelatedProducts action in both the UI and execute sequences.

 

Phil Wilson

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: Tuesday, February 05, 2008 3:59 AM
To: [hidden email]
Subject: [WiX-users] Upgrade code failing for silent installs

 

This is not strictly a WiX problem but I thought someone here may know the answer.

 

If I build v1.1.0 of an MSI with a unique ProductCode and PackageCode and then build v1.2.0 with a new ProductCode and PackageCode. Both packages contain the same UpgradeCode and the following upgrade element:

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

If I install v1.1.0 and then v1.2.0 everything is fine and the package upgrades. If I then run v1.1.0 I see the message that a newer version is installed. Now for the problem, if I install v1.1.0 silently (using /passive or /qb) v1.1.0 is installed so I end up with both versions displayed in Add/Remove programs.

 

Is this something I am doing wrong or am I misunderstanding how MSIs work?

 

Thanks

 

Neil

 

Neil Sleightholm
X2 Systems Limited
[hidden email]

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Neil Sleightholm

Re: Upgrade code failing for silent installs

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

It sounds like I have done something wrong in my script, I have pared this down to a minimal install (see below) to reproduce the problem. I don’t think it is ALLUSERS as I can see this set in the logs, I don’t have a FindRelatedProducts – should I? Can you see what I might be missing?

 

Thanks for your help,

 

Neil

 

P.S. This is WiX v2 but I have the same problem with WiX v3.

 

 

<?xml version="1.0" encoding="UTF-8"?>

<?define Version = "1.0.0" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">

  <Product

    Id="????????-????-????-????-????????????"

    Name="Simple WiX template $(var.Version)" Language="1033"

    Version="$(var.Version)"

    Manufacturer="Me"

    UpgradeCode="10B99CC9-5D83-4489-82F3-368E772B803D">

    <Package

      Id="????????-????-????-????-????????????"

      Description="Simple WiX template Installation"

      InstallerVersion="200"

      Compressed="yes" />

 

    <!-- Support Information shown in Add/Remove programs (this is optional) -->

    <Property Id="ARPCOMMENTS"><![CDATA[Simple WiX template]]></Property>

    <Property Id="ARPCONTACT"><![CDATA[WiX]]></Property>

 

    <!-- Default ALLUSERS to 1 -->

    <Property Id="ALLUSERS"><![CDATA[1]]></Property>

 

    <Condition Message="You need to be an administrator to install this product.">Privileged</Condition>

    <Condition Message="A later version of [ProductName] is already installed.">NOT NEWERVERSIONDETECTED</Condition>

 

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="INSTALLDIR" />

    </Directory>

 

    <Feature Id="DefaultFeature" Level="1" ConfigurableDirectory="TARGETDIR">

      <ComponentRef Id="Test.dll" />

    </Feature>

 

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

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

 

    <UIRef Id="WixUI_ErrorProgressText" />

 

    <InstallExecuteSequence>

      <RemoveExistingProducts After="InstallFinalize" />

    </InstallExecuteSequence>

 

  </Product>

</Wix>

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Wilson, Phil
Sent: 05 February 2008 17:41
To: [hidden email]
Subject: Re: [WiX-users] Upgrade code failing for silent installs

 

Maybe the silent install is bypassing the UI where you set the ALLUSERS property to per-system. So you’re ending up with the default, a per-user install, and that goes on side by side with the per-system one. Something like that anyway.  Another thing that might be happening is that you don’t have the FindRelatedProducts action in both the UI and execute sequences.

 

Phil Wilson

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: Tuesday, February 05, 2008 3:59 AM
To: [hidden email]
Subject: [WiX-users] Upgrade code failing for silent installs

 

This is not strictly a WiX problem but I thought someone here may know the answer.

 

If I build v1.1.0 of an MSI with a unique ProductCode and PackageCode and then build v1.2.0 with a new ProductCode and PackageCode. Both packages contain the same UpgradeCode and the following upgrade element:

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

If I install v1.1.0 and then v1.2.0 everything is fine and the package upgrades. If I then run v1.1.0 I see the message that a newer version is installed. Now for the problem, if I install v1.1.0 silently (using /passive or /qb) v1.1.0 is installed so I end up with both versions displayed in Add/Remove programs.

 

Is this something I am doing wrong or am I misunderstanding how MSIs work?

 

Thanks

 

Neil

 

Neil Sleightholm
X2 Systems Limited
[hidden email]

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Neil Sleightholm

Re: Upgrade code failing for silent installs

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

After a bit of googling I think I have found the answer, the condition doesn’t work in silent mode. To make it work I needed these elements:

 

    <CustomAction Id="NewerVersion" Error="A later version of [ProductName] is already installed." />

 

    <InstallExecuteSequence>

      <Custom Action="NewerVersion" After="FindRelatedProducts">NEWERVERSIONDETECTED</Custom>

    </InstallExecuteSequence>

 

Neil

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: 05 February 2008 17:55
To: Wilson, Phil; [hidden email]
Subject: Re: [WiX-users] Upgrade code failing for silent installs

 

It sounds like I have done something wrong in my script, I have pared this down to a minimal install (see below) to reproduce the problem. I don’t think it is ALLUSERS as I can see this set in the logs, I don’t have a FindRelatedProducts – should I? Can you see what I might be missing?

 

Thanks for your help,

 

Neil

 

P.S. This is WiX v2 but I have the same problem with WiX v3.

 

 

<?xml version="1.0" encoding="UTF-8"?>

<?define Version = "1.0.0" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">

  <Product

    Id="????????-????-????-????-????????????"

    Name="Simple WiX template $(var.Version)" Language="1033"

    Version="$(var.Version)"

    Manufacturer="Me"

    UpgradeCode="10B99CC9-5D83-4489-82F3-368E772B803D">

    <Package

      Id="????????-????-????-????-????????????"

      Description="Simple WiX template Installation"

      InstallerVersion="200"

      Compressed="yes" />

 

    <!-- Support Information shown in Add/Remove programs (this is optional) -->

    <Property Id="ARPCOMMENTS"><![CDATA[Simple WiX template]]></Property>

    <Property Id="ARPCONTACT"><![CDATA[WiX]]></Property>

 

    <!-- Default ALLUSERS to 1 -->

    <Property Id="ALLUSERS"><![CDATA[1]]></Property>

 

    <Condition Message="You need to be an administrator to install this product.">Privileged</Condition>

    <Condition Message="A later version of [ProductName] is already installed.">NOT NEWERVERSIONDETECTED</Condition>

 

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="INSTALLDIR" />

    </Directory>

 

    <Feature Id="DefaultFeature" Level="1" ConfigurableDirectory="TARGETDIR">

      <ComponentRef Id="Test.dll" />

    </Feature>

 

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

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

 

    <UIRef Id="WixUI_ErrorProgressText" />

 

    <InstallExecuteSequence>

      <RemoveExistingProducts After="InstallFinalize" />

    </InstallExecuteSequence>

 

  </Product>

</Wix>

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Wilson, Phil
Sent: 05 February 2008 17:41
To: [hidden email]
Subject: Re: [WiX-users] Upgrade code failing for silent installs

 

Maybe the silent install is bypassing the UI where you set the ALLUSERS property to per-system. So you’re ending up with the default, a per-user install, and that goes on side by side with the per-system one. Something like that anyway.  Another thing that might be happening is that you don’t have the FindRelatedProducts action in both the UI and execute sequences.

 

Phil Wilson

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: Tuesday, February 05, 2008 3:59 AM
To: [hidden email]
Subject: [WiX-users] Upgrade code failing for silent installs

 

This is not strictly a WiX problem but I thought someone here may know the answer.

 

If I build v1.1.0 of an MSI with a unique ProductCode and PackageCode and then build v1.2.0 with a new ProductCode and PackageCode. Both packages contain the same UpgradeCode and the following upgrade element:

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

If I install v1.1.0 and then v1.2.0 everything is fine and the package upgrades. If I then run v1.1.0 I see the message that a newer version is installed. Now for the problem, if I install v1.1.0 silently (using /passive or /qb) v1.1.0 is installed so I end up with both versions displayed in Add/Remove programs.

 

Is this something I am doing wrong or am I misunderstanding how MSIs work?

 

Thanks

 

Neil

 

Neil Sleightholm
X2 Systems Limited
[hidden email]

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Neil Sleightholm

Re: Upgrade code failing for silent installs

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Does anyone have a comment on this? Is there are reason why the condition doesn’t work with the msi is run in silent mode? Is this true for all conditions?

 

Thanks

 

Neil

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: 05 February 2008 18:57
To: [hidden email]
Subject: Re: [WiX-users] Upgrade code failing for silent installs

 

After a bit of googling I think I have found the answer, the condition doesn’t work in silent mode. To make it work I needed these elements:

 

    <CustomAction Id="NewerVersion" Error="A later version of [ProductName] is already installed." />

 

    <InstallExecuteSequence>

      <Custom Action="NewerVersion" After="FindRelatedProducts">NEWERVERSIONDETECTED</Custom>

    </InstallExecuteSequence>

 

Neil

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: 05 February 2008 17:55
To: Wilson, Phil; [hidden email]
Subject: Re: [WiX-users] Upgrade code failing for silent installs

 

It sounds like I have done something wrong in my script, I have pared this down to a minimal install (see below) to reproduce the problem. I don’t think it is ALLUSERS as I can see this set in the logs, I don’t have a FindRelatedProducts – should I? Can you see what I might be missing?

 

Thanks for your help,

 

Neil

 

P.S. This is WiX v2 but I have the same problem with WiX v3.

 

 

<?xml version="1.0" encoding="UTF-8"?>

<?define Version = "1.0.0" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">

  <Product

    Id="????????-????-????-????-????????????"

    Name="Simple WiX template $(var.Version)" Language="1033"

    Version="$(var.Version)"

    Manufacturer="Me"

    UpgradeCode="10B99CC9-5D83-4489-82F3-368E772B803D">

    <Package

      Id="????????-????-????-????-????????????"

      Description="Simple WiX template Installation"

      InstallerVersion="200"

      Compressed="yes" />

 

    <!-- Support Information shown in Add/Remove programs (this is optional) -->

    <Property Id="ARPCOMMENTS"><![CDATA[Simple WiX template]]></Property>

    <Property Id="ARPCONTACT"><![CDATA[WiX]]></Property>

 

    <!-- Default ALLUSERS to 1 -->

    <Property Id="ALLUSERS"><![CDATA[1]]></Property>

 

    <Condition Message="You need to be an administrator to install this product.">Privileged</Condition>

    <Condition Message="A later version of [ProductName] is already installed.">NOT NEWERVERSIONDETECTED</Condition>

 

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="INSTALLDIR" />

    </Directory>

 

    <Feature Id="DefaultFeature" Level="1" ConfigurableDirectory="TARGETDIR">

      <ComponentRef Id="Test.dll" />

    </Feature>

 

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

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

 

    <UIRef Id="WixUI_ErrorProgressText" />

 

    <InstallExecuteSequence>

      <RemoveExistingProducts After="InstallFinalize" />

    </InstallExecuteSequence>

 

  </Product>

</Wix>

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Wilson, Phil
Sent: 05 February 2008 17:41
To: [hidden email]
Subject: Re: [WiX-users] Upgrade code failing for silent installs

 

Maybe the silent install is bypassing the UI where you set the ALLUSERS property to per-system. So you’re ending up with the default, a per-user install, and that goes on side by side with the per-system one. Something like that anyway.  Another thing that might be happening is that you don’t have the FindRelatedProducts action in both the UI and execute sequences.

 

Phil Wilson

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Neil Sleightholm
Sent: Tuesday, February 05, 2008 3:59 AM
To: [hidden email]
Subject: [WiX-users] Upgrade code failing for silent installs

 

This is not strictly a WiX problem but I thought someone here may know the answer.

 

If I build v1.1.0 of an MSI with a unique ProductCode and PackageCode and then build v1.2.0 with a new ProductCode and PackageCode. Both packages contain the same UpgradeCode and the following upgrade element:

    <Upgrade Id="10B99CC9-5D83-4489-82F3-368E772B803D">

      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />

      <UpgradeVersion

        Minimum="0.0.0"

        Maximum="$(var.Version)"

        IncludeMinimum="yes"

        IncludeMaximum="no"

        Property="OLDERVERSIONBEINGUPGRADED" />

      <Property Id="OLDERVERSIONBEINGUPGRADED" Secure="yes" />

    </Upgrade>

 

If I install v1.1.0 and then v1.2.0 everything is fine and the package upgrades. If I then run v1.1.0 I see the message that a newer version is installed. Now for the problem, if I install v1.1.0 silently (using /passive or /qb) v1.1.0 is installed so I end up with both versions displayed in Add/Remove programs.

 

Is this something I am doing wrong or am I misunderstanding how MSIs work?

 

Thanks

 

Neil

 

Neil Sleightholm
X2 Systems Limited
[hidden email]

 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Bob Arnson-6

Re: Upgrade code failing for silent installs

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Neil Sleightholm wrote:

Does anyone have a comment on this? Is there are reason why the condition doesn’t work with the msi is run in silent mode? Is this true for all conditions?


Standard advice applies: Check a verbose log; it records when properties are set. The likely cause is that FindRelatedProducts is scheduled after LaunchConditions, which is what evaluations launch conditions.

-- 
sig://boB
http://joyofsetup.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users