From 9a34008c484e6f4a15df05e5c2f79ffd4860a0d9 Mon Sep 17 00:00:00 2001 From: idk Date: Fri, 25 Mar 2022 12:05:57 -0400 Subject: [PATCH] Makefile wasn't producing licenses at the right step, try and detect if elevated from the NSIS installer from the start of the script, for now, fail if we aren't --- Makefile | 2 +- src/nsis/i2pbrowser-installer.nsi | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 246fdf4..5b1d2e1 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ prep: profile.tgz app-profile.tgz profile build/licenses build/I2P build/I2P/con cp src/nsis/*.nsh build cp src/icons/*.ico build -install.exe: +install.exe: build/licenses cd build && makensis i2pbrowser-installer.nsi && cp I2P-Profile-Installer-*.exe ../ && echo "built windows installer" export RES_DIR="../i2p.i2p.jpackage-build/installer/resources" diff --git a/src/nsis/i2pbrowser-installer.nsi b/src/nsis/i2pbrowser-installer.nsi index 9938829..d3a32b2 100644 --- a/src/nsis/i2pbrowser-installer.nsi +++ b/src/nsis/i2pbrowser-installer.nsi @@ -144,6 +144,13 @@ Page instfiles !include i2pbrowser-mozcompat.nsi Function .onInit + UserInfo::GetAccountType + pop $0 + ${If} $0 != "admin" + MessageBox mb_iconstop "Administrator rights required!" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Quit + ${EndIf} !insertmacro MUI_LANGDLL_DISPLAY Call ShouldInstall64Bit ${If} $0 == 1