[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - solenv/bin

Andras Timar andras.timar at collabora.com
Sat Sep 28 16:49:06 PDT 2013


 solenv/bin/modules/installer.pm |   49 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

New commits:
commit 594a9cc9278c8ca3ff9b78bad917233f207be194
Author: Andras Timar <andras.timar at collabora.com>
Date:   Wed Sep 18 01:16:05 2013 -0700

    Sign .msi/.msp files when build signing is enabled on Windows
    
    Change-Id: I927d78ae898596e6425b086f4d50fc4e1b9361c1
    Reviewed-on: https://gerrit.libreoffice.org/5987
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm
index 59331d6..a5a6a01 100644
--- a/solenv/bin/modules/installer.pm
+++ b/solenv/bin/modules/installer.pm
@@ -1648,6 +1648,31 @@ sub run {
                 # Path of new installation set: $finalinstalldir
                 # Path of old installation set: $installer::globals::updatedatabasepath
                 my $mspdir = installer::windows::msp::create_msp_patch($finalinstalldir, $includepatharrayref, $allvariableshashref, $languagestringref, $languagesarrayref, $filesinproductlanguageresolvedarrayref);
+                if ( defined($ENV{'WINDOWS_BUILD_SIGNING'}) && ($ENV{'WINDOWS_BUILD_SIGNING'} eq 'TRUE') )
+                {
+                    my $systemcall = "signtool.exe sign ";
+                    if ( defined($ENV{'PFXFILE'}) ) { $systemcall .= "-f $ENV{'PFXFILE'} "; }
+                    if ( defined($ENV{'PFXPASSWORD'}) ) { $systemcall .= "-p $ENV{'PFXPASSWORD'} "; }
+                    if ( defined($ENV{'TIMESTAMPURL'}) ) { $systemcall .= "-t $ENV{'TIMESTAMPURL'} "; } else { $systemcall .= "-t http://timestamp.globalsign.com/scripts/timestamp.dll "; }
+                    $systemcall .= $mspdir . "/*.msp";
+                    installer::logger::print_message( "... $systemcall ...\n" );
+
+                    my $returnvalue = system($systemcall);
+
+                    my $infoline = "Systemcall: $systemcall\n";
+                    push( @installer::globals::logfileinfo, $infoline);
+
+                    if ($returnvalue)
+                    {
+                        $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+                        push( @installer::globals::logfileinfo, $infoline);
+                    }
+                    else
+                    {
+                        $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+                        push( @installer::globals::logfileinfo, $infoline);
+                    }
+                }
                 ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $mspdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
                 installer::worker::clean_output_tree(); # removing directories created in the output tree
             }
@@ -1668,7 +1693,31 @@ sub run {
                 if ( $allvariableshashref->{'OOODOWNLOADNAME'} ) { $$downloadname = installer::download::set_download_filename($languagestringref, $allvariableshashref); }
                 else { $$downloadname = installer::download::resolve_variables_in_downloadname($allvariableshashref, $$downloadname, $languagestringref); }
                 installer::systemactions::rename_one_file( $finalinstalldir . $installer::globals::separator . $installer::globals::shortmsidatabasename, $finalinstalldir . $installer::globals::separator . $$downloadname . ".msi" );
+                if ( defined($ENV{'WINDOWS_BUILD_SIGNING'}) && ($ENV{'WINDOWS_BUILD_SIGNING'} eq 'TRUE') )
+                {
+                    my $systemcall = "signtool.exe sign ";
+                    if ( defined($ENV{'PFXFILE'}) ) { $systemcall .= "-f $ENV{'PFXFILE'} "; }
+                    if ( defined($ENV{'PFXPASSWORD'}) ) { $systemcall .= "-p $ENV{'PFXPASSWORD'} "; }
+                    if ( defined($ENV{'TIMESTAMPURL'}) ) { $systemcall .= "-t $ENV{'TIMESTAMPURL'} "; } else { $systemcall .= "-t http://timestamp.globalsign.com/scripts/timestamp.dll "; }
+                    $systemcall .= $finalinstalldir . $installer::globals::separator . $$downloadname . ".msi";
+                    installer::logger::print_message( "... $systemcall ...\n" );
+
+                    my $returnvalue = system($systemcall);
 
+                    my $infoline = "Systemcall: $systemcall\n";
+                    push( @installer::globals::logfileinfo, $infoline);
+
+                    if ($returnvalue)
+                    {
+                        $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+                        push( @installer::globals::logfileinfo, $infoline);
+                    }
+                    else
+                    {
+                        $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+                        push( @installer::globals::logfileinfo, $infoline);
+                    }
+                }
             }
             if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
             {


More information about the Libreoffice-commits mailing list