From f4d55be5b46e82fbc77da6fa63ad4b5e44a02560 Mon Sep 17 00:00:00 2001 From: idk Date: Fri, 19 Aug 2022 23:06:25 -0400 Subject: [PATCH] Only use ShellExecAsUser if we are admin --- build.sh | 2 +- src/nsis/i2pbrowser-installer.nsi | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index e01a51c..8cf70e8 100755 --- a/build.sh +++ b/build.sh @@ -66,7 +66,7 @@ if [ ! -f "$HERE/build/jna-platform.jar" ]; then fi if [ ! -f "$HERE/build/i2pfirefox.jar" ]; then - wget -O "$HERE/build/i2pfirefox.jar" https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.5/i2pfirefox.jar + wget -O "$HERE/build/i2pfirefox.jar" https://github.com/eyedeekay/i2p.plugins.firefox/releases/download/0.0.8/i2pfirefox.jar fi cd java diff --git a/src/nsis/i2pbrowser-installer.nsi b/src/nsis/i2pbrowser-installer.nsi index 9dd764d..c4e8d4f 100644 --- a/src/nsis/i2pbrowser-installer.nsi +++ b/src/nsis/i2pbrowser-installer.nsi @@ -328,7 +328,6 @@ Section "uninstall" Delete $I2PINSTEXE\* rmDir /r "$I2PINSTEXE" ${EndIf} - # Remove shortcuts and folders Delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" @@ -363,9 +362,21 @@ Function LaunchLink ${If} ${Silent} ReadEnvStr $0 RESTART_I2P ${If} $0 != "" - ShellExecAsUser::ShellExecAsUser "open" "$DESKTOP\Browse I2P.lnk" + UserInfo::GetAccountType + pop $0 + ${If} $0 == "admin" + ShellExecAsUser::ShellExecAsUser "open" "$DESKTOP\Browse I2P.lnk" + ${Else} + ExecShell "" "$DESKTOP\Browse I2P.lnk" + ${EndIf} ${EndIf} ${Else} - ShellExecAsUser::ShellExecAsUser "open" "$DESKTOP\Browse I2P.lnk" + UserInfo::GetAccountType + pop $0 + ${If} $0 == "admin" + ShellExecAsUser::ShellExecAsUser "open" "$DESKTOP\Browse I2P.lnk" + ${Else} + ExecShell "" "$DESKTOP\Browse I2P.lnk" + ${EndIf} ${EndIf} FunctionEnd