xref: /trunk/main/solenv/bin/make_download.pl (revision ef1ef8e674fabf3a541d12c6e6c14cecdfc2f9e7)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28#################
29# use
30#################
31
32use lib ("$ENV{SOLARENV}/bin/modules");
33
34use Cwd;
35use File::Copy;
36use installer::download;
37use installer::downloadsigner;
38use installer::exiter;
39use installer::followme;
40use installer::globals;
41use installer::logger;
42use installer::windows::sign;
43
44#################################################
45# Main program
46#################################################
47
48installer::downloadsigner::getparameter();
49installer::downloadsigner::checkparameter();
50
51my $temppath = installer::downloadsigner::set_temp_path();
52my $infofilelist = installer::downloadsigner::createproductlist();
53installer::downloadsigner::publishproductlist($infofilelist);
54
55foreach my $infofilename ( @{$infofilelist} )
56{
57    installer::logger::starttime();
58
59    my $success = 1;
60    my $do_copy = 1;
61    my $followmeinfohash = installer::followme::read_followme_info($infofilename);
62    installer::downloadsigner::setlogfilename();    # Successful after reading followme file, resetting log file
63    if ( $installer::globals::writetotemp ) { installer::downloadsigner::set_output_pathes_to_temp($followmeinfohash, $temppath); }
64    if ( $installer::globals::useminor ) { installer::downloadsigner::set_minor_into_pathes($followmeinfohash, $temppath); }
65
66    if (( ! $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
67    {
68        installer::logger::print_message( "... WARNING: Signing only for Windows platforms active ...\n" );
69    }
70
71    # installer::logger::include_header_into_logfile("Reading include pathes");
72    # installer::worker::collect_all_files_from_includepathes($followmeinfohash->{'includepatharray'});
73
74    if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
75    {
76        $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
77
78        ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
79                                                                                                            $followmeinfohash->{'finalinstalldir'},
80                                                                                                            $followmeinfohash->{'installlogdir'},
81                                                                                                            "",
82                                                                                                            \$followmeinfohash->{'languagestring'},
83                                                                                                            $followmeinfohash->{'currentinstallnumber'});
84
85        if ( ! $success ) { installer::exiter::exit_program("ERROR: Signing installation set failed: $followmeinfohash->{'finalinstalldir'}", "Main"); }
86    }
87
88    if ( ! $installer::globals::nodownload )
89    {
90        $followmeinfohash->{'finalinstalldir'} = installer::download::create_download_sets($followmeinfohash->{'finalinstalldir'},
91                                                                                            $followmeinfohash->{'includepatharray'},
92                                                                                            $followmeinfohash->{'allvariableshash'},
93                                                                                            $followmeinfohash->{'downloadname'},
94                                                                                            \$followmeinfohash->{'languagestring'},
95                                                                                            $followmeinfohash->{'languagesarray'});
96
97        ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
98                                                                                                        $followmeinfohash->{'finalinstalldir'},
99                                                                                                        $followmeinfohash->{'installlogdir'},
100                                                                                                        "",
101                                                                                                        \$followmeinfohash->{'languagestring'},
102                                                                                                        $followmeinfohash->{'currentinstallnumber'});
103
104        if (( $success ) && ( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
105        {
106            $do_copy = 0;
107            $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
108
109            ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
110                                                                                                            $followmeinfohash->{'finalinstalldir'},
111                                                                                                            $followmeinfohash->{'installlogdir'},
112                                                                                                            "",
113                                                                                                            \$followmeinfohash->{'languagestring'},
114                                                                                                            $followmeinfohash->{'currentinstallnumber'});
115        }
116    }
117
118    if ( $success )
119    {
120        installer::worker::clean_output_tree();
121        if ( $installer::globals::followme_from_directory ) { installer::downloadsigner::rename_followme_infofile($infofilename); }
122    }
123
124    installer::logger::stoptime();
125}
126
127####################################
128# Main program end
129####################################
130