From 270bb4ae1bfa40262d2b1d9758ffda02c98cd725 Mon Sep 17 00:00:00 2001 From: John Garland Date: Wed, 25 Feb 2009 12:09:31 +0000 Subject: [PATCH] Moved functions to bottom so that they could include defines Installer now automatically selects python if not installed --- win32/deluge.nsi | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/win32/deluge.nsi b/win32/deluge.nsi index ea330d90e..9963f9fcc 100644 --- a/win32/deluge.nsi +++ b/win32/deluge.nsi @@ -107,25 +107,6 @@ var PYTHONDIR -; Functions - -Function autodetect_python - Pop $0 - ReadRegStr "" HKLM "SOFTWARE\Python\PythonCore\${PYTHON_VERSION}\InstallPath" "" - IfErrors 0 +2 - SectionSetInstTypes $0 3 -FunctionEnd - -Function set_python_dir - ReadRegStr $PYTHONDIR HKLM "SOFTWARE\Python\PythonCore\${PYTHON_VERSION}\InstallPath" "" - IfErrors 0 +2 - StrCpy $PYTHONDIR "$INSTDIR\Python" -FunctionEnd - -Function .onInit - Call set_python_dir -FunctionEnd - ; General Settings ; Version @@ -376,3 +357,24 @@ SectionGroupEnd !insertmacro MUI_DESCRIPTION_TEXT ${deluge} $(DESC_deluge) !insertmacro MUI_DESCRIPTION_TEXT ${python} $(DESC_python) !insertmacro MUI_FUNCTION_DESCRIPTION_END + +; Functions + +Function autodetect_python + Pop $0 + ReadRegStr "" HKLM "SOFTWARE\Python\PythonCore\${PYTHON_VERSION}\InstallPath" "" + IfErrors 0 +3 + SectionSetInstTypes $0 3 + SetCurInstType 0 +FunctionEnd + +Function set_python_dir + ReadRegStr $PYTHONDIR HKLM "SOFTWARE\Python\PythonCore\${PYTHON_VERSION}\InstallPath" "" + IfErrors 0 +2 + StrCpy $PYTHONDIR "$INSTDIR\Python" +FunctionEnd + +Function .onInit + Call set_python_dir + ${autodetect} python +FunctionEnd