-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Install scripts will request admin privileges and patch unrela…
…ted files can be automatically voided for test session (#175) * Install scripts will now request admin privileges to make install easier for users who have game installed on C drive * Add user configurable list of files that are automatically voided (renamed) before starting game for testing
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,47 @@ | ||
@echo off | ||
:: BatchGotAdmin | ||
:------------------------------------- | ||
:: --> Check for permissions | ||
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | ||
|
||
:: --> If error flag set, we do not have admin. | ||
if '%errorlevel%' NEQ '0' ( | ||
echo Requesting administrative privileges... | ||
goto UACPrompt | ||
) else ( goto gotAdmin ) | ||
|
||
:UACPrompt | ||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" | ||
set params = %*:"="" | ||
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" | ||
|
||
"%temp%\getadmin.vbs" | ||
del "%temp%\getadmin.vbs" | ||
exit /B | ||
|
||
:gotAdmin | ||
pushd "%CD%" | ||
CD /D "%~dp0" | ||
:-------------------------------------- | ||
echo on | ||
|
||
call MAKE_Install.bat | ||
|
||
:: Rename files as per setup in SETUP_UserSettings.bat | ||
for %%f in (%GameFilesToDisable%) do ( | ||
if exist %GameRootDir%\%%f ( | ||
ren %GameRootDir%\%%f %%f.PATCH104P | ||
) | ||
) | ||
|
||
set GameExeArgs0=%GameExeArgs:"=% | ||
|
||
::Run game | ||
%GameRootDir%\%GameExeFile% %GameExeArgs0% | ||
|
||
:: Restore files as per setup in SETUP_UserSettings.bat | ||
for %%f in (%GameFilesToDisable%) do ( | ||
if exist %GameRootDir%\%%f.PATCH104P ( | ||
ren %GameRootDir%\%%f.PATCH104P %%f | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters