I am facing a strange issue. I have build the wix installer and when the setup is complete an external exe (MyEx.exe) is launched. This works absolutely fine in my local machine.
I use VS 2012 to Build.
Below is the piece of code
<Publish Dialog="MyExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="MyExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchApplication">LAUNCHAPPONEXIT and NOT Installed</Publish>
MyExitDialog.wxs file
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="MyExitDialog" Width="370" Height="270" Title="[ProductName]" NoMinimize="yes">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" />
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" />
<Control Id="LaunchCheckBox" Type="CheckBox" X="10" Y="243" Width="170" Height="17" Property="LAUNCHAPPONEXIT" Hidden="yes" CheckBoxValue="1" Text="Launch NetappAgent Configuration">
<Condition Action="show">NOT Installed</Condition>
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="MyExitDialog" OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="MyExitDialog" OnExit="success" />
</AdminUISequence>
</UI>
</Fragment>
</Wix>
and MyMainFile.wxs
<Condition Message="!(loc.InstallationPrivMessage)">Privileged</Condition>
<Property Id="WixShellExecTarget" Value="$(var.SourceDir)\MyExe.exe" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec"/>.
Issue is when the same piece of code is uploaded on a Jenkins Machine. Build is successful but external exe (MyExe.exe) does not launch when I click finish at the end.
I use MSBuild v4.0.30319 and Ant 1.9.0. I am not sure where should I start debugging. Any help will be appreciated.
Update:
Upon further investigation, I came to know that $(var.SourceDir)\MyExe.exe could be culprit. I think is valid on compile not on the build time.
I have also tried using [#MyExe.exe] but even that not worked.
MSI (c) (EC:68) [16:56:37:679]: Doing action: MyExitDialog
Action 16:56:37: MyExitDialog.
Action start 16:56:37: MyExitDialog.
Action 16:56:37: MyExitDialog. Dialog created
MSI (c) (EC:70) [16:56:48:138]: Doing action: LaunchApplication
Action 16:56:48: LaunchApplication.
Action start 16:56:48: LaunchApplication.
MSI (c) (EC:10) [16:56:48:153]: Invoking remote custom action. DLL: C:\Users\ssachin\AppData\Local\Temp\MSIF5F.tmp, Entrypoint: WixShellExec
MSI (c) (EC!B0) [16:56:48:191]: Note: 1: 2715 2: MyExe.exe
MSI (c) (EC!B0) [16:56:48:191]: Note: 1: 2715 2: MyExe.exe
Action ended 16:56:48: LaunchApplication. Return value 3.
DEBUG: Error 2896: Executing action LaunchApplication failed.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: LaunchApplication, ,
Action ended 16:56:48: MyExitDialog. Return value 3.
Action ended 16:56:48: INSTALL. Return value 1.
MSI (c) (EC:68) [16:56:48:196]: Destroying RemoteAPI object.
MSI (c) (EC:54) [16:56:48:197]: Custom Action Manager thread ending.