xref: /aoo4110/main/solenv/bin/make_download.pl (revision b1cdbd2c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24#################
25# use
26#################
27
28use lib ("$ENV{SOLARENV}/bin/modules");
29
30use Cwd;
31use File::Copy;
32use installer::download;
33use installer::downloadsigner;
34use installer::exiter;
35use installer::followme;
36use installer::globals;
37use installer::logger;
38use installer::windows::sign;
39
40#################################################
41# Main program
42#################################################
43
44installer::downloadsigner::getparameter();
45installer::downloadsigner::checkparameter();
46
47my $temppath = installer::downloadsigner::set_temp_path();
48my $infofilelist = installer::downloadsigner::createproductlist();
49installer::downloadsigner::publishproductlist($infofilelist);
50
51foreach my $infofilename ( @{$infofilelist} )
52{
53	installer::logger::starttime();
54
55	my $success = 1;
56	my $do_copy = 1;
57	my $followmeinfohash = installer::followme::read_followme_info($infofilename);
58	installer::downloadsigner::setlogfilename();	# Successful after reading followme file, resetting log file
59	if ( $installer::globals::writetotemp ) { installer::downloadsigner::set_output_pathes_to_temp($followmeinfohash, $temppath); }
60	if ( $installer::globals::useminor ) { installer::downloadsigner::set_minor_into_pathes($followmeinfohash, $temppath); }
61
62	if (( ! $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
63	{
64		installer::logger::print_message( "... WARNING: Signing only for Windows platforms active ...\n" );
65	}
66
67	# installer::logger::include_header_into_logfile("Reading include pathes");
68	# installer::worker::collect_all_files_from_includepathes($followmeinfohash->{'includepatharray'});
69
70	if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
71	{
72		$followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
73
74		($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
75																											$followmeinfohash->{'finalinstalldir'},
76																											$followmeinfohash->{'installlogdir'},
77																											"",
78																											\$followmeinfohash->{'languagestring'},
79																											$followmeinfohash->{'currentinstallnumber'});
80
81		if ( ! $success ) { installer::exiter::exit_program("ERROR: Signing installation set failed: $followmeinfohash->{'finalinstalldir'}", "Main"); }
82	}
83
84	if ( ! $installer::globals::nodownload )
85	{
86		$followmeinfohash->{'finalinstalldir'} = installer::download::create_download_sets($followmeinfohash->{'finalinstalldir'},
87																							$followmeinfohash->{'includepatharray'},
88																							$followmeinfohash->{'allvariableshash'},
89																							$followmeinfohash->{'downloadname'},
90																							\$followmeinfohash->{'languagestring'},
91																							$followmeinfohash->{'languagesarray'});
92
93		($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
94																										$followmeinfohash->{'finalinstalldir'},
95																										$followmeinfohash->{'installlogdir'},
96																										"",
97																										\$followmeinfohash->{'languagestring'},
98																										$followmeinfohash->{'currentinstallnumber'});
99
100		if (( $success ) && ( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
101		{
102			$do_copy = 0;
103			$followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
104
105			($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
106																											$followmeinfohash->{'finalinstalldir'},
107																											$followmeinfohash->{'installlogdir'},
108																											"",
109																											\$followmeinfohash->{'languagestring'},
110																											$followmeinfohash->{'currentinstallnumber'});
111		}
112	}
113
114	if ( $success )
115	{
116		installer::worker::clean_output_tree();
117		if ( $installer::globals::followme_from_directory ) { installer::downloadsigner::rename_followme_infofile($infofilename); }
118	}
119
120	installer::logger::stoptime();
121}
122
123####################################
124# Main program end
125####################################
126