0

I have created a MSI installer package using Wix Toolset 3.8 that is run by a third party installer service running under the "SYSTEM" account. My issue is that when trying to launch and run an installed executable from my MSI installer using a custom action, it also runs under the SYSTEM account instead of the administrator account that is currently logged in. I have spent hours researching on the net and from what I have read, specifying Impersonate="yes" will run that particular custom action under the account that launched the installer, but there lies the issue. Since the third party installer service is running from the SYSTEM account, specifying Impersonate="yes" would just run the custom action under the SYSTEM account as well correct? At least that's what my tests have shown. A little bit of background on my MSI installer:

InstallScope="perMachine"

<CustomAction Id="StartAction" 
              Directory="FOLDER" 
              ExeCommand ='cmd.exe /c start MYEXE.exe /tray' 
              Execute="immediate" 
              Impersonate="yes" 
              Return="check"/>

 <InstallExecuteSequence>
      <Custom Action='StartAction' Before='InstallFinalize'>NOT Installed</Custom>
 </InstallExecuteSequence>

I have tried both "deferred" and "immediate" for Execute as well as setting "Impersonate" to both yes and no. Is there any way to make this work? I thought about using the runas command but I wouldn't know the password of the user account that initiated the install.

Thanks!

Derek8588
  • 9
  • 3

1 Answers1

1

What is the EXE file doing? Do you have control of the application so you can move the logic from that external EXE into the main application's launching logic?

Other than that you can register such an EXE file to run once per user via ActiveSetup. You can also find another answer from me here.

Here is one more link to an explanation of ActiveSetup (I prefer the one above): http://www.ewall.org/tech/msi/self-healing

Also see these answer here: Stopping MSI from launching an EXE in the SYSTEM context

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • The EXE is a third party application responsible for controlling an Audio Device that the MSI installs drivers for. Using ActiveSetup seems to only start a specified application the next time a user logs in (allows you to "run something once per profile on login") unless I am misunderstanding. I am trying to run this application as soon as the installer is complete without having to log off then back on. I already write to HKLM\Software\Microsoft\Windows\CurrentVersion\Run to start the application upon user login. – Derek8588 Aug 07 '14 at 15:37
  • I think I may have finally found what I am looking for. I had no idea that what seemed to be a simple task is indeed very complicated. Perhaps there is an easier way but for anyone who is interested have a look at these links. Hopefully someone can confirm if this is correct/easiest approach to achieving this. http://stackoverflow.com/questions/4147821/start-a-windows-service-and-launch-cmd and http://stackoverflow.com/questions/1543753/start-exe-after-msi-install-but-using-current-user-privileges – Derek8588 Aug 07 '14 at 16:26