Wix/MSI - 静默模式下的重大升级

Wix/MSI - Major Upgrade in silent mode

我有一个安装程序支持从我们以前的版本升级:

<Product Id="*" 
   Name="$(var.ProductName)" 
   Language="1033" 
   Version="$(var.InstallerVersion)" 
   Manufacturer="$(var.Manufacturer)" 
   UpgradeCode="$(var.UpgradeCode)">

<Upgrade Id="$(var.UpgradeCode)">
  <UpgradeVersion Minimum="$(var.InstallerVersion)" IncludeMinimum="no" OnlyDetect="yes" Property="NEWERVERSIONFOUND" />
  <UpgradeVersion Minimum="5.0.0" IncludeMinimum="yes" Maximum="$(var.InstallerVersion)" IncludeMaximum="yes" Property="OLDERVERSIONFOUND" MigrateFeatures="yes" />
  <UpgradeVersion Minimum="0.0.0" IncludeMinimum="yes" Maximum="5.0.0" IncludeMaximum="no" Property="OLDESTVERSIONFOUND" MigrateFeatures="yes" />
</Upgrade>

<InstallExecuteSequence>
  <Custom Action="SetReInstallProperty" After="FindRelatedProducts">OLDERVERSIONFOUND OR OLDESTVERSIONFOUND</Custom>
  <Custom Action="SetReInstallModeProperty" After="FindRelatedProducts">OLDERVERSIONFOUND OR OLDESTVERSIONFOUND</Custom>
  <RemoveExistingProducts After="InstallInitialize">OLDERVERSIONFOUND OR OLDESTVERSIONFOUND</RemoveExistingProducts>

当我 运行 在 UI 模式下通过旧版本 4.2 安装程序时,升级工作正常。但是当我 运行 使用 /q 使它处于静默模式时,它 运行 处于维护模式并尝试自行卸载。

这是日志的部分:

MSI (s) (EC:00) [10:49:44:999]: PROPERTY CHANGE: Adding ACTION property. Its value is 'INSTALL'.
MSI (s) (EC:00) [10:49:44:999]: Doing action: INSTALL
Action start 10:49:44: INSTALL.
MSI (s) (EC:00) [10:49:44:999]: Running ExecuteSequence
MSI (s) (EC:00) [10:49:45:000]: Doing action: FindRelatedProducts
Action start 10:49:45: FindRelatedProducts.
MSI (s) (EC:00) [10:49:45:000]: PROPERTY CHANGE: Adding OLDESTVERSIONFOUND property. Its value is '{16DF8961-26DE-4A05-B759-102976C5EA22}'.
MSI (s) (EC:00) [10:49:45:000]: PROPERTY CHANGE: Adding MIGRATE property. Its value is '{16DF8961-26DE-4A05-B759-102976C5EA22}'.
MSI (s) (EC:00) [10:49:45:001]: Doing action: SetReInstallModeProperty
Action ended 10:49:45: FindRelatedProducts. Return value 1.
Action start 10:49:45: SetReInstallModeProperty.
MSI (s) (EC:00) [10:49:45:001]: Doing action: SetReInstallProperty
Action ended 10:49:45: SetReInstallModeProperty. Return value 1.
MSI (s) (EC:00) [10:49:45:001]: PROPERTY CHANGE: Adding REINSTALL property. Its value is 'all'.

...

MSI (s) (EC:00) [10:49:47:605]: Doing action: MigrateFeatureStates
Action ended 10:49:47: ReadNCPExtensions. Return value 1.
MSI (s) (EC:00) [10:49:47:605]: Migrating feature settings from product(s) '{16DF8961-26DE-4A05-B759-102976C5EA22}'
Action start 10:49:47: MigrateFeatureStates.
MSI (s) (EC:00) [10:49:47:606]: Doing action: InstallValidate
Action ended 10:49:47: MigrateFeatureStates. Return value 1.
Action start 10:49:47: InstallValidate.
MSI (s) (EC:00) [10:49:47:606]: PROPERTY CHANGE: Deleting MsiRestartManagerSessionKey property. Its current value is '0c59f7d17b575b409c4f5593caddd7f9'.
MSI (s) (EC:00) [10:49:47:606]: Feature: MainFeature; Installed: Absent;   Request: Null;   Action: Null
MSI (s) (EC:00) [10:49:47:606]: Component: C.Name1.dll; Installed: Absent;   Request: Null;   Action: Null
MSI (s) (EC:00) [10:49:47:606]: Component: C.Name2.dll; Installed: Absent;   Request: Null;   Action: Null

...

MSI (s) (EC:00) [10:49:47:621]: PROPERTY CHANGE: Adding REMOVE property. Its value is 'ALL'.
MSI (s) (EC:00) [10:49:47:622]: Doing action: SetARPINSTALLLOCATION
Action ended 10:49:47: InstallValidate. Return value 1.
MSI (s) (EC:00) [10:49:47:622]: PROPERTY CHANGE: Adding ARPINSTALLLOCATION property. Its value is 'C:\Program Files (x86)\SmartDrive Systems Inc\SmartDrive Data Forwarding Gateway\'.
Action start 10:49:47: SetARPINSTALLLOCATION.
MSI (s) (EC:00) [10:49:47:622]: Doing action: InstallInitialize
Action ended 10:49:47: SetARPINSTALLLOCATION. Return value 1.
MSI (s) (EC:00) [10:49:47:622]: Machine policy value 'AlwaysInstallElevated' is 0
MSI (s) (EC:00) [10:49:47:622]: User policy value 'AlwaysInstallElevated' is 0
MSI (s) (EC:00) [10:49:47:622]: BeginTransaction: Locking Server
MSI (s) (EC:00) [10:49:47:623]: SRSetRestorePoint skipped for this transaction.
MSI (s) (EC:00) [10:49:47:623]: Server not locked: locking for product {D097B768-E833-4511-A1F6-E51BD1A02258}
Action start 10:49:47: InstallInitialize.
MSI (s) (EC:00) [10:49:47:936]: Doing action: RemoveExistingProducts
Action ended 10:49:47: InstallInitialize. Return value 1.
MSI (s) (EC:00) [10:49:47:937]: Skipping RemoveExistingProducts action: current configuration is maintenance mode or an uninstall
Action start 10:49:47: RemoveExistingProducts.
MSI (s) (EC:00) [10:49:47:937]: Doing action: ProcessComponents
Action ended 10:49:47: RemoveExistingProducts. Return value 0.
Action start 10:49:47: ProcessComponents.
MSI (s) (EC:00) [10:49:47:938]: Doing action: UnpublishFeatures
Action ended 10:49:47: ProcessComponents. Return value 1.
Action start 10:49:47: UnpublishFeatures.
MSI (s) (EC:00) [10:49:47:938]: Doing action: StopServices
Action ended 10:49:47: UnpublishFeatures. Return value 1.
Action start 10:49:47: StopServices.
MSI (s) (EC:00) [10:49:47:939]: Doing action: DeleteServices
Action ended 10:49:47: StopServices. Return value 1.
Action start 10:49:47: DeleteServices.

两个安装程序中的主要功能名称不同。当我将新版本中的功能名称更改为与 4.2 中相同的名称时,升级在静默模式下工作,但在 UI 模式下停止工作并显示类似日志:在 MigrateFeatureState 之后,所有组件都处于 Installed 状态:Absent;请求:空;操作:Null 并将 REMOVE 设置为 ALL。 知道为什么它的行为如此奇怪吗?

我将主要功能名称设置为与旧安装程序中的名称相同,并删除了我的自定义操作 SetReinstallProperty,并且现在可以在两种模式下进行升级。