BitKFu
BitKFu

Reputation: 3697

Prevent starting with administrative rights

Goal:

It sounds a little bit odd, but I have to prevent that a software starts with administrative rights.

Problem:

I have a setup tool that installs the software very well. After completion the setup starts the software itself. Because the setup tool runs with administrative rights, the software that will be startet automatically after the setup does the same.

But all Settings that the program need, won't be written/read correctly that time, because due to the UAC virtualization, the config directory is different to the config directory the user would have without administrative rights.

Question:

Is there any way to downgrade from admnistrative rights to user rights, if the parent process owns administrative rights. App.config? StartParameter? or something else

Info: I'm using the INNOSETUP to build the setup tool.

Thx for your help

Upvotes: 1

Views: 174

Answers (2)

Alexey Ivanov
Alexey Ivanov

Reputation: 11878

Yes, you can start a process non-elevated, however I'm not sure how this integrates with InnoSetup. The instructions are How do I start a program as the desktop user from an elevated app.

Consider marking your application with appropriate manifest to suppress UAC virtualization, it will then use the same directories in both cases: non-elevated and elevated. And better use directories in user's profile without relying on virtualization.

Upvotes: 0

Alex
Alex

Reputation: 2468

Just set runasoriginaluser flag for running application.

Upvotes: 5

Related Questions