2

I have a Visual Studio setup project that generates an msi installer. The installer works fine if I run it as an administrator. If it is not run as an administrator my updates to HKEY_CURRENT_USER\Software\Microsoft\Office fail.

I have looked at Launch Conditions, Custom Actions and Prerequisites from the project properties but I could not figure out how to do this.

Is it possible to to create an install that will warn users and fail if it is not run with administrative privileges?

Thanks

Frank
  • 3,029
  • 5
  • 34
  • 43
  • 1
    ... why do updates to HKCU fail when run as a limited user? And why are you writing to HKCU when you're apparently trying to do an all users install? – bdonlan Aug 30 '11 at 19:27
  • @bdonlan Thanks. I have set the "InstallAllUsers" setup project property to False (inspired by your comment) and things may be working. I will continue to test and let you know. – Frank Aug 30 '11 at 21:58

1 Answers1

3

Set ALLUSERS to 2.

You can use Privileged property in a conditional Custom Action to show an Error to the user, or simply use it in a LaunchCondition. The Privileged property is set if user has Administrative rights or can perform elevated installation.

See also AdminUser property.

Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68