I need to write an installer for some executables. The user might copy them wherever he wants but usually this is performed in C:\\Program Files\\MyProgram
If there's visual studio installed I also need to copy something to system32 (and that requires admin rights I suppose).
Does that make sense to support normal users and admin users? I mean: if I need to install something I always need admin rights, is this correct?
Supporting both can be tricky but it can be done by using RequestExecutionLevel highest
and then checking if you actually are admin with the UserInfo plugin. You would then have to tell the user to force the installer to run as admin if they are not already when you detect VS.
A normal user cannot write to $programfiles
so you have to default $instdir
to $localappdata\\Programs\\Yourapp
. You should also take a look at SetShellVarContext
, it will help you with the HKCU vs HKLM issue...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.