Search code examples
wixwindows-installerimpersonation

Install MSI as another User (Wix Toolset)


I got a MSI setup with personilized UI and Custom Actions working properly. It will be deployed on a specific park of computer, with always the same account design:

  • An Operator account with classic privilege.
  • A Setup account with administrator privilege.

We want to be able to launch our MSI on both account, but when doing it from the Operator, have to fill a form asking for the Setup credentials and install everything as it was made logged with the setup user.

Is there a Windows/MSI tool for that? Can I do it with a specific Custom Action launched before the display of the UI?

Thank for your help


Solution

  • When you deploy an MSI to a user that has standard privileges this will always ask you for Admin credentials to install the MSI (assuming the MSI is a per-machine install and not a per-user install).

    If you deploy your software via SCCM or other infrastructure management tool you can place this to run in an Administrator Context, thus, you won't need the Administrator privileges in order to install it.

    Also, when you test an MSI it's nice to test it with PSexec. What is Psexec? Check it here.

    PsExec is a portable tool from Microsoft that lets you run processes remotely using any user's credentials. If you run psexec -s -i (in a cmd with administrator rights) this will impersonate the System account and thus allow you to install applications without requiring you to provide administrative right (password, etc).

    PSexec is a must when you test MSI's. For example, if you have any user data in your MSI. Because, when you install an MSI from another account, not all the data is automatically placed on the other user, for this you have to use ActiveSetup or other solutions to make it available on all users. See more about userdata here and any other MSI topics.

    If you are installing an MSI from an Administrator account and want to run different actions on the current logged in user, i designed a tool for this that can be downloaded here.

    So, to answer your question more directly, you can't suppress the credentials dialog as a normal user. The MSI must be deployed from some infrastructure management tool like SCCM, or another solution (which i don't recommend) is to design the MSI to be a per-user installation.