R – Programmatically execute app in Vista

launchpermissionswindows-vista

I have an application that executes an upgrader application automatically whien it starts. However, when the first app laucnches and sees that an upgrade is needed it launches the upgrader and fails becuase of security in Vista. If i launch the upgrader manually as an Administrator then it functions correctly.

1) How can i do this automatically from the first app?

2) If i set the properties to launch as admin then I get the security dialog… how do I launch it without any Vista security/permission dialogs?

Thanks for the help!!

Best Answer

So you want to launch an installation that requires admin rights without admin rights? Because, you know, with UAC enabled, launching an app with admin rights requires the dialog by definition. That's the whole point of it.

Don't even try that. Look at Firefox, a decent application with automatic update. You'll have to confirm the consent dialog for every update, and that's fine. Because if the user does not want that, he can disable UAC. But that is his problem, not yours. You are not supposed to disable UAC from/for your program. It's like a guest requiring unlocking of all doors to enter when you could just ring the bell at the front door.

Embed a manifest into the updater that specifies requireAdministrator. This will show the consent dialog if the user has UAC enabled, and will work flawlessly if the user has UAC disabled.

Regarding Reed Copsey's solution 1: If your updater is a service, people might not like that. Unless you're a well-trusted, let's say, Anti-Virus company, this could damage your reputation seriously.

Related Topic