I use

    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Minimum="$(var.Version)" IncludeMinimum="yes"
OnlyDetect="yes" Property="NEWERVERSIONINSTALLED" />
    </Upgrade>

    <Condition Message="A newer version of this product has been
detected on your system. Setup cannot continue and will now
terminate.><![CDATA[NOT NEWERVERSIONINSTALLED]]></Condition>

No Custom Actions necessary. Tweak the Launch Conditoon text to your
preference.

Palbinder Sandher 
Software Deployment & IT Administrator
T: +44 (0) 141 945 8500 
F: +44 (0) 141 945 8501 

http://www.iesve.com 
**Design, Simulate + Innovate with the <Virtual Environment>**
Integrated Environmental Solutions Limited. Registered in Scotland No.
SC151456 
Registered Office - Helix Building, West Of Scotland Science Park,
Glasgow G20 0SP
Email Disclaimer

-----Original Message-----
From: Bud594 [mailto:mjohn...@xenomorph.com] 
Sent: 14 July 2010 13:52
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Preventing downgrade of version


Nothing like pressure, but my first Wix Install is being released to
clients on friday and I am struggling to prevent a downgrade.  The
product id is set to a guid and the package id to *, the upgrade code it
set to the parameter in the prodcut.

The relevant code is below, I was expecting an error to be displayed if
I tried to install version 4.0.0 on top of version 4.1.0 but I am
getting no such error.

I have run the install with verbose logging but can't find SELFFOUND or
NEWERVERSIONINSTALLED being set, is that expected?

As you can see this code has been adapted from the www.tramonta.co.hu
tutorial, I have also done a search here and can't find anyone else with
my particular issue(but of course my search criteria may be flawed)

Can anyone point me in the right direction please?

Yours in anticipation
Martin


<?define Version="4.0.0" ?>
<?define UpgradeCode="d980bbaf-0f2d-43d7-9305-a7005225eaad"?>

    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property="SELFFOUND"
                      Minimum="$(var.Version)" IncludeMinimum="yes"
                      Maximum="$(var.Version)" IncludeMaximum="yes"
                      OnlyDetect="yes" />
      <UpgradeVersion Property="NEWERVERSIONINSTALLED"
                      Minimum="$(var.Version)" IncludeMinimum="no"
                      OnlyDetect="yes" />
    </Upgrade>
[...]
    <CustomAction Id="AlreadyUpdated" Error="Already Updated" />
    <CustomAction Id="NoDowngrade" Error="NoDowngrade" />
   
    <InstallExecuteSequence>
      <RemoveExistingProducts Before="InstallInitialize" />
      <Custom Action='AlreadyUpdated'
After='FindRelatedProducts'>SELFFOUND</Custom>
      <Custom Action='NoDowngrade'
After='FindRelatedProducts'>NEWERVERSIONINSTALLED</Custom>

-- 
View this message in context:
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Preventing
-downgrade-of-version-tp5292363p5292363.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------
------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to