Search code examples
wixwix3.5

WiX custom action - running application in Target directory


I am using WiX to install a certain EXE file. I want the WiX setup to end running the EXE file (and not leaving any window opened), so I am using:

<CustomAction Id="LaunchApp" FileKey="APPFileKey" ExeCommand="" Return="asyncNoWait" Impersonate="no" />

The only issue is that it runs the application with current directory being the place where I run the MSI.

And I need this application to be running where the user choose to install it - it causes me many issues. Is it possible to tell WiX where to run the custom action?


Solution

  • You can use the Directory attribute of CustomAction to specify a working directory.

    It doesn't work with FileKey, but it works with ExeCommand. Instead of FileKey, you can set ExeCommand to something like "[TARGETDIR]file.exe".