Installation 在service major升级失败时安装以前的版本

Installation 在service major升级失败时安装以前的版本,installation,wix,wix3,Installation,Wix,Wix3,我有下面的场景 MSI安装一个服务 MSI对此已安装的服务进行主要升级(卸载旧版本并安装新版本) 在主要升级过程中,如果失败,将进行回滚,服务将完全卸载 是否可以告诉MSI,如果主要服务升级失败, 是否卸载升级并安装服务的早期版本? 怎么做 这是我的代码: <CustomAction Id="SetCustomActionDataValue" Return="check" Property="RunCmdRollback" Value="[INSTALLDIR], [UPGRAD

我有下面的场景

  • MSI安装一个服务
  • MSI对此已安装的服务进行主要升级(卸载旧版本并安装新版本)
  • 在主要升级过程中,如果失败,将进行回滚,服务将完全卸载
是否可以告诉MSI,如果主要服务升级失败, 是否卸载升级并安装服务的早期版本? 怎么做

这是我的代码:

   <CustomAction Id="SetCustomActionDataValue" Return="check"
Property="RunCmdRollback" Value="[INSTALLDIR], [UPGRADINGPRODUCTCODE],
[OLDFOUND]" />

   <CustomAction Id="RunCmdRollback" BinaryKey="OPGInstallerCA2.dll"
DllEntry="CustomAction1" Execute='rollback' Return="ignore"
Impersonate='no'/>

   <CustomAction Id='InstallServiceSetProp' Property='InstallService'
Value='/installtype=notransaction /action=install /LogFile=
"[#WindowsService]" "[#ConfigFile]"' />
   <CustomAction Id='InstallService' BinaryKey='InstallUtil'
DllEntry='ManagedInstall' Execute='deferred' Return='ignore'
Impersonate='no' />

   <CustomAction Id='UnInstallServiceSetProp'
Property='UnInstallService' Value='/installtype=notransaction
/action=uninstall /LogFile= "[#WindowsService]" "[#ConfigFile]"' />
   <CustomAction Id='UnInstallService' BinaryKey='InstallUtil'
DllEntry='ManagedInstall' Execute='deferred' Return='ignore'
Impersonate='no'/>

   <CustomAction Id='CommitServiceSetProp' Property='CommitService'
Value='/installtype=notransaction /action=commit /LogFile=
"[#WindowsService]" "[#ConfigFile]"' />
   <CustomAction Id='CommitService' BinaryKey='InstallUtil'
DllEntry='ManagedInstall' Execute='commit' Return='ignore'
Impersonate='no' />

   <CustomAction Id='RollbackServiceSetProp'
Property='RollbackService' Value='/installtype=notransaction
/action=rollback /LogFile= "[#WindowsService]" "[#ConfigFile]"' />
   <CustomAction Id='RollbackService' BinaryKey='InstallUtil'
DllEntry='ManagedInstall' Execute='rollback' Return='ignore'
Impersonate='no' />

   <CustomAction Id='ConfigurePort'  Execute='deferred'
Return='ignore' BinaryKey='HTTPCFG' ExeCommand='set urlacl -u
http://+:55555/OPGatewayService/ -a D:(A;;GA;;;NS)' Impersonate='no'/>
   <CustomAction Id='UnConfigurePort'  Execute='deferred'
Return='ignore' BinaryKey='HTTPCFG' ExeCommand='delete urlacl -u
http://+:55555/OPGatewayService/' Impersonate='no'/>
   <CustomAction Id='RollbackConfigurePort'  Execute='rollback'
Return='ignore' BinaryKey='HTTPCFG' ExeCommand='delete urlacl -u
http://+:55555/OPGatewayService/' Impersonate='no'/>

   <CustomAction Id="StopVCA" Execute='rollback' Return='ignore'
ExeCommand="net stop OPGatewayService" Directory="TARGETDIR"
Impersonate='no' />


   <InstallExecuteSequence>


     <InstallValidate Sequence="1400" />
     <RemoveExistingProducts Sequence="1402">OLDFOUND</RemoveExistingProducts>
     <InstallInitialize Sequence="1500" />

     <Custom Action="ConfigurePort"
After='InstallService'>$OPGatewayComponent>2</Custom>
     <Custom Action="UnConfigurePort"
After='UnInstallService'>$OPGatewayComponent=2</Custom>

     <Custom Action='InstallServiceSetProp'
Before='StartServices'>$OPGatewayComponent>2</Custom>
     <Custom Action='InstallService'
After='InstallServiceSetProp'>$OPGatewayComponent>2</Custom>

     <Custom Action='UnInstallServiceSetProp'
After='StopServices'>$OPGatewayComponent=2</Custom>
     <Custom Action='UnInstallService'
After='UnInstallServiceSetProp'>$OPGatewayComponent=2</Custom>

     <Custom Action='CommitServiceSetProp'
After='RollbackService'>$OPGatewayComponent>2</Custom>
     <Custom Action='CommitService'
After='CommitServiceSetProp'>$OPGatewayComponent>2</Custom>

     <Custom Action='RollbackServiceSetProp'
After='InstallService'>$OPGatewayComponent>2</Custom>
     <Custom Action='RollbackService'
After='RollbackServiceSetProp'>$OPGatewayComponent>2</Custom>
     <Custom Action="StopVCA"
After='RollbackService'>$OPGatewayComponent>2</Custom>
     <Custom Action='RollbackConfigurePort'
After='StopVCA'>$OPGatewayComponent>2</Custom>
     <Custom Action='SetCustomActionDataValue'
After='RollbackConfigurePort'>$OPGatewayComponent>2</Custom>
     <Custom Action="RunCmdRollback" After='SetCustomActionDataValue'
 >$OPGatewayComponent>2</Custom>

     <Custom Action='AlreadyUpdated'
After='FindRelatedProducts'>SELFFOUND</Custom>
     <Custom Action='NoDowngrade'
After='FindRelatedProducts'>NEWERFOUND</Custom>

   </InstallExecuteSequence>

旧发现
$OPGatewayComponent>2
$OPGatewayComponent=2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent=2
$OPGatewayComponent=2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent>2
$OPGatewayComponent>2
自找的
纽尔费
另一个问题。如何使回滚操作(RunCmdRollback)不是 要在升级失败时执行,是否仅在新安装失败时执行

多谢各位,
Adriana

有什么原因使您无法使用WiX中的
ServiceInstall
ServiceControl
元素吗

看起来你让事情变得比实际需要的更复杂了