From 017bd21202d4645c29438545a1693936dedcf704 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 15 Jul 2005 10:05:13 +0000 Subject: [PATCH] Sync the 1.3.x and 1.4.x Windows packaging stuff. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10201 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/Win32/packaging/README | 13 +- development/Win32/packaging/build_lyxwin.sh | 319 ++++++++++++++++++ .../Win32/packaging/installer/download.nsh | 42 +-- .../{ioDownload.ini => io_download.ini} | 0 .../{ioSummary.ini => io_summary.ini} | 2 +- .../packaging/installer/io_ui_language.ini | 18 + .../{lyx_path_prefix.C => lyx_configure.C} | 284 +++++++++++----- .../packaging/installer/lyx_installer.nsi | 241 +++++++++++-- .../installer/lyx_languages/danish.nsh | 4 + .../installer/lyx_languages/dutch.nsh | 4 + .../installer/lyx_languages/english.nsh | 6 +- .../installer/lyx_languages/french.nsh | 4 + .../installer/lyx_languages/german.nsh | 4 + .../installer/lyx_languages/italian.nsh | 85 +++++ .../installer/lyx_languages/spanish.nsh | 4 + .../installer/lyx_languages/swedish.nsh | 4 + .../Win32/packaging/installer/lyx_utils.nsh | 152 +++++++++ development/Win32/packaging/package_lyxwin.sh | 2 +- 18 files changed, 1039 insertions(+), 149 deletions(-) create mode 100644 development/Win32/packaging/build_lyxwin.sh rename development/Win32/packaging/installer/{ioDownload.ini => io_download.ini} (100%) rename development/Win32/packaging/installer/{ioSummary.ini => io_summary.ini} (85%) create mode 100644 development/Win32/packaging/installer/io_ui_language.ini rename development/Win32/packaging/installer/{lyx_path_prefix.C => lyx_configure.C} (54%) create mode 100644 development/Win32/packaging/installer/lyx_languages/italian.nsh create mode 100644 development/Win32/packaging/installer/lyx_utils.nsh diff --git a/development/Win32/packaging/README b/development/Win32/packaging/README index 1d88e862c7..12f4aaeef8 100644 --- a/development/Win32/packaging/README +++ b/development/Win32/packaging/README @@ -1,12 +1,19 @@ Packaging LyX 1.3.6 for Windows =============================== +Angus Leeming, 14 July 2005 +=========================== Preparing the way ================= The very first thing to do on the way to creating a LyX/Win package is -to build the sources and install them somewhere accessible. (I've been -using PREFIX='/J/Programs/LyX'.) +to build the sources and install them somewhere accessible. I've written +a script, build_lyxwin.sh, that performs all the necessary steps. Please +read the preamble and (un)comment those steps that are necessary at the +end of the script. + +The (eventual --- mingw is a *very* slow compiler) result is a lyx +package that's almost ready to go in $LYX_SRCS/build/installprefix. Thereafter, the contents of this tree must be manipulated a little. I've written a little script, package_lyxwin.sh, to automate @@ -91,7 +98,7 @@ lyx_original.exe. Remove it. Building the LyX installer ========================== -At this point my J:\Programs\LyX tree now contains everything that is +At this point my build/installprefix tree now contains everything that is to be released as a LyX/Win package. All that remains to do is to generate a Windows installer for it. I've written a script for NSIS (http://nsis.sourceforge.net/) to compile into an installer. diff --git a/development/Win32/packaging/build_lyxwin.sh b/development/Win32/packaging/build_lyxwin.sh new file mode 100644 index 0000000000..798c40a983 --- /dev/null +++ b/development/Win32/packaging/build_lyxwin.sh @@ -0,0 +1,319 @@ +#! /bin/sh + +# This script aims to do averything necessary to automate the building +# of a LyX/Win package. + +# Invocation: +# sh build_lyxwin.sh "1.3.6-pre23" +# The string will be shown in the "About LyX" dialog. + +# This script is written as a bunch of subroutines. You'll probably +# only need to build a couple of the packages (dtl, aspell) once. +# Thereafter, the invocation of these subroutines can be commented out. +# (See the end of the script.) + +# Notes: +# It uses the MinGW/MinSYS environment and compiler. + +# It asks whether the Qt and LyX cvs trees are up to date. +# It asks whether the Qt library has been compiled. +# It checks that qt-mt3.dll, libiconv-2.dll, +# mingw10.dll and clean_dvi.py exist. +# It compiles the dv2dt and dt2dv utilites. +# It compiles and installs the Aspell library. +# It compiles and installs LyX. +# It copies the dv2dt and dt2dv utilites, the .dlls and +# clean_dvi.py to the lyx package. +# It modifies the Resources/lyx/configure script to +# ensure that the generated .dvi file is usable. + +# Once all this is done, you're ready to "package" LyX. +# See the README for details. + +# The script compiles the .dll version of the Qt libraries. Linking of lyx +# against this will, therefore, take "some time". + +# It compiles the static version of the Aspell libraries because no +# .dll version exists. + +HOME="/home/Angus" + +# You may need to change these three variables. +QT_DIR="${HOME}"/qt3 +ASPELL_DIR="${HOME}"/aspell-0.50.5 +# A space-separated string of directories +# ASPELL_DICT_DIRS="${HOME}/aspell-en-0.50-2 ${HOME}/aspell-de-0.50-2 " +ASPELL_DICT_DIRS="${HOME}/aspell-en-0.50-2" +LYX_DIR="${HOME}"/lyx/13x + +# Everything from here on down should be OK "as is". +PACKAGING_DIR="$LYX_DIR/development/Win32/packaging" +DTL_DIR="$PACKAGING_DIR/dtl" +CLEAN_DVI_DIR="$PACKAGING_DIR" + +ASPELL_INSTALL_DIR="c:/Aspell" +LYX_ASPELL_DIR="/c/Aspell" # the Autotools don't like "C:/" syntax. +LYX_RELATIVE_BUILDDIR=build +LYX_INSTALL_DIR=installprefix + +# These are all installed in the final LyX package +QT_DLL="${QT_DIR}/bin/qt-mt3.dll" +LIBICONV_DLL="/j/MinGW/bin/libiconv-2.dll" +MINGW_DLL="/j/MinGW/bin/mingwm10.dll" + +DT2DV="$DTL_DIR/dt2dv.exe" +DV2DT="$DTL_DIR/dv2dt.exe" +CLEAN_DVI_PY="$CLEAN_DVI_DIR/clean_dvi.py" + +# Change this to 'mv -f' when you are confident that +# the various sed scripts are working correctly. +MV='mv -f' + +check_dirs_exist() +{ + for dir in "$QT_DIR" "$ASPELL_DIR" "$LYX_DIR" "$DTL_DIR" + do + test -d "$dir" || { + echo "$dir does not exist" >&2 + exit 1 + } + done +} + + +query_qt() +{ + echo "Please ensure that the Qt and LyX cvs trees are up to date" + echo "and that the Qt library is compiled and ready to go." + echo "Press any key to continue" + read ans +} + + +check_files_exist() +{ + # Check that the dlls and clean_dvi.py exist + for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${CLEAN_DVI_PY}" + do + test -r "${file}" || { + echo "$file does not exist" >&2 + exit 1 + } + done +} + + +build_dtl() +{ + # dt2dv and dv2dt + ( + cd "$DTL_DIR" || { + echo "Unable to cd $DTL_DIR" >&2 + exit 1 + } + + make || { + echo "Failed to make $DTL_DIR" >&2 + exit 1 + } + ) + + for file in "${DT2DV}" "${DV2DT}" + do + test -x "$file" || { + echo "${file} does not exist or is not executable" >&2 + exit 1 + } + done +} + + +build_aspell() +{ + # Aspell + ( + cd "$ASPELL_DIR" || { + echo "Unable to cd $ASPELL_DIR" >&2 + exit 1 + } + + ./configure --enable-static --disable-shared --prefix="${ASPELL_INSTALL_DIR}" --sysconfdir="${ASPELL_INSTALL_DIR}" --enable-docdir="${ASPELL_INSTALL_DIR}/doc" --datadir="${ASPELL_INSTALL_DIR}/data" --enable-pkgdatadir="${ASPELL_INSTALL_DIR}/data" --enable-dict-dir="${ASPELL_INSTALL_DIR}/dict" --enable-win32-relocatable || { + echo "Failed to configure $ASPELL_DIR" >&2 + exit 1 + } + + # We have to clean up two of the generated Makefiles. + TMP=tmp.$$ + MAKEFILE=examples/Makefile + sed ' +# Replace "CC = gcc" with "CC = g++" +s/^ *\(CC *= *\)gcc *$/\1g++/ +# Remove trailing "/" from the -I directory. +s@^ *\(INCLUDES *= *-I\${top_srcdir}/interfaces/cc\)/ *$@\1@ +' "${MAKEFILE}" > "${TMP}" + cmp -s "${MAKEFILE}" "${TMP}" && { + echo "${MAKEFILE} is unchanged" 2>&1 + } || { + diff -u "${MAKEFILE}" "${TMP}" + ${MV} "${TMP}" "${MAKEFILE}" + } + rm -f "${TMP}" + + MAKEFILE=prog/Makefile + sed ' +# Remove trailing "/" from the -I directories. +/^ *INCLUDES *= *-I\${top_srcdir}\/common/{ +:loop +$!{ +N +/\n *$/!bloop +} +s@/ *\(\\ *\n\)@ \1@g +}' "${MAKEFILE}" > "${TMP}" + cmp -s "${MAKEFILE}" "${TMP}" && { + echo "${MAKEFILE} is unchanged" 2>&1 + } || { + diff -u "${MAKEFILE}" "${TMP}" + ${MV} "${TMP}" "${MAKEFILE}" + } + rm -f "${TMP}" + + make || { + echo "Failed to make $ASPELL_DIR" >&2 + exit 1 + } + + rm -fr "$ASPELL_INSTALL_DIR" || { + echo "Failed to remove $ASPELL_INSTALL_DIR prior to installing Aspell" >&2 + exit 1 + } + + make install || { + echo "Failed to install $ASPELL_DIR" >&2 + exit 1 + } + ) +} + + +build_aspell_dicts() +{ + ( + PATH="${LYX_ASPELL_DIR}:$PATH" + export PATH + + for dir in $ASPELL_DICT_DIRS + do + ( + cd $dir + ./configure + make + make install + ) + done + ) + +} + +modify_version_C() +{ + VERSION_C="src/version.C" + test -r "${VERSION_C}" || { + echo "Unable to find ${VERSION_C}" + return + } + test "${LYX_VERSION_STR}" == "" && return + + sed '/char const \* lyx_version = /s/"[^"]*"/"'${LYX_VERSION_STR}'"/' \ + ${VERSION_C} > tmp.$$ + diff -u ${VERSION_C} tmp.$$ + ${MV} tmp.$$ ${VERSION_C} +} + + +build_lyx() +{ + ( + cd "${LYX_DIR}" || { + echo "Unable to cd ${LYX_DIR}" >&2 + exit 1 + } + + # Check the line endings of configure.ac + # The configure script will be unable to create config.h if it + # contains Win32-style line endings. + sed 's/ +$//' ${LYX_DIR}/configure.ac > configure.ac.$$ + cmp -s ${LYX_DIR}/configure.ac configure.ac.$$ && { + rm -f configure.ac.$$ + } || { + mv -f configure.ac.$$ ${LYX_DIR}/configure.ac + echo 'configure.ac has Win32-style line endings. Corrected' >&2 + } + + ./autogen.sh || { + echo "autogen.sh failed" >&2 + exit 1 + } + + BUILDDIR="${LYX_RELATIVE_BUILDDIR}" + test ! -d "${BUILDDIR}" && { + mkdir "${BUILDDIR}" || \ + Error "Unable to create build dir, ${BUILDDIR}." + } + + CONFIGURE="../configure --without-x --with-included-gettext --with-extra-prefix='${LYX_ASPELL_DIR}' --with-frontend=qt QTDIR='$QT_DIR'" + + echo "${CONFIGURE}" + cd "${BUILDDIR}" + echo "${PWD}" + eval "${CONFIGURE}" || { + echo "Failed to configure LyX" >&2 + exit 1 + } + + # Modify the "lyx_version" string in build/src/version.C + modify_version_C + + # Build LyX + make || { + echo "Failed to make $LYX_DIR" >&2 + exit 1 + } + ) +} + + +install_lyx() +{ + ( + BUILDDIR="${LYX_RELATIVE_BUILDDIR}" + cd "${LYX_DIR}/${BUILDDIR}" || { + echo "Unable to cd ${LYX_DIR}/${BUILDDIR}" >&2 + exit 1 + } + + rm -fr "$LYX_INSTALL_DIR" || { + echo "Failed to remove $LYX_INSTALL_DIR prior to installing LyX" >&2 + exit 1 + } + + make install || { + echo "Failed to install $LYX_DIR" >&2 + exit 1 + } + ) +} + +LYX_VERSION_STR="" +test $# -ne 0 && LYX_VERSION_STR=$1 + +check_dirs_exist || exit 1 +query_qt || exit 1 +check_files_exist || exit 1 +#build_dtl || exit 1 +#build_aspell || exit 1 +#build_aspell_dicts || exit 1 +build_lyx || exit 1 +install_lyx || exit 1 +# The end diff --git a/development/Win32/packaging/installer/download.nsh b/development/Win32/packaging/installer/download.nsh index 3382c50d36..910433cab6 100644 --- a/development/Win32/packaging/installer/download.nsh +++ b/development/Win32/packaging/installer/download.nsh @@ -51,20 +51,20 @@ ; DoNothing. ; If the widget is disabled then set DoNothing ($3) to 0. ; Otherwise, set it equal to the "state" variable of the field. - !insertmacro MUI_INSTALLOPTIONS_READ $3 "ioDownload.ini" "Field 2" "Flags" + !insertmacro MUI_INSTALLOPTIONS_READ $3 "io_download.ini" "Field 2" "Flags" IntOp $3 $3 & DISABLED ${if} $3 == 1 StrCpy $3 0 ${else} - !insertmacro MUI_INSTALLOPTIONS_READ $3 "ioDownload.ini" "Field 2" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $3 "io_download.ini" "Field 2" "State" ${endif} ; Download - !insertmacro MUI_INSTALLOPTIONS_READ $2 "ioDownload.ini" "Field 3" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $2 "io_download.ini" "Field 3" "State" ; SelectFolder - !insertmacro MUI_INSTALLOPTIONS_READ $1 "ioDownload.ini" "Field 4" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $1 "io_download.ini" "Field 4" "State" ; FolderPath - !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Field 5" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $0 "io_download.ini" "Field 5" "State" ; Return output to user. ; The stack available to the user contains: @@ -193,8 +193,8 @@ !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)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 1" "Text" "" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 2" "Text" "$(DownloadPageField2)" Push $0 ${if} ${Required} == 1 @@ -202,31 +202,31 @@ ${else} StrCpy $0 "DISABLED" ${endif} - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 2" "Flags" $0 + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 2" "Flags" $0 Pop $0 - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 2" "State" "0" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "Text" "${DownloadLabel}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "Text" "${HomeLabel}" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 2" "State" "0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 3" "Text" "${DownloadLabel}" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.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_WRITE "ioDownload.ini" "Field 5" "Flags" PATH_MUST_EXIST|DISABLED - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "State" "" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 3" "State" "1" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 4" "State" "0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 5" "Flags" PATH_MUST_EXIST|DISABLED + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.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 + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 3" "State" "0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 4" "State" "1" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 5" "Flags" PATH_MUST_EXIST - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "State" "${ExePath}" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_download.ini" "Field 5" "State" "${ExePath}" ${endif} ClearErrors !insertmacro MUI_HEADER_TEXT "${PageHeader}" "${PageDescription}" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioDownload.ini" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_download.ini" !macroend @@ -282,7 +282,7 @@ !macro DownloadLeave_Private DoNotRequire Download FolderPath URL EnterFolder ExeName InvalidFolder - !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Settings" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $0 "io_download.ini" "Settings" "State" StrCmp $0 0 go_on ; Next button? diff --git a/development/Win32/packaging/installer/ioDownload.ini b/development/Win32/packaging/installer/io_download.ini similarity index 100% rename from development/Win32/packaging/installer/ioDownload.ini rename to development/Win32/packaging/installer/io_download.ini diff --git a/development/Win32/packaging/installer/ioSummary.ini b/development/Win32/packaging/installer/io_summary.ini similarity index 85% rename from development/Win32/packaging/installer/ioSummary.ini rename to development/Win32/packaging/installer/io_summary.ini index 0fb6a70f2e..92e85b880b 100644 --- a/development/Win32/packaging/installer/ioSummary.ini +++ b/development/Win32/packaging/installer/io_summary.ini @@ -6,4 +6,4 @@ Type=Label Left=5 Right=-1 Top=0 -Bottom=60 +Bottom=140 diff --git a/development/Win32/packaging/installer/io_ui_language.ini b/development/Win32/packaging/installer/io_ui_language.ini new file mode 100644 index 0000000000..9b280622d8 --- /dev/null +++ b/development/Win32/packaging/installer/io_ui_language.ini @@ -0,0 +1,18 @@ +[Settings] +NumFields=2 + +[Field 1] +Type=GroupBox +Left=0 +Right=160 +Top=0 +Bottom=-4 +Text=" Available Languages " + +[Field 2] +Type=Droplist +ListItems=Dansk|Deutsch|English|Español|Euskara|Français|Italiano|Nederlands|Norsk|Nynorsk|Polski|Româna|Russian|Slovenský|Slovenšcina|Suomi|Türkçe +Left=20 +Right=130 +Top=15 +Bottom=130 diff --git a/development/Win32/packaging/installer/lyx_path_prefix.C b/development/Win32/packaging/installer/lyx_configure.C similarity index 54% rename from development/Win32/packaging/installer/lyx_path_prefix.C rename to development/Win32/packaging/installer/lyx_configure.C index 5255183b6a..0a00133c87 100644 --- a/development/Win32/packaging/installer/lyx_path_prefix.C +++ b/development/Win32/packaging/installer/lyx_configure.C @@ -1,5 +1,5 @@ /* - * \file lyx_path_prefix.C + * \file lyx_configure.C * This file is part of LyX, the document processor. * http://www.lyx.org/ * Licence details can be found in the file COPYING or copy at @@ -9,30 +9,37 @@ * Full author contact details are available in file CREDITS or copy at * http://www.lyx.org/about/credits.php * - * This little piece of code is used to insert some code into LyX's - * Resources/lyx/configure script so that it will cause lyxrc.defaults to - * contain + * Define four functions that can be called from the NSIS installer: * - * \path_prefix ";;..." + * set_path_prefix [ configure_file, path_prefix ] + * create_bat_files [ bin_dir, lang ] + * run_configure [ configure_file, path_prefix ] + * set_env [ var_name, var_value ] + * + * The quantities in [ ... ] are the variables that the functions exxpect + * to find on the stack. They push "-1" onto the stack on failure and "0" + * onto the stack on success. * * Compile the code with * * g++ -I/c/Program\ Files/NSIS/Contrib -Wall -shared \ - * lyx_path_prefix.C -o lyx_path_prefix.dll + * lyx_configure.C -o lyx_configure.dll * * Move resulting .dll to /c/Program\ Files/NSIS/Plugins */ -#include -#include "ExDLL/exdll.h" -#include -#include +#include +#include #include #include #include #include #include +#include +#include "ExDLL/exdll.h" + + namespace { std::string const subst(std::string const & a, @@ -53,18 +60,18 @@ std::string const subst(std::string const & a, std::string const basename(std::string const & path) { std::string::size_type const final_slash = path.find_last_of('\\'); - if (final_slash == std::string::npos) - return path; - return path.substr(final_slash+1); + return (final_slash == std::string::npos) ? + path : + path.substr(final_slash+1); } std::string const dirname(std::string const & path) { std::string::size_type const final_slash = path.find_last_of('\\'); - if (final_slash == std::string::npos) - return std::string(); - return path.substr(0, final_slash); + return (final_slash == std::string::npos) ? + std::string() : + path.substr(0, final_slash); } @@ -76,6 +83,14 @@ std::string const pop_from_stack() } +void push_to_stack(int data) +{ + std::ostringstream os; + os << data; + pushstring(os.str().c_str()); +} + + std::list const tokenize(std::string data, char const separator) { @@ -192,29 +207,15 @@ bool insert_path_prefix(std::string & data, return true; } -} // namespace anon - - -BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) -{ - return TRUE; -} - // Inserts code into "configure" to output "path_prefix" to lyxrc.defaults. -extern "C" -void __declspec(dllexport) set_path_prefix(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) +// \returns 0 on success, -1 on failure +int set_path_prefix(std::string const & configure_file, + std::string const & path_prefix) { - EXDLL_INIT(); - - std::string const configure_file = pop_from_stack(); - std::string const path_prefix = pop_from_stack(); - std::ifstream ifs(configure_file.c_str()); - if (!ifs) { - pushstring("-1"); - return; - } + if (!ifs) + return -1; std::istreambuf_iterator const begin_ifs(ifs); std::istreambuf_iterator const end_ifs; @@ -226,77 +227,184 @@ void __declspec(dllexport) set_path_prefix(HWND hwndParent, int string_size, cha std::string::size_type const prefix_pos = configure_data.find("path_prefix"); if (prefix_pos != std::string::npos) { - if (!replace_path_prefix(configure_data, prefix_pos, path_prefix)) { - pushstring("-1"); - return; - } + if (!replace_path_prefix(configure_data, prefix_pos, path_prefix)) + return -1; } else { std::string::size_type const xfonts_pos = configure_data.find("X FONTS"); - if (xfonts_pos == std::string::npos) { - pushstring("-1"); - return; - } + if (xfonts_pos == std::string::npos) + return -1; - if (!insert_path_prefix(configure_data, xfonts_pos, path_prefix)) { - pushstring("-1"); - return; - } + if (!insert_path_prefix(configure_data, xfonts_pos, path_prefix)) + return -1; } std::ofstream ofs(configure_file.c_str()); - if (!ofs) { - pushstring("-1"); - return; - } + if (!ofs) + return -1; ofs << configure_data; - pushstring("0"); + return 0; +} + + +bool write_bat(std::ostream & os, std::string const & quoted_exe) +{ + os << "if \"%~1\" == \"~1\" goto win95\n" + << quoted_exe << " %*\n" + << "goto end\n" + << ":win95\n" + << quoted_exe << " %1 %2 %3 %4 %5 %6 %7 %8 %9\n" + << ":end\n"; + + return os; +} + + +// Creates the files lyx.bat and reLyX.bat in the LyX\bin folder. +// \returns 0 on success, -1 on failure +int create_bat_files(std::string const & bin_dir, std::string const & lang) +{ + std::string const lyx_bat_file = bin_dir + "\\lyx.bat"; + std::ofstream lyx_bat(lyx_bat_file.c_str()); + if (!lyx_bat) + return -1; + + lyx_bat << "@echo off\n" + << "if \"%LANG%\"==\"\" SET LANG=" << lang << "\n"; + + std::string const lyx_exe_file = bin_dir + "\\lyx.exe"; + if (!write_bat(lyx_bat, "start \"LyX\" \"" + lyx_exe_file + "\"")) + return -1; + + std::string const relyx_bat_file = bin_dir + "\\reLyX.bat"; + std::ofstream relyx_bat(relyx_bat_file.c_str()); + if (!relyx_bat) + return -1; + + std::string relyx_file = bin_dir + "\\reLyX"; + std::string relyx = "perl.exe \"" + relyx_file + "\""; + if (!write_bat(relyx_bat, "perl.exe \"" + relyx_file + "\"")) + return -1; + return 0; +} + + +// Runs "sh configure" to generate things like lyxrc.defaults. +// \returns 0 on success, -1 on failure +int run_configure(std::string const & abs_configure_file, + std::string const & path_prefix) +{ + std::string const configure_dir = dirname(abs_configure_file); + std::string const configure_file = basename(abs_configure_file); + + if (configure_dir.empty()) + return -1; + + if (SetCurrentDirectory(configure_dir.c_str()) == 0) + return -1; + + char path_orig[10*MAX_PATH]; + if (GetEnvironmentVariable("PATH", path_orig, 10*MAX_PATH) == 0) + return -1; + + std::string const path = path_prefix + ';' + path_orig; + if (SetEnvironmentVariable("PATH", path.c_str()) == 0) + return -1; + + // 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) + return -1; + return 0; +} + +} // namespace anon + + +//===========================================// +// // +// Below is the public interface to the .dll // +// // +//===========================================// + +BOOL WINAPI DllMain(HANDLE hInst, + ULONG ul_reason_for_call, + LPVOID lpReserved) +{ + return TRUE; +} + + +// Inserts code into "configure" to output "path_prefix" to lyxrc.defaults. +extern "C" +void __declspec(dllexport) set_path_prefix(HWND hwndParent, + int string_size, + char * variables, + stack_t ** stacktop) +{ + EXDLL_INIT(); + + std::string const configure_file = pop_from_stack(); + std::string const path_prefix = pop_from_stack(); + + int const result = set_path_prefix(configure_file, path_prefix); + push_to_stack(result); +} + + +// Creates the files lyx.bat and reLyX.bat in the LyX\bin folder. +extern "C" +void __declspec(dllexport) create_bat_files(HWND hwndParent, + int string_size, + char * variables, + stack_t ** stacktop) +{ + EXDLL_INIT(); + + std::string const bin_dir = pop_from_stack(); + std::string const lang = pop_from_stack(); + + int const result = create_bat_files(bin_dir, lang); + push_to_stack(result); } // Runs "sh configure" to generate things like lyxrc.defaults. extern "C" -void __declspec(dllexport) run_configure(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) +void __declspec(dllexport) run_configure(HWND hwndParent, + int string_size, + char * variables, + stack_t ** stacktop) { EXDLL_INIT(); - std::string configure_file = pop_from_stack(); + std::string const configure_file = pop_from_stack(); std::string const path_prefix = pop_from_stack(); - std::string const configure_dir = dirname(configure_file); - configure_file = basename(configure_file); - - if (configure_dir.empty()) { - pushstring("-1"); - return; - } - - if (SetCurrentDirectory(configure_dir.c_str()) == 0) { - pushstring("-1"); - return; - } - - char path_orig[10*MAX_PATH]; - if (GetEnvironmentVariable("PATH", path_orig, 10*MAX_PATH) == 0) { - pushstring("-1"); - return; - } - - std::string const path = path_prefix + ';' + path_orig; - if (SetEnvironmentVariable("PATH", path.c_str()) == 0) { - pushstring("-1"); - return; - } - - // 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; - } - - pushstring("0"); + int const result = run_configure(configure_file, path_prefix); + push_to_stack(result); +} + + +// Set an environment variable +extern "C" +void __declspec(dllexport) set_env(HWND hwndParent, + int string_size, + char * variables, + stack_t ** stacktop) +{ + EXDLL_INIT(); + + std::string const var_name = pop_from_stack(); + std::string const var_value = pop_from_stack(); + + // Function returns a nonzero value on success. + int const result = + SetEnvironmentVariableA(var_name.c_str(), var_value.c_str()) ? + 0 : -1; + + push_to_stack(result); } diff --git a/development/Win32/packaging/installer/lyx_installer.nsi b/development/Win32/packaging/installer/lyx_installer.nsi index 2340150519..2f9fffbbdb 100644 --- a/development/Win32/packaging/installer/lyx_installer.nsi +++ b/development/Win32/packaging/installer/lyx_installer.nsi @@ -7,6 +7,7 @@ ; http://www.lyx.org/about/license.php3 ; Author Angus Leeming +; Author Uwe Stöhr ; Full author contact details are available in file CREDITS or copy at ; http://www.lyx.org/about/credits.php @@ -27,8 +28,9 @@ SetCompressor lzma !define PRODUCT_NAME "LyX" !define PRODUCT_VERSION "1.3.6" !define PRODUCT_LICENSE_FILE "..\..\..\..\COPYING" -!define PRODUCT_SOURCEDIR "J:\Programs\LyX" +!define PRODUCT_SOURCEDIR "..\..\..\..\build\installprefix" !define PRODUCT_EXE "$INSTDIR\bin\lyx.exe" +!define PRODUCT_BAT "$INSTDIR\bin\lyx.bat" !define PRODUCT_EXT ".lyx" !define PRODUCT_MIME_TYPE "application/lyx" !define PRODUCT_UNINSTALL_EXE "$INSTDIR\uninstall.exe" @@ -55,20 +57,7 @@ InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" !include "StrFunc.nsh" !include "strtrim.nsh" !include "download.nsh" - -; Declare used functions -${StrLoc} -${StrNSISToIO} -${StrRep} -${StrTrim} -${StrLTrim} -${StrRTrim} -${StrRTrimChar} -${ReadDownloadValues} -${EnableBrowseControls} -${SearchRegistry} -${DownloadEnter} -${DownloadLeave} +!include "lyx_utils.nsh" ; Grabbed from ; http://nsis.sourceforge.net/archive/viewpage.php?pageid=275 @@ -80,6 +69,24 @@ ${DownloadLeave} ; in the Registry. !include "abi_util_fileassoc.nsh" +;-------------------------------- +; Declare used functions + +${StrStrAdv} +${StrLoc} +${StrNSISToIO} +${StrRep} +${StrTok} +${StrTrim} +${StrLTrim} +${StrRTrim} +${StrRTrimChar} +${ReadDownloadValues} +${EnableBrowseControls} +${SearchRegistry} +${DownloadEnter} +${DownloadLeave} + ;-------------------------------- ; Variables @@ -105,6 +112,12 @@ Var DoNotRequireImageMagick Var ImageMagickPath Var DownloadImageMagick +Var PDFViewerPath +Var PDFViewerProg + +Var PSViewerPath +Var PSViewerProg + Var DoNotInstallLyX Var PathPrefix @@ -113,6 +126,9 @@ Var CreateDesktopIcon Var StartmenuFolder Var ProductRootKey +Var LangName +Var LangCode + ;-------------------------------- ; Remember the installer language @@ -141,6 +157,9 @@ Page custom SummariseDownloads SummariseDownloads_LeaveFunction ; Specify the installation directory. !insertmacro MUI_PAGE_DIRECTORY +; Specify LyX's menu language. +Page custom SelectMenuLanguage SelectMenuLanguage_LeaveFunction + ; Define which components to install. !insertmacro MUI_PAGE_COMPONENTS @@ -153,9 +172,10 @@ Page custom SummariseDownloads SummariseDownloads_LeaveFunction ; Watch the components being installed. !insertmacro MUI_PAGE_INSTFILES +!define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)" !define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)" -!define MUI_FINISHPAGE_RUN "${PRODUCT_EXE}" +!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProduct" !insertmacro MUI_PAGE_FINISH ; The uninstaller. @@ -169,6 +189,7 @@ Page custom SummariseDownloads SummariseDownloads_LeaveFunction !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "Italian" !insertmacro MUI_LANGUAGE "Dutch" !insertmacro MUI_LANGUAGE "Swedish" @@ -177,6 +198,7 @@ Page custom SummariseDownloads SummariseDownloads_LeaveFunction !include "lyx_languages\dutch.nsh" !include "lyx_languages\french.nsh" !include "lyx_languages\german.nsh" +!include "lyx_languages\italian.nsh" !include "lyx_languages\spanish.nsh" !include "lyx_languages\swedish.nsh" @@ -189,9 +211,11 @@ LicenseData "$(LyXLicenseData)" ; Keep these lines before any File command ; Only for solid compression (by default, solid compression ; is enabled for BZIP2 and LZMA) -ReserveFile "ioDownload.ini" -ReserveFile "ioSummary.ini" +ReserveFile "io_download.ini" +ReserveFile "io_summary.ini" !insertmacro MUI_RESERVEFILE_LANGDLL +ReserveFile "io_ui_language.ini" +!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;-------------------------------- @@ -216,22 +240,29 @@ SectionEnd ; Sections are entered in order, so the settings above are all ; available to SecInstallation Section "-Installation actions" SecInstallation - SetOverwrite off + SetOverwrite on SetOutPath "$INSTDIR" File /r "${PRODUCT_SOURCEDIR}\Resources" File /r "${PRODUCT_SOURCEDIR}\bin" ${if} "$PathPrefix" != "" - lyx_path_prefix::set_path_prefix "$INSTDIR\Resources\lyx\configure" "$PathPrefix" + lyx_configure::set_path_prefix "$INSTDIR\Resources\lyx\configure" "$PathPrefix" Pop $0 ${if} $0 != 0 MessageBox MB_OK "$(ModifyingConfigureFailed)" ${endif} - lyx_path_prefix::run_configure "$INSTDIR\Resources\lyx\configure" "$PathPrefix" - Pop $0 - ${if} $0 != 0 - MessageBox MB_OK "$(RunConfigureFailed)" - ${endif} + ${endif} + + lyx_configure::create_bat_files "$INSTDIR\bin" "$LangCode" + Pop $0 + ${if} $0 != 0 + MessageBox MB_OK "$(CreateCmdFilesFailed)" + ${endif} + + lyx_configure::run_configure "$INSTDIR\Resources\lyx\configure" "$PathPrefix" + Pop $0 + ${if} $0 != 0 + MessageBox MB_OK "$(RunConfigureFailed)" ${endif} WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}" @@ -243,11 +274,11 @@ Section "-Installation actions" SecInstallation WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder" CreateDirectory "$SMPROGRAMS\$StartmenuFolder" - CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_EXE}" + CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}" CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}" ${if} $CreateDesktopIcon == "true" - CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_EXE}" + CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}" ${endif} ${if} $CreateFileAssociations == "true" @@ -256,7 +287,7 @@ Section "-Installation actions" SecInstallation "${PRODUCT_NAME}" \ "${PRODUCT_NAME} Document" \ "${PRODUCT_EXE},1" \ - "${PRODUCT_EXE}" + "${PRODUCT_BAT}" ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}" ${endif} @@ -280,8 +311,9 @@ SectionEnd Function .onInit !insertmacro MUI_LANGDLL_DISPLAY - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioDownload.ini" - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioSummary.ini" + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_download.ini" + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_summary.ini" + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_ui_language.ini" ; Default settings ; These can be reset to "all" in section SecAllUsers. @@ -316,13 +348,30 @@ Function .onInit Call SearchPerl Call SearchGhostscript Call SearchImageMagick + Call SearchPDFViewer + Call SearchPSViewer ClearErrors FunctionEnd ;-------------------------------- +Function LaunchProduct + lyx_configure::set_env LANG $LangCode + Exec ${PRODUCT_EXE} +FunctionEnd + +;-------------------------------- + +; Sets the value of the global $MinSYSPath variable. Function SearchMinSYS + ; This function manipulates the registers $0-$3, + ; so push their current content onto the stack. + Push $0 + Push $1 + Push $2 + Push $3 + ; Search the registry for the MinSYS uninstaller. ; If successful, put its location in $2. StrCpy $3 "Software\Microsoft\Windows\CurrentVersion\Uninstall" @@ -351,6 +400,12 @@ Function SearchMinSYS "Inno Setup: App Path" \ "" \ "\bin" + + ; Return the $0, $1, $2 and $2 registers to their original state + Pop $3 + Pop $2 + Pop $1 + Pop $0 FunctionEnd Function DownloadMinSYS @@ -366,6 +421,10 @@ Function DownloadMinSYS FunctionEnd Function DownloadMinSYS_LeaveFunction + ; This function manipulates the $0 register + ; so push its current content onto the stack. + Push $0 + ${DownloadLeave} \ $0 \ $DownloadMinSYS \ @@ -374,10 +433,14 @@ Function DownloadMinSYS_LeaveFunction "$(EnterMinSYSFolder)" \ "sh.exe" \ "$(InvalidMinSYSFolder)" + + ; Return the $0 register to its original state + Pop $0 FunctionEnd ;-------------------------------- +; Sets the value of the global $PythonPath variable. Function SearchPython ${SearchRegistry} \ $PythonPath \ @@ -400,6 +463,10 @@ Function DownloadPython FunctionEnd Function DownloadPython_LeaveFunction + ; This function manipulates the $0 register + ; so push its current content onto the stack. + Push $0 + ${DownloadLeave} \ $0 \ $DownloadPython \ @@ -408,10 +475,14 @@ Function DownloadPython_LeaveFunction "$(EnterPythonFolder)" \ "Python.exe" \ "$(InvalidPythonFolder)" + + ; Return the $0 register to its original state + Pop $0 FunctionEnd ;-------------------------------- +; Sets the value of the global $MiKTeXPath variable. Function SearchMiKTeX ${SearchRegistry} \ $MiKTeXPath \ @@ -447,6 +518,7 @@ FunctionEnd ;-------------------------------- +; Sets the value of the global $PerlPath variable. Function SearchPerl ${SearchRegistry} \ $PerlPath \ @@ -482,13 +554,24 @@ FunctionEnd ;-------------------------------- +; Sets the value of the global $GhostscriptPath variable. Function SearchGhostscript + ; This function manipulates the $0 and $1 registers, + ; so push their current content onto the stack. + Push $0 + Push $1 + ; Find which version of ghostscript, if any, is installed. + ; Store this value in $0. + StrCpy $0 "" EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0 ${if} $1 != "" StrCpy $0 "Software\AFPL Ghostscript\$1" ${else} - StrCpy $0 "" + EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0 + ${if} $1 != "" + StrCpy $0 "Software\GPL Ghostscript\$1" + ${endif} ${endif} ${SearchRegistry} \ @@ -497,6 +580,10 @@ Function SearchGhostscript "GS_DLL" \ "\gsdll32.dll" \ "" + + ; Return the $0 and $1 registers to their original states + Pop $1 + Pop $0 FunctionEnd Function DownloadGhostscript @@ -505,8 +592,16 @@ Function DownloadGhostscript ; Find which version of ghostscript, if any, is installed. EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0 + ${if} $1 == "" + EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0 + StrCpy $2 "True" + ${endif} ${if} $1 != "" + ${if} $2 == "True" + StrCpy $0 "Software\GPL Ghostscript\$1" + ${else} StrCpy $0 "Software\AFPL Ghostscript\$1" + ${endif} ${else} StrCpy $0 "" ${endif} @@ -533,6 +628,7 @@ FunctionEnd ;-------------------------------- +; Sets the value of the global $ImageMagickPath variable. Function SearchImageMagick ${SearchRegistry} \ $ImageMagickPath \ @@ -568,6 +664,58 @@ FunctionEnd ;-------------------------------- +; Sets the value of the global $PDFViewerPath and $PDFViewerProg variables. +Function SearchPDFViewer + StrCpy $PDFViewerPath "" + !insertmacro GetFileExtProg $PDFViewerPath $PDFViewerProg ".pdf" "a" +FunctionEnd + +;-------------------------------- + +Function SearchPSViewer + ; This function manipulates the $0 and $1 registers, + ; so push their current content onto the stack. + Push $0 + Push $1 + + StrCpy $PSViewerPath "" + StrCpy $0 "" + StrCpy $1 "" + !insertmacro GetFileExtProg $PSViewerPath $PSViewerProg ".ps" "a" + ${if} $PSViewerPath != "" + StrCpy $0 $PSViewerPath + StrCpy $0 $0 "" -8 + ${endif} + ${if} $0 == "Distillr" + !insertmacro GetFileExtProg $0 $1 ".ps" "b" + ${if} $1 != "" + StrCpy $PSViewerPath $0 + StrCpy $PSViewerProg $1 + ${endif} + ${endif} + + ; Failed to find anything that way. Try another. + ${if} $PSViewerPath == "" + ReadRegStr $PSViewerProg HKCR "psfile\shell\open\command" "" + ; Extract the first quoted word. + ${StrTok} $0 "$PSViewerProg" '"' '1' '0' + ${if} $0 != "" + StrCpy $PSViewerProg $0 + ${endif} + + ${StrTrim} $PSViewerProg "$PSViewerProg" + ; Split into pair + ${StrStrAdv} $PSViewerPath $PSViewerProg "\" "<" "<" "0" "0" "0" + ${StrStrAdv} $PSViewerProg $PSViewerProg "\" "<" ">" "0" "0" "0" + ${endif} + + ; Return the $0 and $1 registers to their original states + Pop $1 + Pop $0 +FunctionEnd + +;-------------------------------- + Function SummariseDownloads StrCpy $PathPrefix "" @@ -599,15 +747,16 @@ Function SummariseDownloads IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadImageMagick ${if} "$DoNotInstallLyX" == 1 - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$(SummaryPleaseInstall)" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_summary.ini" "Field 1" "Text" "$(SummaryPleaseInstall)" ${else} ${StrNSISToIO} $0 '$PathPrefix' + ${StrRep} $0 "$0" ";" "\r\n" StrCpy $0 "$(SummaryPathPrefix)\r\n\r\n$0" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$0" + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_summary.ini" "Field 1" "Text" "$0" ${endif} !insertmacro MUI_HEADER_TEXT "$(SummaryTitle)" "" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioSummary.ini" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_summary.ini" FunctionEnd Function SummariseDownloads_LeaveFunction @@ -616,6 +765,30 @@ Function SummariseDownloads_LeaveFunction ${endif} FunctionEnd +;-------------------------------- + +Function SelectMenuLanguage + StrCpy $LangName "" + + ;tranlate NSIS's language code to the language name; macro from lyx_utils.nsh + !insertmacro TranslateLangCode $LangName $Language + + !insertmacro MUI_INSTALLOPTIONS_WRITE "io_ui_language.ini" "Field 2" "State" "$LangName" + + !insertmacro MUI_HEADER_TEXT "$(UILangageTitle)" "$(UILangageDescription)" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "io_ui_language.ini" +FunctionEnd + +;-------------------------------- + +Function SelectMenuLanguage_LeaveFunction + !insertmacro MUI_INSTALLOPTIONS_READ $LangName "io_ui_language.ini" "Field 2" "State" + + ;Get the language code; macro from lyx_utils.nsh + StrCpy $LangCode "" + !insertmacro GetLangCode $LangCode $LangName +FunctionEnd + ;-------------------------------- ; The Uninstaller diff --git a/development/Win32/packaging/installer/lyx_languages/danish.nsh b/development/Win32/packaging/installer/lyx_languages/danish.nsh index 62ace1de8c..f68a31fcf4 100644 --- a/development/Win32/packaging/installer/lyx_languages/danish.nsh +++ b/development/Win32/packaging/installer/lyx_languages/danish.nsh @@ -18,6 +18,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Opret association mellem LyX o LangString SecDesktopDescription "${LYX_LANG}" "Et ${PRODUCT_NAME} ikon på skrivebordet" LangString ModifyingConfigureFailed "${LYX_LANG}" "Forsøget på at indstille 'path_prefix' i konfigurationen mislykkedes" +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Mislykket forsøg på at afvikle konfigurations-scriptet" LangString FinishPageMessage "${LYX_LANG}" "Tillykke!! LyX er installeret." @@ -71,6 +72,9 @@ LangString SummaryTitle "${LYX_LANG}" "Software - sammendrag" LangString SummaryPleaseInstall "${LYX_LANG}" "Installer de filer du har downloaded, og kør så LyX's installationsprogram igen." LangString SummaryPathPrefix "${LYX_LANG}" "Jeg tilføjer en 'path_prefix' streng til 'lyxrc.defaults' som indeholder:" +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + LangString UnNotInRegistryLabel "${LYX_LANG}" "Kunne ikke finde $(^Name) i registreringsdatabsen$\r$\nGenvejene på skrivebordet og i Start-menuen bliver ikke fjernet" LangString UnNotAdminLabel "${LYX_LANG}" "Beklager! Du skal have administrator-rettigheder$\r$\nfor at afinstallere$(^Name)." LangString UnReallyRemoveLabel "${LYX_LANG}" "Er du sikker på, at du vil slette $(^Name) og alle tilhørende komponenter?" diff --git a/development/Win32/packaging/installer/lyx_languages/dutch.nsh b/development/Win32/packaging/installer/lyx_languages/dutch.nsh index 8e8e0c97fd..daa8c151c5 100644 --- a/development/Win32/packaging/installer/lyx_languages/dutch.nsh +++ b/development/Win32/packaging/installer/lyx_languages/dutch.nsh @@ -18,6 +18,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Associeer het LyX programma me LangString SecDesktopDescription "${LYX_LANG}" "Een ${PRODUCT_NAME} pictogram op het Bureaublad." LangString ModifyingConfigureFailed "${LYX_LANG}" "Mislukte poging om 'path_prefix' te registreren tijdens de configuratie" +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Mislukte configuratie poging" LangString FinishPageMessage "${LYX_LANG}" "Gefeliciteerd! LyX is succesvol geinstalleerd." @@ -71,6 +72,9 @@ LangString SummaryTitle "${LYX_LANG}" "Software samenvatting" LangString SummaryPleaseInstall "${LYX_LANG}" "Installeer de opgehaalde bestanden en start vervolgens het LyX installatie programma nogmaals om de installatie af te ronden." LangString SummaryPathPrefix "${LYX_LANG}" "Ik voeg een 'path_prefix' tekst aan 'lyxrc.defaults' toe met:" +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + LangString UnNotInRegistryLabel "${LYX_LANG}" "$(^Name) is niet gevonden in het Windows register$\r$\nSnelkoppelingen op het Bureaublad en in het Start Menu worden niet verwijderd." LangString UnNotAdminLabel "${LYX_LANG}" "Sorry! U heeft systeembeheer rechten nodig$\r$\nom $(^Name) te verwijderen." LangString UnReallyRemoveLabel "${LYX_LANG}" "Weet u zeker dat u $(^Name) en alle componenten volledig wil verwijderen van deze computer?" diff --git a/development/Win32/packaging/installer/lyx_languages/english.nsh b/development/Win32/packaging/installer/lyx_languages/english.nsh index b8f0144182..362453d6e9 100644 --- a/development/Win32/packaging/installer/lyx_languages/english.nsh +++ b/development/Win32/packaging/installer/lyx_languages/english.nsh @@ -18,6 +18,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Create associations between th LangString SecDesktopDescription "${LYX_LANG}" "A ${PRODUCT_NAME} icon on the desktop." LangString ModifyingConfigureFailed "${LYX_LANG}" "Failed attempting to set 'path_prefix' in the configure script" +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Failed attempting to execute the configure script" LangString FinishPageMessage "${LYX_LANG}" "Congratulations! LyX has been installed successfully." @@ -61,7 +62,7 @@ LangString ImageMagickDownloadLabel "${LYX_LANG}" "&Download ImageMagick" LangString ImageMagickFolderLabel "${LYX_LANG}" "&Folder containing convert.exe" LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript" -LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) is used to convert images to/from PostScript." +LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (www.cs.wisc.edu/~ghost/) is used to convert images to/from PostScript." LangString EnterGhostscriptFolder "${LYX_LANG}" "Please input the path to the folder containing gswin32c.exe" LangString InvalidGhostscriptFolder "${LYX_LANG}" "Unable to find gswin32c.exe" LangString GhostscriptDownloadLabel "${LYX_LANG}" "&Download Ghostscript" @@ -71,6 +72,9 @@ LangString SummaryTitle "${LYX_LANG}" "Software summary" LangString SummaryPleaseInstall "${LYX_LANG}" "Please install your downloaded files and then run LyX's installer once again." LangString SummaryPathPrefix "${LYX_LANG}" "I shall add a 'path_prefix' string to 'lyxrc.defaults' containing:" +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + LangString UnNotInRegistryLabel "${LYX_LANG}" "Unable to find $(^Name) in the registry$\r$\nShortcuts on the desktop and in the Start Menu will not be removed." LangString UnNotAdminLabel "${LYX_LANG}" "Sorry! You must have administrator privileges$\r$\nto uninstall $(^Name)." LangString UnReallyRemoveLabel "${LYX_LANG}" "Are you sure you want to completely remove $(^Name) and all of its components?" diff --git a/development/Win32/packaging/installer/lyx_languages/french.nsh b/development/Win32/packaging/installer/lyx_languages/french.nsh index edd8eb41e5..9871e79969 100644 --- a/development/Win32/packaging/installer/lyx_languages/french.nsh +++ b/development/Win32/packaging/installer/lyx_languages/french.nsh @@ -19,6 +19,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Cr LangString SecDesktopDescription "${LYX_LANG}" "Une icône ${PRODUCT_NAME} sur le bureau." LangString ModifyingConfigureFailed "${LYX_LANG}" "Échec de l'allocation 'path_prefix' lors de la configuration." +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Échec de la tentative de configuration initiale de LyX." LangString FinishPageMessage "${LYX_LANG}" "Félicitations ! LyX est installé avec succès." @@ -72,6 +73,9 @@ LangString SummaryTitle "${LYX_LANG}" "R LangString SummaryPleaseInstall "${LYX_LANG}" "Merci d'installer les fichiers téléchargés, puis d'exécuter de nouveau l'installation de LyX." LangString SummaryPathPrefix "${LYX_LANG}" "Durant l'installation, une chaîne de caractères 'path_prefix' sera ajoutée à 'lyxrc.defaults', elle contiendra :" +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + LangString UnNotInRegistryLabel "${LYX_LANG}" "$(^Name) introuvable dans le base des registres. $\r$\nLes raccourcis sur le bureau et dans le menu de démarrage ne seront pas supprimés." LangString UnNotAdminLabel "${LYX_LANG}" "Désolé ! Vous devez avoir les droits d'administration$\r$\npour installer$(^Name)." LangString UnReallyRemoveLabel "${LYX_LANG}" "Êtes vous sûr(e) de vouloir supprimer complètement $(^Name) et tous ses composants ?" diff --git a/development/Win32/packaging/installer/lyx_languages/german.nsh b/development/Win32/packaging/installer/lyx_languages/german.nsh index 246cf56e54..38c4a90d5c 100644 --- a/development/Win32/packaging/installer/lyx_languages/german.nsh +++ b/development/Win32/packaging/installer/lyx_languages/german.nsh @@ -18,6 +18,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Vern 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 CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Konnte das Konfigurationsskript nicht ausführen." LangString FinishPageMessage "${LYX_LANG}" "Glückwunsch! LyX wurde erfolgreich installiert." @@ -71,6 +72,9 @@ LangString SummaryTitle "${LYX_LANG}" "Software Zusammenfassung" LangString SummaryPleaseInstall "${LYX_LANG}" "Bitte installieren sie die heruntergeladenen Programme und starten dann ${PRODUCT_NAME}'s Installer nochmal." LangString SummaryPathPrefix "${LYX_LANG}" "Die Liste mit den Programmpfaden, der so genannte 'path_prefix' wird zur Datei 'lyxrc.defaults' hinzugefügt:" +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + LangString UnNotInRegistryLabel "${LYX_LANG}" "Kann $(^Name) nicht in der Registry finden. $\r$\n Desktopsymbole und Einträge im Startmenü können nicht entfernt werden." LangString UnNotAdminLabel "${LYX_LANG}" "Sie benötigen Administratorrechte $\r$\n um $(^Name) zu deinstallieren." LangString UnReallyRemoveLabel "${LYX_LANG}" "Sind Sie sicher, dass sie $(^Name) und all seine Komponenten deinstalliern möchten?" diff --git a/development/Win32/packaging/installer/lyx_languages/italian.nsh b/development/Win32/packaging/installer/lyx_languages/italian.nsh new file mode 100644 index 0000000000..0e2069ab78 --- /dev/null +++ b/development/Win32/packaging/installer/lyx_languages/italian.nsh @@ -0,0 +1,85 @@ +!ifndef _LYX_LANGUAGES_ITALIAN_NSH_ +!define _LYX_LANGUAGES_ITALIAN_NSH_ + +!ifdef LYX_LANG + !undef LYX_LANG +!endif +!define LYX_LANG ${LANG_ITALIAN} + +LicenseLangString LyXLicenseData ${LYX_LANG} "${PRODUCT_LICENSE_FILE}" + +LangString SecAllUsersTitle "${LYX_LANG}" "Installazione per tutti gli utenti?" +LangString SecFileAssocTitle "${LYX_LANG}" "Associazioni dei file" +LangString SecDesktopTitle "${LYX_LANG}" "Icona sul Desktop" + +LangString SecCoreDescription "${LYX_LANG}" "I file di ${PRODUCT_NAME}." +LangString SecAllUsersDescription "${LYX_LANG}" "Installazione per tutti gli utenti o solo per l'utente attuale. (Sono richiesti privilegi da amministratore.)" +LangString SecFileAssocDescription "${LYX_LANG}" "Crea le associazioni tra il programma e le estensioni .lyx." +LangString SecDesktopDescription "${LYX_LANG}" "Icona ${PRODUCT_NAME} sul desktop." + +LangString ModifyingConfigureFailed "${LYX_LANG}" "Fallito tentativo di aggiornare 'path_prefix' nello script di configurazione" +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" +LangString RunConfigureFailed "${LYX_LANG}" "Fallito tentativo di eseguire lo script di configurazione" + +LangString FinishPageMessage "${LYX_LANG}" "Congratulazioni! LyX è stato installato con successo." +LangString FinishPageRun "${LYX_LANG}" "Lancia LyX" + +LangString DownloadPageField2 "${LYX_LANG}" "&Non installare" + +LangString MinSYSHeader "${LYX_LANG}" "MinSYS" +LangString MinSYSDescription "${LYX_LANG}" "MinSYS fornisce un ambiente unix minimale (www.mingw.org/msys.shtml) richiesto da ${PRODUCT_NAME} per far girare un certo numero di file script." +LangString EnterMinSYSFolder "${LYX_LANG}" "Inserite il percorso alla cartella contenente sh.exe" +LangString InvalidMinSYSFolder "${LYX_LANG}" "Non riesco a trovare sh.exe" +LangString MinSYSDownloadLabel "${LYX_LANG}" "&Scarica MinSYS" +LangString MinSYSFolderLabel "${LYX_LANG}" "&Cartella contenente sh.exe" + +LangString PythonHeader "${LYX_LANG}" "Python" +LangString PythonDescription "${LYX_LANG}" "L'interprete Python (www.python.org) deve essere installato, altrimenti ${PRODUCT_NAME} non sarà in grado di far girare un certo numero di file script." +LangString EnterPythonFolder "${LYX_LANG}" "Inserite il percorso alla cartella contenente Python.exe" +LangString InvalidPythonFolder "${LYX_LANG}" "Non riesco a trovare Python.exe" +LangString PythonDownloadLabel "${LYX_LANG}" "&carica Python" +LangString PythonFolderLabel "${LYX_LANG}" "&Cartella contenente Python.exe" + +LangString MiKTeXHeader "${LYX_LANG}" "MiKTeX" +LangString MiKTeXDescription "${LYX_LANG}" "MiKTeX (www.miktex.org) è un'aggiornata implementazione di TeX per Windows." +LangString EnterMiKTeXFolder "${LYX_LANG}" "Inserite il percorso alla cartella contenente latex.exe" +LangString InvalidMiKTeXFolder "${LYX_LANG}" "Non riesco a trovare latex.exe" +LangString MiKTeXDownloadLabel "${LYX_LANG}" "&Scarica MiKTeX" +LangString MiKTeXFolderLabel "${LYX_LANG}" "&Cartella contenente latex.exe" + +LangString PerlHeader "${LYX_LANG}" "Perl" +LangString PerlDescription "${LYX_LANG}" "Se volete usare reLyX per convertire documenti LaTeX nel formato LyX, dovete installare Perl (www.perl.com)." +LangString EnterPerlFolder "${LYX_LANG}" "Inserite il percorso alla cartella contenente Perl.exe" +LangString InvalidPerlFolder "${LYX_LANG}" "Non riesco a trovare Perl.exe" +LangString PerlDownloadLabel "${LYX_LANG}" "&Scarica Perl" +LangString PerlFolderLabel "${LYX_LANG}" "&Cartella contenente perl.exe" + +LangString ImageMagickHeader "${LYX_LANG}" "ImageMagick" +LangString ImageMagickDescription "${LYX_LANG}" "I programmi forniti da ImageMagick (www.imagemagick.org/script/index.php) vengono usati per convertire file grafici da un certo formato ad un qualsiasi altro formato." +LangString EnterImageMagickFolder "${LYX_LANG}" "Inserite il percorso alla cartella contenente convert.exe" +LangString InvalidImageMagickFolder "${LYX_LANG}" "Non riesco a trovare convert.exe" +LangString ImageMagickDownloadLabel "${LYX_LANG}" "&Scarica ImageMagick" +LangString ImageMagickFolderLabel "${LYX_LANG}" "&Cartella contenente convert.exe" + +LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript" +LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) viene usato per convertire immagini in/da PostScript." +LangString EnterGhostscriptFolder "${LYX_LANG}" "Inserite il percorso alla cartella contenente gswin32c.exe" +LangString InvalidGhostscriptFolder "${LYX_LANG}" "Non riesco a trovare gswin32c.exe" +LangString GhostscriptDownloadLabel "${LYX_LANG}" "&Scarica Ghostscript" +LangString GhostscriptFolderLabel "${LYX_LANG}" "&Cartella contenente gswin32c.exe" + +LangString SummaryTitle "${LYX_LANG}" "Sommario del software" +LangString SummaryPleaseInstall "${LYX_LANG}" "Siete pregati di installare i pacchetti scaricati e quindi lanciare nuovamente l'installazione di LyX." +LangString SummaryPathPrefix "${LYX_LANG}" "Verrà aggiunta una stringa 'path_prefix' al file 'lyxrc.defaults' contenente:" + +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + +LangString UnNotInRegistryLabel "${LYX_LANG}" "Non riesco a trovare $(^Name) nel registro$\r$\nI collegamenti sul desktop e nel menu Start non saranno rimossi." +LangString UnNotAdminLabel "${LYX_LANG}" "Spiacente! Occorrono privilegi da amministratore$\r$\nper disinstallare $(^Name)." +LangString UnReallyRemoveLabel "${LYX_LANG}" "Siete sicuri di voler rimuovere completamente $(^Name) e tutti i suoi componenti?" +LangString UnRemoveSuccessLabel "${LYX_LANG}" "$(^Name) è stato rimosso con successo dal computer." + +!undef LYX_LANG + +!endif ; _LYX_LANGUAGES_ITALIAN_NSH_ diff --git a/development/Win32/packaging/installer/lyx_languages/spanish.nsh b/development/Win32/packaging/installer/lyx_languages/spanish.nsh index 48ed626a68..bac01e1561 100644 --- a/development/Win32/packaging/installer/lyx_languages/spanish.nsh +++ b/development/Win32/packaging/installer/lyx_languages/spanish.nsh @@ -18,6 +18,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Asociar la extesi LangString SecDesktopDescription "${LYX_LANG}" "Crear un icono de ${PRODUCT_NAME} en el escritorio." LangString ModifyingConfigureFailed "${LYX_LANG}" "Error al intentar añadir 'path_prefix' durante la ejecución del programa de configuración" +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Error al intentar ejecutar el programa de configuración" LangString FinishPageMessage "${LYX_LANG}" "Enhorabuena! LyX ha sido instalado satisfactoriamente." @@ -71,6 +72,9 @@ LangString SummaryTitle "${LYX_LANG}" "Resumen de la instalaci LangString SummaryPleaseInstall "${LYX_LANG}" "Por favor, instale los programas descargados y vuelva a ejecutar el insralador de LyX una vez más." LangString SummaryPathPrefix "${LYX_LANG}" "Durante la instalación el siguiente 'path_prefix' se añadirá a 'lyxrc.defaults':" +LangString UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + LangString UnNotInRegistryLabel "${LYX_LANG}" "Imposible encontrar $(^Name) en el registro$\r$\nLos accesos rápidos del escritorio y del Menú de Inicio no serán eliminados." LangString UnNotAdminLabel "${LYX_LANG}" "Lo siento! Necesita privilegios de administrador$\r$\npara desinstalar $(^Name)." LangString UnReallyRemoveLabel "${LYX_LANG}" "¿Está seguro de que desea eliminar completamente $(^Name) y todos sus componentes?" diff --git a/development/Win32/packaging/installer/lyx_languages/swedish.nsh b/development/Win32/packaging/installer/lyx_languages/swedish.nsh index 32caeec375..00ad3ccae7 100644 --- a/development/Win32/packaging/installer/lyx_languages/swedish.nsh +++ b/development/Win32/packaging/installer/lyx_languages/swedish.nsh @@ -23,6 +23,7 @@ LangString SecFileAssocDescription "${LYX_LANG}" "Skapa en association mellan pr LangString SecDesktopDescription "${LYX_LANG}" "En ${PRODUCT_NAME}ikon på skrivbordet." LangString ModifyingConfigureFailed "${LYX_LANG}" "Misslyckades med att sätta 'path_prefix' i konfigurationsskriptet" +LangString CreateCmdFilesFailed "${LYX_LANG}" "Failed atempting to create lyx.cmd and reLyX.cmd" LangString RunConfigureFailed "${LYX_LANG}" "Misslyckades med att köra konfigurationsskriptet" LangString FinishPageMessage "${LYX_LANG}" "Gratulerar! LyX har installerats framgångsrikt." @@ -76,6 +77,9 @@ 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 UILangageTitle "${LYX_LANG}" "The language of LyX's interface" +LangString UILangageDescription "${LYX_LANG}" "As used for menus, messages, etc." + 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?" diff --git a/development/Win32/packaging/installer/lyx_utils.nsh b/development/Win32/packaging/installer/lyx_utils.nsh new file mode 100644 index 0000000000..84be2468ef --- /dev/null +++ b/development/Win32/packaging/installer/lyx_utils.nsh @@ -0,0 +1,152 @@ +;-------------------------------- + +!macro GetFileExtProg ProgPath AppExe Extension Subentry + + ReadRegStr ${AppExe} HKCU \ + +"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${Extension}\OpenWithList" \ + "${Subentry}" + ${if} ${AppExe} != "" + ReadRegStr ${ProgPath} HKLM \ + "Software\Microsoft\Windows\CurrentVersion\App Paths\${AppExe}" "Path" + ;remove the "\" at the end + StrCpy $0 ${ProgPath} "" -1 + ${if} $0 == "\" + StrCpy ${ProgPath} ${ProgPath} -1 + ${endif} + ${endif} + +!macroend + +;-------------------------------- + +!macro FileCheck Result FileName FilePath + Push $0 + Push $1 + StrCpy $0 "" + StrCpy $1 "" + + FileOpen $0 "${Filepath}\${FileName}" r + + ${if} $0 = "" + StrCpy $1 "False" + ${Else} + StrCpy $1 "True" + ${endif} + + FileClose $0 + StrCpy ${Result} $1 + + Pop $1 + Pop $0 +!macroend + + +!macro TranslateLangCode LangNme LangISOCode + + ${if} ${LangISOCode} = 1030 + StrCpy ${LangNme} "Dansk" + ${endif} + + ${if} ${LangISOCode} = 1031 + StrCpy ${LangNme} "Deutsch" + ${endif} + + ${if} ${LangISOCode} = 1033 + StrCpy ${LangNme} "English" + ${endif} + + ${if} ${LangISOCode} = 1034 + StrCpy ${LangNme} "Español" + ${endif} + + ${if} ${LangISOCode} = 1036 + StrCpy ${LangNme} "Français" + ${endif} + + ${if} ${LangISOCode} = 1040 + StrCpy ${LangNme} "Italiano" + ${endif} + + ${if} ${LangISOCode} = 1043 + StrCpy ${LangNme} "Nederlands" + ${endif} + + ${if} ${LangISOCode} = 1053 + StrCpy ${LangNme} "Svenska" + ${endif} + +!macroend + + +!macro GetLangCode LangCde Name + + ${if} ${Name} == "Dansk" + StrCpy ${LangCde} "da_DK" + ${endif} + + ${if} ${Name} == "Deutsch" + StrCpy ${LangCde} "de_DE" + ${endif} + + ${if} ${Name} == "English" + StrCpy ${LangCde} "en_EN" + ${endif} + + ${if} ${Name} == "Español" + StrCpy ${LangCde} "es_ES" + ${endif} + + ${if} ${Name} == "Euskara" + StrCpy ${LangCde} "eu_EU" + ${endif} + + ${if} ${Name} == "Français" + StrCpy ${LangCde} "fr_FR" + ${endif} + + ${if} ${Name} == "Italiano" + StrCpy ${LangCde} "it_IT" + ${endif} + + ${if} ${Name} == "Nederlands" + StrCpy ${LangCde} "nl_NL" + ${endif} + + ${if} ${Name} == "Norsk" + StrCpy ${LangCde} "no_NO" + ${endif} + + ${if} ${Name} == "Nynorsk" + StrCpy ${LangCde} "no_NY" + ${endif} + + ${if} ${Name} == "Polski" + StrCpy ${LangCde} "pl_PL" + ${endif} + + ${if} ${Name} == "Româna" + StrCpy ${LangCde} "ro_RO" + ${endif} + + ${if} ${Name} == "Russian" + StrCpy ${LangCde} "ru_RU" + ${endif} + + ${if} ${Name} == "Slovenský" + StrCpy ${LangCde} "sk_SK" + ${endif} + + ${if} ${Name} == "Slovenšcina" + StrCpy ${LangCde} "sl_SI" + ${endif} + + ${if} ${Name} == "Suomi" + StrCpy ${LangCde} "fi_FI" + ${endif} + + ${if} ${Name} == "Türkçe" + StrCpy ${LangCde} "tr_TR" + ${endif} + +!macroend diff --git a/development/Win32/packaging/package_lyxwin.sh b/development/Win32/packaging/package_lyxwin.sh index 7e0c2e3f20..e8ec1cbd40 100644 --- a/development/Win32/packaging/package_lyxwin.sh +++ b/development/Win32/packaging/package_lyxwin.sh @@ -33,7 +33,7 @@ DTL_DIR=dtl DT2DV="$DTL_DIR/dt2dv.exe" DV2DT="$DTL_DIR/dv2dt.exe" -LYX_INSTALL_DIR="/j/Programs/LyX" +LYX_INSTALL_DIR="../../../build/installprefix" # Change this to 'mv -f' when you are confident that # the various sed scripts are working correctly.