win installer: updated silent mode to support update PATH env. var.

This commit is contained in:
Vladimir.Orlov
2018-06-25 11:55:08 +03:00
parent a4a84553e4
commit 9c5715e200
4 changed files with 32 additions and 13 deletions
+14 -7
View File
@@ -331,7 +331,7 @@ done:
FunctionEnd
Function getControllPostions
Function getInstallationOptionsPostions
!insertmacro INSTALLOPTIONS_READ $launcherShortcut "Desktop.ini" "Settings" "DesktopShortcutToLauncher"
!insertmacro INSTALLOPTIONS_READ $secondLauncherShortcut "Desktop.ini" "Settings" "DesktopShortcutToSecondLauncher"
!insertmacro INSTALLOPTIONS_READ $addToPath "Desktop.ini" "Settings" "AddToPath"
@@ -351,7 +351,7 @@ Function ConfirmDesktopShortcut
StrCpy $R1 ""
${EndIf}
Call getControllPostions
Call getInstallationOptionsPostions
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $launcherShortcut" "Text" $R0
${If} $R1 != ""
@@ -507,6 +507,7 @@ LicenseLangString myLicenseData ${LANG_JAPANESE} "${LICENSE_FILE}.txt"
Function .onInit
SetRegView 32
!insertmacro INSTALLOPTIONS_EXTRACT "Desktop.ini"
Call getInstallationOptionsPostions
IfSilent silent_mode uac_elevate
silent_mode:
IntCmp ${CUSTOM_SILENT_CONFIG} 0 silent_config silent_config custom_silent_config
@@ -553,7 +554,7 @@ FunctionEnd
Function silentConfigReader
; read Desktop.ini
Call getControllPostions
Call getInstallationOptionsPostions
${GetParameters} $R0
ClearErrors
@@ -574,10 +575,17 @@ launcher_32:
launcher_64:
ClearErrors
${ConfigRead} "$R1" "launcher64=" $R3
IfErrors download_jre32
IfErrors update_PATH
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $secondLauncherShortcut" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $secondLauncherShortcut" "State" $R3
update_PATH:
ClearErrors
${ConfigRead} "$R1" "updatePATH=" $R3
IfErrors download_jre32
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $addToPath" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $addToPath" "State" $R3
download_jre32:
ClearErrors
${ConfigRead} "$R1" "jre32=" $R3
@@ -946,7 +954,6 @@ FunctionEnd
;------------------------------------------------------------------------------
Section "IDEA Files" CopyIdeaFiles
CreateDirectory $INSTDIR
Call getControllPostions
Call customInstallActions
SetRegView 32
@@ -987,9 +994,9 @@ add_to_path:
do_association:
StrCpy $R2 ${INSTALL_OPTION_ELEMENTS}
get_user_choice:
!insertmacro INSTALLOPTIONS_READ $R3 "Desktop.ini" "Field $launcherShortcut" "State"
!insertmacro INSTALLOPTIONS_READ $R3 "Desktop.ini" "Field $R2" "State"
StrCmp $R3 1 "" next_association
!insertmacro INSTALLOPTIONS_READ $R4 "Desktop.ini" "Field $launcherShortcut" "Text"
!insertmacro INSTALLOPTIONS_READ $R4 "Desktop.ini" "Field $R2" "Text"
call ProductAssociation
next_association:
IntOp $R2 $R2 + 1
@@ -6,5 +6,8 @@ mode=user
launcher32=0
launcher64=1
; Add launchers path to PATH env variable
updatePATH=0
; Download and install jre32
jre32=0
@@ -65,21 +65,28 @@ run_in_user_mode:
ClearErrors
${ConfigRead} "$R1" "launcher32=" $R3
IfErrors launcher_64
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 2" "State" $R3
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $launcherShortcut" "State" $R3
launcher_64:
ClearErrors
${ConfigRead} "$R1" "launcher64=" $R3
IfErrors update_PATH
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $secondLauncherShortcut" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $secondLauncherShortcut" "State" $R3
update_PATH:
ClearErrors
${ConfigRead} "$R1" "updatePATH=" $R3
IfErrors download_jre32
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 3" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 3" "State" $R3
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $addToPath" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $addToPath" "State" $R3
download_jre32:
ClearErrors
${ConfigRead} "$R1" "jre32=" $R3
IfErrors download_python2
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 4" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 4" "State" $R3
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $downloadJRE" "Type" "checkbox"
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $downloadJRE" "State" $R3
download_python2:
!insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 8" "State" 0
@@ -128,7 +135,6 @@ Function customInstallActions
StrCmp $R0 ${PYTHON_VERSIONS} getPythonInfo
cantOpenFile:
StrCpy $internetConnection "No"
; MessageBox MB_OK|MB_ICONEXCLAMATION "python.txt is invalid. Python will not be downloaded." /SD IDOK
goto check_python
getPythonInfo:
Call getPythonInfo
@@ -6,6 +6,9 @@ mode=user
launcher32=0
launcher64=1
; Add launchers path to PATH env variable
updatePATH=0
; Download and install jre32. This may take a few minutes.
jre32=0