X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2FWin32%2Fpackaging%2FAltInstaller%2FInstallActions-update.nsh;h=509c65d2b8fd33f1bc94817eb06d661e0d9344f4;hb=8b85ff4da0f5741cd2802d0b1764cab57e2f813f;hp=846711e246ce6a94aba1d942151d1a156d9ff625;hpb=8f8faa574de284df067b17ce73258bbc7d1f1e12;p=lyx.git diff --git a/development/Win32/packaging/AltInstaller/InstallActions-update.nsh b/development/Win32/packaging/AltInstaller/InstallActions-update.nsh index 846711e246..509c65d2b8 100644 --- a/development/Win32/packaging/AltInstaller/InstallActions-update.nsh +++ b/development/Win32/packaging/AltInstaller/InstallActions-update.nsh @@ -187,10 +187,6 @@ Function InstDirChange StrCpy $FileName "session" Call CheckAppPathPreferences # function from LyXUtils.nsh - # set the new path to the lyx.bat file - # following macro from TextFunc.nsh # calls Function ReplaceLineContent from LyXUtils.nsh - ${LineFind} "$INSTDIR\bin\lyx.bat" "" "1:-1" "ReplaceLineContent" - # set new path to ImageMagick ReadRegStr $ImageMagickPath SHCTX "SOFTWARE\Classes\Applications" "AutoRun" ${if} $ImageMagickPath != "" @@ -214,8 +210,37 @@ Function RefreshRegUninst WriteRegStr HKLM "SOFTWARE\Aspell" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" ${endif} - # install eLyXer as Python module - Call eLyXer # function from InstallThirdPartyProgs.nsh + # eLyXer + # first test if Python is installed + ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" "" + ${if} $PythonPath == "" + ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.6\InstallPath" "" + ${endif} + ${if} $PythonPath == "" + ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\3.0\InstallPath" "" + ${endif} + ${if} $PythonPath == "" + ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\3.1\InstallPath" "" + ${endif} + ${if} $PythonPath != "" + StrCpy $PythonPath $PythonPath -1 # remove the "\" at the end + ${endif} + # now install eLyXer as Python module + ${if} $PythonPath != "" + # a Python module cannot simply started with + # ExecWait '$PythonPath\python.exe "$INSTDIR\bin\setup.py" install' + # therefore run a script + StrCpy $1 $INSTDIR 2 # get drive letter + FileOpen $R1 "$INSTDIR\bin\eLyXer.bat" w + FileWrite $R1 '$1$\r$\n\ + cd "$INSTDIR\bin"$\r$\n\ + "$PythonPath\python.exe" setup.py install' + FileClose $R1 + ExecWait '"$INSTDIR\bin\eLyXer.bat"' + Delete "$INSTDIR\bin\eLyXer.bat" + ${else} + ExecWait '"$INSTDIR\bin\python.exe" "$INSTDIR\bin\setup.py" install' + ${endif} # Metafile2eps Var /GLOBAL RegLocation