Question

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?

Was it helpful?

Solution

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...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top