My WiX installer removes the VC10 redistributable merge modules on upgrade. It 
unpublishes the MMs but does not reinstall them (and yes, my 
RemoveExistingProducts action occurs AFTER InstallInitialize). I'm hoping 
someone on this list can assist me in figuring out the issue. Here is my WiX 
script and here is a link to a verbose MSI log 
(https://gist.github.com/1607604). Thanks!

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"; 
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension";>
    <Product Name="$(var.LongName)" Id="*" UpgradeCode="$(var.UpgradeGuid)" 
Language="1033" Codepage="1252" Version="$(var.Version)" 
Manufacturer="$(var.EmcLong)">

        <Package Id="*" Keywords="Installer" 
Description="$(var.ProjectDescription)" Comments="$(var.ProjectDescription)" 
Manufacturer="$(var.EmcLong)" InstallerVersion="300" Languages="1033" 
Compressed="yes" SummaryCodepage="1252" />

       <!-- UPGRADES -->
        <Upgrade Id="$(var.UpgradeGuid)">
            <UpgradeVersion Minimum="3.9.9" IncludeMinimum="yes" 
Maximum="$(var.Version)" IncludeMaximum="yes" 
Property="OLDERVERSIONBEINGUPGRADED" />
            <UpgradeVersion Minimum="$(var.Version)" IncludeMinimum="no" 
OnlyDetect="yes" Property="NEWERVERSIONDETECTED" />
        </Upgrade>
        
        <!--
            This is a very IMPORTANT section. Because I, akutz, farked up and
            did not put each file into an individual component, same version
            upgrades, which also allow downgrades, do not work correctly. This
            is because each component is not tied to a single file entry, and
            thus the file versions/dates do not get compared correctly -
            the file versioning rules (http://bit.ly/hIpqg2). To remedy the
            situation I am using a custom action, ExitEarlyWithSuccess,
            to exit the installer early if a key file has a verion that is 
            greater than the version to be installed. This means a later version
            of the MSI is already installed.
            
            Also, there is a custom action defined as part of the 
            InstallExecuteSequence that will invoke the ExitEarlyWithSuccess
            acution if this product is not installed and there is a new
            file version detected.
        -->
        
        <!-- CUSTOM ACTIONS -->
        <CustomActionRef Id="WixExitEarlyWithSuccess"/>
        <CustomAction Id="ExitEarlyWithSuccess"
                      VBScriptCall="Main"
                      Property="ExitEarlyWithSuccessScript" />
        <CustomAction Id="CopyMsiToInstallDir" Script="vbscript">
            <![CDATA[
            msiFile = Session.Property("OriginalDatabase")
            installDir = Session.Property("LACFEATUREDIR")
            Set fso = CreateObject("Scripting.FileSystemObject")
            fso.CopyFile msiFile, installDir
            ]]>
        </CustomAction>

        <!-- INSTALL SEQUENCES -->
        <InstallExecuteSequence>
            <Custom Action="ExitEarlyWithSuccess" After="InstallInitialize">NOT 
Installed AND NEWERFILEVERSIONDETECTED</Custom>
            <RemoveExistingProducts After="InstallInitialize" />
            <Custom Action="CopyMsiToInstallDir" After="InstallFinalize">Not 
Installed</Custom>
        </InstallExecuteSequence>

        <!-- MEDIA -->
        <Media Id="1" Cabinet="media.cab" CompressionLevel="none" 
EmbedCab="yes" />

        <!-- PROPERTIES -->
        <Property Id="LACFEATUREDIR">
            <RegistrySearch Id="EmcVsiVSphere4LacDir" Root="HKLM" 
Key="SOFTWARE\$(var.EmcShort)\$(var.VsiLong)\vSphere4" Type="directory" 
Name="LacPath" />
        </Property>
        <Property Id="ARPSYSTEMCOMPONENT" Value="1" />
        <Property Id="ALLUSERS" Value="1" />
        <Property Id="ExitEarlyWithSuccessScript">
            <![CDATA[
            Function Main()
                Main = 5
            End Function
            ]]>
        </Property>
        <Property Id="NEWERFILEVERSIONDETECTED">
            <DirectorySearch Id="NewerFileVersionDirSearch" 
Path="[LACFEATUREDIR]">
                <FileSearch Name="EMC.VSI.VSphere4.Features.SPO.Common.dll" 
MinVersion="$(var.Version4)"/>
            </DirectorySearch>
        </Property>

        <!-- INSTALL CONDITIONS -->
        <Condition Message="$(var.VsiForVSphereRequiredConditionMessage)">
            Installed OR LACFEATUREDIR
        </Condition>

        <!-- DIRECTORY STRUCTURE -->
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="LACFEATUREDIR" />
        </Directory>

        <!-- APPLICATION FILES -->
        <DirectoryRef Id="LACFEATUREDIR">
            <Component Id="ApplicationFiles" 
Guid="4A95A3AF-C64E-4011-80AE-CF9B659AEA93">
                <File 
Source="$(var.BuildOutput)\EMC.VSI.VSphere4.Features.SPO.Common.dll" />
                <File Source="$(var.PowerPathWrapperPath)\PowerPathWrapper.dll" 
/> 
                <File Source="$(var.SEWrapperPath)\SEWrapper.dll" /> 
                <?ifdef $(var.DEBUG) ?>
                    <File 
Source="$(var.BuildOutput)\EMC.VSI.VSphere4.Features.SPO.Common.pdb" />
                    <File 
Source="$(var.PowerPathWrapperPath)\PowerPathWrapper.pdb" /> 
                    <File Source="$(var.SEWrapperPath)\SEWrapper.pdb" />
                <?endif?>
            </Component>
            <?ifdef $(var.DEBUG) ?>
                <Merge Id="VCRedistVC100DebugCRTx86" 
SourceFile="$(env.CommonProgramFiles)\Merge 
Modules\Microsoft_VC100_DebugCRT_x86.msm" DiskId="1" Language="0" />
            <?else?>
                <Merge Id="VCRedistVC100CRTx86" 
SourceFile="$(env.CommonProgramFiles)\Merge 
Modules\Microsoft_VC100_CRT_x86.msm" DiskId="1" Language="0" />
            <?endif?>
        </DirectoryRef>

        <!-- FEATURES -->
        <Feature Id="MainApplication" Title="$(var.LongName)" Level="1">
            <ComponentRef Id="ApplicationFiles" />
            <?ifdef $(var.DEBUG) ?>
                <MergeRef Id="VCRedistVC100DebugCRTx86" />
            <?else?>
                <MergeRef Id="VCRedistVC100CRTx86" />
            <?endif?>
        </Feature>
        
        <Icon Id="EmcVsiLogo" SourceFile="$(var.Resources)\emc-vsi.ico" />
        <Property Id="ARPPRODUCTICON" Value="EmcVsiLogo" />

        <UIRef Id="WixUI_Minimal" />
        <WixVariable Id="WixUILicenseRtf" 
Value="$(var.Resources)\License-Setup.rtf" />
        <WixVariable Id="WixUIDialogBmp" 
Value="$(var.Resources)\emc-wix-dialog-bmp.bmp"/>
        <WixVariable Id="WixUIBannerBmp" 
Value="$(var.Resources)\emc-wix-banner-bmp.bmp"/>

    </Product>
</Wix>

-- 
-a

"I wonder if procrastinators realize that they're not putting off work, just 
putting it off onto other people?" 


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to