开发者

How do I force a Visual Studio setup project generated msi installer to only run in administrative mode?

开发者 https://www.devze.com 2023-03-31 16:18 出处:网络
I have a Visual Studio setup project that generates an msi installer.The in开发者_开发知识库staller works fine if I run it as an administrator.If it is not run as an administrator my updates to HKEY_C

I have a Visual Studio setup project that generates an msi installer. The in开发者_开发知识库staller 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号