You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2016/10/21 14:30:15 UTC
svn commit: r1766031 - in /openoffice/trunk: ./ main/
main/setup_native/source/win32/nsis/ main/solenv/bin/modules/installer/
Author: arielch
Date: Fri Oct 21 14:30:14 2016
New Revision: 1766031
URL: http://svn.apache.org/viewvc?rev=1766031&view=rev
Log:
i127100 - Build Windows installer with NSIS >= 3.0
Modified:
openoffice/trunk/ (props changed)
openoffice/trunk/main/configure.ac
openoffice/trunk/main/setup_native/source/win32/nsis/downloadtemplate.nsi
openoffice/trunk/main/solenv/bin/modules/installer/download.pm
openoffice/trunk/main/solenv/bin/modules/installer/globals.pm
openoffice/trunk/main/solenv/bin/modules/installer/simplepackage.pm
Propchange: openoffice/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 21 14:30:14 2016
@@ -1,7 +1,7 @@
/incubator/ooo/branches/gbuild:1409313-1413470
/openoffice/branches/AOO400:1503684
/openoffice/branches/AOO410:1572480,1573601,1583349,1583635,1583666
-/openoffice/branches/AOO413:1760628
+/openoffice/branches/AOO413:1760628-1760629
/openoffice/branches/alg_writerframes:1556289-1579189
/openoffice/branches/gbuild:1413471
/openoffice/branches/gbuild-reintegration:1731503-1755453
Modified: openoffice/trunk/main/configure.ac
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/configure.ac?rev=1766031&r1=1766030&r2=1766031&view=diff
==============================================================================
--- openoffice/trunk/main/configure.ac (original)
+++ openoffice/trunk/main/configure.ac Fri Oct 21 14:30:14 2016
@@ -5429,6 +5429,23 @@ if test "$_os" = "WINNT" ; then
NSIS_PATH=`cygpath -d "$NSIS_PATH"`
NSIS_PATH=`cygpath -u "$NSIS_PATH"`
AC_MSG_RESULT([found ($NSIS_PATH)])
+ AC_MSG_CHECKING([whether NSIS version is >= 3.*])
+ nsis_version_string=`"$NSIS_PATH/makensis.exe" /VERSION | $SED -e s/^v//i`
+ nsis_version_major=`echo $nsis_version_string | cut -d. -f1`
+ nsis_version_minor=`echo $nsis_version_string | cut -d. -f2`
+ if test "$nsis_version_major" -ge "3"; then
+ AC_MSG_RESULT([found NSIS $nsis_version_major.$nsis_version_minor >= 3.*])
+ AC_MSG_CHECKING([whether NSIS was compiled with Unicode support])
+ if echo `"$NSIS_PATH/makensis.exe" /HDRINFO` | $EGREP "\bNSIS_UNICODE_MAKENSIS\b" 2>&1 >/dev/null; then
+ AC_MSG_RESULT([NSIS version compiled with Unicode support.])
+ else
+ NSIS_PATH=""
+ AC_MSG_WARN([NSIS version compiled without Unicode support, no self contained installer will be build.])
+ fi
+ else
+ NSIS_PATH=""
+ AC_MSG_WARN([NSIS version found is < 3.*, no self contained installer will be build.])
+ fi
fi
fi
AC_SUBST(NSIS_PATH)
Modified: openoffice/trunk/main/setup_native/source/win32/nsis/downloadtemplate.nsi
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/setup_native/source/win32/nsis/downloadtemplate.nsi?rev=1766031&r1=1766030&r2=1766031&view=diff
==============================================================================
--- openoffice/trunk/main/setup_native/source/win32/nsis/downloadtemplate.nsi (original)
+++ openoffice/trunk/main/setup_native/source/win32/nsis/downloadtemplate.nsi Fri Oct 21 14:30:14 2016
@@ -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
Modified: openoffice/trunk/main/solenv/bin/modules/installer/download.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/download.pm?rev=1766031&r1=1766030&r2=1766031&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/download.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/download.pm Fri Oct 21 14:30:14 2016
@@ -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
##################################################################
@@ -1108,9 +1069,7 @@ sub put_windows_productpath_into_templat
if (length($locallangs) > $installer::globals::max_lang_length) { $locallangs = "multi lingual"; }
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);
}
@@ -1411,12 +1370,6 @@ sub get_language_string_from_language_bl
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++ )
{
@@ -1609,17 +1562,9 @@ sub copy_and_translate_nsis_language_fil
installer::systemactions::copy_one_file($sourcepath, $nshfilename);
# Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN -> MUI_LANGUAGEFILE_PACK_BEGIN
- 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
- }
-
+ convert_utf16_to_utf8($nshfilename);
+ convert_utf16_to_utf8($nlffilename);
+ my $nshfile = installer::files::read_file($nshfilename);
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_fil
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);
Modified: openoffice/trunk/main/solenv/bin/modules/installer/globals.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/globals.pm?rev=1766031&r1=1766030&r2=1766031&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/globals.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/globals.pm Fri Oct 21 14:30:14 2016
@@ -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 = ();
Modified: openoffice/trunk/main/solenv/bin/modules/installer/simplepackage.pm
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/bin/modules/installer/simplepackage.pm?rev=1766031&r1=1766030&r2=1766031&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/bin/modules/installer/simplepackage.pm (original)
+++ openoffice/trunk/main/solenv/bin/modules/installer/simplepackage.pm Fri Oct 21 14:30:14 2016
@@ -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);