Wix - How do I specify a directory to run a batch file in?

Posted by Mike Pateras on Stack Overflow See other posts from Stack Overflow or by Mike Pateras
Published on 2010-04-21T18:47:54Z Indexed on 2010/04/21 19:13 UTC
Read the original article Hit count: 645

Filed under:
|
|

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:

  1. How do I specify that my action should only be run on install, not uninstall?

  2. How do I uninstall this current copy?

© Stack Overflow or respective owner

Related posts about wix

Related posts about installer