What is wrong in my code. I can't run app after I check"EXITDIALOGOPTIONALCHECKBOX" on "ExitDialog".
<UI>
<UIRef Id='WixUI_Minimal'/>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchInstalledExe">LAUNCH_APP_ON_EXIT</Publish>
</UI>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="APPLICATIONROOTDIRECTORY">
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" />
</Directory>
<Directory Id="DesktopFolder" />
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="Test.exe" Guid="EF2B3E63-B797-47E6-A1AD-8221F13B6959">
<File Id="Test.exe" Source="ApplicationFiles\Test.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="Test.exe" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationDesktopShortcut" />
</Feature>
<InstallExecuteSequence>
<Custom Action='ChangeDir' After='CostFinalize' >NOT Installed</Custom>
</InstallExecuteSequence>
<Fragment>
<CustomAction Id="ChangeDir" Directory="APPLICATIONROOTDIRECTORY" Value="C:\\SampleFolder\" />
<CustomAction Id="LaunchApplication" FileKey="Test.exe" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" />
<CustomAction Id="LaunchInstalledExe"
FileKey="Test.exe"
ExeCommand=""
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" >
</CustomAction>
</Fragment>
<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="FBE47082-5FC5-4861-B113-96BA9D30821F">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Test"
Description="opis"
Icon="logo.ico"
Target="[APPLICATIONROOTDIRECTORY]\Test.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Test" Name="Test" Type="integer" Value="1" KeyPath="yes"/>
<!-- Uninstall Shortcut-->
<Shortcut Id="UninstallProduct"
Name="Uninstall Test"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstall Test" />
</Component>
</DirectoryRef>
<!-- desktop shortcut-->
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDesktopShortcut" Guid="5c9b9050-3846-49c3-8484-910f49d4eddf">
<Shortcut Id="desktopSC" Target="[APPLICATIONROOTDIRECTORY]\Test.exe"
Directory="DesktopFolder" Name="Test" IconIndex="0" WorkingDirectory="APPLICATIONFOLDER" Icon="logo.ico" Advertise="no" />
<RemoveFolder Id="ApplicationDesktopFolder" Directory="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="SOFTWARE\Test" Name="Test" Value="1" Type="integer" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
When I rem line with 'Custom Action='ChangeDir'' app will lunch. I really need this Custom Action becouse in other custom action I run (below code) to change 'APPLICATIONROOTDIRECTORY'
<CustomAction Id="LicenseInfoCustomAction" BinaryKey="CustomActionBinary" DllEntry="ShowLicenseInfo" Execute="immediate" Return="check" HideTarget="yes" />
<Binary Id="CustomActionBinary" SourceFile="$(var.MyCustomAction.TargetDir)$(var.MyCustomAction.TargetName).CA.dll"/>
.
Please help.
Update:
Finally I find solution in this documentation: wix documentation
App starts even with administrator privileges.