Only use ShellExecAsUser if we are admin

This commit is contained in:
idk
2022-08-19 23:06:25 -04:00
parent 03ea86c345
commit f4d55be5b4
2 changed files with 15 additions and 4 deletions

View File

@@ -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

View File

@@ -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