summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scp2/source/gnome/module_gnome.scp2
-rw-r--r--solenv/bin/make_installer.pl2
-rw-r--r--solenv/bin/modules/installer/download.pm8
-rw-r--r--solenv/bin/modules/installer/logger.pm24
-rw-r--r--solenv/bin/modules/installer/parameter.pm3
-rw-r--r--solenv/bin/modules/installer/scriptitems.pm82
-rw-r--r--solenv/bin/modules/installer/setupscript.pm40
-rw-r--r--solenv/bin/modules/installer/simplepackage.pm7
-rw-r--r--solenv/bin/modules/installer/systemactions.pm2
-rw-r--r--solenv/config/sdev300.ini8
10 files changed, 136 insertions, 42 deletions
diff --git a/scp2/source/gnome/module_gnome.scp b/scp2/source/gnome/module_gnome.scp
index 4c58635690af..739609ce74bd 100644
--- a/scp2/source/gnome/module_gnome.scp
+++ b/scp2/source/gnome/module_gnome.scp
@@ -44,7 +44,7 @@ Module gid_Module_Optional_Gnome
Default = YES;
PackageInfo = "packinfo_office.txt";
MOD_NAME_DESC(MODULE_OPTIONAL_GNOME);
-#ifdef LINUX
+#ifdef UNX
Styles = ();
#else
Styles = (DONTSHOWINUSERINSTALL);
diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index 932388bec809..8d1dbed78b97 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -384,7 +384,7 @@ if ( $installer::globals::globallogging ) { installer::files::save_file($logging
installer::setupscript::resolve_lowercase_productname_setupscriptvariable($allscriptvariablesref);
if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscriptvariables3.log" ,$allscriptvariablesref); }
-installer::setupscript::replace_all_setupscriptvariables_in_script($setupscriptref, $allscriptvariablesref);
+$setupscriptref = installer::setupscript::replace_all_setupscriptvariables_in_script($setupscriptref, $allscriptvariablesref);
if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscript2.log" ,$setupscriptref); }
# Adding all variables defined in the installation object into the hash of all variables.
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index 3780bed95052..70802b6bc582 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -1045,7 +1045,6 @@ sub nsis_language_converter
elsif ( $language eq "zh-CN" ) { $nsislanguage = "SimpChinese"; }
elsif ( $language eq "zh-TW" ) { $nsislanguage = "TradChinese"; }
else {
-
my $infoline = "NSIS language_converter : Could not find nsis language for $language!\n";
push( @installer::globals::logfileinfo, $infoline);
$nsislanguage = "English";
@@ -1356,6 +1355,8 @@ sub copy_and_translate_nsis_language_files
my $nlffilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Language\ files" . $installer::globals::separator;
my $nshfilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Modern\ UI" . $installer::globals::separator . "Language files" . $installer::globals::separator;
+ my $infoline = "";
+
for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
{
my $onelanguage = ${$languagesarrayref}[$i];
@@ -1390,6 +1391,8 @@ sub copy_and_translate_nsis_language_files
if ( $installer::globals::unicodensis )
{
+ $infoline = "This is Unicode NSIS!\n";
+ push( @installer::globals::logfileinfo, $infoline);
convert_utf16_to_utf8($nshfilename);
convert_utf16_to_utf8($nlffilename);
$nshfile = installer::files::read_file($nshfilename); # read nsh file again
@@ -1604,6 +1607,9 @@ sub get_translation_file
my $translationfile = installer::files::read_file($translationfilename);
replace_variables($translationfile, $allvariableshashref);
+ my $infoline = "Reading translation file: $translationfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
return $translationfile;
}
diff --git a/solenv/bin/modules/installer/logger.pm b/solenv/bin/modules/installer/logger.pm
index 299347d6c9ca..26d0b6313743 100644
--- a/solenv/bin/modules/installer/logger.pm
+++ b/solenv/bin/modules/installer/logger.pm
@@ -59,6 +59,30 @@ sub include_header_into_logfile
}
####################################################
+# Including header files into the logfile
+####################################################
+
+sub include_header_into_globallogfile
+{
+ my ($message) = @_;
+
+ my $infoline;
+
+ $infoline = "\n" . get_time_string();
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "######################################################\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "$message\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+
+ $infoline = "######################################################\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+}
+
+####################################################
# Write timestamp into log file
####################################################
diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm
index 9c90735c7d6b..68cc6a4cddcb 100644
--- a/solenv/bin/modules/installer/parameter.pm
+++ b/solenv/bin/modules/installer/parameter.pm
@@ -415,10 +415,11 @@ sub setglobalvariables
# setting and creating the temppath
- if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ))
+ if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ) || ( $ENV{'TMPDIR'} ))
{
if ( $ENV{'TMP'} ) { $installer::globals::temppath = $ENV{'TMP'}; }
elsif ( $ENV{'TEMP'} ) { $installer::globals::temppath = $ENV{'TEMP'}; }
+ elsif ( $ENV{'TMPDIR'} ) { $installer::globals::temppath = $ENV{'TMPDIR'}; }
$installer::globals::temppath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
$installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . $installer::globals::globaltempdirname;
installer::systemactions::create_directory_with_privileges($installer::globals::temppath, "777");
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
index a6f99124305e..d02f91a62dcc 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -2351,13 +2351,60 @@ sub resolve_links_with_flag_relative
}
########################################################################
+# This function is a helper of function "assigning_modules_to_items"
+########################################################################
+
+sub insert_for_item ($$$)
+{
+ my ($hash, $item, $id) = @_;
+
+ # print STDERR "insert '$id' for '$item'\n";
+ if (!defined $hash->{$item})
+ {
+ my @gids = ();
+ $hash->{$item} = \@gids;
+ }
+ my $gid_list = $hash->{$item};
+ push @{$gid_list}, $id;
+ $hash->{$item} = $gid_list;
+}
+
+sub build_modulegids_table
+{
+ my ($modulesref, $itemname) = @_;
+
+ my %module_lookup_table = ();
+
+ # build map of item names to list of respective module gids
+ # containing these items
+ for my $onemodule (@{$modulesref})
+ {
+ next if ( ! defined $onemodule->{$itemname} );
+ # these are the items contained in this module
+ # eg. Files = (gid_a_b_c,gid_d_e_f)
+ my $module_gids = $onemodule->{$itemname};
+
+ # prune outer brackets
+ $module_gids =~ s|^\s*\(||g;
+ $module_gids =~ s|\)\s*$||g;
+ for my $id (split (/,/, $module_gids))
+ {
+ chomp $id;
+ insert_for_item(\%module_lookup_table, lc ($id), $onemodule->{'gid'});
+ }
+ }
+
+ return \%module_lookup_table;
+}
+
+########################################################################
# Items like files do not know their modules
# This function is a helper of function "assigning_modules_to_items"
########################################################################
sub get_string_of_modulegids_for_itemgid
{
- my ($modulesref, $itemgid, $itemname) = @_;
+ my ($module_lookup_table, $modulesref, $itemgid, $itemname) = @_;
if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_string_of_modulegids_for_itemgid : $#{$modulesref} : $itemgid : $itemname"); }
@@ -2365,22 +2412,16 @@ sub get_string_of_modulegids_for_itemgid
my $haslanguagemodule = 0;
my %foundmodules = ();
- for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
- {
- my $onemodule = ${$modulesref}[$i];
- my $allitems = "";
-
- if ( $onemodule->{$itemname} ) { $allitems = $onemodule->{$itemname}; }
+ # print STDERR "lookup '" . lc($itemgid) . "'\n";
+ my $gid_list = $module_lookup_table->{lc($itemgid)};
- if ( $allitems =~ /\b$itemgid\b/i )
- {
- $allmodules = $allmodules . "," . $onemodule->{'gid'};
- $foundmodules{$onemodule->{'gid'}} = 1;
-
- # Is this module a language module? This info should be stored at the file.
- if ( exists($installer::globals::alllangmodules{$onemodule->{'gid'}}) ) { $haslanguagemodule = 1; }
- }
- }
+ for my $gid (@{$gid_list})
+ {
+ $foundmodules{$gid} = 1;
+ $allmodules = $allmodules . "," . $gid;
+ # Is this module a language module? This info should be stored at the file.
+ if ( exists($installer::globals::alllangmodules{$gid}) ) { $haslanguagemodule = 1; }
+ }
$allmodules =~ s/^\s*\,//; # removing leading comma
@@ -2391,6 +2432,8 @@ sub get_string_of_modulegids_for_itemgid
if ( ! $isreallylanguagemodule ) { installer::exiter::exit_program("ERROR: \"$itemgid\" is assigned to modules with flag \"LANGUAGEMODULE\" and also to modules without this flag! Modules: $allmodules", "get_string_of_modulegids_for_itemgid"); }
}
+ # print STDERR "get_string_for_itemgid ($itemgid, $itemname) => $allmodules, $haslanguagemodule\n";
+
return ($allmodules, $haslanguagemodule);
}
@@ -2409,9 +2452,10 @@ sub assigning_modules_to_items
my $languageassignmenterror = 0;
my @languageassignmenterrors = ();
- for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ my $module_lookup_table = build_modulegids_table($modulesref, $itemname);
+
+ for my $oneitem (@{$itemsref})
{
- my $oneitem = ${$itemsref}[$i];
my $itemgid = $oneitem->{'gid'};
my $styles = "";
@@ -2425,7 +2469,7 @@ sub assigning_modules_to_items
# every item can belong to many modules
- my ($modulegids, $haslanguagemodule) = get_string_of_modulegids_for_itemgid($modulesref, $itemgid, $itemname);
+ my ($modulegids, $haslanguagemodule) = get_string_of_modulegids_for_itemgid($module_lookup_table, $modulesref, $itemgid, $itemname);
if ($modulegids eq "")
{
diff --git a/solenv/bin/modules/installer/setupscript.pm b/solenv/bin/modules/installer/setupscript.pm
index c62322c4b4aa..a131d32b21c0 100644
--- a/solenv/bin/modules/installer/setupscript.pm
+++ b/solenv/bin/modules/installer/setupscript.pm
@@ -34,6 +34,7 @@ package installer::setupscript;
use installer::existence;
use installer::exiter;
use installer::globals;
+use installer::logger;
use installer::remover;
use installer::scriptitems;
use installer::ziplist;
@@ -236,6 +237,8 @@ sub replace_all_setupscriptvariables_in_script
{
my ( $scriptref, $variablesref ) = @_;
+ installer::logger::include_header_into_globallogfile("Replacing variables in setup script (start)");
+
# make hash of variables to be substituted if they appear in the script
my %subs;
for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
@@ -248,22 +251,37 @@ sub replace_all_setupscriptvariables_in_script
}
}
- for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
+ # This is far faster than running a regexp for each line
+ my $bigstring = '';
+ for my $line (@{$scriptref}) { $bigstring = $bigstring . $line; }
+
+ foreach my $key ( keys %subs )
{
- my $line = ${$scriptref}[$i];
+ # Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
+ my $value = $subs{$key};
+ $bigstring =~ s/$key/$value/g;
+ }
- if ( $line =~ /^.*\%\w+.*$/ ) # only oif "%" occurs
- {
- # Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
+ my @newlines = split /\n/, $bigstring;
+ $scriptref = \@newlines;
- foreach my $key ( keys %subs )
- {
- my $value = $subs{$key};
- $line =~ s/$key/$value/g;
- ${$scriptref}[$i] = $line;
- }
+ # now check for any mis-named '%' variables that we have left
+ my $num = 0;
+ for my $check (@newlines)
+ {
+ $num++;
+ if ( $check =~ /^.*\%\w+.*$/ )
+ {
+ if (( $check =~ /%1/ ) || ( $check =~ /%2/ ) || ( $check =~ /%verify/ )) { next; }
+ my $infoline = "WARNING: mis-named or un-known '%' variable in setup script at line $num:\n$check\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ # print STDERR "Warning: mis-named or un-known '%' variable at line $num:\n$check\n";
}
}
+
+ installer::logger::include_header_into_globallogfile("Replacing variables in setup script (end)");
+
+ return $scriptref;
}
#######################################################################
diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
index 2ee21c46631e..d567ac8e61ab 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -69,7 +69,7 @@ sub check_simple_packager_project
sub register_extensions
{
- my ($officedir) = @_;
+ my ($officedir, $languagestringref) = @_;
my $programdir = $officedir . $installer::globals::separator;
# if ( $installer::globals::sundirhostname ne "" ) { $programdir = $programdir . $installer::globals::sundirhostname . $installer::globals::separator; }
@@ -110,7 +110,8 @@ sub register_extensions
if ( ! -f $unopkgfile ) { installer::exiter::exit_program("ERROR: $unopkgfile not found!", "register_extensions"); }
if ( ! -f $oneextension ) { installer::exiter::exit_program("ERROR: $oneextension not found!", "register_extensions"); }
- my $localtemppath = $installer::globals::temppath;
+ my $localtemppath = installer::systemactions::create_directories("uno", $languagestringref);
+
if ( $installer::globals::iswindowsbuild )
{
if (( $^O =~ /cygwin/i ) && ( $ENV{'USE_SHELL'} ne "4nt" ))
@@ -398,7 +399,7 @@ sub create_simple_package
installer::logger::print_message( "... registering extensions ...\n" );
installer::logger::include_header_into_logfile("Registering extensions:");
- register_extensions($subfolderdir);
+ register_extensions($subfolderdir, $languagestringref);
# Adding scpactions for mac installations sets, that use not dmg format. Without scpactions the
# office does not start.
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index eea60d2118d8..16cd938c6280 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -324,7 +324,7 @@ sub create_directories
my $path = "";
- if (( $newdirectory eq "zip" ) || ( $newdirectory eq "cab" ) || ( $newdirectory =~ /rdb\s*$/i )) # special handling for zip files, cab files and services file because of performance reasons
+ if (( $newdirectory eq "uno" ) || ( $newdirectory eq "zip" ) || ( $newdirectory eq "cab" ) || ( $newdirectory =~ /rdb\s*$/i )) # special handling for zip files, cab files and services file because of performance reasons
{
if ( $installer::globals::temppathdefined ) { $path = $installer::globals::temppath; }
else { $path = $installer::globals::unpackpath; }
diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini
index 7a78f2da078d..fab2f806c858 100644
--- a/solenv/config/sdev300.ini
+++ b/solenv/config/sdev300.ini
@@ -2797,7 +2797,7 @@ wntgcci1
COMPATH %SOLAR_ENV_ROOT%$/MinGW
# FSDK %SOLAR_ENV_ROOT%$/msvc7net$/FrameworkSDK
DEVROOT %SOLAR_ENV_ROOT%
- NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_237_unicode
+ NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_242_unicode
PERL %SOLAR_ENV_ROOT%$/btw$/perl$/bin$/perl
PKGFORMAT some_dummy
PSDK %SOLAR_ENV_ROOT%$/MinGW$/w32api
@@ -3470,8 +3470,8 @@ wntmsci12
DEVROOT %SOLAR_ENV_ROOT%
DSDK %SOLAR_ENV_ROOT%\msvc9p\DirectXSDK
FSDK %SOLAR_ENV_ROOT%\msvc9p\Sdk\v3.5
- F20SDK %SOLAR_ENV_ROOT%\msvc9p\Sdk\v2.0
- NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_237_unicode
+ F20SDK %SOLAR_ENV_ROOT%\msvc9p\Sdk\v2.0
+ NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_242_unicode
PERL %SOLAR_ENV_ROOT%\btw\perl\bin\perl
PSDK %SOLAR_ENV_ROOT%\msvc9p\PlatformSDK\V6.1
SHARED_COM_SDK_PATH %SOLAR_ENV_ROOT%\msvc9p\Common7\ide
@@ -3868,7 +3868,7 @@ wntmsci13
DEVROOT %SOLAR_ENV_ROOT%
DSDK %SOLAR_ENV_ROOT%$/msvc9p$/DirectXSDK
FSDK %SOLAR_ENV_ROOT%$/msvc9p$/Sdk$/v3.5
- NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_237_unicode
+ NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_242_unicode
PERL $/usr$/bin$/perl
PSDK %SOLAR_ENV_ROOT%$/msvc9p$/PlatformSDK$/V6.1
SHARED_COM_SDK_PATH %SOLAR_ENV_ROOT%$/msvc9p$/Common7$/ide