Can you force Visual Studio to always run as an Administrator in Windows 8?

In Windows 8, Windows 10, and Windows 11, you have to right-click devenv.exe and select “Troubleshoot compatibility”. Select “Troubleshoot program” Check “The program requires additional permissions” Click “Next” Click “Test the program…” Wait for the program to launch Click “Next” Select “Yes, save these settings for this program” Click “Close” If, when you open Visual … Read more

Does Windows 7 restrict folder access as Vista does?

It’s not a “problem”, it’s a feature. It’s called User Account Control (UAC), and it’s one of the ways that system security was tightened under Windows Vista. Windows 7 indeed retains a similar security model. There’s absolutely no reason that your application should need to mess with system folders in the first place. As you’ve … Read more

Delphi: Prompt for UAC elevation when needed

i would relaunch yourself as elevated, passing command line parameters indicating what elevated thing you want to do. You can then jump right to the appropriate form, or just save your HKLM stuff. function RunAsAdmin(hWnd: HWND; filename: string; Parameters: string): Boolean; { See Step 3: Redesign for UAC Compatibility (UAC) http://msdn.microsoft.com/en-us/library/bb756922.aspx This code is released … Read more

Requested registry access is not allowed

app.manifest should be like this: <?xml version=”1.0″ encoding=”utf-8″?> <asmv1:assembly manifestVersion=”1.0″ xmlns=”urn:schemas-microsoft-com:asm.v1″ xmlns:asmv1=”urn:schemas-microsoft-com:asm.v1″ xmlns:asmv2=”urn:schemas-microsoft-com:asm.v2″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”> <assemblyIdentity version=”1.0.0.0″ name=”MyApplication.app” /> <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2″> <security> <requestedPrivileges xmlns=”urn:schemas-microsoft-com:asm.v3″> <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false” /> </requestedPrivileges> </security> </trustInfo> </asmv1:assembly>

Make Inno Setup installer request privileges elevation only when needed

Inno Setup 6 has a built-in support for non-administrative install mode. Basically, you can simply set PrivilegesRequiredOverridesAllowed: [Setup] PrivilegesRequiredOverridesAllowed=commandline dialog Additionally, you will likely want to use the auto* variants of the constants. Notably the {autopf} for the DefaultDirName. [Setup] DefaultDirName={pf}\My Program The following is my (now obsolete) solution for Inno Setup 5, based on … Read more