From b92ba32781e817a34543244b5e8e3bb3f677ccbf Mon Sep 17 00:00:00 2001 From: Richard Jenkins Date: Mon, 14 Aug 2017 09:09:25 +0100 Subject: [PATCH] Revert "Fix #6169: Windows installer runs game with admin privileges (#6171)" (#6175) This reverts commit d84db2d4636413fe77818516931aa0155f9d2a50. --- distribution/windows/install.nsi | 40 ++------------------------------ scripts/ps/appveyor_install.ps1 | 8 ------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/distribution/windows/install.nsi b/distribution/windows/install.nsi index 5ecb78260c..73d2b9cf76 100644 --- a/distribution/windows/install.nsi +++ b/distribution/windows/install.nsi @@ -57,7 +57,7 @@ CRCCheck force ShowInstDetails show ShowUninstDetails show -RequestExecutionLevel user +RequestExecutionLevel admin Var SHORTCUTS @@ -66,7 +66,6 @@ Var SHORTCUTS !include "InstallOptions.nsh" !include "WinVer.nsh" !include "x64.nsh" -!include "UAC.nsh" !define MUI_ABORTWARNING !define MUI_WELCOMEPAGE_TITLE_3LINES @@ -92,8 +91,7 @@ ManifestDPIAware true !define MUI_FINISHPAGE_TITLE_3LINES !define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!" -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun +!define MUI_FINISHPAGE_RUN "$INSTDIR\${OPENRCT2_EXE}" !define MUI_FINISHPAGE_LINK "Visit the OpenRCT2 site for more information" !define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}" !define MUI_FINISHPAGE_NOREBOOTSUPPORT @@ -110,35 +108,6 @@ ManifestDPIAware true !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_RESERVEFILE_LANGDLL -!macro Init thing -uac_tryagain: -!insertmacro UAC_RunElevated -${Switch} $0 -${Case} 0 - ${IfThen} $1 = 1 ${|} Quit ${|} ;we are the outer process, the inner process has done its work, we are done - ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;we are admin, let the show go on - ${If} $1 = 3 ;RunAs completed successfully, but with a non-admin user - MessageBox mb_YesNo|mb_IconExclamation|mb_TopMost|mb_SetForeground "This ${thing} requires admin privileges, try again" /SD IDNO IDYES uac_tryagain IDNO 0 - ${EndIf} - ;fall-through and die -${Case} 1223 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "This ${thing} requires admin privileges, aborting!" - Quit -${Case} 1062 - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Logon service not running, aborting!" - Quit -${Default} - MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0" - Quit -${EndSwitch} - -SetShellVarContext all -!macroend - -Function PageFinishRun -!insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\${OPENRCT2_EXE}" "" "" "" -FunctionEnd - ;-------------------------------------------------------------- ; (Core) OpenRCT2 install section. Copies all internal game data Section "!OpenRCT2" Section1 @@ -485,7 +454,6 @@ Var UninstallString ;----------------------------------------------------------------------------------- ; NSIS Initialize function, determine if we are going to install/upgrade or uninstall Function .onInit - !insertmacro Init "installer" StrCpy $SHORTCUTS "OpenRCT2" SectionSetFlags 0 17 @@ -507,8 +475,4 @@ FinishCallback: ; Call CheckProcessorArchitecture ; Call CheckWindowsVersion FunctionEnd - -Function un.onInit -!insertmacro Init "uninstaller" -FunctionEnd ; eof diff --git a/scripts/ps/appveyor_install.ps1 b/scripts/ps/appveyor_install.ps1 index 898b098d8b..39de1eacaf 100644 --- a/scripts/ps/appveyor_install.ps1 +++ b/scripts/ps/appveyor_install.ps1 @@ -44,14 +44,6 @@ if (${env:OPENRCT2_ORG_TOKEN} -and -not $testing) 7z x nsisxtra.zip > $null Check-ExitCode cp FindProcDLL.dll "C:\ProgramData\chocolatey\lib\nsis.portable\tools\nsis-3.0b1\Plugins\x86-ansi" - - Write-Host "Downloading UAC plugin for NSIS..." -ForegroundColor Cyan - curl "http://nsis.sourceforge.net/mediawiki/images/8/8f/UAC.zip" -OutFile uac.zip - Check-ExitCode - 7z x uac.zip > $null - Check-ExitCode - cp UAC.nsh "C:\ProgramData\chocolatey\lib\nsis.portable\tools\nsis-3.0b1\Includes" - cp Plugins "C:\ProgramData\chocolatey\lib\nsis.portable\tools\nsis-3.0b1" -Recurse -Force } } else