Search code examples
wixwindows-installerwix3

Execute process as normal user from MSI (wix) under different context


I'm trying to configure an installer for some software we use within the company.

The installer is pushed out to target machines via SMS, and it performs the following steps:

  1. Terminate any currently running instances of the app (the app is a utility, so this isn't an impact on the user).
  2. Remove the previous version.
  3. Install the updated version.

What we want it to do is launch the installed executable (as the currently logged in user, not the system account which the SMS job runs as) once step 3 is completed.

I've tried adding a custom action as follows:

<CustomAction Id="Relaunch" Impersonate="yes" Return="asyncNoWait" FileKey="AppExeFile" Execute="commit" ExeCommand="acm" />

And in the InstallExecuteSequence element I have the following:

<Custom Action="Relaunch" OnExit="success" />

However when we try this, either as a SMS job or executing as an administrator nothing happens (e.g. the app isn't relaunched).

Any suggestions?


Solution

  • Unfortunately it would seem this isn't possible - I suppose it might be an option to write an extension for the MSI which does what I need in code some how - although it seems like a lot of work for a little reward.

    What we've decided to do is use SMS to send out a chained package - the primary one which executes our application, which first depends on the installer being run.

    Hope this helps someone else :)