Wix - How do I specify a directory to run a batch file in?
- by Mike Pateras
I want to run a batch file, which I do via the following:
<CustomAction Id='InstallFilter' FileKey='install' ExeCommand='' Execute='deferred' />
<InstallExecuteSequence>
<Custom Action='InstallFilter' Before='InstallFinalize' />
</InstallExecuteSequence>
This will execute the batch file, but it runs in C:\Windows\System32 (or something like that). I want it to run in the directory that the file is found in. It won'et let me specify a Directory attribute with a FileKey attribute. How can I tell the installer to run out of a specific directory, preferably by the directory ID.
Also, when I try to uninstall my app with script, I get an error message saying "There is a problem with the Windows Installer package. A program required for the install to complete could not be run." This makes sense, as by the time the script gets run, the files have been removed. The question is:
How do I specify that my action should only be run on install, not uninstall?
How do I uninstall this current copy?