[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - setup_native/source solenv/bin

Ariel Constenla-Haile arielch at apache.org
Fri Oct 21 16:42:47 UTC 2016


 setup_native/source/win32/customactions/shellextensions/registerextensions.cxx |    2 
 setup_native/source/win32/nsis/downloadtemplate.nsi                            |   94 +++---
 solenv/bin/modules/installer/download.pm                                       |  136 ----------
 solenv/bin/modules/installer/globals.pm                                        |    3 
 solenv/bin/modules/installer/simplepackage.pm                                  |    3 
 5 files changed, 48 insertions(+), 190 deletions(-)

New commits:
commit ff2631c08ee4ab17d99836c5d1b83c65123a601a
Author: Ariel Constenla-Haile <arielch at apache.org>
Date:   Fri Oct 21 14:30:14 2016 +0000

    i127100 - Build Windows installer with NSIS >= 3.0

diff --git a/setup_native/source/win32/nsis/downloadtemplate.nsi b/setup_native/source/win32/nsis/downloadtemplate.nsi
index d755dfb..79d4d7a 100644
--- a/setup_native/source/win32/nsis/downloadtemplate.nsi
+++ b/setup_native/source/win32/nsis/downloadtemplate.nsi
@@ -3,6 +3,9 @@
 !define PRODUCT_PUBLISHER "PUBLISHERPLACEHOLDER"
 !define PRODUCT_WEB_SITE "WEBSITEPLACEHOLDER"
 
+; Enable Unicode
+Unicode true
+
 ; SetCompressor lzma
 SetCompressor zlib
 
@@ -212,59 +215,44 @@ FunctionEnd
 !insertmacro MUI_PAGE_DIRECTORY
 !insertmacro MUI_PAGE_INSTFILES
 
-#231#!macro MUI_LANGUAGE_PACK LANGUAGE
-#231#  !verbose push
-#231#  !verbose ${MUI_VERBOSE}
-#231#  !insertmacro MUI_INSERT
-#231#  LoadLanguageFile "NSISPATHPLACEHOLDER\${LANGUAGE}_pack.nlf"
-#231#  ;Set default language file for MUI and backup user setting
-#231#  !ifdef LANGFILE_DEFAULT
-#231#    !define MUI_LANGFILE_DEFAULT_TEMP "${LANGFILE_DEFAULT}"
-#231#    !undef LANGFILE_DEFAULT
-#231#  !endif
-#231#  !define LANGFILE_DEFAULT "${NSISDIR}\Contrib\Language files\English.nsh"
-#231#  ;Include language file
-#231#  !insertmacro LANGFILE_INCLUDE "NSISPATHPLACEHOLDER\${LANGUAGE}_pack.nsh"
-#231#  ;Restore user setting for default language file
-#231#  !undef LANGFILE_DEFAULT
-#231#  !ifdef MUI_LANGFILE_DEFAULT_TEMP
-#231#    !define LANGFILE_DEFAULT "${MUI_LANGFILE_DEFAULT}"
-#231#  !endif
-#231#  ;Add language to list of languages for selection dialog  
-#231#  !ifndef MUI_LANGDLL_LANGUAGES
-#231#   !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' "
-#231#    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' "
-#231#  !else
-#231#    !ifdef MUI_LANGDLL_LANGUAGES_TEMP
-#231#      !undef MUI_LANGDLL_LANGUAGES_TEMP
-#231#    !endif
-#231#    !define MUI_LANGDLL_LANGUAGES_TEMP "${MUI_LANGDLL_LANGUAGES}"
-#231#    !undef MUI_LANGDLL_LANGUAGES
-#231#	!ifdef MUI_LANGDLL_LANGUAGES_CP_TEMP
-#231#      !undef MUI_LANGDLL_LANGUAGES_CP_TEMP
-#231#    !endif
-#231#    !define MUI_LANGDLL_LANGUAGES_CP_TEMP "${MUI_LANGDLL_LANGUAGES_CP}"
-#231#    !undef MUI_LANGDLL_LANGUAGES_CP
-#231#    !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' ${MUI_LANGDLL_LANGUAGES_TEMP}"
-#231#    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' ${MUI_LANGDLL_LANGUAGES_CP_TEMP}"
-#231#  !endif
-#231#  !verbose pop
-#231#!macroend
-
-#204#!macro MUI_LANGUAGE_PACK LANGUAGE
-#204#  !verbose push
-#204#  !verbose ${MUI_VERBOSE}
-#204#  !include "NSISPATHPLACEHOLDER\${LANGUAGE}_pack.nsh"
-#204#  !verbose pop
-#204#!macroend
-
-#204#!macro MUI_LANGUAGEFILE_PACK_BEGIN LANGUAGE
-#204#  !ifndef MUI_INSERT
-#204#    !define MUI_INSERT
-#204#    !insertmacro MUI_INSERT
-#204#  !endif
-#204#  LoadLanguageFile "NSISPATHPLACEHOLDER\${LANGUAGE}_pack.nlf"
-#204#!macroend
+!macro MUI_LANGUAGE_PACK LANGUAGE
+  !verbose push
+  !verbose ${MUI_VERBOSE}
+  !insertmacro MUI_INSERT
+  LoadLanguageFile "NSISPATHPLACEHOLDER\${LANGUAGE}_pack.nlf"
+  ;Set default language file for MUI and backup user setting
+  !ifdef LANGFILE_DEFAULT
+    !define MUI_LANGFILE_DEFAULT_TEMP "${LANGFILE_DEFAULT}"
+    !undef LANGFILE_DEFAULT
+  !endif
+  !define LANGFILE_DEFAULT "${NSISDIR}\Contrib\Language files\English.nsh"
+  ;Include language file
+  !insertmacro LANGFILE_INCLUDE "NSISPATHPLACEHOLDER\${LANGUAGE}_pack.nsh"
+  ;Restore user setting for default language file
+  !undef LANGFILE_DEFAULT
+  !ifdef MUI_LANGFILE_DEFAULT_TEMP
+    !define LANGFILE_DEFAULT "${MUI_LANGFILE_DEFAULT}"
+  !endif
+  ;Add language to list of languages for selection dialog  
+  !ifndef MUI_LANGDLL_LANGUAGES
+   !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' "
+    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' "
+  !else
+    !ifdef MUI_LANGDLL_LANGUAGES_TEMP
+      !undef MUI_LANGDLL_LANGUAGES_TEMP
+    !endif
+    !define MUI_LANGDLL_LANGUAGES_TEMP "${MUI_LANGDLL_LANGUAGES}"
+    !undef MUI_LANGDLL_LANGUAGES
+	!ifdef MUI_LANGDLL_LANGUAGES_CP_TEMP
+      !undef MUI_LANGDLL_LANGUAGES_CP_TEMP
+    !endif
+    !define MUI_LANGDLL_LANGUAGES_CP_TEMP "${MUI_LANGDLL_LANGUAGES_CP}"
+    !undef MUI_LANGDLL_LANGUAGES_CP
+    !define MUI_LANGDLL_LANGUAGES "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' ${MUI_LANGDLL_LANGUAGES_TEMP}"
+    !define MUI_LANGDLL_LANGUAGES_CP "'${LANGFILE_${LANGUAGE}_NAME}' '${LANG_${LANGUAGE}}' '${LANG_${LANGUAGE}_CP}' ${MUI_LANGDLL_LANGUAGES_CP_TEMP}"
+  !endif
+  !verbose pop
+!macroend
 
 ; Language files
 ALLLANGUAGESPLACEHOLDER
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index d373fca..f82db28 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -895,45 +895,6 @@ sub convert_to_unicode
 }
 
 ##################################################################
-# Windows: Setting nsis version is necessary because of small
-# changes in nsis from version 2.0.4 to 2.3.1
-##################################################################
-
-sub set_nsis_version
-{
-    my ($nshfile) = @_;
-
-    my $searchstring = "\$\{LangFileString\}"; # occurs only in nsis 2.3.1 or similar
-
-    for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
-    {
-        if ( ${$nshfile}[$i] =~ /\Q$searchstring\E/ )
-        {
-            # this is nsis 2.3.1 or similar
-            $installer::globals::nsis231 = 1;
-            $installer::globals::unicodensis = 0;
-            last;
-        }
-    }
-
-    # checking unicode version
-    $searchstring = convert_to_unicode($searchstring);
-
-    for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
-    {
-        if ( ${$nshfile}[$i] =~ /\Q$searchstring\E/ )
-        {
-            # this is nsis 2.3.1 or similar
-            $installer::globals::nsis231 = 1;
-            $installer::globals::unicodensis = 1;
-            last;
-        }
-    }
-
-    if ( ! $installer::globals::nsis231 ) { $installer::globals::nsis204 = 1; }
-}
-
-##################################################################
 # Windows: Including the product name into nsi template
 ##################################################################
 
@@ -1109,8 +1070,6 @@ sub put_windows_productpath_into_template
 
     if ( ! $installer::globals::languagepack ) { $productpath = $productpath . " (" . $locallangs . ")"; }
 
-    # if (( $installer::globals::languagepack ) && ( $installer::globals::unicodensis )) { $productpath = convert_textstring_to_utf16($productpath, $localnsisdir, "stringhelper.txt"); }
-
     replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER", $productpath);
 }
 
@@ -1412,12 +1371,6 @@ sub replace_identifier_in_nshfile
 {
     my ( $nshfile, $identifier, $newstring, $nshfilename, $onelanguage ) = @_;
 
-    if ( $installer::globals::nsis231 )
-    {
-        $newstring =~ s/\\r/\$\\r/g;    # \r -> $\r  in modern nsis versions
-        $newstring =~ s/\\n/\$\\n/g;    # \n -> $\n  in modern nsis versions
-    }
-
     for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
     {
         if ( ${$nshfile}[$i] =~ /\s+\Q$identifier\E\s+\"(.+)\"\s*$/ )
@@ -1609,17 +1562,9 @@ sub copy_and_translate_nsis_language_files
         installer::systemactions::copy_one_file($sourcepath, $nshfilename);
 
         # Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN -> MUI_LANGUAGEFILE_PACK_BEGIN
+        convert_utf16_to_utf8($nshfilename);
+        convert_utf16_to_utf8($nlffilename);
         my $nshfile = installer::files::read_file($nshfilename);
-        set_nsis_version($nshfile);
-
-        if ( $installer::globals::unicodensis )
-        {
-            $installer::logger::Lang->printf("This is Unicode NSIS!\n");
-            convert_utf16_to_utf8($nshfilename);
-            convert_utf16_to_utf8($nlffilename);
-            $nshfile = installer::files::read_file($nshfilename);   # read nsh file again
-        }
-
         replace_one_variable($nshfile, "MUI_LANGUAGEFILE_BEGIN", "MUI_LANGUAGEFILE_PACK_BEGIN");
 
         # find the ulf file for translation
@@ -1632,11 +1577,8 @@ sub copy_and_translate_nsis_language_files
         installer::files::save_file($nshfilename, $nshfile);
         installer::files::save_file($nlffilename, $nlffile);
 
-        if ( $installer::globals::unicodensis )
-        {
-            convert_utf8_to_utf16($nshfilename);
-            convert_utf8_to_utf16($nlffilename);
-        }
+        convert_utf8_to_utf16($nshfilename);
+        convert_utf8_to_utf16($nlffilename);
     }
 
 }
@@ -1666,83 +1608,20 @@ sub put_output_path_into_template
 }
 
 ##################################################################
-# Windows: Only allow specific code for nsis 2.0.4 or nsis 2.3.1
-##################################################################
-
-sub put_version_specific_code_into_template
-{
-    my ($templatefile) = @_;
-
-    my $subst204 = "";
-    my $subst231 = "";
-
-    if ( $installer::globals::nsis204 )
-    {
-        $subst231 = ";";
-    }
-    else
-    {
-        $subst204 = ";";
-    }
-
-    replace_one_variable($templatefile, "\#204\#", $subst204);
-    replace_one_variable($templatefile, "\#231\#", $subst231);
-}
-
-##################################################################
 # Windows: Finding the path to the nsis SDK
 ##################################################################
 
 sub get_path_to_nsis_sdk
 {
-    my $vol;
-    my $dir;
-    my $file;
     my $nsispath = "";
 
     if ( $ENV{'NSIS_PATH'} )
     {
         $nsispath = $ENV{'NSIS_PATH'};
     }
-    elsif ( $ENV{'SOLARROOT'} )
-    {
-        $nsispath = $ENV{'SOLARROOT'} . $installer::globals::separator . "NSIS";
-    }
-    else
-    {
-        # do we have nsis already in path ?
-        my @paths = split(/:/, $ENV{'PATH'});
-        foreach my $path (@paths)
-        {
-            $path =~ s/[\/\\]+$//; # remove trailing slashes;
-            $nsispath = $path . "/nsis";
-
-            if ( -x $nsispath )
-            {
-                $nsispath = $path;
-                last;
-            }
-            else
-            {
-                $nsispath = "";
-            }
-        }
-    }
-    if ( $ENV{'NSISSDK_SOURCE'} )
-    {
-        installer::logger::print_warning( "NSISSDK_SOURCE is deprecated. use NSIS_PATH instead.\n" );
-        $nsispath = $ENV{'NSISSDK_SOURCE'}; # overriding the NSIS SDK with NSISSDK_SOURCE
-    }
-
-#   if( ($^O =~ /cygwin/i) and $nsispath =~ /\\/ ) {
-#       # We need a POSIX path for W32-4nt-cygwin-perl
-#       $nsispath =~ s/\\/\\\\/g;
-#       chomp( $nsispath = qx{cygpath -u "$nsispath"} );
-#   }
-
     if ( $nsispath eq "" )
     {
-        $installer::logger::Info->print("... no Environment variable \"SOLARROOT\", \"NSIS_PATH\" or \"NSISSDK_SOURCE\" found and NSIS not found in path!\n");
+        $installer::logger::Info->print("... no Environment variable \"NSIS_PATH\"!\n");
     }
     elsif ( ! -d $nsispath )
     {
@@ -1833,9 +1712,7 @@ sub replace_variables
 sub get_translation_file
 {
     my ($allvariableshashref) = @_;
-    my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::nsisfilename;
-    if ( $installer::globals::unicodensis ) { $translationfilename = $translationfilename . ".uulf"; }
-    else { $translationfilename = $translationfilename . ".mlf"; }
+    my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::nsisfilename . ".uulf";
     if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_translation_file"); }
     my $translationfile = installer::files::read_file($translationfilename);
     replace_variables($translationfile, $allvariableshashref);
@@ -2071,7 +1948,6 @@ sub create_download_sets
         put_language_list_into_template($templatefile, $languagesarrayref);
         put_nsis_path_into_template($templatefile, $localnsisdir);
         put_output_path_into_template($templatefile, $downloaddir);
-        put_version_specific_code_into_template($templatefile);
 
         my $nsifilename = save_script_file($localnsisdir, $templatefilename, $templatefile);
 
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index a3b2851..83df651 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -447,9 +447,6 @@ BEGIN
     $msiassemblyfiles = "";
     $nsisfilename = "Nsis";
     $macinstallfilename = "macinstall.ulf";
-    $nsis204 = 0;
-    $nsis231 = 0;
-    $unicodensis = 0;
     $linuxlinkrpms = "";
     $extensioninstalldir = "gid_Dir_Share_Extension_Install";
     @languagenames = ();
diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
index 13e09cd..e6929192 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -173,9 +173,6 @@ sub register_extensions
 sub get_mac_translation_file
 {
     my $translationfilename = $installer::globals::maclangpackfilename;
-    # my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::maclangpackfilename;
-    # if ( $installer::globals::unicodensis ) { $translationfilename = $translationfilename . ".uulf"; }
-    # else { $translationfilename = $translationfilename . ".mlf"; }
     if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_mac_translation_file"); }
     my $translationfile = installer::files::read_file($translationfilename);
 
commit e44ff6cc12f316d1fa0218649126ecc3f7e1bae0
Author: Ariel Constenla-Haile <arielch at apache.org>
Date:   Fri Oct 21 14:15:10 2016 +0000

    i127107 - Quote module name in CreateProcess call

diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index bcd8a18..f2ff5df 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -327,7 +327,7 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
     if ( hFindUnopkg != INVALID_HANDLE_VALUE )
     {
         // unopkg.exe exists in program directory
-        std::_tstring sCommand = sUnoPkgFile + " sync";
+        std::_tstring sCommand = "\"" + sUnoPkgFile + "\" sync";
 
         DWORD exitCode = 0;
         bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode);


More information about the Libreoffice-commits mailing list