diff --git a/development/Win32/packaging/installer/download.nsh b/development/Win32/packaging/installer/download.nsh index d9641f4a8b..3382c50d36 100644 --- a/development/Win32/packaging/installer/download.nsh +++ b/development/Win32/packaging/installer/download.nsh @@ -16,6 +16,7 @@ !insertmacro LYX_DEFFUNC `ReadDownloadValues` !insertmacro LYX_DEFFUNC `EnableBrowseControls` +!insertmacro LYX_DEFFUNC `SearchRegistry` !insertmacro LYX_DEFFUNC `DownloadEnter` !insertmacro LYX_DEFFUNC `DownloadLeave` @@ -133,12 +134,65 @@ !macroend -!macro DownloadEnter_Private ExePath RegistryKey RegistrySubKey RemoveFromPath AddtoPath Required DownloadLabel HomeLabel PageHeader PageDescription - !define skipBackupLbl "skipBackup_${__LINE__}" +!macro SearchRegistry_Private ExePath RegistryKey RegistrySubKey RemoveFromPath AddtoPath - StrCpy ${ExePath} "" - ReadRegStr ${ExePath} HKLM "${RegistryKey}" "${RegistrySubKey}" + ${if} ${ExePath} == "" + ReadRegStr ${ExePath} HKLM "${RegistryKey}" "${RegistrySubKey}" + ${if} ${ExePath} != "" + ${StrRep} "${ExePath}" "${ExePath}" "${RemoveFromPath}" "" + StrCpy ${ExePath} "${ExePath}${AddtoPath}" + ${endif} + ${endif} +!macroend + + +!macro LYX_FUNCTION_SearchRegistry + !insertmacro LYX_FUNC `SearchRegistry` + + ; The stack contains: + ; TOP + ; ExePath + ; RegistryKey + ; RegistrySubKey + ; RemoveFromPath + ; AddtoPath + + ; After this point: + ; $0 = ExePath + ; $1 = RegistryKey + ; $2 = RegistrySubKey + ; $3 = RemoveFromPath + ; $4 = AddtoPath + + Exch $0 + Exch + Exch $1 + Exch 2 + Exch $2 + Exch 3 + Exch $3 + Exch 4 + Exch $4 + + ; Use a macro simply to make life understandable. + !insertmacro SearchRegistry_Private "$0" "$1" "$2" "$3" "$4" + + ; Return output to user. + Exch $4 + Exch 4 + Exch $3 + Exch 3 + Exch $2 + Exch 2 + Exch $1 + Exch + Exch $0 + FunctionEnd +!macroend + + +!macro DownloadEnter_Private ExePath Required DownloadLabel HomeLabel PageHeader PageDescription !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 1" "Text" "" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 2" "Text" "$(DownloadPageField2)" @@ -155,18 +209,17 @@ !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "Text" "${DownloadLabel}" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "Text" "${HomeLabel}" + ${if} ${ExePath} == "" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "State" "1" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "State" "0" - !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Field 5" "Flags" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "Flags" $0|DISABLED + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "Flags" PATH_MUST_EXIST|DISABLED !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "State" "" ${else} !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "State" "0" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "State" "1" + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "Flags" PATH_MUST_EXIST - ${StrRep} "${ExePath}" "${ExePath}" "${RemoveFromPath}" "" - StrCpy ${ExePath} "${ExePath}${AddtoPath}" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "State" "${ExePath}" ${endif} @@ -174,7 +227,6 @@ !insertmacro MUI_HEADER_TEXT "${PageHeader}" "${PageDescription}" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioDownload.ini" - !undef skipBackupLbl !macroend @@ -184,10 +236,6 @@ ; The stack contains: ; TOP ; ExePath - ; RegistryKey - ; RegistrySubKey - ; RemoveFromPath - ; AddtoPath ; Required ; DownloadLabel ; HomeLabel @@ -196,15 +244,11 @@ ; After this point: ; $0 = ExePath - ; $1 = RegistryKey - ; $2 = RegistrySubKey - ; $3 = RemoveFromPath - ; $4 = AddtoPath - ; $5 = Required - ; $6 = DownloadLabel - ; $7 = HomeLabel - ; $8 = PageHeader - ; $9 = PageDescription + ; $1 = Required + ; $2 = DownloadLabel + ; $3 = HomeLabel + ; $4 = PageHeader + ; $5 = PageDescription Exch $0 Exch @@ -217,27 +261,11 @@ Exch $4 Exch 5 Exch $5 - Exch 6 - Exch $6 - Exch 7 - Exch $7 - Exch 8 - Exch $8 - Exch 9 - Exch $9 ; Use a macro simply to make life understandable. - !insertmacro DownloadEnter_Private "$0" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" + !insertmacro DownloadEnter_Private "$0" "$1" "$2" "$3" "$4" "$5" ; Return output to user. - Exch $9 - Exch 9 - Exch $8 - Exch 8 - Exch $7 - Exch 7 - Exch $6 - Exch 6 Exch $5 Exch 5 Exch $4 @@ -254,7 +282,6 @@ !macro DownloadLeave_Private DoNotRequire Download FolderPath URL EnterFolder ExeName InvalidFolder - !define skipBackupLbl "skipBackup_${__LINE__}" !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Settings" "State" StrCmp $0 0 go_on ; Next button? @@ -271,7 +298,8 @@ go_on: StrCpy ${FolderPath} "" ExecShell open "${URL}" ${else} - ${StrTrim} ${FolderPath} + ${StrTrim} ${FolderPath} ${FolderPath} + ${StrRTrimChar} ${FolderPath} ${FolderPath} '\' ${if} ${FolderPath} == "" MessageBox MB_OK "${EnterFolder}" @@ -280,8 +308,9 @@ go_on: ${if} ${FileExists} "${FolderPath}" ${StrRep} ${FolderPath} ${FolderPath} "${ExeName}" "" + ${StrRTrimChar} ${FolderPath} ${FolderPath} '\' - ${if} ${FileExists} "${FolderPath}${ExeName}" + ${if} ${FileExists} "${FolderPath}\${ExeName}" ${else} MessageBox MB_OK "${InvalidFolder}" Abort @@ -291,7 +320,6 @@ go_on: Abort ${endif} ${endif} - !undef skipBackupLbl !macroend @@ -370,17 +398,32 @@ go_on: !macroend -!macro LYX_FUNCTION_DownloadEnter_Call ExePath RegistryKey RegistrySubKey RemoveFromPath AddtoPath Required DownloadLabel HomeLabel PageHeader PageDescription - Push `${PageDescription}` - Push `${PageHeader}` - Push `${HomeLabel}` - Push `${DownloadLabel}` - Push `${Required}` +!macro LYX_FUNCTION_SearchRegistry_Call ExePath RegistryKey RegistrySubKey RemoveFromPath AddtoPath Push `${AddtoPath}` Push `${RemoveFromPath}` Push `${RegistrySubKey}` Push `${RegistryKey}` Push `${ExePath}` + + Call SearchRegistry + ; Empty the stack of all the stuff we've just added. + ; We're not interested in most of it, so just fill $0 repeatedly. + + Pop `${ExePath}` + Pop `$0` + Pop `$0` + Pop `$0` + Pop `$0` +!macroend + + +!macro LYX_FUNCTION_DownloadEnter_Call ExePath Required DownloadLabel HomeLabel PageHeader PageDescription + Push `${PageDescription}` + Push `${PageHeader}` + Push `${HomeLabel}` + Push `${DownloadLabel}` + Push `${Required}` + Push `${ExePath}` Call DownloadEnter ; Empty the stack of all the stuff we've just added. ; We're not interested in keeping it, so just fill $0 repeatedly. @@ -390,10 +433,6 @@ go_on: Pop `$0` Pop `$0` Pop `$0` - Pop `$0` - Pop `$0` - Pop `$0` - Pop `$0` !macroend diff --git a/development/Win32/packaging/installer/ioDownload.ini b/development/Win32/packaging/installer/ioDownload.ini index e5e3ddb0f1..3d568e93c2 100644 --- a/development/Win32/packaging/installer/ioDownload.ini +++ b/development/Win32/packaging/installer/ioDownload.ini @@ -39,4 +39,3 @@ Left=5 Right=-1 Top=47 Bottom=58 -Flags=PATH_MUST_EXIST \ No newline at end of file diff --git a/development/Win32/packaging/installer/ioSummary.ini b/development/Win32/packaging/installer/ioSummary.ini index 9205c9ca20..0fb6a70f2e 100644 --- a/development/Win32/packaging/installer/ioSummary.ini +++ b/development/Win32/packaging/installer/ioSummary.ini @@ -1,16 +1,9 @@ [Settings] -NumFields=2 +NumFields=1 [Field 1] Type=Label Left=5 Right=-1 Top=0 -Bottom=20 - -[Field 2] -Type=Label -Left=5 -Right=-1 -Top=21 Bottom=60 diff --git a/development/Win32/packaging/installer/lyx_installer.nsi b/development/Win32/packaging/installer/lyx_installer.nsi index 233f2ca367..2340150519 100644 --- a/development/Win32/packaging/installer/lyx_installer.nsi +++ b/development/Win32/packaging/installer/lyx_installer.nsi @@ -58,10 +58,15 @@ InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" ; Declare used functions ${StrLoc} +${StrNSISToIO} ${StrRep} ${StrTrim} +${StrLTrim} +${StrRTrim} +${StrRTrimChar} ${ReadDownloadValues} ${EnableBrowseControls} +${SearchRegistry} ${DownloadEnter} ${DownloadLeave} @@ -165,6 +170,7 @@ Page custom SummariseDownloads SummariseDownloads_LeaveFunction !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "Dutch" +!insertmacro MUI_LANGUAGE "Swedish" !include "lyx_languages\english.nsh" !include "lyx_languages\danish.nsh" @@ -172,6 +178,7 @@ Page custom SummariseDownloads SummariseDownloads_LeaveFunction !include "lyx_languages\french.nsh" !include "lyx_languages\german.nsh" !include "lyx_languages\spanish.nsh" +!include "lyx_languages\swedish.nsh" LicenseData "$(LyXLicenseData)" @@ -303,15 +310,19 @@ Function .onInit !undef READ_ONLY ${endif} + Call SearchMinSYS + Call SearchPython + Call SearchMiKTeX + Call SearchPerl + Call SearchGhostscript + Call SearchImageMagick + ClearErrors FunctionEnd ;-------------------------------- -Function DownloadMinSYS - StrCpy $MinSYSPath "" - StrCpy $DownloadMinSYS "0" - +Function SearchMinSYS ; Search the registry for the MinSYS uninstaller. ; If successful, put its location in $2. StrCpy $3 "Software\Microsoft\Windows\CurrentVersion\Uninstall" @@ -334,9 +345,19 @@ Function DownloadMinSYS Goto loop done: + ${SearchRegistry} \ + $MinSYSPath \ + "$2" \ + "Inno Setup: App Path" \ + "" \ + "\bin" +FunctionEnd + +Function DownloadMinSYS + StrCpy $DownloadMinSYS "0" + ${DownloadEnter} \ - $MinSYSPath "$2" "Inno Setup: App Path" \ - "" "\bin" \ + $MinSYSPath \ 0 \ "$(MinSYSDownloadLabel)" \ "$(MinSYSFolderLabel)" \ @@ -351,19 +372,26 @@ Function DownloadMinSYS_LeaveFunction $MinSYSPath \ "http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82721&release_id=158803" \ "$(EnterMinSYSFolder)" \ - "\sh.exe" \ + "sh.exe" \ "$(InvalidMinSYSFolder)" FunctionEnd ;-------------------------------- +Function SearchPython + ${SearchRegistry} \ + $PythonPath \ + "Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" \ + "" \ + "\Python.exe" \ + "" +FunctionEnd + Function DownloadPython - StrCpy $PythonPath "" StrCpy $DownloadPython "0" ${DownloadEnter} \ - $PythonPath "Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" "" \ - "\Python.exe" "" \ + $PythonPath \ 0 \ "$(PythonDownloadLabel)" \ "$(PythonFolderLabel)" \ @@ -378,20 +406,27 @@ Function DownloadPython_LeaveFunction $PythonPath \ "http://www.python.org/download/" \ "$(EnterPythonFolder)" \ - "\Python.exe" \ + "Python.exe" \ "$(InvalidPythonFolder)" FunctionEnd ;-------------------------------- +Function SearchMiKTeX + ${SearchRegistry} \ + $MiKTeXPath \ + "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" \ + "Install Root" \ + "" \ + "\miktex\bin" +FunctionEnd + Function DownloadMiKTeX StrCpy $DoNotRequireMiKTeX "1" - StrCpy $MiKTeXPath "" StrCpy $DownloadMiKTeX "0" ${DownloadEnter} \ - $MiKTeXPath "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root" \ - "" "\miktex\bin" \ + $MiKTeXPath \ 1 \ "$(MiKTeXDownloadLabel)" \ "$(MiKTeXFolderLabel)" \ @@ -406,20 +441,27 @@ Function DownloadMiKTeX_LeaveFunction $MiKTeXPath \ "http://www.miktex.org/setup.html" \ "$(EnterMiKTeXFolder)" \ - "\latex.exe" \ + "latex.exe" \ "$(InvalidMiKTeXFolder)" FunctionEnd ;-------------------------------- +Function SearchPerl + ${SearchRegistry} \ + $PerlPath \ + "Software\Perl" \ + BinDir \ + "\perl.exe" \ + "" +FunctionEnd + Function DownloadPerl StrCpy $DoNotRequirePerl "1" - StrCpy $PerlPath "" StrCpy $DownloadPerl "1" ${DownloadEnter} \ - $PerlPath "Software\Perl" BinDir \ - "\perl.exe" "" \ + $PerlPath \ 1 \ "$(PerlDownloadLabel)" \ "$(PerlFolderLabel)" \ @@ -434,15 +476,31 @@ Function DownloadPerl_LeaveFunction $PerlPath \ "http://www.activestate.com/Products/ActivePerl/" \ "$(EnterPerlFolder)" \ - "\perl.exe" \ + "perl.exe" \ "$(InvalidPerlFolder)" FunctionEnd ;-------------------------------- +Function SearchGhostscript + ; Find which version of ghostscript, if any, is installed. + EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0 + ${if} $1 != "" + StrCpy $0 "Software\AFPL Ghostscript\$1" + ${else} + StrCpy $0 "" + ${endif} + + ${SearchRegistry} \ + $GhostscriptPath \ + "$0" \ + "GS_DLL" \ + "\gsdll32.dll" \ + "" +FunctionEnd + Function DownloadGhostscript StrCpy $DoNotRequireGhostscript "1" - StrCpy $GhostscriptPath "" StrCpy $DownloadGhostscript "0" ; Find which version of ghostscript, if any, is installed. @@ -454,8 +512,7 @@ Function DownloadGhostscript ${endif} ${DownloadEnter} \ - $GhostscriptPath "$0" "GS_DLL" \ - "\gsdll32.dll" "" \ + $GhostscriptPath \ 1 \ "$(GhostscriptDownloadLabel)" \ "$(GhostscriptFolderLabel)" \ @@ -470,20 +527,27 @@ Function DownloadGhostscript_LeaveFunction $GhostscriptPath \ "http://www.cs.wisc.edu/~ghost/doc/AFPL/index.htm" \ "$(EnterGhostscriptFolder)" \ - "\gswin32c.exe" \ + "gswin32c.exe" \ "$(InvalidGhostscriptFolder)" FunctionEnd ;-------------------------------- +Function SearchImageMagick + ${SearchRegistry} \ + $ImageMagickPath \ + "Software\ImageMagick\Current" \ + "BinPath" \ + "" \ + "" +FunctionEnd + Function DownloadImageMagick StrCpy $DoNotRequireImageMagick "1" - StrCpy $ImageMagickPath "" StrCpy $DownloadImageMagick "0" ${DownloadEnter} \ - $ImageMagickPath "Software\ImageMagick\Current" "BinPath" \ - "" "" \ + $ImageMagickPath \ 1 \ "$(ImageMagickDownloadLabel)" \ "$(ImageMagickFolderLabel)" \ @@ -498,7 +562,7 @@ Function DownloadImageMagick_LeaveFunction $ImageMagickPath \ "http://www.imagemagick.org/script/binary-releases.php" \ "$(EnterImageMagickFolder)" \ - "\convert.exe" \ + "convert.exe" \ "$(InvalidImageMagickFolder)" FunctionEnd @@ -536,10 +600,10 @@ Function SummariseDownloads ${if} "$DoNotInstallLyX" == 1 !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$(SummaryPleaseInstall)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" "" ${else} - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$(SummaryPathPrefix)" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" "$PathPrefix" + ${StrNSISToIO} $0 '$PathPrefix' + StrCpy $0 "$(SummaryPathPrefix)\r\n\r\n$0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$0" ${endif} !insertmacro MUI_HEADER_TEXT "$(SummaryTitle)" "" diff --git a/development/Win32/packaging/installer/lyx_languages/german.nsh b/development/Win32/packaging/installer/lyx_languages/german.nsh index e0ea9b4c1b..246cf56e54 100644 --- a/development/Win32/packaging/installer/lyx_languages/german.nsh +++ b/development/Win32/packaging/installer/lyx_languages/german.nsh @@ -12,10 +12,10 @@ LangString SecAllUsersTitle "${LYX_LANG}" "F LangString SecFileAssocTitle "${LYX_LANG}" "Dateizuordnungen" LangString SecDesktopTitle "${LYX_LANG}" "Desktopsymbol" -LangString SecCoreDescription "${LYX_LANG}" "Die ${PRODUCT_NAME} Datei." +LangString SecCoreDescription "${LYX_LANG}" "Das Programm ${PRODUCT_NAME}." LangString SecAllUsersDescription "${LYX_LANG}" "Für alle Nutzer oder nur für den aktuellen Nutzer installieren. (Dazu werden Administratorrechte benötigt.)" LangString SecFileAssocDescription "${LYX_LANG}" "Vernüpfung zwischen ${PRODUCT_NAME} und der .lyx Dateiendung." -LangString SecDesktopDescription "${LYX_LANG}" "Ein ${PRODUCT_NAME} Symbol auf dem Desktop." +LangString SecDesktopDescription "${LYX_LANG}" "Verknüpfung zu ${PRODUCT_NAME} auf dem Desktop." LangString ModifyingConfigureFailed "${LYX_LANG}" "Der 'path_prefix' (Liste mit Programmpfaden) konnte nicht im Konfigurationsskript gesetzt werden." LangString RunConfigureFailed "${LYX_LANG}" "Konnte das Konfigurationsskript nicht ausführen." @@ -33,7 +33,7 @@ LangString MinSYSDownloadLabel "${LYX_LANG}" "&MinSYS herunterladen" LangString MinSYSFolderLabel "${LYX_LANG}" "&Ordner der die Datei sh.exe enthält" LangString PythonHeader "${LYX_LANG}" "Python" -LangString PythonDescription "${LYX_LANG}" "Ein Interpreter der Skriptspreche Python (www.python.org) ist notwendig damit ${PRODUCT_NAME} Skripte ausführen kann." +LangString PythonDescription "${LYX_LANG}" "Ein Interpreter der Skriptsprache Python (www.python.org) ist notwendig damit ${PRODUCT_NAME} Skripte ausführen kann." LangString EnterPythonFolder "${LYX_LANG}" "Geben sie den Pfad zur Datei python.exe an." LangString InvalidPythonFolder "${LYX_LANG}" "Kann die Datei python.exe nicht finden." LangString PythonDownloadLabel "${LYX_LANG}" "&Python herunterladen" @@ -61,7 +61,7 @@ LangString ImageMagickDownloadLabel "${LYX_LANG}" "&ImageMagic herunterladen" LangString ImageMagickFolderLabel "${LYX_LANG}" "&Ordner der die Datei convert.exe enthält" LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript" -LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) wird für PDF- und PostScript-Grafikendateien benötigt." +LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) wird für PDF- und PostScript-Grafikdateien benötigt." LangString EnterGhostscriptFolder "${LYX_LANG}" "Geben sie den Pfad zur Datei gswin32c.exe an." LangString InvalidGhostscriptFolder "${LYX_LANG}" "Kann die Datei gswin32c.exe nicht finden." LangString GhostscriptDownloadLabel "${LYX_LANG}" "&Ghostscript herunterladen" diff --git a/development/Win32/packaging/installer/lyx_languages/swedish.nsh b/development/Win32/packaging/installer/lyx_languages/swedish.nsh new file mode 100644 index 0000000000..32caeec375 --- /dev/null +++ b/development/Win32/packaging/installer/lyx_languages/swedish.nsh @@ -0,0 +1,91 @@ +!ifndef _LYX_LANGUAGES_SWEDISH_NSH_ +!define _LYX_LANGUAGES_SWEDISH_NSH_ + +!ifdef LYX_LANG + !undef LYX_LANG +!endif +!define LYX_LANG ${LANG_SWEDISH} + +!define SwedishInputFolderPath "Var god mata in sökvägen till katalogen som innehåller" +!define SwedishUnableToFind "Kan inte hitta" +!define SwedishDownload "&Ladda ner" +!define SwedishFolderContaining "&Katalog innehållande" + +LicenseLangString LyXLicenseData ${LYX_LANG} "${PRODUCT_LICENSE_FILE}" + +LangString SecAllUsersTitle "${LYX_LANG}" "Installera för alla användare?" +LangString SecFileAssocTitle "${LYX_LANG}" "Filassociationer" +LangString SecDesktopTitle "${LYX_LANG}" "Skrivbordsikon" + +LangString SecCoreDescription "${LYX_LANG}" "${PRODUCT_NAME}-filer." +LangString SecAllUsersDescription "${LYX_LANG}" "Installera för alla användare, eller enbart för den aktuella användare. (Kräver administratörsrättigheter.)" +LangString SecFileAssocDescription "${LYX_LANG}" "Skapa en association mellan programmet och filtilläget .lyx." +LangString SecDesktopDescription "${LYX_LANG}" "En ${PRODUCT_NAME}ikon på skrivbordet." + +LangString ModifyingConfigureFailed "${LYX_LANG}" "Misslyckades med att sätta 'path_prefix' i konfigurationsskriptet" +LangString RunConfigureFailed "${LYX_LANG}" "Misslyckades med att köra konfigurationsskriptet" + +LangString FinishPageMessage "${LYX_LANG}" "Gratulerar! LyX har installerats framgångsrikt." +LangString FinishPageRun "${LYX_LANG}" "Kör LyX" + +LangString DownloadPageField2 "${LYX_LANG}" "Installera &ej" + +LangString MinSYSHeader "${LYX_LANG}" "MinSYS" +LangString MinSYSDescription "${LYX_LANG}" "MinSYS är en minimal UNIX-liknande skriptmiljö (www.mingw.org/msys.shtml) som ${PRODUCT_NAME} behöver för att använda ett flertal skript." +LangString EnterMinSYSFolder "${LYX_LANG}" "${SwedishInputFolderPath} sh.exe" +LangString InvalidMinSYSFolder "${LYX_LANG}" "${SwedishUnableToFind} sh.exe" +LangString MinSYSDownloadLabel "${LYX_LANG}" "${SwedishDownload} MinSYS" +LangString MinSYSFolderLabel "${LYX_LANG}" "${SwedishFolderContaining} sh.exe" + +LangString PythonHeader "${LYX_LANG}" "Python" +LangString PythonDescription "${LYX_LANG}" "Skriptspråket Python (www.python.org) bör installeras, annars kan inte ${PRODUCT_NAME} använda ett flertal skript." +LangString EnterPythonFolder "${LYX_LANG}" "${SwedishInputFolderPath} Python.exe" +LangString InvalidPythonFolder "${LYX_LANG}" "${SwedishUnableToFind} Python.exe" +LangString PythonDownloadLabel "${LYX_LANG}" "${SwedishDownload} Python" +LangString PythonFolderLabel "${LYX_LANG}" "${SwedishFolderContaining} Python.exe" + +LangString MiKTeXHeader "${LYX_LANG}" "MiKTeX" +LangString MiKTeXDescription "${LYX_LANG}" "MiKTeX (www.miktex.org) aktuell (nyligen uppdaterad) implementation av TeX för Windows." +LangString EnterMiKTeXFolder "${LYX_LANG}" "${SwedishInputFolderPath} latex.exe" +LangString InvalidMiKTeXFolder "${LYX_LANG}" "${SwedishUnableToFind} latex.exe" +LangString MiKTeXDownloadLabel "${LYX_LANG}" "${SwedishDownload} MiKTeX" +LangString MiKTeXFolderLabel "${LYX_LANG}" "${SwedishFolderContaining} latex.exe" + +LangString PerlHeader "${LYX_LANG}" "Perl" +LangString PerlDescription "${LYX_LANG}" "Om du räknar med att använda reLyX för att konvertera LaTeX-dokument till LyX-dokument, måste du installera Perl (www.perl.com)." +LangString EnterPerlFolder "${LYX_LANG}" "${SwedishInputFolderPath} Perl.exe" +LangString InvalidPerlFolder "${LYX_LANG}" "${SwedishUnableToFind} Perl.exe" +LangString PerlDownloadLabel "${LYX_LANG}" "${SwedishDownload} Perl" +LangString PerlFolderLabel "${LYX_LANG}" "${SwedishFolderContaining} perl.exe" + +LangString ImageMagickHeader "${LYX_LANG}" "ImageMagick" +LangString ImageMagickDescription "${LYX_LANG}" "Verktygen i paketet ImageMagick (www.imagemagick.org/script/index.php) kan användas av LyX för att konvertera mellan de flesta grafikformat." +LangString EnterImageMagickFolder "${LYX_LANG}" "${SwedishInputFolderPath} convert.exe" +LangString InvalidImageMagickFolder "${LYX_LANG}" "${SwedishUnableToFind} convert.exe" +LangString ImageMagickDownloadLabel "${LYX_LANG}" "${SwedishDownload} ImageMagick" +LangString ImageMagickFolderLabel "${LYX_LANG}" "${SwedishFolderContaining} convert.exe" + +LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript" +LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) används till att konvertera bilder till/från PostScript." +LangString EnterGhostscriptFolder "${LYX_LANG}" "${SwedishInputFolderPath} gswin32c.exe" +LangString InvalidGhostscriptFolder "${LYX_LANG}" "${SwedishUnableToFind} gswin32c.exe" +LangString GhostscriptDownloadLabel "${LYX_LANG}" "${SwedishDownload} Ghostscript" +LangString GhostscriptFolderLabel "${LYX_LANG}" "${SwedishFolderContaining} gswin32c.exe" + +LangString SummaryTitle "${LYX_LANG}" "Mjukvarusammanfattning" +LangString SummaryPleaseInstall "${LYX_LANG}" "Var god installera först dina nedladdade filer och kör sedan LyXs installationsprogram igen." +LangString SummaryPathPrefix "${LYX_LANG}" "En 'path_prefix'-sträng kommer att läggas till i filen 'lyxrc.defaults' innehållande följande:" + +LangString UnNotInRegistryLabel "${LYX_LANG}" "${SwedishUnableToFind} $(^Name) i registret\r$\nGenvägar på skrivbordet och i startmeny kommer inte att tas bort." +LangString UnNotAdminLabel "${LYX_LANG}" "Tyvärr! Du måste ha administratörsrättigheter för\r$\natt avinstallera $(^Name)." +LangString UnReallyRemoveLabel "${LYX_LANG}" "Är du säker på att du verkligen vill fullständigt avinstallera $(^Name) och alla dess komponenter?" +LangString UnRemoveSuccessLabel "${LYX_LANG}" "$(^Name) har framgångsrikt avinstallerats från din dator." + +!undef SwedishInputFolderPath +!undef SwedishUnableToFind +!undef SwedishDownload +!undef SwedishFolderContaining + +!undef LYX_LANG + +!endif ; _LYX_LANGUAGES_SWEDISH_NSH_ diff --git a/development/Win32/packaging/installer/lyx_path_prefix.C b/development/Win32/packaging/installer/lyx_path_prefix.C index 601818600b..5255183b6a 100644 --- a/development/Win32/packaging/installer/lyx_path_prefix.C +++ b/development/Win32/packaging/installer/lyx_path_prefix.C @@ -290,7 +290,9 @@ void __declspec(dllexport) run_configure(HWND hwndParent, int string_size, char return; } - std::string const command = std::string("start /WAIT /B sh.exe ") + configure_file; + // Even "start /WAIT /B sh.exe configure" returns + // before the script is done, so just invoke "sh" directly. + std::string const command = std::string("sh.exe ") + configure_file; if (system(command.c_str()) != 0) { pushstring("-1"); return; diff --git a/development/Win32/packaging/installer/strtrim.nsh b/development/Win32/packaging/installer/strtrim.nsh index a5857395b0..8a5af35211 100644 --- a/development/Win32/packaging/installer/strtrim.nsh +++ b/development/Win32/packaging/installer/strtrim.nsh @@ -3,10 +3,13 @@ !include "lyxfunc.nsh" +!insertmacro LYX_DEFFUNC `StrLTrim` +!insertmacro LYX_DEFFUNC `StrRTrim` !insertmacro LYX_DEFFUNC `StrTrim` +!insertmacro LYX_DEFFUNC `StrRTrimChar` -!macro LYX_FUNCTION_StrTrim - !insertmacro LYX_FUNC `StrTrim` +!macro LYX_FUNCTION_StrLTrim + !insertmacro LYX_FUNC `StrLTrim` ; After this point: ; $0 = String (input) @@ -22,12 +25,35 @@ Loop: StrCmp "$1" "$\r" TrimLeft StrCmp "$1" "$\n" TrimLeft StrCmp "$1" " " TrimLeft ; this is a tab. - GoTo Loop2 + GoTo Done TrimLeft: StrCpy $0 "$0" "" 1 Goto Loop -Loop2: +Done: + Pop $1 + Exch $0 + FunctionEnd +!macroend + +!macro LYX_FUNCTION_StrLTrim_Call Output Input + Push `${Input}` + Call StrLTrim + Pop `${Output}` +!macroend + +!macro LYX_FUNCTION_StrRTrim + !insertmacro LYX_FUNC `StrRTrim` + + ; After this point: + ; $0 = String (input) + ; $1 = Temp (temp) + + ; Get input from user + Exch $0 + Push $1 + +Loop: StrCpy $1 "$0" 1 -1 StrCmp "$1" " " TrimRight StrCmp "$1" "$\r" TrimRight @@ -36,7 +62,7 @@ Loop2: GoTo Done TrimRight: StrCpy $0 "$0" -1 - Goto Loop2 + Goto Loop Done: Pop $1 @@ -44,10 +70,58 @@ Done: FunctionEnd !macroend -!macro LYX_FUNCTION_StrTrim_Call String - Push `${String}` +!macro LYX_FUNCTION_StrRTrim_Call Output Input + Push `${Input}` + Call StrRTrim + Pop `${Output}` +!macroend + +!macro LYX_FUNCTION_StrTrim + !insertmacro LYX_FUNC `StrTrim` + Call StrLTrim + Call StrRTrim + FunctionEnd +!macroend + +!macro LYX_FUNCTION_StrTrim_Call Output Input + Push `${Input}` Call StrTrim - Pop `${String}` + Pop `${Output}` +!macroend + +!macro LYX_FUNCTION_StrRTrimChar + !insertmacro LYX_FUNC `StrRTrimChar` + + ; After this point: + ; $0 = Input + ; $1 = Char + ; $2 = Temp + + ; Get input from user + Exch $0 + Exch + Exch $1 + Push $2 + + StrCpy $2 "$0" 1 -1 + + StrCmp "$2" "$1" TrimRight + GoTo Done +TrimRight: + StrCpy $0 "$0" -1 + +Done: + Pop $2 + Pop $1 + Exch $0 + FunctionEnd +!macroend + +!macro LYX_FUNCTION_StrRTrimChar_Call Output Input Char + Push `${Char}` + Push `${Input}` + Call StrRTrimChar + Pop `${Output}` !macroend !endif ; _STRTRIM_NSH_