Don't pass an ArgumentList unless an ArgumentList exists

This commit is contained in:
idk
2022-05-18 11:30:48 -04:00
parent fa05c5f1cc
commit ea8788e1c8
2 changed files with 12 additions and 3 deletions

View File

@@ -148,6 +148,12 @@ Section Install
${EndIf}
${GetOptions} $CMDLINE "/p" $PARENTOPTIONS
# if PARENTOPTIONS is not blank, prepend PARENTOPTIONS string with -ArgumentList
${If} "${PARENTOPTIONS}" != ""
StrCpy $PARENTOPTIONS "-ArgumentList '${PARENTOPTIONS}'"
${EndIf}
# set the installation directory as the destination for the following actions
createDirectory $INSTDIR
SetOutPath $INSTDIR
@@ -155,7 +161,7 @@ Section Install
UserInfo::GetAccountType
pop $0
${If} $I2PINSTEXE != "${I2PINSTEXE_USERMODE}"
ExecShell open "powershell -Command Start-Process .\I2P-Profile-Installer-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}-wrapped.exe -Verb RunAs -Wait -ArgumentList '$PARENTOPTIONS'"
ExecShell open "powershell -Command Start-Process .\I2P-Profile-Installer-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}-wrapped.exe -Verb RunAs -Wait $PARENTOPTIONS"
${Else}
ExecShell open "I2P-Profile-Installer-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}-wrapped.exe $PARENTOPTIONS"
${EndIf}

View File

@@ -345,10 +345,13 @@ FunctionEnd
# start default section
Section Install
${GetOptions} $CMDLINE "/p" $PARENTOPTIONS
${If} "${PARENTOPTIONS}" != ""
StrCpy $PARENTOPTIONS "-ArgumentList '${PARENTOPTIONS}'"
${EndIf}
${If} ${FileExists} "${I2PINSTEXE64}\i2p.exe"
ExecShell open "powershell -Command Start-Process .\$EXEFILE -Wait -Verb RunAs -ArgumentList '$PARENTOPTIONS'"
ExecShell open "powershell -Command Start-Process .\$EXEFILE -Wait -Verb RunAs $PARENTOPTIONS"
${ElseIf} ${FileExists} "${I2PINSTEXE32}\i2p.exe"
ExecShell open "powershell -Command Start-Process .\$EXEFILE -Wait -Verb RunAs -ArgumentList '$PARENTOPTIONS'"
ExecShell open "powershell -Command Start-Process .\$EXEFILE -Wait -Verb RunAs $PARENTOPTIONS"
${Else}
Call installerFunction
${EndIf}