[FREE] Launchpad - A free, open-source UE4-compatible game launcher

Spent some time on this again today. For anyone packaging and distributing this project on Windows that has run into the issue where your launcher always requires users to right click and “run as administrator”

I have found a solution!

First, you need to add a new Application Manifest File to the project in Visual Studio.

Project -> Add New Item -> Application Manifest File

You’ll then change the <requestedExecutionLevel> element to:


<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

This will basically force the application to run as an administrator, and anyone running the program without proper authority will now receive the Windows UAC prompt.

Finally, ensure that your project is set to use your newly created app.manifest file by checking the “Application” tab of the project’s properties. There’s a dropdown menu labeled “Manifest”, and you should select the one you just created.

Build the project as usual.

Now, when inside Inno Script, before you compile your distributable exe, you need to make a few changes to the script.

First, add this line to the Setup section:


[Setup]
PrivilegesRequired=admin

Finally, you’ll need to add “runascurrentuser” flags to each command in the “Run” section. Mine look like this:



[Run]
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\gtk-sharp-2.12.26.msi"" /qn"; Flags: runascurrentuser;
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: runascurrentuser nowait postinstall skipifsilent

That should do it. Hit compile in Inno Script, and it’ll finish doing it’s thing.

Now when you distribute this .exe to users, they’ll get an initial UAC prompt when first installing the launcher, and then they won’t be asked for admin credentials again and the program won’t just fail to open. Subsequent opens of the launcher program will give another UAC prompt.

I hope that’s helpful!