2

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

<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。任何想法为什么它表现得如此奇怪?

4

1 回答 1

1

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

于 2015-08-14T09:46:17.157 回答