簡體   English   中英

WIX僅升級版本,而不升級已安裝的文件

[英]WIX upgrade only the version and not the installed files

我有一個<Product Id="GUID" Version="3.4.1.15"..的安裝程序。..該安裝程序將運行自定義操作分發給客戶。

我正在嘗試創建對msi的更新/升級/補丁(版本= 3.4.1.16)。 新補丁應僅執行新動作,這些動作是3.4.16的一部分。

下面是我嘗試實現的代碼。 (更改了ProductId="*"並嘗試了AllowSameVersionUpgrades="yes"

安裝程序進入“主要”升級模式,但是,安裝程序正在執行以下序列。

  1. 刪除版本15
  2. 將產品代碼15升級到產品代碼16
  3. 以全新安裝方式安裝產品16。

因此,所有新的安裝腳本都會在修補過程中再次執行。

下面是示例測試包,說明了所講的內容。

要求是針對3.4.15至3.4.16單獨運行步驟2,並針對3.4.16全新安裝運行步驟1和2。

我采取的步驟可能不正確。 請幫助實現這一目標。

謝謝

<?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>

主要升級是uninstall-> install。 如果要更改現有安裝,則應使用補丁。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM