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