WiX Executing an Application Unconditionally
alo Everyone.
My problem is twofold. I have a WiX Project that I have been working on, and have been tasked to make it perform a program execution regardless of the user pressing cancel, the installation being aborted (via an already existing version) or the user successfully finishing the installation.
I currently use the built-in diaglog system:
<UIRef Id="WixUI_InstallDir" />
I currently have been very successful at executing the application after the install has finished. The difficulty has been in the fact the application is in the same location of the installer and I can't guarantee where that will be. Therefore I used the following method to execute the program after the install has been successful:
<InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<RemoveExistingProducts After="InstallInitialize" />
<Custom Action="PropertyAssign" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="LaunchFile" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
<CustomAction Id='PropertyAssign' Property='PathProperty' Value='[SourceDir][DRIVEREXEC]' />
<CustomAction Id="LaunchFile" Property="PathProperty" ExeCommand='/S' Return="asyncNoWait" />
The two custom actions are used to execute the application after the install has finished. Because of this I can't assign two custom actions when the program exists. OnExit="error" throws an exception when two custom actions have the same setting.
How does one execute an application, location unknown -- but assumed to be in the same directory of the in开发者_C百科staller -- unconditionally?
I thank you all for your time and kind replies
You might check out the WiX documentation about how to run an application after setup: http://wix.sourceforge.net/manual-wix3/run_program_after_install.htm. That will give you pointers into the WiX UI dialog set that you could tweak if necessary.
Also, SourceDir is a very tricky thing to use: http://robmensching.com/blog/posts/2010/1/26/StackOverflow-what-does-NameSourceDir-refer-to. Ideally you'd launch the application installed instead of from media.
精彩评论