From 9c5715e200a2e521121b5dde2cfd4b7e4e95ff59 Mon Sep 17 00:00:00 2001 From: "Vladimir.Orlov" Date: Mon, 25 Jun 2018 11:55:08 +0300 Subject: [PATCH] win installer: updated silent mode to support update PATH env. var. --- build/conf/nsis/idea.nsi | 21 ++++++++++++------- .../resources/win/nsis/silent.config | 3 +++ .../build/customInstallActions.nsi | 18 ++++++++++------ python/educational-python/build/silent.config | 3 +++ 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/build/conf/nsis/idea.nsi b/build/conf/nsis/idea.nsi index 5f06f4cc51fb..6c846bd9da48 100644 --- a/build/conf/nsis/idea.nsi +++ b/build/conf/nsis/idea.nsi @@ -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 diff --git a/platform/build-scripts/resources/win/nsis/silent.config b/platform/build-scripts/resources/win/nsis/silent.config index ecca4ad6792c..f455d2c77ae4 100644 --- a/platform/build-scripts/resources/win/nsis/silent.config +++ b/platform/build-scripts/resources/win/nsis/silent.config @@ -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 \ No newline at end of file diff --git a/python/educational-python/build/customInstallActions.nsi b/python/educational-python/build/customInstallActions.nsi index 8a6830e54b05..33d0d07869dc 100644 --- a/python/educational-python/build/customInstallActions.nsi +++ b/python/educational-python/build/customInstallActions.nsi @@ -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 diff --git a/python/educational-python/build/silent.config b/python/educational-python/build/silent.config index 943968860ea9..ac086c60e769 100644 --- a/python/educational-python/build/silent.config +++ b/python/educational-python/build/silent.config @@ -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