[wix-users] How to pass the INSTALLFOLDER used to a program run as a custom action

Rob Mensching rob at firegiant.com
Sat Mar 7 08:45:59 PST 2020


https://docs.microsoft.com/en-us/windows/win32/msi/formatted

Short replies here. Complete answers here: https://www.firegiant.com/services/


-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Angus Comber via wix-users
Sent: Saturday, March 7, 2020 7:48 AM
To: Wix users list <wix-users at lists.wixtoolset.org>
Cc: Angus Comber <anguscomber at gmail.com>
Subject: [wix-users] How to pass the INSTALLFOLDER used to a program run as a custom action

I run a program, config_maker.exe, at the end of install but I need to know the installation folder to write data to.

When I run the installer the current directory seems to be C:\Windows\system32 , so I need to pass the instal path to the program.
I can do this on the command line.  What syntax to use?

Here is my custom action:

    <CustomAction Id="EXECUTE_AFTER_FINALIZE"
              Execute="immediate"
              Impersonate="yes"
              Return="asyncNoWait"
              FileKey="config_maker.exe"
              ExeCommand="INSTALLFOLDER" />

I have a DirectoryRef for install folder like this:

    <DirectoryRef Id="INSTALLFOLDER">

I get config_maker.exe print output to a known place and the argument is printed like this:

arg=INSTALLFOLDER

So do I pass in a variable that will get substituted with the real value on install?



More information about the wix-users mailing list