I have an installer with <Product Id="GUID" Version="3.4.1.15"..
..
The installer will run custom actions is distributed to customers.
Am trying to created a update/upgrade/patch to the msi (Version = 3.4.1.16). The new patch should execute actions only the new actions, that are part of 3.4.16.
Below is the code that I tried to achieve this. (changed ProductId="*"
and tried AllowSameVersionUpgrades="yes"
.
The installer goes to Major upgrade mode, however, the Installer is doing the following Sequence.
So all the fresh install scripts are executed again during the patch process.
Below is the sample Test package that illustrates what am saying.
The requirement is to Run Step 2 alone for 3.4.15 to 3.4.16 & Run Step 1 & 2 for fresh install of 3.4.16
The steps I have taken may not be the right ones. Kindly help to achieve this.
Thanks
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="WIXInstaller" Language="1033" Version="1.0.1.16" Manufacturer="ShoreTel" UpgradeCode="86c5a799-abe4-4949-a50c-f5aea92e5537">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
<MediaTemplate />
<Feature Id="ProductFeature" Title="WIXInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="base.ver" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Component Id="base.ver" DiskId="1" Guid="E1B7D00A-D6D8-4594-B4E1-E9AF67877132">
<File Source="base.ver" KeyPath="yes" />
</Component>
<Directory Id="INSTALLFOLDER" Name="WIXInstaller" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<InstallExecuteSequence>
<!-- SQLCMD commands preparation -->
<Custom Action="fstInstall" After="InstallFiles">NOT Installed</Custom>
<Custom Action="upgradeInstall" After="InstallFiles">UPGRADINGPRODUCTCODE</Custom>
<Custom Action="remove" After="InstallFiles">REMOVE</Custom>
</InstallExecuteSequence>
<CustomAction Id="remove" Script="vbscript">
<![CDATA[
MsgBox("Remove 16")
]]>
</CustomAction>
<CustomAction Id="fstInstall" Script="vbscript">
<![CDATA[
MsgBox("First Install : 16")
]]>
</CustomAction>
<CustomAction Id="upgradeInstall" Script="vbscript">
<![CDATA[
MsgBox("Upgrade + Install : 16")
]]>
</CustomAction>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</ComponentGroup>
</Fragment>
Major upgrade is the uninstall->install. If you want to change existing installation, you should use patch.