У меня есть установка WiX Burn с цепочкой пакетов.
Обновления запускаются в пассивном режиме и не требуют вмешательства пользователя.
Последний пакет запускается только при обновлении, и единственная цель - запустить исполняемый файл, что он делает с помощью следующего кода:
<!-- Quiet Execution Deferred execution with qtExec-->
<Property Id="QtExecDeferredExample" Value=""C:\Program Files (x86)\Acme Inc\MyApp.exe""/>
<CustomAction Id="QtExecDeferredExample" BinaryKey="WixCA" DllEntry="CAQuietExec"
Execute="deferred" Return="ignore" Impersonate="no"/>
<InstallExecuteSequence>
<Custom Action="QtExecDeferredExample" Before="InstallFinalize"/>
</InstallExecuteSequence>
Однако, хотя MyApp.exe запускается, установка не завершится, пока MyApp.exe не завершится. Очевидно, я хочу, чтобы приложение запустилось, а установщик завершил свою работу.
Я не могу изменить CustomAction для запуска после завершения установки ..
<Custom Action="QtExecDeferredExample" After="InstallFinalize"/>
По следующим причинам:
ICE77: QtExecDeferredExample is a in-script custom action.
It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table
Любые идеи приветствуются.
Обновление: ответ Брайана Джей привел меня к ответу. Как запросил @escist, соответствующая часть моего ЦС выглядит следующим образом:
<!-- CA To set the property of the process to start-->
<CustomAction
Id ="SetProcessToStart"
BinaryKey ="WiXCustomActions"
DllEntry ="GetProcessToStart"
Execute ="immediate" />
<!-- CA to start the process-->
<CustomAction
Id ="StartApp"
Directory ="APPLICATIONROOTDIRECTORY"
ExeCommand ="[PROCESSTOSTART]"
Execute ="deferred"
Return ="asyncNoWait"/>
</Fragment>
</Wix>
и в другом месте (есть несколько моих приложений, которые могли запустить этот процесс, поэтому путь к ним хранится в реестре) ..
<Property Id="PROCESSTOSTART">[Not Set]</Property>
<InstallExecuteSequence>
<!-- Use our Custom Action to set the PROCESSTOSTART property-->
<!-- Custom Action to get the value from registry of the App that started the bootstrapper-->
<Custom Action="SetProcessToStart" Before="LaunchConditions">NOT Installed</Custom>
<!-- NOT installed ensures that the CA does not get fired on an uninstall -->
<Custom Action="StartApp" Before="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>