Reputation: 1367
How do I run my application under the trustedinstaller
account?
I tried creating a Visual Studio setup project and made an msi
. But even that doesn't run under the trustedinstaller
account. It runs only under the system account.
Can someone please guide me on how I can run my windows application under trusted installer account?
Just in-case you're wonder why I need it, its because I am supposed to copy some files into the winsxs
folder for the client's C++
application to work.
Thank you so much in advance.
Upvotes: 3
Views: 9559
Reputation: 399
Give one of these two utilities a try. DO NOT TAKE OWNERSHIP as suggested in other answers! This could break things worse than whatever small thing you are trying to do!
Download PsTools from Microsoft: https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
psexec -s -i <path\to\executable
The -s option causes it to impersonate SYSTEM. -i makes it interactive.
This seems to handle most cases - even though it is system, it seems to be able to edit TrustedInstaller owned keys.
https://www.nirsoft.net/utils/advanced_run.html
This free tool is from Nirsoft (a long-standing, trustworthy provider of awesome utilities), and can be used in GUI and command line mode.
This explicitly allows you to select a specific service account, although the process shows up running as SYSTEM, it seems to be able to edit TrustedInstaller owned things.
Upvotes: 3
Reputation: 5882
This can't be done, instead you must:
Upvotes: 0
Reputation: 49
Can someone please guide me on how I can run my windows application under trusted installer account?
You can use devxexec
For example:
devxexec.exe /user:TrustedInstaller cmd
Upvotes: 4
Reputation: 19
Unfortunately devxexec.exe /user:TrustedInstaller cmd
does not work in Windows 8.
It does run other programs fine though, but not cmd
.
Upvotes: 1
Reputation: 612794
That's not how you are supposed to do it. You are meant to mark your .msi as requiring administrator rights and then the system will show the user a UAC elevation dialog when they install.
This article has more details on Trusted Installer. The bottom line is that it's not actually a user but a service. In any case, it's not the solution to your problem.
Upvotes: 4