2013-02-25 172 views
0

以下是我爲版本1和版本2設置的設置。但是當我安裝MSI軟件包進行升級時,彈出消息框並要求從添加/刪除程序中刪除以前版本的安裝而不是自動刪除舊版本並安裝新版本。使用WIX安裝升級產品

請讓我知道任何設置需要修改。下面

版本1設置:

<Product Id="*" Name="CBUDirectMSI" Language="1033" Version="1.0.0.0" Manufacturer="" UpgradeCode="5fa35d9d-5b5a-40f0-9607-e381e728a146"> 

     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/> 

     <Upgrade Id="5fa35d9d-5b5a-40f0-9607-e381e728a146"> 
      <UpgradeVersion Property="OLD_VERSION_FOUND" 
      Minimum="1.0.0.0" 
      Maximum="2.0.0.0" 
      IncludeMinimum="yes" 
      IncludeMaximum="no" 
      OnlyDetect="no" 
      IgnoreRemoveFailure="no" 
      MigrateFeatures="yes" 
      Language="1033" /> 
      <UpgradeVersion 
      Property="NEWER_VERSION_FOUND" 
      Minimum="2.0.0.0" 
      IncludeMinimum="no" 
      OnlyDetect="yes" 
      Language="1033" /> 
     </Upgrade> 

     <Condition Message="A newer version of [ProductName] is already installed. Exiting installation."> 

     </Condition> 

     <InstallExecuteSequence> 
      <InstallExecute Before="RemoveExistingProducts" /> 
      <RemoveExistingProducts Before="InstallFinalize" /> 
     </InstallExecuteSequence> 
    </Product> 

第2版設置

<Product Id="B55596A8-93E3-47EB-84C4-D7FE07D0CAF4" Name="CBUDirectMSI" Language="1033" Version="2.0.0.0" Manufacturer="" UpgradeCode="5fa35d9d-5b5a-40f0-9607-e381e728a146"> 

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/> 


    <Upgrade Id="5fa35d9d-5b5a-40f0-9607-e381e728a146"> 
     <UpgradeVersion Property="OLD_VERSION_FOUND" 
     Minimum="1.0.0.0" 
     Maximum="2.0.0.0" 
     IncludeMinimum="yes" 
     IncludeMaximum="no" 
     OnlyDetect="no" 
     IgnoreRemoveFailure="no" 
     MigrateFeatures="yes" 
     Language="1033" /> 
     <UpgradeVersion 
     Property="NEWER_VERSION_FOUND" 
     Minimum="2.0.0.0" 
     IncludeMinimum="no" 
     OnlyDetect="yes" 
     Language="1033" /> 
    </Upgrade> 

    <Condition Message="A newer version of [ProductName] is already installed. Exiting installation."> 

    </Condition> 

    <InstallExecuteSequence> 
     <InstallExecute Before="RemoveExistingProducts" /> 
     <RemoveExistingProducts Before="InstallFinalize" /> 
    </InstallExecuteSequence> 
</Product> 

維克斯安裝程序會識別新版本,但不會不刪除舊版本並安裝新版本;並給出下面的消息框「但仍然收到錯誤消息框說」此產品的另一個版本已經安裝。我的這個版本的安裝無法continue.To配置或刪除該產品的現有版本,使用添加/刪除控制面板上的程序」。

任何一個可以建議我在哪裏,我錯了。

回答

1

會。​​

:建議使用 MajorUpgrade標籤,而不是當前正在實施 Upgrade之一 MajorUpgrade一個更簡單的使用過程取自

<MajorUpgrade 
    Schedule="afterInstallInitialize" 
    DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit.">