medfall

A super great game engine
Log | Files | Refs

commit ad0d358a5a7d6d1e6b7357d28e987e5d97897e9f
parent f27a64c5a378a6b92543559cff29eebbf8d8d90c
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Mon, 30 Oct 2017 23:35:47 +0200

Add elevate_for_update

No idea if it works because I would have to enable UAC for that.

Diffstat:
elevate_for_update.cc | 8++++++++
elevate_for_update_manifest.rc | 1+
elevate_for_update_manifest.xml | 11+++++++++++
make.lua | 5+++++
4 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/elevate_for_update.cc b/elevate_for_update.cc @@ -0,0 +1,8 @@ +#include <windows.h> + +#include "win32_exec.h" + +int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, char * szCmdLine, int iCmdShow ) { + exec_and_quit( "launch.exe", "-startupdate" ); + return 1; +} diff --git a/elevate_for_update_manifest.rc b/elevate_for_update_manifest.rc @@ -0,0 +1 @@ +1 24 "elevate_for_update_manifest.xml" diff --git a/elevate_for_update_manifest.xml b/elevate_for_update_manifest.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> + <assemblyIdentity version="0.0.0.0" name="asdf" /> + <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> +</assembly> diff --git a/make.lua b/make.lua @@ -26,6 +26,11 @@ bin( "launch", { "launcher/main", "http", "sha2", "platform_network", game_objs msvc_bin_ldflags( "launch", "opengl32.lib gdi32.lib Ws2_32.lib" ) gcc_bin_ldflags( "launch", game_ldflags ) +if OS == "windows" then + bin( "elevate_for_update", { "elevate_for_update", "elevate_for_update_manifest", common_objs }, { } ) + rc( "elevate_for_update_manifest" ) +end + require( "libs/imgui" ) require( "libs/glfw" ) require( "libs/lodepng" )