solenv/bin/modules/installer.pm | 2 -- solenv/bin/modules/installer/control.pm | 4 +++- solenv/bin/modules/installer/globals.pm | 2 +- solenv/bin/modules/installer/parameter.pm | 1 + solenv/bin/modules/installer/windows/msiglobal.pm | 21 ++++++++++++--------- 5 files changed, 17 insertions(+), 13 deletions(-)
New commits: commit 010f122f2269709ec4fc84ffbc7df4c2dfe56a16 Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Fri Apr 19 14:54:12 2024 +0200 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Wed Oct 2 19:34:24 2024 +0200 don't throw away command output when packaging installsets and adjust installer to work with MSWin-style perl (like strawberry perl) Change-Id: I9305c7cb6ef72560bbf77626f113f3ee439b3ef3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166331 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174233 Tested-by: Balazs Varga <balazs.varga.ext...@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index a22385924b92..9fe41ed25fd8 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -581,8 +581,6 @@ sub run { installer::scriptitems::changing_name_of_language_dependent_keys($filesinproductlanguageresolvedarrayref); - if ( $installer::globals::iswin and $^O =~ /MSWin/i ) { installer::converter::convert_slash_to_backslash($filesinproductlanguageresolvedarrayref); } - $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_non_existent_languages_in_productlists($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file"); installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($filesinproductlanguageresolvedarrayref, $dirsinproductarrayref); diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm index d126e917b57f..4faff4f39b9f 100644 --- a/solenv/bin/modules/installer/control.pm +++ b/solenv/bin/modules/installer/control.pm @@ -87,6 +87,8 @@ sub check_system_path map { my $dir = qx{cygpath -m "$_"}; chomp($dir); $dir } split /\Q$local_pathseparator\E\s*/, $pathvariable; $local_pathseparator = ';'; + } elsif ( $^O =~ /MSWin/i ) { + $local_pathseparator = ';'; } my $patharrayref = installer::converter::convert_stringlist_into_array(\$pathvariable, $local_pathseparator); @@ -96,7 +98,7 @@ sub check_system_path if (($installer::globals::iswin) && ($installer::globals::iswindowsbuild)) { - @needed_files_in_path = ("zip.exe", "msiinfo.exe", "msidb.exe", "uuidgen", "makecab.exe", "msitran.exe", "expand.exe"); + @needed_files_in_path = ("msiinfo.exe", "msidb.exe", "uuidgen.exe", "makecab.exe", "msitran.exe", "expand.exe"); } elsif ($installer::globals::iswin) { diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 045d9d6afde9..0dc148a9155a 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -265,7 +265,7 @@ BEGIN @installer::globals::removedirs = (); @installer::globals::removefiletable = (); - if ( $^O =~ /cygwin/i ) + if ( $^O =~ /cygwin/i || $^O =~ /MSWin/i ) { $installer::globals::zippath = "zip"; # Has to be in the path: /usr/bin/zip $installer::globals::separator = "/"; diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index b183057eac1e..98910d53b756 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -187,6 +187,7 @@ sub control_fundamental_parameter sub make_path_absolute { my ($pathref) = @_; + return if ( $^O =~ /MSWin/i ); # no need to do anything here if ( $installer::globals::isunix ) { diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm index 6d4282709ab9..9d2612480e0d 100644 --- a/solenv/bin/modules/installer/windows/msiglobal.pm +++ b/solenv/bin/modules/installer/windows/msiglobal.pm @@ -461,7 +461,7 @@ sub create_msi_database $msifilename = installer::converter::make_path_conform($msifilename); - if ( $^O =~ /cygwin/i ) { + if ( $^O =~ /cygwin/i || $^O =~ /MSWin/i ) { # msidb.exe really wants backslashes. (And double escaping because system() expands the string.) $idtdirbase =~ s/\//\\/g; $msifilename =~ s/\//\\/g; @@ -472,14 +472,15 @@ sub create_msi_database } my $systemcall = $msidb . " -f " . $idtdirbase . " -d " . $msifilename . " -c " . "-i " . $extraslash . "*"; - my $returnvalue = system($systemcall); + my $systemcall_output = `$systemcall`; + my $returnvalue = $? >> 8; my $infoline = "Systemcall: $systemcall "; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) { - $infoline = "ERROR: Could not execute $msidb! "; + $infoline = "ERROR: Could not execute $msidb! - returncode: $returnvalue - output: $systemcall_output "; push( @installer::globals::logfileinfo, $infoline); } else @@ -625,14 +626,15 @@ sub write_summary_into_msi_database . " -j " . $subject . " -o " . $comment . " -k " . $keywords . " -n " . $appname . " -u " . $security . " -w " . $wordcount; - my $returnvalue = system($systemcall); + my $systemcall_output = `$systemcall`; + my $returnvalue = $? >> 8; my $infoline = "Systemcall: $systemcall "; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) { - $infoline = "ERROR: Could not execute $systemcall (return $returnvalue) "; + $infoline = "ERROR: Could not execute $systemcall (return $returnvalue) - output: $systemcall_output "; push( @installer::globals::logfileinfo, $infoline); } else @@ -808,16 +810,17 @@ sub create_transforms } } - my $systemcall = "TEMP=$ENV{'TMPDIR'} $cscript \"$wilangid\" $basedbname Package $templatevalue"; - - my $returnvalue = system($systemcall); + $ENV{TEMP} = $ENV{TMPDIR}; + my $systemcall = "$cscript \"$wilangid\" $basedbname Package $templatevalue"; + my $systemcall_output = `$systemcall`; + my $returnvalue = $? >> 8; my $infoline = "Systemcall: $systemcall "; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) { - $infoline = "ERROR: $returnvalue from $systemcall "; + $infoline = "ERROR: $returnvalue from $systemcall - output: $systemcall_output "; push( @installer::globals::logfileinfo, $infoline); } else