From c7a67f5c5320e376c262c8ee6e1afa08871e147d Mon Sep 17 00:00:00 2001 From: John Garland Date: Wed, 25 Feb 2009 07:58:50 +0000 Subject: [PATCH] Auto-detect if python is installed on startup --- win32/deluge.nsi | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/win32/deluge.nsi b/win32/deluge.nsi index bf15152fb..1069fb131 100644 --- a/win32/deluge.nsi +++ b/win32/deluge.nsi @@ -28,7 +28,7 @@ !macro install_MSI installer_name install_dir ${download} "${${installer_name}_URL}" "$TEMP\${${installer_name}}" - ExecWait 'msiexec /qn /i "$TEMP\${${installer_name}}" TARGETDIR="${install_dir}' + ExecWait 'msiexec /qn /i "$TEMP\${${installer_name}}"' delete "$TEMP\${${installer_name}}" !macroend @@ -96,6 +96,19 @@ ${create_url} LIBTORRENT_INSTALLER ${create_url} LIBTORRENT_DLL_ZIP + +; Variables + + var PYTHONDIR + +; Functions + +Function .onInit + ReadRegStr $PYTHONDIR HKLM "SOFTWARE\Python\PythonCore\${PYTHON_VERSION}\InstallPath" "" + IfErrors 0 +2 + StrCpy $PYTHONDIR "$INSTDIR\Python" +FunctionEnd + ; General Settings ; Version @@ -337,8 +350,8 @@ SectionGroupEnd ; Descriptions ; Language strings - LangString DESC_deluge ${LANG_ENGLISH} "Deluge 1.1.3" - LangString DESC_python ${LANG_ENGLISH} "Python 2.5.4" + LangString DESC_deluge ${LANG_ENGLISH} "Deluge ${DELUGE_VERSION}" + LangString DESC_python ${LANG_ENGLISH} "Python ${PYTHON_VERSION}" ; Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN