enable a user-mode install of I2P jpackages

This commit is contained in:
idk
2022-03-25 15:04:15 -04:00
parent cf3385cfd0
commit c64f0fe632

View File

@ -27,6 +27,8 @@ SetOverwrite on
!define I2PINSTEXE !define I2PINSTEXE
!define I2PINSTEXE32 "$PROGRAMFILES32\i2p" !define I2PINSTEXE32 "$PROGRAMFILES32\i2p"
!define I2PINSTEXE64 "$PROGRAMFILES64\i2p" !define I2PINSTEXE64 "$PROGRAMFILES64\i2p"
!define I2PINSTEXE_USERMODE "$LOCALAPPDATA\i2p"
!define RAM_NEEDED_FOR_64BIT 0x80000000 !define RAM_NEEDED_FOR_64BIT 0x80000000
@ -144,10 +146,12 @@ Page instfiles
!include i2pbrowser-mozcompat.nsi !include i2pbrowser-mozcompat.nsi
Function .onInit Function .onInit
StrCpy $I2PINSTEXE "${I2PINSTEXE64}"
UserInfo::GetAccountType UserInfo::GetAccountType
pop $0 pop $0
${If} $0 != "admin" ${If} $0 != "admin"
StrCpy $INSTDIR "$LOCALAPPDATA\${COMPANYNAME}\${APPNAME}" StrCpy $INSTDIR "$LOCALAPPDATA\${COMPANYNAME}\${APPNAME}"
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}"
${EndIf} ${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY !insertmacro MUI_LANGDLL_DISPLAY
Call ShouldInstall64Bit Call ShouldInstall64Bit
@ -177,13 +181,16 @@ Function .onInit
StrCpy $FFINSTEXE "$PROFILE\Desktop\Tor Browser\Browser\" StrCpy $FFINSTEXE "$PROFILE\Desktop\Tor Browser\Browser\"
${EndIf} ${EndIf}
${EndIf} ${EndIf}
StrCpy $I2PINSTEXE "${I2PINSTEXE64}"
${If} ${FileExists} "${I2PINSTEXE32}\i2p.exe" ${If} ${FileExists} "${I2PINSTEXE32}\i2p.exe"
StrCpy $I2PINSTEXE "${I2PINSTEXE32}" StrCpy $I2PINSTEXE "${I2PINSTEXE32}"
${EndIf} ${EndIf}
${If} ${FileExists} "${I2PINSTEXE64}\i2p.exe" ${If} ${FileExists} "${I2PINSTEXE64}\i2p.exe"
StrCpy $I2PINSTEXE "${I2PINSTEXE64}" StrCpy $I2PINSTEXE "${I2PINSTEXE64}"
${EndIf} ${EndIf}
${If} ${FileExists} "${I2PINSTEXE_USERMODE}\i2p.exe"
StrCpy $I2PINSTEXE "${I2PINSTEXE_USERMODE}"
${EndIf}
# look for user installs
FunctionEnd FunctionEnd
Function firefoxDetect Function firefoxDetect