From dba33ce6afa021d76e685d65d309ced77aa89eb4 Mon Sep 17 00:00:00 2001 From: "Vladimir.Orlov" Date: Wed, 21 Jun 2017 17:13:42 +0300 Subject: [PATCH] EDU-937 Is it possible to install PyCharm EDU without the default Python 3.5 installation? --- build/conf/nsis/registry.nsi | 2 + .../build/customInstallActions.nsi | 57 ++++++++++--------- python/educational-python/build/desktop.ini | 4 +- python/educational-python/build/python.txt | 4 +- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/build/conf/nsis/registry.nsi b/build/conf/nsis/registry.nsi index baff6702852a..99a47ce2715d 100644 --- a/build/conf/nsis/registry.nsi +++ b/build/conf/nsis/registry.nsi @@ -81,6 +81,8 @@ Function ${un}OMReadRegStr hkcr: ReadRegStr $3 HKCR $1 $2 done: + IfErrors 0 +2 + DetailPrint "ERROR: $0, $1, $2" FunctionEnd ; ----------------------------------------------------------------------------- diff --git a/python/educational-python/build/customInstallActions.nsi b/python/educational-python/build/customInstallActions.nsi index ec1240f3c0b9..8279f05602b1 100644 --- a/python/educational-python/build/customInstallActions.nsi +++ b/python/educational-python/build/customInstallActions.nsi @@ -10,7 +10,7 @@ deletePythonFileInfo: Delete "$TEMP\python.txt" getPythonFileInfo: inetc::get "https://www.jetbrains.com/updates/python.txt" "$TEMP\python.txt" - ${LineSum} "$TEMP\python.txt" $R0 + ${LineSum} "$TEMP\test\python.txt" $R0 IfErrors cantOpenFile StrCmp $R0 ${PYTHON_VERSIONS} getPythonInfo cantOpenFile: @@ -25,18 +25,16 @@ getPythonInfo: ; check if pythons are already installed StrCpy $R2 $0 Call searchPython - !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 6" "Text" "Python $0" - StrCmp $R2 "Absent" checkPython3 - StrCpy $R2 $0 + !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 6" "Text" "Python $R2" + StrCmp $4 "Absent" checkPython3 StrCpy $R4 "Field 6" StrCpy $R5 "Field 7" Call updatePythonControls checkPython3: StrCpy $R2 $R0 Call searchPython - !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 7" "Text" "Python $R0" - StrCmp $R2 "Absent" done - StrCpy $R2 $R0 + !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 7" "Text" "Python $R2" + StrCmp $4 "Absent" done StrCpy $R4 "Field 7" StrCpy $R5 "Field 6" Call updatePythonControls @@ -48,7 +46,7 @@ Function customInstallActions IfErrors cantOpenFile ; info about 2 and 3 version of python StrCmp $R0 ${PYTHON_VERSIONS} getPythonInfo -cantOpenFile: +cantOpenFile: MessageBox MB_OK|MB_ICONEXCLAMATION "python.txt is invalid. Python will not be downloaded." goto skip_python_download getPythonInfo: @@ -128,30 +126,35 @@ FunctionEnd Function searchPython ; $R2 - version of python - ReadRegStr $1 "HKCU" "Software\Python\PythonCore\$R2\InstallPath" "" - StrCmp $1 "" CU_32bit verifyPythonLauncher -CU_32bit: - ReadRegStr $1 "HKCU" "Software\Python\PythonCore\$R2-32\InstallPath" "" - StrCmp $1 "" CU_64bit verifyPythonLauncher -CU_64bit: - ReadRegStr $1 "HKCU" "Software\Python\PythonCore\$R2-64\InstallPath" "" - StrCmp $1 "" installationForAllUsers verifyPythonLauncher + StrCpy $0 "HKCU" + StrCpy $1 "Software\Python\PythonCore\$R2\InstallPath" + StrCpy $2 "" + SetRegView 64 + call OMReadRegStr + SetRegView 32 + StrCmp $3 "" CU_32bit verifyPythonLauncher + +CU_32bit: + call OMReadRegStr + StrCmp $3 "" installationForAllUsers verifyPythonLauncher installationForAllUsers: - ReadRegStr $1 "HKLM" "Software\Python\PythonCore\$R2\InstallPath" "" - StrCmp $1 "" LM_32bit verifyPythonLauncher -LM_32bit: - ReadRegStr $1 "HKLM" "Software\Python\PythonCore\$R2-32\InstallPath" "" - StrCmp $1 "" LM_64bit verifyPythonLauncher -LM_64bit: - ReadRegStr $1 "HKLM" "Software\Python\PythonCore\$R2-64\InstallPath" "" - StrCmp $1 "" pythonAbsent + StrCpy $0 "HKLM" + call OMReadRegStr + SetRegView 64 + call OMReadRegStr + SetRegView 32 + StrCmp $3 "" LM_32bit verifyPythonLauncher + +LM_32bit: + call OMReadRegStr + StrCmp $3 "" pythonAbsent verifyPythonLauncher: - IfFileExists $1python.exe pythonExists pythonAbsent + IfFileExists $3python.exe pythonExists pythonAbsent pythonAbsent: - StrCpy $R2 "Absent" + StrCpy $4 "Absent" goto done pythonExists: - StrCpy $R2 "Exists" + StrCpy $4 "Exists" done: FunctionEnd diff --git a/python/educational-python/build/desktop.ini b/python/educational-python/build/desktop.ini index faba27ec1aaf..40afb68a03f2 100644 --- a/python/educational-python/build/desktop.ini +++ b/python/educational-python/build/desktop.ini @@ -49,7 +49,7 @@ Left=5 Right=100 Top=60 Bottom=70 -State=1 +State=0 Text=Python 2 [Field 7] @@ -58,7 +58,7 @@ Left=120 Right=-1 Top=60 Bottom=70 -State=0 +State=1 Text=Python 3 [Field 8] diff --git a/python/educational-python/build/python.txt b/python/educational-python/build/python.txt index 2cd60cbe9f56..3ba28ac60061 100644 --- a/python/educational-python/build/python.txt +++ b/python/educational-python/build/python.txt @@ -1,4 +1,4 @@ python2 2.7 https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi -python3 3.5 https://www.python.org/ftp/python/3.5.1/python-3.5.1-amd64.exe +python3 3.6 https://www.python.org/ftp/python/3.6.1/python-3.6.1-amd64.exe python2 2.7 https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi -python3 3.5 https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe \ No newline at end of file +python3 3.6 https://www.python.org/ftp/python/3.6.1/python-3.6.1.exe \ No newline at end of file