Question

Folks,

I've got a strange issue at the moment with a visual studio 2010 built MSI...

When I run the msi, it performs a few tasks, then executes a tool we built - this tool then carries out some more advanced work we couldn't do within a custom task.

The issue here, is then when the msi starts my custom built tool, it doesn't execute it with the same credentials as I start the MSI with (i.e. my administrative login).

Is there a parameter I can pass to an MSI to enforece this? Or perhaps I can pass the credentials to the process when I start it?

My process is started using Process process = Process.Start(procInfo) nothing fancy. I've also noted the ability to pass in a parameterised username/password/domain, but this will vary depending on the user who is installing - can this be extracted from the installer somehow?

Any help (or questions) welcomed.

Dave

EDIT: for clarity... I'm running the MSI under my domain account, and I want my custom process to run under that 'context'. At present, it starts (regardless of whether I start as administrator or not) under the SYSTEM account (rather than mydomain\me). I'm using Windows Server DataCenter edition if that helps...

I should also add, I think this is a policy issue, but I've no idea what to check/where to check...

Was it helpful?

Solution

By default Windows Installer runs custom actions as the current user. If the MSI is elevated, custom actions will run as the elevated user.

Please note that if you are running the MSI as an Administrator, it doesn't mean your custom actions will have full Administrator privileges. On Vista or higher any user can gain Administrator privileges through elevation.

So if your custom actions need Administrator privileges, make sure they use the msidbCustomActionTypeNoImpersonate flag so they run under the local system account.

If this is not the problem and you just need access to the current user data, can you please give me more details?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top