I am following the instructions given at 
http://blogs.technet.com/alexshev/archive/2008/02/15/from-msi-to-wix-part-8-major-upgrade.aspx
 and http://msdn.microsoft.com/en-us/library/aa370840(VS.85).aspx to prevent an 
old package from installing.  Below is the WIX file with the yellow highlight 
the additional steps I added.  However, it does not work.  It still installs 
resulting in a second entry in Add/Remove programs.  Can someone see what is 
wrong?  I am using WIX v3.0.3907.0.  Thanks.


<?xml version="1.0"?>

<?define __BUILDVERSION__           = 
"$(env._BLDVERMAJOR).$(env._BLDVERMINOR).$(env._BLDNUMMAJOR).$(env._BLDNUMMINOR)"
 ?>
<?define __MANUFACTURERSHORTNAME__  = " Undisclosed"?>
<?define __PRODUCTNAME__            = "Undisclosed" ?>
<?define __PRODUCTNAMESHORT__       = "xxx" ?>
<?define __DIRNAME__                = " Undisclosed xxx" ?>
<?define __SHORTCUTDIRNAME__        = " Undisclosed xxx" ?>
<?define __TARGETROOT__             = $(env.inetroot)\target ?>
<?define __TARGETDIR__              = 
$(var.__TARGETROOT__)\$(env.BUILDTYPE)\$(env.BUILDTARGET) ?>
<?define __UPGRADEIDGUID__          = "8615BFFD-514E-44e6-AFC9-B94DFCAB1E91" ?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>

    <Product Name="Microsoft $(var.__PRODUCTNAME__) v$(var.__BUILDVERSION__)"
        Id="*"
        UpgradeCode="$(var.__UPGRADEIDGUID__)"
        Language="1033"
        Codepage="1252"
        Version="$(var.__BUILDVERSION__)"
        Manufacturer="$(var.__MANUFACTURERSHORTNAME__) Corporation">

        <Package
            Keywords='$(var.__MANUFACTURERSHORTNAME__) $(var.__PRODUCTNAME__) 
$(var.__PRODUCTNAMESHORT__)'
            Description="$(var.__PRODUCTNAME__)"
            Manufacturer="$(var.__MANUFACTURERSHORTNAME__)"
            InstallerVersion="300"
            Languages="1033"
            Compressed="yes"
            InstallPrivileges="limited"
            SummaryCodepage="1252" />

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

        <PropertyRef Id="NETFRAMEWORK30"/>

        <Condition Message='[ProductName] requires Windows XP SP2, Windows 
Server 2003 SP1 or greater.'>
            (VersionNT >= 501 AND ServicePackLevel>=2) OR (VersionNT >= 502 AND 
ServicePackLevel>=1) OR (VersionNT>502)
        </Condition>

        <!--Condition Message='[ProductName] requires the .NET Framework 2.0 or 
higher.'>
            <![CDATA[MsiNetAssemblySupport>="2.0.50727"]]>
        </Condition-->

        <Condition Message="[ProductName] requires Microsoft .NET Framework 
3.0. Search for 'Microsoft .NET Framework 3.0 Download' with your favorite 
internet search engine. The download link should be the top link of the search 
result page.">
            Installed OR NETFRAMEWORK30
        </Condition>

        <!-- Enforce Component Rules on Minor Upgrades by default -->
        <!-- Warning: this only has effect on MSI 3.x and greater -->
        <Property Id='MSIENFORCEUPGRADECOMPONENTRULES' Value='1' Secure='yes' />
        <Property Id="ARPNOMODIFY" Value="1" />
        <Property Id="ARPNOREPAIR" Value="1" />

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

            <Directory Id='ProgramMenuFolder' Name='PMFolder'>
                <Directory Id='VrtaProgramMenuFolder' 
Name='$(var.__SHORTCUTDIRNAME__)' />
            </Directory>

            <Directory Id="DesktopFolder" Name="Desktop"/>
            <Directory Id="StartMenuFolder" Name="StartupMenu"/>
            <Directory Id='LocalAppDataFolder'>
                <Directory Id='ManufacturerFolder' 
Name="$(var.__MANUFACTURERSHORTNAME__)">
                    <Directory Id='INSTALLDIR' 
Name="$(var.__PRODUCTNAMESHORT__)">
                        <Component Id='MainExecutable' 
Guid='9B90990A-27A6-45af-9CD0-4F5F64474941'>
                            <RemoveFolder Id="RemoveManufacturerFolder" 
Directory="ManufacturerFolder" On="uninstall" />
                            <RemoveFolder Id="RemoveVrtaProgramMenuFolder" 
Directory="VrtaProgramMenuFolder" On="uninstall" />
                            <RemoveFolder Id="RemoveProgramMenuFolder" 
Directory="ProgramMenuFolder" On="uninstall" />
                            <RemoveFolder Id="RemoveProgramFolder" 
On="uninstall" />
                            <RegistryKey Id='keyPathRegKey' Root='HKCU' 
Key='Software\$(var.__MANUFACTURERSHORTNAME__)\$(var.__PRODUCTNAMESHORT__)' 
Action='createAndRemoveOnUninstall'>
                            <RegistryValue Id='keyPathRegVal' 
Name='UpdateAvailable' Type='string' Value=''/>
                            </RegistryKey>
                            <File Id='VRTA.EXE' Name='VRTA.EXE' DiskId='1' 
Source="$(var.__TARGETDIR__)\VRTA.EXE" Vital="yes" ReadOnly="yes">
                                <Shortcut Id="VrtaShortcutDesktop" 
Directory="DesktopFolder" Name="$(var.__MANUFACTURERSHORTNAME__) 
$(var.__PRODUCTNAME__)" />
                                <Shortcut Id="VrtaShortcutStartMenu" 
Directory="StartMenuFolder" Name="$(var.__MANUFACTURERSHORTNAME__) 
$(var.__PRODUCTNAME__)" />
                            </File>
                            <File Id="VRTA.PDB" Name="VRTA.PDB" DiskId='1' 
Source="$(var.__TARGETDIR__)\VRTA.PDB" Vital="no" ReadOnly="yes">
                            </File>
                        </Component>
                    </Directory>
                </Directory>
            </Directory>
        </Directory>

        <Feature Id='Complete' Level='1'>
            <ComponentRef Id='MainExecutable' />
        </Feature>

        <Upgrade Id='$(var.__UPGRADEIDGUID__)'>
          <UpgradeVersion Maximum="$(var.__BUILDVERSION__)" 
IncludeMinimum="yes" Minimum="0.0.0.0" IncludeMaximum="no" Property="ISUPGRADE" 
IgnoreRemoveFailure="yes"/>

          <UpgradeVersion Minimum="$(var.__BUILDVERSION__)" IncludeMinimum="no" 
OnlyDetect="yes" Property="NEWPRODUCTFOUND" />
          <UpgradeVersion Minimum="2.3.0" IncludeMinimum="yes" 
Maximum="$(var.__BUILDVERSION__)" IncludeMaximum="no" Property="UPGRADEFOUND" />
        </Upgrade>

        <CustomAction Id="LaunchExe" FileKey="VRTA.EXE" ExeCommand= "" 
Execute="immediate" Return="asyncNoWait" />

        <!-- Prevent downgrading -->
        <CustomAction Id="PreventDowngrading" Error="Newer version already 
installed." />

        <InstallExecuteSequence>
            <Custom Action="PreventDowngrading" 
After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>

            <!-- The sequence is recommened by 
http://msdn2.microsoft.com/en-us/library/aa371197.aspx -->
            <RemoveExistingProducts After="InstallFinalize" />
            <Custom Action="LaunchExe" After ="InstallFinalize">NOT 
REMOVE="ALL"</Custom>
        </InstallExecuteSequence>

        <!-Not sure why this is needed. Our setup is UI less -->
        <InstallUISequence>
            <Custom Action="PreventDowngrading" 
After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
        </InstallUISequence>

    </Product>
</Wix>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to