tags:

views:

27

answers:

1

hi,

usually when you install a MSI package on windows, it is installed using the currently logged on user account. but i want to install it to a specific user account. for now, i want to install my MSI package using the system account. is it possible? how to do that?

thanks.

P.S. i am using Wix 3.5

+1  A: 

Not that I would recommend it, but there is an old trick you can use to do this under the SYSTEM account...

First, you'll need to craft the installation command-line to install silently/without user input.** Something like msiexec.exe /i MyProgram.msi /qb- should work.

Second, you'll need to create a Scheduled Task (XP) or Task Schedule job (Vista/Win7) to execute the command, and have it run as the SYSTEM user. Set it for a time a few minutes in the future, et voila!

(** Okay, technically you could just run msiexec /i MyProgram.msi and configure the task to allow interaction with the local user, but this only works on Win2k and XP.)


Alternately, you could use the great little SysInternals utility PSEXEC with the -s option to execute the process as the local SYSTEM user...

ewall
that's tricky...so WiX itself does not have a way to impersonate as a SYSTEM user?
davidshen84
No, not built-in... WiX is limited by the bounds of the Windows Installer (MSI) package it is making. (Er, well, and add-ons like the [Burn](http://en.wikipedia.org/wiki/WiX#Burn) bootstrapper, but I don't think that will do it either.)
ewall
After thinking about it a bit more, I suppose that when Windows Installer installs with "elevated privileges", it is using the LocalSystem account which the service is running under. This is set via Group Policy, so check out this page for more info: http://msdn.microsoft.com/en-us/library/aa369519%28VS.85%29.aspx
ewall