I have created a WIX installer that installs a windows service into the ProgramFilesFolder. Once installed, I need to be able to modify the app.config to point several entries to the installation folder. Since the installed service could be installed on both x86 and x64 machines I don't know at compile time if the correct path is "\Program Files" or "\Program Files (x86)", nor can I guarantee that the Program Files folder will be on C:.
The custom action that I've created modifies the installed app.config to point to the correct folder using the data available in the INSTALLFOLDER session variable. This works great when I run the installer from an elevated command prompt, but I'm trying to make things simpler on my users.
Unfortunately, the app.config is for a windows service, and as such the directory that launches the service is \Windows\System32, and not the installed folder, so using a relative path in the app.config won't work.
Is there any way that I can execute the custom action as an administrator while still maintaining access to the session variables, or alternately, some way to make just the value of INSTALLFOLDER available to the custom action?