首页 文章

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

提问于
浏览
1

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

<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之后,所有组件都处于已安装状态:缺席;要求:无效;操作:Null和REMOVE设置为ALL . 有什么想法,为什么它表现得如此奇怪?

1 回答

  • 1

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

相关问题