download.pm (60203e34) download.pm (1dba2a1a)
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

--- 20 unchanged lines hidden (view full) ---

29use installer::globals;
30use installer::logger;
31use installer::pathanalyzer;
32use installer::remover;
33use installer::systemactions;
34
35use strict;
36
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

--- 20 unchanged lines hidden (view full) ---

29use installer::globals;
30use installer::logger;
31use installer::pathanalyzer;
32use installer::remover;
33use installer::systemactions;
34
35use strict;
36
37BEGIN { # This is needed so that cygwin's perl evaluates ACLs
37BEGIN { # This is needed so that Cygwin's perl evaluates ACLs
38 # (needed for correctly evaluating the -x test.)
39 if( $^O =~ /cygwin/i ) {
40 require filetest; import filetest "access";
41 }
42}
43
44##################################################################
45# Including the lowercase product name into the script template
46##################################################################
47
48sub put_productname_into_script
49{
50 my ($scriptfile, $variableshashref) = @_;
38 # (needed for correctly evaluating the -x test.)
39 if( $^O =~ /cygwin/i ) {
40 require filetest; import filetest "access";
41 }
42}
43
44##################################################################
45# Including the lowercase product name into the script template
46##################################################################
47
48sub put_productname_into_script
49{
50 my ($scriptfile, $variableshashref) = @_;
51
51
52 my $productname = $variableshashref->{'PRODUCTNAME'};
53 $productname = lc($productname);
54 $productname =~ s/\.//g; # openoffice.org -> openofficeorg
55 $productname =~ s/\s*//g;
56
57 $installer::logger::Lang->printf("Adding productname %s into download shell script\n", $productname);
58
59 for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )

--- 4 unchanged lines hidden (view full) ---

64
65#########################################################
66# Including the linenumber into the script template
67#########################################################
68
69sub put_linenumber_into_script
70{
71 my ( $scriptfile ) = @_;
52 my $productname = $variableshashref->{'PRODUCTNAME'};
53 $productname = lc($productname);
54 $productname =~ s/\.//g; # openoffice.org -> openofficeorg
55 $productname =~ s/\s*//g;
56
57 $installer::logger::Lang->printf("Adding productname %s into download shell script\n", $productname);
58
59 for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )

--- 4 unchanged lines hidden (view full) ---

64
65#########################################################
66# Including the linenumber into the script template
67#########################################################
68
69sub put_linenumber_into_script
70{
71 my ( $scriptfile ) = @_;
72
72
73 my $linenumber = $#{$scriptfile} + 2;
74
75 $installer::logger::Lang->printf("Adding linenumber %d into download shell script\n", $linenumber);
76
77 for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
78 {
79 ${$scriptfile}[$i] =~ s/LINENUMBERPLACEHOLDER/$linenumber/;
73 my $linenumber = $#{$scriptfile} + 2;
74
75 $installer::logger::Lang->printf("Adding linenumber %d into download shell script\n", $linenumber);
76
77 for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
78 {
79 ${$scriptfile}[$i] =~ s/LINENUMBERPLACEHOLDER/$linenumber/;
80 }
80 }
81}
82
83#########################################################
84# Determining the name of the new scriptfile
85#########################################################
86
87sub determine_scriptfile_name
88{

--- 10 unchanged lines hidden (view full) ---

99
100#########################################################
101# Saving the script file in the installation directory
102#########################################################
103
104sub save_script_file
105{
106 my ($directory, $newscriptfilename, $scriptfile) = @_;
81}
82
83#########################################################
84# Determining the name of the new scriptfile
85#########################################################
86
87sub determine_scriptfile_name
88{

--- 10 unchanged lines hidden (view full) ---

99
100#########################################################
101# Saving the script file in the installation directory
102#########################################################
103
104sub save_script_file
105{
106 my ($directory, $newscriptfilename, $scriptfile) = @_;
107
107
108 $newscriptfilename = $directory . $installer::globals::separator . $newscriptfilename;
109 installer::files::save_file($newscriptfilename, $scriptfile);
110
111 $installer::logger::Lang->printf("Saving script file %s\n", $newscriptfilename);
112
113 if ( ! $installer::globals::iswindowsbuild )
114 {
115 my $localcall = "chmod 775 $newscriptfilename \>\/dev\/null 2\>\&1";
116 system($localcall);
117 }
108 $newscriptfilename = $directory . $installer::globals::separator . $newscriptfilename;
109 installer::files::save_file($newscriptfilename, $scriptfile);
110
111 $installer::logger::Lang->printf("Saving script file %s\n", $newscriptfilename);
112
113 if ( ! $installer::globals::iswindowsbuild )
114 {
115 my $localcall = "chmod 775 $newscriptfilename \>\/dev\/null 2\>\&1";
116 system($localcall);
117 }
118
118
119 return $newscriptfilename;
120}
121
122#########################################################
123# Including checksum and size into script file
124#########################################################
125
126sub put_checksum_and_size_into_script
127{
128 my ($scriptfile, $sumout) = @_;
129
130 my $checksum = "";
131 my $size = "";
119 return $newscriptfilename;
120}
121
122#########################################################
123# Including checksum and size into script file
124#########################################################
125
126sub put_checksum_and_size_into_script
127{
128 my ($scriptfile, $sumout) = @_;
129
130 my $checksum = "";
131 my $size = "";
132
133 if ( $sumout =~ /^\s*(\d+)\s+(\d+)\s*$/ )
132
133 if ( $sumout =~ /^\s*(\d+)\s+(\d+)\s*$/ )
134 {
135 $checksum = $1;
134 {
135 $checksum = $1;
136 $size = $2;
136 $size = $2;
137 }
138 else
139 {
140 installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/sum: $sumout", "put_checksum_and_size_into_script");
141 }
142
143 $installer::logger::Lang->printf(
144 "Adding checksum %s and size %s into download shell script\n", $checksum, $size);
145
146 for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
147 {
148 ${$scriptfile}[$i] =~ s/CHECKSUMPLACEHOLDER/$checksum/;
149 ${$scriptfile}[$i] =~ s/DISCSPACEPLACEHOLDER/$size/;
150 }
137 }
138 else
139 {
140 installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/sum: $sumout", "put_checksum_and_size_into_script");
141 }
142
143 $installer::logger::Lang->printf(
144 "Adding checksum %s and size %s into download shell script\n", $checksum, $size);
145
146 for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
147 {
148 ${$scriptfile}[$i] =~ s/CHECKSUMPLACEHOLDER/$checksum/;
149 ${$scriptfile}[$i] =~ s/DISCSPACEPLACEHOLDER/$size/;
150 }
151
151
152}
153
154#########################################################
155# Calling md5sum
156#########################################################
157
158sub call_md5sum
159{
160 my ($filename) = @_;
161
162 my $md5sumfile = "/usr/bin/md5sum";
152}
153
154#########################################################
155# Calling md5sum
156#########################################################
157
158sub call_md5sum
159{
160 my ($filename) = @_;
161
162 my $md5sumfile = "/usr/bin/md5sum";
163
163
164 if ( ! -f $md5sumfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/md5sum", "call_md5sum"); }
164 if ( ! -f $md5sumfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/md5sum", "call_md5sum"); }
165
165
166 my $systemcall = "$md5sumfile $filename |";
166 my $systemcall = "$md5sumfile $filename |";
167
167
168 my $md5sumoutput = "";
169
170 open (SUM, "$systemcall");
171 $md5sumoutput = <SUM>;
172 close (SUM);
173
174 my $returnvalue = $?; # $? contains the return value of the systemcall
175
176 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
168 my $md5sumoutput = "";
169
170 open (SUM, "$systemcall");
171 $md5sumoutput = <SUM>;
172 close (SUM);
173
174 my $returnvalue = $?; # $? contains the return value of the systemcall
175
176 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
177
177
178 if ($returnvalue)
179 {
180 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
181 }
182 else
183 {
184 $installer::logger::Lang->print("Success: Executed \"%s\" successfully!\n", $systemcall);
185 }
178 if ($returnvalue)
179 {
180 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
181 }
182 else
183 {
184 $installer::logger::Lang->print("Success: Executed \"%s\" successfully!\n", $systemcall);
185 }
186
187 return $md5sumoutput;
186
187 return $md5sumoutput;
188}
189
190#########################################################
191# Calling md5sum
192#########################################################
193
194sub get_md5sum
195{
196 my ($md5sumoutput) = @_;
188}
189
190#########################################################
191# Calling md5sum
192#########################################################
193
194sub get_md5sum
195{
196 my ($md5sumoutput) = @_;
197
197
198 my $md5sum;
198 my $md5sum;
199
200 if ( $md5sumoutput =~ /^\s*(\w+?)\s+/ )
199
200 if ( $md5sumoutput =~ /^\s*(\w+?)\s+/ )
201 {
202 $md5sum = $1;
203 }
204 else
205 {
206 installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/md5sum: $md5sumoutput", "get_md5sum");
207 }
208

--- 6 unchanged lines hidden (view full) ---

215# Determining checksum and size of tar file
216#########################################################
217
218sub call_sum
219{
220 my ($filename, $getuidlibrary) = @_;
221
222 my $systemcall = "/usr/bin/sum $filename |";
201 {
202 $md5sum = $1;
203 }
204 else
205 {
206 installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/md5sum: $md5sumoutput", "get_md5sum");
207 }
208

--- 6 unchanged lines hidden (view full) ---

215# Determining checksum and size of tar file
216#########################################################
217
218sub call_sum
219{
220 my ($filename, $getuidlibrary) = @_;
221
222 my $systemcall = "/usr/bin/sum $filename |";
223
223
224 my $sumoutput = "";
225
226 open (SUM, "$systemcall");
227 $sumoutput = <SUM>;
228 close (SUM);
229
230 my $returnvalue = $?; # $? contains the return value of the systemcall
231
232 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
224 my $sumoutput = "";
225
226 open (SUM, "$systemcall");
227 $sumoutput = <SUM>;
228 close (SUM);
229
230 my $returnvalue = $?; # $? contains the return value of the systemcall
231
232 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
233
233
234 if ($returnvalue)
235 {
236 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
237 }
238 else
239 {
240 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
241 }
234 if ($returnvalue)
235 {
236 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
237 }
238 else
239 {
240 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
241 }
242
242
243 $sumoutput =~ s/\s+$filename\s$//;
243 $sumoutput =~ s/\s+$filename\s$//;
244 return $sumoutput;
244 return $sumoutput;
245}
246
247#########################################################
248# Searching for the getuid.so in the solver
249#########################################################
250
251sub get_path_for_library
252{
253 my ($includepatharrayref) = @_;
245}
246
247#########################################################
248# Searching for the getuid.so in the solver
249#########################################################
250
251sub get_path_for_library
252{
253 my ($includepatharrayref) = @_;
254
254
255 my $getuidlibraryname = "getuid.so";
256
257 my $getuidlibraryref = "";
258
259 if ( $installer::globals::include_pathes_read )
260 {
261 $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
262 }
263 else
264 {
265 $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$getuidlibraryname, $includepatharrayref, 0);
266 }
267
268 if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR: Could not find $getuidlibraryname!", "get_path_for_library"); }
255 my $getuidlibraryname = "getuid.so";
256
257 my $getuidlibraryref = "";
258
259 if ( $installer::globals::include_pathes_read )
260 {
261 $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
262 }
263 else
264 {
265 $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$getuidlibraryname, $includepatharrayref, 0);
266 }
267
268 if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR: Could not find $getuidlibraryname!", "get_path_for_library"); }
269
269
270 return $$getuidlibraryref;
271}
272
273#########################################################
274# Include the tar file into the script
275#########################################################
276
277sub include_tar_into_script
278{
279 my ($scriptfile, $temporary_tarfile) = @_;
280
281 my $systemcall = "cat $temporary_tarfile >> $scriptfile && rm $temporary_tarfile";
282 my $returnvalue = system($systemcall);
283
284 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
270 return $$getuidlibraryref;
271}
272
273#########################################################
274# Include the tar file into the script
275#########################################################
276
277sub include_tar_into_script
278{
279 my ($scriptfile, $temporary_tarfile) = @_;
280
281 my $systemcall = "cat $temporary_tarfile >> $scriptfile && rm $temporary_tarfile";
282 my $returnvalue = system($systemcall);
283
284 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
285
285
286 if ($returnvalue)
287 {
288 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
289 }
290 else
291 {
292 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
293 }

--- 6 unchanged lines hidden (view full) ---

300
301sub tar_package
302{
303 my ( $installdir, $tarfilename, $getuidlibrary) = @_;
304
305 my $ldpreloadstring = $ENV{'FAKEROOT'};
306
307 my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - * > $tarfilename";
286 if ($returnvalue)
287 {
288 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
289 }
290 else
291 {
292 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
293 }

--- 6 unchanged lines hidden (view full) ---

300
301sub tar_package
302{
303 my ( $installdir, $tarfilename, $getuidlibrary) = @_;
304
305 my $ldpreloadstring = $ENV{'FAKEROOT'};
306
307 my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - * > $tarfilename";
308
308
309 my $returnvalue = system($systemcall);
310
311 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
309 my $returnvalue = system($systemcall);
310
311 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
312
312
313 if ($returnvalue)
314 {
315 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
316 }
317 else
318 {
319 $installer::logger::Lang->printf("Success: Executed \"\" successfully!\n", $systemcall);
320 }
313 if ($returnvalue)
314 {
315 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
316 }
317 else
318 {
319 $installer::logger::Lang->printf("Success: Executed \"\" successfully!\n", $systemcall);
320 }
321
321
322 my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
323 $returnvalue = system($localcall);
324
325 return ( -s $tarfilename );
326}
327
328#########################################################
329# Creating a tar.gz file

--- 11 unchanged lines hidden (view full) ---

341
342 for ( my $i = 0; $i <= $#{$allfiles}; $i++ )
343 {
344 my $onefile = ${$allfiles}[$i];
345 my $systemcall = "cd $installdir; rm $onefile";
346 my $returnvalue = system($systemcall);
347
348 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
322 my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
323 $returnvalue = system($localcall);
324
325 return ( -s $tarfilename );
326}
327
328#########################################################
329# Creating a tar.gz file

--- 11 unchanged lines hidden (view full) ---

341
342 for ( my $i = 0; $i <= $#{$allfiles}; $i++ )
343 {
344 my $onefile = ${$allfiles}[$i];
345 my $systemcall = "cd $installdir; rm $onefile";
346 my $returnvalue = system($systemcall);
347
348 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
349
349
350 if ($returnvalue)
351 {
352 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
353 }
354 else
355 {
356 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
357 }
358 }
359
360 $alldirs = installer::systemactions::get_all_directories($installdir);
350 if ($returnvalue)
351 {
352 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
353 }
354 else
355 {
356 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
357 }
358 }
359
360 $alldirs = installer::systemactions::get_all_directories($installdir);
361 my $packagename = ${$alldirs}[0]; # only taking the first Solaris package
361 my $packagename = ${$alldirs}[0]; # only taking the first Solaris package
362 if ( $packagename eq "" ) { installer::exiter::exit_program("ERROR: Could not find package in directory $installdir!", "determine_packagename"); }
363
364 installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packagename);
362 if ( $packagename eq "" ) { installer::exiter::exit_program("ERROR: Could not find package in directory $installdir!", "determine_packagename"); }
363
364 installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packagename);
365
365
366 $installer::globals::downloadfileextension = ".tar.gz";
367 my $targzname = $packagename . $installer::globals::downloadfileextension;
368 $installer::globals::downloadfilename = $targzname;
369
370 my $ldpreloadstring = $ENV{'FAKEROOT'};
371
372 my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - $packagename | gzip > $targzname";
373 $installer::logger::Info->printf("... %s ...\n", $systemcall);
374
375 my $returnvalue = system($systemcall);
376
377 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
366 $installer::globals::downloadfileextension = ".tar.gz";
367 my $targzname = $packagename . $installer::globals::downloadfileextension;
368 $installer::globals::downloadfilename = $targzname;
369
370 my $ldpreloadstring = $ENV{'FAKEROOT'};
371
372 my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - $packagename | gzip > $targzname";
373 $installer::logger::Info->printf("... %s ...\n", $systemcall);
374
375 my $returnvalue = system($systemcall);
376
377 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
378
378
379 if ($returnvalue)
380 {
381 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
382 }
383 else
384 {
385 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
386 }
387}
388
389#########################################################
390# Setting type of installation
391#########################################################
392
393sub get_installation_type
394{
395 my $type = "";
379 if ($returnvalue)
380 {
381 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
382 }
383 else
384 {
385 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
386 }
387}
388
389#########################################################
390# Setting type of installation
391#########################################################
392
393sub get_installation_type
394{
395 my $type = "";
396
396
397 if ( $installer::globals::languagepack ) { $type = "langpack"; }
398 else { $type = "install"; }
397 if ( $installer::globals::languagepack ) { $type = "langpack"; }
398 else { $type = "install"; }
399
399
400 return $type;
401}
402
403#########################################################
404# Setting installation languages
405#########################################################
406
407sub get_downloadname_language

--- 5 unchanged lines hidden (view full) ---

413 if ( $installer::globals::added_english )
414 {
415 $languages =~ s/en-US_//;
416 $languages =~ s/_en-US//;
417 }
418
419 # en-US is default language and can be removed therefore
420 # for one-language installation sets
400 return $type;
401}
402
403#########################################################
404# Setting installation languages
405#########################################################
406
407sub get_downloadname_language

--- 5 unchanged lines hidden (view full) ---

413 if ( $installer::globals::added_english )
414 {
415 $languages =~ s/en-US_//;
416 $languages =~ s/_en-US//;
417 }
418
419 # en-US is default language and can be removed therefore
420 # for one-language installation sets
421
421
422 # if ( $languages =~ /^\s*en-US\s*$/ )
423 # {
424 # $languages = "";
422 # if ( $languages =~ /^\s*en-US\s*$/ )
423 # {
424 # $languages = "";
425 # }
425 # }
426
427 if ( length ($languages) > $installer::globals::max_lang_length )
428 {
429 $languages = 'multi';
430 }
431
432 return $languages;
433}

--- 46 unchanged lines hidden (view full) ---

480
481#########################################################
482# Setting download version
483#########################################################
484
485sub get_download_version
486{
487 my ($allvariables) = @_;
426
427 if ( length ($languages) > $installer::globals::max_lang_length )
428 {
429 $languages = 'multi';
430 }
431
432 return $languages;
433}

--- 46 unchanged lines hidden (view full) ---

480
481#########################################################
482# Setting download version
483#########################################################
484
485sub get_download_version
486{
487 my ($allvariables) = @_;
488
488
489 my $version = "";
489 my $version = "";
490
490
491 my $devproduct = 0;
492 if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && ( $allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
491 my $devproduct = 0;
492 if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && ( $allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
493
493
494 my $cwsproduct = 0;
495 # the environment variable CWS_WORK_STAMP is set only in CWS
496 if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
497
498 if (( $cwsproduct ) || ( $devproduct )) # use "DEV300m75"
499 {
500 my $source = uc($installer::globals::build); # DEV300
501 my $localminor = "";
502 if ( $installer::globals::minor ne "" ) { $localminor = $installer::globals::minor; }
503 else { $localminor = $installer::globals::lastminor; }
504 $version = $source . $localminor;
505 }
506 else # use 3.2.0rc1
507 {
508 $version = $allvariables->{'PRODUCTVERSION'};
509 if (( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ) && ( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ne "" )) { $version = $allvariables->{'ABOUTBOXPRODUCTVERSION'}; }
494 my $cwsproduct = 0;
495 # the environment variable CWS_WORK_STAMP is set only in CWS
496 if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
497
498 if (( $cwsproduct ) || ( $devproduct )) # use "DEV300m75"
499 {
500 my $source = uc($installer::globals::build); # DEV300
501 my $localminor = "";
502 if ( $installer::globals::minor ne "" ) { $localminor = $installer::globals::minor; }
503 else { $localminor = $installer::globals::lastminor; }
504 $version = $source . $localminor;
505 }
506 else # use 3.2.0rc1
507 {
508 $version = $allvariables->{'PRODUCTVERSION'};
509 if (( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ) && ( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ne "" )) { $version = $allvariables->{'ABOUTBOXPRODUCTVERSION'}; }
510 if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $version = $version . $allvariables->{'SHORT_PRODUCTEXTENSION'}; }
510 if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $version = $version . $allvariables->{'SHORT_PRODUCTEXTENSION'}; }
511 }
511 }
512
512
513 return $version;
514}
515
516###############################################################
517# Set date string, format: yymmdd
518###############################################################
519
520sub set_date_string
521{
522 my ($allvariables) = @_;
523
524 my $datestring = "";
525
526 my $devproduct = 0;
527 if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && ( $allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
513 return $version;
514}
515
516###############################################################
517# Set date string, format: yymmdd
518###############################################################
519
520sub set_date_string
521{
522 my ($allvariables) = @_;
523
524 my $datestring = "";
525
526 my $devproduct = 0;
527 if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && ( $allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
528
528
529 my $cwsproduct = 0;
530 # the environment variable CWS_WORK_STAMP is set only in CWS
531 if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
532
533 my $releasebuild = 1;
529 my $cwsproduct = 0;
530 # the environment variable CWS_WORK_STAMP is set only in CWS
531 if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
532
533 my $releasebuild = 1;
534 if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $releasebuild = 0; }
534 if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $releasebuild = 0; }
535
536 if (( ! $devproduct ) && ( ! $cwsproduct ) && ( ! $releasebuild ))
537 {
538 my @timearray = localtime(time);
539
540 my $day = $timearray[3];
541 my $month = $timearray[4] + 1;
542 my $year = $timearray[5] + 1900;
535
536 if (( ! $devproduct ) && ( ! $cwsproduct ) && ( ! $releasebuild ))
537 {
538 my @timearray = localtime(time);
539
540 my $day = $timearray[3];
541 my $month = $timearray[4] + 1;
542 my $year = $timearray[5] + 1900;
543
543
544 if ( $month < 10 ) { $month = "0" . $month; }
545 if ( $day < 10 ) { $day = "0" . $day; }
546
547 $datestring = $year . $month . $day;
548 }
549
550 return $datestring;
551}
552
553#################################################################
554# Setting the platform name for download
555#################################################################
556
557sub get_download_platformname
558{
559 my $platformname = "";
544 if ( $month < 10 ) { $month = "0" . $month; }
545 if ( $day < 10 ) { $day = "0" . $day; }
546
547 $datestring = $year . $month . $day;
548 }
549
550 return $datestring;
551}
552
553#################################################################
554# Setting the platform name for download
555#################################################################
556
557sub get_download_platformname
558{
559 my $platformname = "";
560
560
561 if ( $installer::globals::islinuxbuild )
562 {
563 $platformname = "Linux";
564 }
565 elsif ( $installer::globals::issolarisbuild )
566 {
567 $platformname = "Solaris";
568 }
569 elsif ( $installer::globals::iswindowsbuild )
570 {
571 $platformname = "Win";
572 }
573 elsif ( $installer::globals::isfreebsdbuild )
574 {
561 if ( $installer::globals::islinuxbuild )
562 {
563 $platformname = "Linux";
564 }
565 elsif ( $installer::globals::issolarisbuild )
566 {
567 $platformname = "Solaris";
568 }
569 elsif ( $installer::globals::iswindowsbuild )
570 {
571 $platformname = "Win";
572 }
573 elsif ( $installer::globals::isfreebsdbuild )
574 {
575 $platformname = "FreeBSD";
575 $platformname = "FreeBSD";
576 }
577 elsif ( $installer::globals::ismacbuild )
578 {
579 $platformname = "MacOS";
580 }
581 else
582 {
583 # $platformname = $installer::globals::packageformat;
576 }
577 elsif ( $installer::globals::ismacbuild )
578 {
579 $platformname = "MacOS";
580 }
581 else
582 {
583 # $platformname = $installer::globals::packageformat;
584 $platformname = $installer::globals::compiler;
584 $platformname = $installer::globals::compiler;
585 }
585 }
586
586
587 return $platformname;
588}
589
590#########################################################
591# Setting the architecture for the download name
592#########################################################
593
594sub get_download_architecture
595{
596 my $arch = "";
587 return $platformname;
588}
589
590#########################################################
591# Setting the architecture for the download name
592#########################################################
593
594sub get_download_architecture
595{
596 my $arch = "";
597
597
598 if(( $installer::globals::compiler =~ /^unxlngi/ )
599 || ( $installer::globals::compiler =~ /^unxmac.i/ )
600 || ( $installer::globals::issolarisx86build )
601 || ( $installer::globals::iswindowsbuild ))
602 {
603 $arch = "x86";
604 }
605 elsif(( $installer::globals::compiler =~ /^unxlngx/ )

--- 5 unchanged lines hidden (view full) ---

611 {
612 $arch = "Sparc";
613 }
614 elsif(( $installer::globals::compiler =~ /^unxmacxp/ )
615 || ( $installer::globals::compiler =~ /^unxlngppc/ ))
616 {
617 $arch = "PPC";
618 }
598 if(( $installer::globals::compiler =~ /^unxlngi/ )
599 || ( $installer::globals::compiler =~ /^unxmac.i/ )
600 || ( $installer::globals::issolarisx86build )
601 || ( $installer::globals::iswindowsbuild ))
602 {
603 $arch = "x86";
604 }
605 elsif(( $installer::globals::compiler =~ /^unxlngx/ )

--- 5 unchanged lines hidden (view full) ---

611 {
612 $arch = "Sparc";
613 }
614 elsif(( $installer::globals::compiler =~ /^unxmacxp/ )
615 || ( $installer::globals::compiler =~ /^unxlngppc/ ))
616 {
617 $arch = "PPC";
618 }
619
620 return $arch;
619
620 return $arch;
621}
622
623#########################################################
624# Setting the installation type for the download name
625#########################################################
626
627sub get_install_type
628{
629 my ($allvariables) = @_;
621}
622
623#########################################################
624# Setting the installation type for the download name
625#########################################################
626
627sub get_install_type
628{
629 my ($allvariables) = @_;
630
630
631 my $type = "";
631 my $type = "";
632
632
633 if ( $installer::globals::languagepack )
634 {
635 $type = "langpack";
636
637 if ( $installer::globals::islinuxrpmbuild )
638 {
639 $type = $type . "-rpm";
640 }
633 if ( $installer::globals::languagepack )
634 {
635 $type = "langpack";
636
637 if ( $installer::globals::islinuxrpmbuild )
638 {
639 $type = $type . "-rpm";
640 }
641
641
642 if ( $installer::globals::islinuxdebbuild )
643 {
644 $type = $type . "-deb";
645 }
642 if ( $installer::globals::islinuxdebbuild )
643 {
644 $type = $type . "-deb";
645 }
646
646
647 if ( $installer::globals::packageformat eq "archive" )
648 {
647 if ( $installer::globals::packageformat eq "archive" )
648 {
649 $type = $type . "-arc";
649 $type = $type . "-arc";
650 }
651 }
652 else
653 {
654 $type = "install";
655
656 if ( $installer::globals::islinuxrpmbuild )
657 {
658 $type = $type . "-rpm";
659 }
650 }
651 }
652 else
653 {
654 $type = "install";
655
656 if ( $installer::globals::islinuxrpmbuild )
657 {
658 $type = $type . "-rpm";
659 }
660
660
661 if ( $installer::globals::islinuxdebbuild )
662 {
663 $type = $type . "-deb";
664 }
661 if ( $installer::globals::islinuxdebbuild )
662 {
663 $type = $type . "-deb";
664 }
665
665
666 if ( $installer::globals::packageformat eq "archive" )
667 {
666 if ( $installer::globals::packageformat eq "archive" )
667 {
668 $type = $type . "-arc";
668 $type = $type . "-arc";
669 }
670
671 }
669 }
670
671 }
672
672
673 return $type;
674}
675
676#########################################################
677# Setting installation addons
678#########################################################
679
680sub get_downloadname_addon
681{
682 my $addon = "";
683
684 if ( $installer::globals::islinuxdebbuild ) { $addon = $addon . "_deb"; }
673 return $type;
674}
675
676#########################################################
677# Setting installation addons
678#########################################################
679
680sub get_downloadname_addon
681{
682 my $addon = "";
683
684 if ( $installer::globals::islinuxdebbuild ) { $addon = $addon . "_deb"; }
685
685
686 return $addon;
687}
688
689#########################################################
690# Looking for versionstring in version.info
691# This has to be the only content of this file.
692#########################################################
693
694sub get_versionstring
695{
696 my ( $versionfile ) = @_;
686 return $addon;
687}
688
689#########################################################
690# Looking for versionstring in version.info
691# This has to be the only content of this file.
692#########################################################
693
694sub get_versionstring
695{
696 my ( $versionfile ) = @_;
697
697
698 my $versionstring = "";
699
700 for ( my $i = 0; $i <= $#{$versionfile}; $i++ )
701 {
702 my $oneline = ${$versionfile}[$i];
698 my $versionstring = "";
699
700 for ( my $i = 0; $i <= $#{$versionfile}; $i++ )
701 {
702 my $oneline = ${$versionfile}[$i];
703
703
704 if ( $oneline =~ /^\s*\#/ ) { next; } # comment line
705 if ( $oneline =~ /^\s*\"\s*(.*?)\s*\"\s*$/ )
706 {
707 $versionstring = $1;
708 last;
709 }
710 }
704 if ( $oneline =~ /^\s*\#/ ) { next; } # comment line
705 if ( $oneline =~ /^\s*\"\s*(.*?)\s*\"\s*$/ )
706 {
707 $versionstring = $1;
708 last;
709 }
710 }
711
711
712 return $versionstring;
713}
714
715#########################################################
716# Returning the current product version
717# This has to be defined in file "version.info"
718# in directory $installer::globals::ooouploaddir
719#########################################################
720
721sub get_current_version
722{
723 my $versionstring = "";
724 my $filename = "version.info";
725 # $filename = $installer::globals::ooouploaddir . $installer::globals::separator . $filename;
712 return $versionstring;
713}
714
715#########################################################
716# Returning the current product version
717# This has to be defined in file "version.info"
718# in directory $installer::globals::ooouploaddir
719#########################################################
720
721sub get_current_version
722{
723 my $versionstring = "";
724 my $filename = "version.info";
725 # $filename = $installer::globals::ooouploaddir . $installer::globals::separator . $filename;
726
726
727 if ( -f $filename )
728 {
729 $installer::logger::Lang->printf("File %s exists. Trying to find current version.\n", $filename);
730 my $versionfile = installer::files::read_file($filename);
731 $versionstring = get_versionstring($versionfile);
732 $installer::logger::Lang->printf("Setting version string: %s\n", $versionstring);
733 }
734 else
735 {
736 $installer::logger::Lang->printf("File %s does not exist. No version setting in download file name.\n", $filename);
737 }
738
739 $installer::globals::oooversionstring = $versionstring;
727 if ( -f $filename )
728 {
729 $installer::logger::Lang->printf("File %s exists. Trying to find current version.\n", $filename);
730 my $versionfile = installer::files::read_file($filename);
731 $versionstring = get_versionstring($versionfile);
732 $installer::logger::Lang->printf("Setting version string: %s\n", $versionstring);
733 }
734 else
735 {
736 $installer::logger::Lang->printf("File %s does not exist. No version setting in download file name.\n", $filename);
737 }
738
739 $installer::globals::oooversionstring = $versionstring;
740
740
741 return $versionstring;
742}
743
744###############################################################################################
745# Setting the download file name
746# Syntax:
747# (PRODUCTNAME)_(VERSION)_(TIMESTAMP)_(OS)_(ARCH)_(INSTALLTYPE)_(LANGUAGE).(FILEEXTENSION)
748# Rules:
749# Timestamp only for Beta and Release Candidate
750###############################################################################################
751
752sub set_download_filename
753{
754 my ($languagestringref, $allvariables) = @_;
741 return $versionstring;
742}
743
744###############################################################################################
745# Setting the download file name
746# Syntax:
747# (PRODUCTNAME)_(VERSION)_(TIMESTAMP)_(OS)_(ARCH)_(INSTALLTYPE)_(LANGUAGE).(FILEEXTENSION)
748# Rules:
749# Timestamp only for Beta and Release Candidate
750###############################################################################################
751
752sub set_download_filename
753{
754 my ($languagestringref, $allvariables) = @_;
755
755
756 my $start = get_downloadname_productname($allvariables);
757 my $versionstring = get_download_version($allvariables);
758 my $date = set_date_string($allvariables);
759 my $platform = get_download_platformname();
760 my $architecture = get_download_architecture();
761 my $type = get_install_type($allvariables);
762 my $language = get_downloadname_language($languagestringref);
756 my $start = get_downloadname_productname($allvariables);
757 my $versionstring = get_download_version($allvariables);
758 my $date = set_date_string($allvariables);
759 my $platform = get_download_platformname();
760 my $architecture = get_download_architecture();
761 my $type = get_install_type($allvariables);
762 my $language = get_downloadname_language($languagestringref);
763
763
764 # Setting the extension happens automatically
765
766 my $filename = $start . "_" . $versionstring . "_" . $date . "_" . $platform . "_" . $architecture . "_" . $type . "_" . $language;
764 # Setting the extension happens automatically
765
766 my $filename = $start . "_" . $versionstring . "_" . $date . "_" . $platform . "_" . $architecture . "_" . $type . "_" . $language;
767
767
768 $filename =~ s/\_\_/\_/g; # necessary, if $versionstring or $platform or $language are empty
769 $filename =~ s/\_\s*$//; # necessary, if $language and $addon are empty
768 $filename =~ s/\_\_/\_/g; # necessary, if $versionstring or $platform or $language are empty
769 $filename =~ s/\_\s*$//; # necessary, if $language and $addon are empty
770
770
771 $installer::globals::ooodownloadfilename = $filename;
771 $installer::globals::ooodownloadfilename = $filename;
772
772
773 return $filename;
774}
775
776#########################################################
777# Creating a tar.gz file
778#########################################################
779
780sub create_tar_gz_file_from_directory

--- 7 unchanged lines hidden (view full) ---

788
789 my $ldpreloadstring = $ENV{'FAKEROOT'};
790
791 $installer::globals::downloadfileextension = ".tar.gz";
792 $installer::globals::downloadfilename = $downloadfilename . $installer::globals::downloadfileextension;
793 my $targzname = $downloaddir . $installer::globals::separator . $installer::globals::downloadfilename;
794
795 my $systemcall = "cd $changedir; $ldpreloadstring tar -cf - $packdir | gzip > $targzname";
773 return $filename;
774}
775
776#########################################################
777# Creating a tar.gz file
778#########################################################
779
780sub create_tar_gz_file_from_directory

--- 7 unchanged lines hidden (view full) ---

788
789 my $ldpreloadstring = $ENV{'FAKEROOT'};
790
791 $installer::globals::downloadfileextension = ".tar.gz";
792 $installer::globals::downloadfilename = $downloadfilename . $installer::globals::downloadfileextension;
793 my $targzname = $downloaddir . $installer::globals::separator . $installer::globals::downloadfilename;
794
795 my $systemcall = "cd $changedir; $ldpreloadstring tar -cf - $packdir | gzip > $targzname";
796
796
797 my $returnvalue = system($systemcall);
798
799 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
797 my $returnvalue = system($systemcall);
798
799 $installer::logger::Lang->printf("Systemcall: %s\n", $systemcall);
800
800
801 if ($returnvalue)
802 {
803 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
804 }
805 else
806 {
807 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
808 }
801 if ($returnvalue)
802 {
803 $installer::logger::Lang->printf("ERROR: Could not execute \"%s\"!\n", $systemcall);
804 }
805 else
806 {
807 $installer::logger::Lang->printf("Success: Executed \"%s\" successfully!\n", $systemcall);
808 }
809
809
810 return $targzname;
811}
812
813#########################################################
814# Setting the variables in the download name
815#########################################################
816
817sub resolve_variables_in_downloadname

--- 18 unchanged lines hidden (view full) ---

836 my $os = "";
837 if ( $installer::globals::iswindowsbuild ) { $os = "windows"; }
838 elsif ( $installer::globals::issolarissparcbuild ) { $os = "solsparc"; }
839 elsif ( $installer::globals::issolarisx86build ) { $os = "solia"; }
840 elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; }
841 elsif ( $installer::globals::compiler =~ /unxmac.i/ ) { $os = "macosi"; }
842 elsif ( $installer::globals::compiler =~ /unxmac.x/ ) { $os = "macosx"; }
843 elsif ( $installer::globals::compiler =~ /unxmacxp/ ) { $os = "macosp"; }
810 return $targzname;
811}
812
813#########################################################
814# Setting the variables in the download name
815#########################################################
816
817sub resolve_variables_in_downloadname

--- 18 unchanged lines hidden (view full) ---

836 my $os = "";
837 if ( $installer::globals::iswindowsbuild ) { $os = "windows"; }
838 elsif ( $installer::globals::issolarissparcbuild ) { $os = "solsparc"; }
839 elsif ( $installer::globals::issolarisx86build ) { $os = "solia"; }
840 elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; }
841 elsif ( $installer::globals::compiler =~ /unxmac.i/ ) { $os = "macosi"; }
842 elsif ( $installer::globals::compiler =~ /unxmac.x/ ) { $os = "macosx"; }
843 elsif ( $installer::globals::compiler =~ /unxmacxp/ ) { $os = "macosp"; }
844 else { $os = ""; }
844 else { $os = ""; }
845 $downloadname =~ s/\{os\}/$os/;
846
847 my $languages = $$languagestringref;
848 $downloadname =~ s/\{languages\}/$languages/;
845 $downloadname =~ s/\{os\}/$os/;
846
847 my $languages = $$languagestringref;
848 $downloadname =~ s/\{languages\}/$languages/;
849
849
850 $downloadname =~ s/\-\-\-/\-/g;
851 $downloadname =~ s/\-\-/\-/g;
852 $downloadname =~ s/\-\s*$//;
853
854 return $downloadname;
855}
856
857##################################################################

--- 15 unchanged lines hidden (view full) ---

873
874########################################################################################
875# Converting a string to a unicode string
876########################################################################################
877
878sub convert_to_unicode
879{
880 my ($string) = @_;
850 $downloadname =~ s/\-\-\-/\-/g;
851 $downloadname =~ s/\-\-/\-/g;
852 $downloadname =~ s/\-\s*$//;
853
854 return $downloadname;
855}
856
857##################################################################

--- 15 unchanged lines hidden (view full) ---

873
874########################################################################################
875# Converting a string to a unicode string
876########################################################################################
877
878sub convert_to_unicode
879{
880 my ($string) = @_;
881
881
882 my $unicodestring = "";
882 my $unicodestring = "";
883
883
884 my $stringlength = length($string);
884 my $stringlength = length($string);
885
885
886 for ( my $i = 0; $i < $stringlength; $i++ )
887 {
888 $unicodestring = $unicodestring . substr($string, $i, 1);
889 $unicodestring = $unicodestring . chr(0);
886 for ( my $i = 0; $i < $stringlength; $i++ )
887 {
888 $unicodestring = $unicodestring . substr($string, $i, 1);
889 $unicodestring = $unicodestring . chr(0);
890 }
890 }
891
892 return $unicodestring;
893}
894
895##################################################################
896# Windows: Including the product name into nsi template
897##################################################################
898
899sub put_windows_productname_into_template
900{
901 my ($templatefile, $variableshashref) = @_;
891
892 return $unicodestring;
893}
894
895##################################################################
896# Windows: Including the product name into nsi template
897##################################################################
898
899sub put_windows_productname_into_template
900{
901 my ($templatefile, $variableshashref) = @_;
902
902
903 my $productname = $variableshashref->{'PRODUCTNAME'};
904 $productname =~ s/\.//g; # OpenOffice.org -> OpenOfficeorg
905
906 replace_one_variable($templatefile, "PRODUCTNAMEPLACEHOLDER", $productname);
907}
908
909##################################################################
910# Windows: Including the path to the banner.bmp into nsi template
911##################################################################
912
913sub put_banner_bmp_into_template
914{
915 my ($templatefile, $includepatharrayref, $allvariables) = @_;
903 my $productname = $variableshashref->{'PRODUCTNAME'};
904 $productname =~ s/\.//g; # OpenOffice.org -> OpenOfficeorg
905
906 replace_one_variable($templatefile, "PRODUCTNAMEPLACEHOLDER", $productname);
907}
908
909##################################################################
910# Windows: Including the path to the banner.bmp into nsi template
911##################################################################
912
913sub put_banner_bmp_into_template
914{
915 my ($templatefile, $includepatharrayref, $allvariables) = @_;
916
916
917 # my $filename = "downloadbanner.bmp";
918 if ( ! $allvariables->{'DOWNLOADBANNER'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBANNER not defined in product definition!", "put_banner_bmp_into_template"); }
919 my $filename = $allvariables->{'DOWNLOADBANNER'};
920
921 my $completefilenameref = "";
922
923 if ( $installer::globals::include_pathes_read )
924 {
917 # my $filename = "downloadbanner.bmp";
918 if ( ! $allvariables->{'DOWNLOADBANNER'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBANNER not defined in product definition!", "put_banner_bmp_into_template"); }
919 my $filename = $allvariables->{'DOWNLOADBANNER'};
920
921 my $completefilenameref = "";
922
923 if ( $installer::globals::include_pathes_read )
924 {
925 $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
925 $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
926 }
927 else
928 {
929 $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
930 }
931
932 if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_banner_bmp_into_template"); }
933

--- 64 unchanged lines hidden (view full) ---

998
999##################################################################
1000# Windows: Including the publisher into nsi template
1001##################################################################
1002
1003sub put_publisher_into_template ($$)
1004{
1005 my ($templatefile, $variables) = @_;
926 }
927 else
928 {
929 $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
930 }
931
932 if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_banner_bmp_into_template"); }
933

--- 64 unchanged lines hidden (view full) ---

998
999##################################################################
1000# Windows: Including the publisher into nsi template
1001##################################################################
1002
1003sub put_publisher_into_template ($$)
1004{
1005 my ($templatefile, $variables) = @_;
1006
1006
1007 my $publisher = $variables->{'OOOVENDOR'};
1008 $publisher = "" unless defined $publisher;
1009
1010 replace_one_variable($templatefile, "PUBLISHERPLACEHOLDER", $publisher);
1011}
1012
1013##################################################################
1014# Windows: Including the web site into nsi template

--- 11 unchanged lines hidden (view full) ---

1026
1027##################################################################
1028# Windows: Including the Java file name into nsi template
1029##################################################################
1030
1031sub put_javafilename_into_template
1032{
1033 my ($templatefile, $variableshashref) = @_;
1007 my $publisher = $variables->{'OOOVENDOR'};
1008 $publisher = "" unless defined $publisher;
1009
1010 replace_one_variable($templatefile, "PUBLISHERPLACEHOLDER", $publisher);
1011}
1012
1013##################################################################
1014# Windows: Including the web site into nsi template

--- 11 unchanged lines hidden (view full) ---

1026
1027##################################################################
1028# Windows: Including the Java file name into nsi template
1029##################################################################
1030
1031sub put_javafilename_into_template
1032{
1033 my ($templatefile, $variableshashref) = @_;
1034
1034
1035 my $javaversion = "";
1035 my $javaversion = "";
1036
1036
1037 if ( $variableshashref->{'WINDOWSJAVAFILENAME'} ) { $javaversion = $variableshashref->{'WINDOWSJAVAFILENAME'}; }
1037 if ( $variableshashref->{'WINDOWSJAVAFILENAME'} ) { $javaversion = $variableshashref->{'WINDOWSJAVAFILENAME'}; }
1038
1038
1039 replace_one_variable($templatefile, "WINDOWSJAVAFILENAMEPLACEHOLDER", $javaversion);
1040}
1041
1042##################################################################
1043# Windows: Including the product version into nsi template
1044##################################################################
1045
1046sub put_windows_productversion_into_template
1047{
1048 my ($templatefile, $variableshashref) = @_;
1039 replace_one_variable($templatefile, "WINDOWSJAVAFILENAMEPLACEHOLDER", $javaversion);
1040}
1041
1042##################################################################
1043# Windows: Including the product version into nsi template
1044##################################################################
1045
1046sub put_windows_productversion_into_template
1047{
1048 my ($templatefile, $variableshashref) = @_;
1049
1049
1050 my $productversion = $variableshashref->{'PRODUCTVERSION'};
1050 my $productversion = $variableshashref->{'PRODUCTVERSION'};
1051
1051
1052 replace_one_variable($templatefile, "PRODUCTVERSIONPLACEHOLDER", $productversion);
1053}
1054
1055##################################################################
1056# Windows: Including the product version into nsi template
1057##################################################################
1058
1059sub put_windows_productpath_into_template
1060{
1061 my ($templatefile, $variableshashref, $languagestringref, $localnsisdir) = @_;
1052 replace_one_variable($templatefile, "PRODUCTVERSIONPLACEHOLDER", $productversion);
1053}
1054
1055##################################################################
1056# Windows: Including the product version into nsi template
1057##################################################################
1058
1059sub put_windows_productpath_into_template
1060{
1061 my ($templatefile, $variableshashref, $languagestringref, $localnsisdir) = @_;
1062
1062
1063 my $productpath = $variableshashref->{'PROPERTYTABLEPRODUCTNAME'};
1063 my $productpath = $variableshashref->{'PROPERTYTABLEPRODUCTNAME'};
1064
1064
1065 my $locallangs = $$languagestringref;
1066 $locallangs =~ s/_/ /g;
1067 if (length($locallangs) > $installer::globals::max_lang_length) { $locallangs = "multi lingual"; }
1068
1065 my $locallangs = $$languagestringref;
1066 $locallangs =~ s/_/ /g;
1067 if (length($locallangs) > $installer::globals::max_lang_length) { $locallangs = "multi lingual"; }
1068
1069 if ( ! $installer::globals::languagepack ) { $productpath = $productpath . " (" . $locallangs . ")"; }
1069 if ( ! $installer::globals::languagepack ) { $productpath = $productpath . " (" . $locallangs . ")"; }
1070
1071 replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER", $productpath);
1072}
1073
1074##################################################################
1075# Windows: Including download file name into nsi template
1076##################################################################
1077
1078sub put_outputfilename_into_template
1079{
1080 my ($templatefile, $downloadname) = @_;
1070
1071 replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER", $productpath);
1072}
1073
1074##################################################################
1075# Windows: Including download file name into nsi template
1076##################################################################
1077
1078sub put_outputfilename_into_template
1079{
1080 my ($templatefile, $downloadname) = @_;
1081
1081
1082 $installer::globals::downloadfileextension = ".exe";
1083 $downloadname = $downloadname . $installer::globals::downloadfileextension;
1084 $installer::globals::downloadfilename = $downloadname;
1085
1086 replace_one_variable($templatefile, "DOWNLOADNAMEPLACEHOLDER", $downloadname);
1087}
1088
1089##################################################################
1090# Windows: Generating the file list in nsi file format
1091##################################################################
1092
1093sub get_file_list
1094{
1095 my ( $basedir ) = @_;
1096
1097 my @filelist = ();
1098
1099 my $alldirs = installer::systemactions::get_all_directories($basedir);
1100 unshift(@{$alldirs}, $basedir); # $basedir is the first directory in $alldirs
1082 $installer::globals::downloadfileextension = ".exe";
1083 $downloadname = $downloadname . $installer::globals::downloadfileextension;
1084 $installer::globals::downloadfilename = $downloadname;
1085
1086 replace_one_variable($templatefile, "DOWNLOADNAMEPLACEHOLDER", $downloadname);
1087}
1088
1089##################################################################
1090# Windows: Generating the file list in nsi file format
1091##################################################################
1092
1093sub get_file_list
1094{
1095 my ( $basedir ) = @_;
1096
1097 my @filelist = ();
1098
1099 my $alldirs = installer::systemactions::get_all_directories($basedir);
1100 unshift(@{$alldirs}, $basedir); # $basedir is the first directory in $alldirs
1101
1101
1102 for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
1103 {
1104 my $onedir = ${$alldirs}[$i];
1102 for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
1103 {
1104 my $onedir = ${$alldirs}[$i];
1105
1105
1106 # Syntax:
1107 # SetOutPath "$INSTDIR"
1108
1109 my $relativedir = $onedir;
1110 $relativedir =~ s/\Q$basedir\E//;
1111
1112 my $oneline = " " . "SetOutPath" . " " . "\"\$INSTDIR" . $relativedir . "\"" . "\n";
1106 # Syntax:
1107 # SetOutPath "$INSTDIR"
1108
1109 my $relativedir = $onedir;
1110 $relativedir =~ s/\Q$basedir\E//;
1111
1112 my $oneline = " " . "SetOutPath" . " " . "\"\$INSTDIR" . $relativedir . "\"" . "\n";
1113
1113
1114 if ( $^O =~ /cygwin/i ) {
1115 $oneline =~ s/\//\\/g;
1116 }
1117 push(@filelist, $oneline);
1114 if ( $^O =~ /cygwin/i ) {
1115 $oneline =~ s/\//\\/g;
1116 }
1117 push(@filelist, $oneline);
1118
1118
1119 # Collecting all files in the specific directory
1119 # Collecting all files in the specific directory
1120
1120
1121 my $files = installer::systemactions::get_all_files_from_one_directory($onedir);
1121 my $files = installer::systemactions::get_all_files_from_one_directory($onedir);
1122
1122
1123 for ( my $j = 0; $j <= $#{$files}; $j++ )
1124 {
1125 my $onefile = ${$files}[$j];
1123 for ( my $j = 0; $j <= $#{$files}; $j++ )
1124 {
1125 my $onefile = ${$files}[$j];
1126
1126
1127 my $fileline = " " . "File" . " " . "\"" . $onefile . "\"" . "\n";
1128
1129 if ( $^O =~ /cygwin/i ) {
1130 $fileline =~ s/\//\\/g;
1131 }
1132 push(@filelist, $fileline);
1133 }
1134 }
1135
1136 return \@filelist;
1137}
1138
1139##################################################################
1140# Windows: Including list of all files into nsi template
1141##################################################################
1142
1143sub put_filelist_into_template
1144{
1145 my ($templatefile, $installationdir) = @_;
1127 my $fileline = " " . "File" . " " . "\"" . $onefile . "\"" . "\n";
1128
1129 if ( $^O =~ /cygwin/i ) {
1130 $fileline =~ s/\//\\/g;
1131 }
1132 push(@filelist, $fileline);
1133 }
1134 }
1135
1136 return \@filelist;
1137}
1138
1139##################################################################
1140# Windows: Including list of all files into nsi template
1141##################################################################
1142
1143sub put_filelist_into_template
1144{
1145 my ($templatefile, $installationdir) = @_;
1146
1146
1147 my $filelist = get_file_list($installationdir);
1148
1149 my $filestring = "";
1150
1151 for ( my $i = 0; $i <= $#{$filelist}; $i++ )
1152 {
1153 $filestring = $filestring . ${$filelist}[$i];
1154 }
1147 my $filelist = get_file_list($installationdir);
1148
1149 my $filestring = "";
1150
1151 for ( my $i = 0; $i <= $#{$filelist}; $i++ )
1152 {
1153 $filestring = $filestring . ${$filelist}[$i];
1154 }
1155
1155
1156 $filestring =~ s/\s*$//;
1156 $filestring =~ s/\s*$//;
1157
1157
1158 replace_one_variable($templatefile, "ALLFILESPLACEHOLDER", $filestring);
1159}
1160
1161##################################################################
1162# Windows: NSIS uses specific language names
1163##################################################################
1164
1165sub nsis_language_converter
1166{
1167 my ($language) = @_;
1158 replace_one_variable($templatefile, "ALLFILESPLACEHOLDER", $filestring);
1159}
1160
1161##################################################################
1162# Windows: NSIS uses specific language names
1163##################################################################
1164
1165sub nsis_language_converter
1166{
1167 my ($language) = @_;
1168
1168
1169 my $nsislanguage = "";
1170
1171 # Assign language used by NSIS.
1172 # The files "$nsislanguage.nsh" and "$nsislanguage.nlf"
1173 # are needed in the NSIS environment.
1174 # Directory: <NSIS-Dir>/Contrib/Language files
1175 if ( $language eq "en-US" ) { $nsislanguage = "English"; }
1176 elsif ( $language eq "af" ) { $nsislanguage = "Afrikaans"; }

--- 84 unchanged lines hidden (view full) ---

1261 # Syntax: !insertmacro MUI_LANGUAGE "English"
1262 my $langstring = "\!insertmacro MUI_LANGUAGE_PACK " . $nsislanguage . "\n";
1263 if ( $nsislanguage eq "English" )
1264 {
1265 $alllangstring = $langstring . $alllangstring;
1266 }
1267 else
1268 {
1169 my $nsislanguage = "";
1170
1171 # Assign language used by NSIS.
1172 # The files "$nsislanguage.nsh" and "$nsislanguage.nlf"
1173 # are needed in the NSIS environment.
1174 # Directory: <NSIS-Dir>/Contrib/Language files
1175 if ( $language eq "en-US" ) { $nsislanguage = "English"; }
1176 elsif ( $language eq "af" ) { $nsislanguage = "Afrikaans"; }

--- 84 unchanged lines hidden (view full) ---

1261 # Syntax: !insertmacro MUI_LANGUAGE "English"
1262 my $langstring = "\!insertmacro MUI_LANGUAGE_PACK " . $nsislanguage . "\n";
1263 if ( $nsislanguage eq "English" )
1264 {
1265 $alllangstring = $langstring . $alllangstring;
1266 }
1267 else
1268 {
1269 $alllangstring = $alllangstring . $langstring;
1269 $alllangstring = $alllangstring . $langstring;
1270 }
1271 }
1272
1273 $alllangstring =~ s/\s*$//;
1270 }
1271 }
1272
1273 $alllangstring =~ s/\s*$//;
1274
1274
1275 replace_one_variable($templatefile, "ALLLANGUAGESPLACEHOLDER", $alllangstring);
1276}
1277
1278##################################################################
1279# Windows: Collecting all identifier from mlf file
1280##################################################################
1281
1282sub get_identifier
1283{
1284 my ( $mlffile ) = @_;
1275 replace_one_variable($templatefile, "ALLLANGUAGESPLACEHOLDER", $alllangstring);
1276}
1277
1278##################################################################
1279# Windows: Collecting all identifier from mlf file
1280##################################################################
1281
1282sub get_identifier
1283{
1284 my ( $mlffile ) = @_;
1285
1285
1286 my @identifier = ();
1286 my @identifier = ();
1287
1287
1288 for ( my $i = 0; $i <= $#{$mlffile}; $i++ )
1289 {
1290 my $oneline = ${$mlffile}[$i];
1291
1292 if ( $oneline =~ /^\s*\[(.+)\]\s*$/ )
1293 {
1294 my $identifier = $1;
1295 push(@identifier, $identifier);

--- 10 unchanged lines hidden (view full) ---

1306
1307sub get_language_block_from_language_file
1308{
1309 my ($searchstring, $languagefile) = @_;
1310
1311 my @language_block = ();
1312
1313 for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
1288 for ( my $i = 0; $i <= $#{$mlffile}; $i++ )
1289 {
1290 my $oneline = ${$mlffile}[$i];
1291
1292 if ( $oneline =~ /^\s*\[(.+)\]\s*$/ )
1293 {
1294 my $identifier = $1;
1295 push(@identifier, $identifier);

--- 10 unchanged lines hidden (view full) ---

1306
1307sub get_language_block_from_language_file
1308{
1309 my ($searchstring, $languagefile) = @_;
1310
1311 my @language_block = ();
1312
1313 for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
1314 {
1314 {
1315 if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
1316 {
1317 my $counter = $i;
1318
1319 push(@language_block, ${$languagefile}[$counter]);
1320 $counter++;
1315 if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
1316 {
1317 my $counter = $i;
1318
1319 push(@language_block, ${$languagefile}[$counter]);
1320 $counter++;
1321
1321
1322 while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ )))
1323 {
1324 push(@language_block, ${$languagefile}[$counter]);
1325 $counter++;
1326 }
1322 while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ )))
1323 {
1324 push(@language_block, ${$languagefile}[$counter]);
1325 $counter++;
1326 }
1327
1327
1328 last;
1329 }
1328 last;
1329 }
1330 }
1331
1330 }
1331
1332 return \@language_block;
1333}
1334
1335##############################################################
1336# Returning a specific language string from the block
1337# of all translations
1338##############################################################
1339
1340sub get_language_string_from_language_block
1341{
1342 my ($language_block, $language) = @_;
1332 return \@language_block;
1333}
1334
1335##############################################################
1336# Returning a specific language string from the block
1337# of all translations
1338##############################################################
1339
1340sub get_language_string_from_language_block
1341{
1342 my ($language_block, $language) = @_;
1343
1343
1344 my $newstring = "";
1345
1346 for ( my $i = 0; $i <= $#{$language_block}; $i++ )
1347 {
1348 if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
1349 {
1350 $newstring = $1;
1351 last;
1344 my $newstring = "";
1345
1346 for ( my $i = 0; $i <= $#{$language_block}; $i++ )
1347 {
1348 if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
1349 {
1350 $newstring = $1;
1351 last;
1352 }
1353 }
1354
1352 }
1353 }
1354
1355 if ( $newstring eq "" )
1356 {
1355 if ( $newstring eq "" )
1356 {
1357 $language = "en-US"; # defaulting to english
1357 $language = "en-US"; # defaulting to English
1358
1359 for ( my $i = 0; $i <= $#{$language_block}; $i++ )
1358
1359 for ( my $i = 0; $i <= $#{$language_block}; $i++ )
1360 {
1360 {
1361 if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
1362 {
1363 $newstring = $1;
1364 last;
1365 }
1366 }
1367 }
1361 if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
1362 {
1363 $newstring = $1;
1364 last;
1365 }
1366 }
1367 }
1368
1368
1369 return $newstring;
1370}
1371
1372##################################################################
1373# Windows: Replacing strings in NSIS nsh file
1374# nsh file syntax:
1375# !define MUI_TEXT_DIRECTORY_TITLE "Choose Install Location"
1376##################################################################
1377
1378sub replace_identifier_in_nshfile
1379{
1380 my ( $nshfile, $identifier, $newstring, $nshfilename, $onelanguage ) = @_;
1381
1369 return $newstring;
1370}
1371
1372##################################################################
1373# Windows: Replacing strings in NSIS nsh file
1374# nsh file syntax:
1375# !define MUI_TEXT_DIRECTORY_TITLE "Choose Install Location"
1376##################################################################
1377
1378sub replace_identifier_in_nshfile
1379{
1380 my ( $nshfile, $identifier, $newstring, $nshfilename, $onelanguage ) = @_;
1381
1382 $newstring =~ s/\\r/\$\\r/g; # \r -> $\r in modern nsis versions
1383 $newstring =~ s/\\n/\$\\n/g; # \n -> $\n in modern nsis versions
1384
1382 for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
1383 {
1384 if ( ${$nshfile}[$i] =~ /\s+\Q$identifier\E\s+\"(.+)\"\s*$/ )
1385 {
1386 my $oldstring = $1;
1387 ${$nshfile}[$i] =~ s/\Q$oldstring\E/$newstring/;
1388 $installer::logger::Lang->printf("NSIS replacement in %s (%s): \-\> %s\n",
1389 $nshfilename,

--- 24 unchanged lines hidden (view full) ---

1414 ${$nlffile}[$next] = $newstring . "\n";
1415 $oldstring =~ s/\s*$//;
1416 $installer::logger::Lang->printf("NSIS replacement in %s (%s): %s \-\> %s\n",
1417 $nlffilename,
1418 $onelanguage,
1419 $oldstring,
1420 $newstring);
1421 }
1385 for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
1386 {
1387 if ( ${$nshfile}[$i] =~ /\s+\Q$identifier\E\s+\"(.+)\"\s*$/ )
1388 {
1389 my $oldstring = $1;
1390 ${$nshfile}[$i] =~ s/\Q$oldstring\E/$newstring/;
1391 $installer::logger::Lang->printf("NSIS replacement in %s (%s): \-\> %s\n",
1392 $nshfilename,

--- 24 unchanged lines hidden (view full) ---

1417 ${$nlffile}[$next] = $newstring . "\n";
1418 $oldstring =~ s/\s*$//;
1419 $installer::logger::Lang->printf("NSIS replacement in %s (%s): %s \-\> %s\n",
1420 $nlffilename,
1421 $onelanguage,
1422 $oldstring,
1423 $newstring);
1424 }
1422 }
1425 }
1423}
1424
1425##################################################################
1426# Windows: Translating the NSIS nsh and nlf file
1427##################################################################
1428
1429sub translate_nsh_nlf_file
1430{
1431 my ($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage) = @_;
1432
1433 # Analyzing the mlf file, collecting all Identifier
1434 my $allidentifier = get_identifier($mlffile);
1426}
1427
1428##################################################################
1429# Windows: Translating the NSIS nsh and nlf file
1430##################################################################
1431
1432sub translate_nsh_nlf_file
1433{
1434 my ($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage) = @_;
1435
1436 # Analyzing the mlf file, collecting all Identifier
1437 my $allidentifier = get_identifier($mlffile);
1435
1438
1436 $onelanguage = "en-US" if ( $nsislanguage eq "English" && $onelanguage ne "en-US");
1437 for ( my $i = 0; $i <= $#{$allidentifier}; $i++ )
1438 {
1439 my $identifier = ${$allidentifier}[$i];
1440 my $language_block = get_language_block_from_language_file($identifier, $mlffile);
1441 my $newstring = get_language_string_from_language_block($language_block, $onelanguage);
1439 $onelanguage = "en-US" if ( $nsislanguage eq "English" && $onelanguage ne "en-US");
1440 for ( my $i = 0; $i <= $#{$allidentifier}; $i++ )
1441 {
1442 my $identifier = ${$allidentifier}[$i];
1443 my $language_block = get_language_block_from_language_file($identifier, $mlffile);
1444 my $newstring = get_language_string_from_language_block($language_block, $onelanguage);
1442
1445
1443 # removing mask
1444 $newstring =~ s/\\\'/\'/g;
1446 # removing mask
1447 $newstring =~ s/\\\'/\'/g;
1445
1448
1446 replace_identifier_in_nshfile($nshfile, $identifier, $newstring, $nshfilename, $onelanguage);
1449 replace_identifier_in_nshfile($nshfile, $identifier, $newstring, $nshfilename, $onelanguage);
1447 replace_identifier_in_nlffile($nlffile, $identifier, $newstring, $nlffilename, $onelanguage);
1450 replace_identifier_in_nlffile($nlffile, $identifier, $newstring, $nlffilename, $onelanguage);
1448 }
1449}
1450
1451##################################################################
1452# Converting utf 16 file to utf 8
1453##################################################################
1454
1455sub convert_utf16_to_utf8

--- 12 unchanged lines hidden (view full) ---

1468 {
1469 push @localfile, $line;
1470 }
1471 close( IN );
1472
1473 if ( open( OUT, ">:utf8", $filename ) )
1474 {
1475 print OUT @localfile;
1451 }
1452}
1453
1454##################################################################
1455# Converting utf 16 file to utf 8
1456##################################################################
1457
1458sub convert_utf16_to_utf8

--- 12 unchanged lines hidden (view full) ---

1471 {
1472 push @localfile, $line;
1473 }
1474 close( IN );
1475
1476 if ( open( OUT, ">:utf8", $filename ) )
1477 {
1478 print OUT @localfile;
1476 close(OUT);
1479 close(OUT);
1477 }
1478
1479 $savfilename = $filename . "_before.utf8";
1480 installer::systemactions::copy_one_file($filename, $savfilename);
1481}
1482
1483##################################################################
1484# Converting utf 8 file to utf 16

--- 13 unchanged lines hidden (view full) ---

1498 {
1499 push @localfile, $line;
1500 }
1501 close( IN );
1502
1503 if ( open( OUT, ">:raw:encoding(UTF16-LE):crlf:utf8", $filename ) )
1504 {
1505 print OUT @localfile;
1480 }
1481
1482 $savfilename = $filename . "_before.utf8";
1483 installer::systemactions::copy_one_file($filename, $savfilename);
1484}
1485
1486##################################################################
1487# Converting utf 8 file to utf 16

--- 13 unchanged lines hidden (view full) ---

1501 {
1502 push @localfile, $line;
1503 }
1504 close( IN );
1505
1506 if ( open( OUT, ">:raw:encoding(UTF16-LE):crlf:utf8", $filename ) )
1507 {
1508 print OUT @localfile;
1506 close(OUT);
1509 close(OUT);
1507 }
1508
1509 $savfilename = $filename . "_after.utf16";
1510 installer::systemactions::copy_one_file($filename, $savfilename);
1511}
1512
1513##################################################################
1514# Converting text string to utf 16

--- 17 unchanged lines hidden (view full) ---

1532
1533##################################################################
1534# Windows: Copying NSIS language files to local nsis directory
1535##################################################################
1536
1537sub copy_and_translate_nsis_language_files
1538{
1539 my ($nsispath, $localnsisdir, $languagesarrayref, $allvariables) = @_;
1510 }
1511
1512 $savfilename = $filename . "_after.utf16";
1513 installer::systemactions::copy_one_file($filename, $savfilename);
1514}
1515
1516##################################################################
1517# Converting text string to utf 16

--- 17 unchanged lines hidden (view full) ---

1535
1536##################################################################
1537# Windows: Copying NSIS language files to local nsis directory
1538##################################################################
1539
1540sub copy_and_translate_nsis_language_files
1541{
1542 my ($nsispath, $localnsisdir, $languagesarrayref, $allvariables) = @_;
1540
1543
1541 my $nlffilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Language\ files" . $installer::globals::separator;
1542 my $nshfilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Modern\ UI" . $installer::globals::separator . "Language files" . $installer::globals::separator;
1543
1544 for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
1545 {
1546 my $onelanguage = ${$languagesarrayref}[$i];
1547 my $nsislanguage = nsis_language_converter($onelanguage);
1548
1549 # Copying the nlf file
1550 my $sourcepath = $nlffilepath . $nsislanguage . "\.nlf";
1551 if ( ! -f $sourcepath ) { installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files"); }
1552 my $nlffilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nlf";
1553 if ( $^O =~ /cygwin/i ) { $nlffilename =~ s/\//\\/g; }
1554 installer::systemactions::copy_one_file($sourcepath, $nlffilename);
1544 my $nlffilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Language\ files" . $installer::globals::separator;
1545 my $nshfilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Modern\ UI" . $installer::globals::separator . "Language files" . $installer::globals::separator;
1546
1547 for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
1548 {
1549 my $onelanguage = ${$languagesarrayref}[$i];
1550 my $nsislanguage = nsis_language_converter($onelanguage);
1551
1552 # Copying the nlf file
1553 my $sourcepath = $nlffilepath . $nsislanguage . "\.nlf";
1554 if ( ! -f $sourcepath ) { installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files"); }
1555 my $nlffilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nlf";
1556 if ( $^O =~ /cygwin/i ) { $nlffilename =~ s/\//\\/g; }
1557 installer::systemactions::copy_one_file($sourcepath, $nlffilename);
1555
1558
1556 # Copying the nsh file
1557 # In newer nsis versions, the nsh file is located next to the nlf file
1558 $sourcepath = $nshfilepath . $nsislanguage . "\.nsh";
1559 if ( ! -f $sourcepath )
1560 {
1561 # trying to find the nsh file next to the nlf file
1562 $sourcepath = $nlffilepath . $nsislanguage . "\.nsh";
1563 if ( ! -f $sourcepath )
1564 {
1565 installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files");
1566 }
1567 }
1568 my $nshfilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nsh";
1569 if ( $^O =~ /cygwin/i ) { $nshfilename =~ s/\//\\/g; }
1559 # Copying the nsh file
1560 # In newer nsis versions, the nsh file is located next to the nlf file
1561 $sourcepath = $nshfilepath . $nsislanguage . "\.nsh";
1562 if ( ! -f $sourcepath )
1563 {
1564 # trying to find the nsh file next to the nlf file
1565 $sourcepath = $nlffilepath . $nsislanguage . "\.nsh";
1566 if ( ! -f $sourcepath )
1567 {
1568 installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files");
1569 }
1570 }
1571 my $nshfilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nsh";
1572 if ( $^O =~ /cygwin/i ) { $nshfilename =~ s/\//\\/g; }
1570 installer::systemactions::copy_one_file($sourcepath, $nshfilename);
1573 installer::systemactions::copy_one_file($sourcepath, $nshfilename);
1571
1572 # Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN -> MUI_LANGUAGEFILE_PACK_BEGIN
1574
1575 # Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN -> MUI_LANGUAGEFILE_PACK_BEGIN
1573 convert_utf16_to_utf8($nshfilename);
1574 convert_utf16_to_utf8($nlffilename);
1576 #convert_utf16_to_utf8($nshfilename);
1577 #convert_utf16_to_utf8($nlffilename);
1575 my $nshfile = installer::files::read_file($nshfilename);
1576 replace_one_variable($nshfile, "MUI_LANGUAGEFILE_BEGIN", "MUI_LANGUAGEFILE_PACK_BEGIN");
1577
1578 # find the ulf file for translation
1579 my $mlffile = get_translation_file($allvariables);
1578 my $nshfile = installer::files::read_file($nshfilename);
1579 replace_one_variable($nshfile, "MUI_LANGUAGEFILE_BEGIN", "MUI_LANGUAGEFILE_PACK_BEGIN");
1580
1581 # find the ulf file for translation
1582 my $mlffile = get_translation_file($allvariables);
1580
1583
1581 # Translate the files
1582 my $nlffile = installer::files::read_file($nlffilename);
1583 translate_nsh_nlf_file($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage);
1584 # Translate the files
1585 my $nlffile = installer::files::read_file($nlffilename);
1586 translate_nsh_nlf_file($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage);
1584
1587
1585 installer::files::save_file($nshfilename, $nshfile);
1586 installer::files::save_file($nlffilename, $nlffile);
1587
1588 installer::files::save_file($nshfilename, $nshfile);
1589 installer::files::save_file($nlffilename, $nlffile);
1590
1588 convert_utf8_to_utf16($nshfilename);
1589 convert_utf8_to_utf16($nlffilename);
1591 #convert_utf8_to_utf16($nshfilename);
1592 #convert_utf8_to_utf16($nlffilename);
1590 }
1591
1592}
1593
1594##################################################################
1595# Windows: Including the nsis path into the nsi template
1596##################################################################
1597

--- 32 unchanged lines hidden (view full) ---

1630 if ( $nsispath eq "" )
1631 {
1632 $installer::logger::Info->print("... no Environment variable \"NSIS_PATH\"!\n");
1633 }
1634 elsif ( ! -d $nsispath )
1635 {
1636 installer::exiter::exit_program("ERROR: NSIS path $nsispath does not exist!", "get_path_to_nsis_sdk");
1637 }
1593 }
1594
1595}
1596
1597##################################################################
1598# Windows: Including the nsis path into the nsi template
1599##################################################################
1600

--- 32 unchanged lines hidden (view full) ---

1633 if ( $nsispath eq "" )
1634 {
1635 $installer::logger::Info->print("... no Environment variable \"NSIS_PATH\"!\n");
1636 }
1637 elsif ( ! -d $nsispath )
1638 {
1639 installer::exiter::exit_program("ERROR: NSIS path $nsispath does not exist!", "get_path_to_nsis_sdk");
1640 }
1638
1641
1639 return $nsispath;
1640}
1641
1642##################################################################
1643# Windows: Executing NSIS to create the installation set
1644##################################################################
1645
1646sub call_nsis
1647{
1648 my ( $nsispath, $nsifile ) = @_;
1642 return $nsispath;
1643}
1644
1645##################################################################
1646# Windows: Executing NSIS to create the installation set
1647##################################################################
1648
1649sub call_nsis
1650{
1651 my ( $nsispath, $nsifile ) = @_;
1649
1652
1650 my $makensisexe = $nsispath . $installer::globals::separator . "makensis.exe";
1651
1652 $installer::logger::Info->printf("... starting %s ... \n", $makensisexe);
1653
1654 if( $^O =~ /cygwin/i ) { $nsifile =~ s/\\/\//g; }
1655
1656 my $systemcall = "$makensisexe $nsifile |";
1657

--- 9 unchanged lines hidden (view full) ---

1667
1668 if ($returnvalue)
1669 {
1670 $installer::logger::Lang->printf("ERROR: %s !\n", $systemcall);
1671 }
1672 else
1673 {
1674 $installer::logger::Lang->printf("Success: %s\n", $systemcall);
1653 my $makensisexe = $nsispath . $installer::globals::separator . "makensis.exe";
1654
1655 $installer::logger::Info->printf("... starting %s ... \n", $makensisexe);
1656
1657 if( $^O =~ /cygwin/i ) { $nsifile =~ s/\\/\//g; }
1658
1659 my $systemcall = "$makensisexe $nsifile |";
1660

--- 9 unchanged lines hidden (view full) ---

1670
1671 if ($returnvalue)
1672 {
1673 $installer::logger::Lang->printf("ERROR: %s !\n", $systemcall);
1674 }
1675 else
1676 {
1677 $installer::logger::Lang->printf("Success: %s\n", $systemcall);
1675 }
1678 }
1676
1677 foreach my $line (@nsisoutput)
1678 {
1679 $installer::logger::Lang->print($line);
1680 }
1681}
1682
1683#################################################################################
1684# Replacing one variable in one files
1685#################################################################################
1686
1687sub replace_one_variable_in_translationfile
1688{
1689 my ($translationfile, $variable, $searchstring) = @_;
1679
1680 foreach my $line (@nsisoutput)
1681 {
1682 $installer::logger::Lang->print($line);
1683 }
1684}
1685
1686#################################################################################
1687# Replacing one variable in one files
1688#################################################################################
1689
1690sub replace_one_variable_in_translationfile
1691{
1692 my ($translationfile, $variable, $searchstring) = @_;
1690
1693
1691 for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
1692 {
1693 ${$translationfile}[$i] =~ s/\%$searchstring/$variable/g;
1694 for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
1695 {
1696 ${$translationfile}[$i] =~ s/\%$searchstring/$variable/g;
1694 }
1697 }
1695}
1696
1697#################################################################################
1698# Replacing the variables in the translation file
1699#################################################################################
1700
1701sub replace_variables
1702{

--- 18 unchanged lines hidden (view full) ---

1721{
1722 my ($allvariableshashref) = @_;
1723 my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::nsisfilename . ".uulf";
1724 if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_translation_file"); }
1725 my $translationfile = installer::files::read_file($translationfilename);
1726 replace_variables($translationfile, $allvariableshashref);
1727
1728 $installer::logger::Lang->printf("Reading translation file: %s\n", $translationfilename);
1698}
1699
1700#################################################################################
1701# Replacing the variables in the translation file
1702#################################################################################
1703
1704sub replace_variables
1705{

--- 18 unchanged lines hidden (view full) ---

1724{
1725 my ($allvariableshashref) = @_;
1726 my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::nsisfilename . ".uulf";
1727 if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_translation_file"); }
1728 my $translationfile = installer::files::read_file($translationfilename);
1729 replace_variables($translationfile, $allvariableshashref);
1730
1731 $installer::logger::Lang->printf("Reading translation file: %s\n", $translationfilename);
1729
1732
1730 return $translationfile;
1731}
1732
1733####################################################
1733 return $translationfile;
1734}
1735
1736####################################################
1734# Removing english, if it was added before
1737# Removing English, if it was added before
1735####################################################
1736
1737sub remove_english_for_nsis_installer
1738{
1739 my ($languagestringref, $languagesarrayref) = @_;
1740
1741 # $$languagestringref =~ s/en-US_//;
1742 # shift(@{$languagesarrayref});
1743
1738####################################################
1739
1740sub remove_english_for_nsis_installer
1741{
1742 my ($languagestringref, $languagesarrayref) = @_;
1743
1744 # $$languagestringref =~ s/en-US_//;
1745 # shift(@{$languagesarrayref});
1746
1744 @{$languagesarrayref} = ("en-US"); # only english for NSIS installer!
1747 @{$languagesarrayref} = ("en-US"); # only English for NSIS installer!
1745}
1746
1747####################################################
1748# Creating link tree for upload
1749####################################################
1750
1751sub create_link_tree
1752{
1753 my ($sourcedownloadfile, $destfilename, $versionstring) = @_;
1748}
1749
1750####################################################
1751# Creating link tree for upload
1752####################################################
1753
1754sub create_link_tree
1755{
1756 my ($sourcedownloadfile, $destfilename, $versionstring) = @_;
1754
1757
1755 if ( ! $installer::globals::ooouploaddir ) { installer::exiter::exit_program("ERROR: Directory for AOO upload not defined!", "create_link_tree"); }
1756 my $versiondir = $installer::globals::ooouploaddir . $installer::globals::separator . $versionstring;
1757 $installer::logger::Lang->printf("Directory for the link: %s\n", $versiondir);
1758 if ( ! $installer::globals::ooouploaddir ) { installer::exiter::exit_program("ERROR: Directory for AOO upload not defined!", "create_link_tree"); }
1759 my $versiondir = $installer::globals::ooouploaddir . $installer::globals::separator . $versionstring;
1760 $installer::logger::Lang->printf("Directory for the link: %s\n", $versiondir);
1758
1761
1759 if ( ! -d $versiondir ) { installer::systemactions::create_directory_structure($versiondir); }
1762 if ( ! -d $versiondir ) { installer::systemactions::create_directory_structure($versiondir); }
1760
1761 # inside directory $versiondir all links have to be created
1763
1764 # inside directory $versiondir all links have to be created
1762 my $linkdestination = $versiondir . $installer::globals::separator . $destfilename;
1763
1764 # If there is an older version of this file (link), it has to be removed
1765 if ( -f $linkdestination ) { unlink($linkdestination); }
1766
1767 $installer::logger::Lang->printf("Creating hard link from %s to %s\n", $sourcedownloadfile, $linkdestination);
1765 my $linkdestination = $versiondir . $installer::globals::separator . $destfilename;
1766
1767 # If there is an older version of this file (link), it has to be removed
1768 if ( -f $linkdestination ) { unlink($linkdestination); }
1769
1770 $installer::logger::Lang->printf("Creating hard link from %s to %s\n", $sourcedownloadfile, $linkdestination);
1768 installer::systemactions::hardlink_one_file($sourcedownloadfile, $linkdestination);
1771 installer::systemactions::hardlink_one_file($sourcedownloadfile, $linkdestination);
1769}
1770
1771#######################################################
1772# Setting supported platform for OpenOffice builds
1773#######################################################
1774
1775sub is_supported_platform
1776{
1777 my $is_supported = 0;
1772}
1773
1774#######################################################
1775# Setting supported platform for OpenOffice builds
1776#######################################################
1777
1778sub is_supported_platform
1779{
1780 my $is_supported = 0;
1778
1781
1779 if (( $installer::globals::islinuxrpmbuild ) ||
1780 ( $installer::globals::issolarissparcbuild ) ||
1781 ( $installer::globals::issolarisx86build ) ||
1782 ( $installer::globals::iswindowsbuild ))
1783 {
1784 $is_supported = 1;
1785 }
1786
1787 return $is_supported;
1788}
1789
1790####################################################
1791# Creating download installation sets
1792####################################################
1793
1794sub create_download_sets
1795{
1796 my ($installationdir, $includepatharrayref, $allvariableshashref, $downloadname, $languagestringref, $languagesarrayref) = @_;
1782 if (( $installer::globals::islinuxrpmbuild ) ||
1783 ( $installer::globals::issolarissparcbuild ) ||
1784 ( $installer::globals::issolarisx86build ) ||
1785 ( $installer::globals::iswindowsbuild ))
1786 {
1787 $is_supported = 1;
1788 }
1789
1790 return $is_supported;
1791}
1792
1793####################################################
1794# Creating download installation sets
1795####################################################
1796
1797sub create_download_sets
1798{
1799 my ($installationdir, $includepatharrayref, $allvariableshashref, $downloadname, $languagestringref, $languagesarrayref) = @_;
1797
1800
1798 $installer::logger::Info->print("\n");
1799 $installer::logger::Info->print("******************************************\n");
1800 $installer::logger::Info->print("... creating download installation set ...\n", 1);
1801 $installer::logger::Info->print("******************************************\n");
1802
1803 installer::logger::include_header_into_logfile("Creating download installation sets:");
1804
1805 # special handling for installation sets, to which english was added automatically
1806 if ( $installer::globals::added_english ) { remove_english_for_nsis_installer($languagestringref, $languagesarrayref); }
1807
1808 my $firstdir = $installationdir;
1809 installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir);
1801 $installer::logger::Info->print("\n");
1802 $installer::logger::Info->print("******************************************\n");
1803 $installer::logger::Info->print("... creating download installation set ...\n", 1);
1804 $installer::logger::Info->print("******************************************\n");
1805
1806 installer::logger::include_header_into_logfile("Creating download installation sets:");
1807
1808 # special handling for installation sets, to which english was added automatically
1809 if ( $installer::globals::added_english ) { remove_english_for_nsis_installer($languagestringref, $languagesarrayref); }
1810
1811 my $firstdir = $installationdir;
1812 installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir);
1810
1813
1811 my $lastdir = $installationdir;
1812 installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$lastdir);
1813
1814 if ( $lastdir =~ /\./ ) { $lastdir =~ s/\./_download_inprogress\./ }
1815 else { $lastdir = $lastdir . "_download_inprogress"; }
1816
1817 # removing existing directory "_native_packed_inprogress" and "_native_packed_witherror" and "_native_packed"
1818
1819 my $downloaddir = $firstdir . $lastdir;
1814 my $lastdir = $installationdir;
1815 installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$lastdir);
1816
1817 if ( $lastdir =~ /\./ ) { $lastdir =~ s/\./_download_inprogress\./ }
1818 else { $lastdir = $lastdir . "_download_inprogress"; }
1819
1820 # removing existing directory "_native_packed_inprogress" and "_native_packed_witherror" and "_native_packed"
1821
1822 my $downloaddir = $firstdir . $lastdir;
1820
1823
1821 if ( -d $downloaddir ) { installer::systemactions::remove_complete_directory($downloaddir); }
1824 if ( -d $downloaddir ) { installer::systemactions::remove_complete_directory($downloaddir); }
1822
1825
1823 my $olddir = $downloaddir;
1824 $olddir =~ s/_inprogress/_witherror/;
1825 if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
1826
1827 $olddir = $downloaddir;
1828 $olddir =~ s/_inprogress//;
1829 if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
1830
1831 # creating the new directory
1826 my $olddir = $downloaddir;
1827 $olddir =~ s/_inprogress/_witherror/;
1828 if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
1829
1830 $olddir = $downloaddir;
1831 $olddir =~ s/_inprogress//;
1832 if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
1833
1834 # creating the new directory
1832
1835
1833 installer::systemactions::create_directory($downloaddir);
1834
1835 $installer::globals::saveinstalldir = $downloaddir;
1836
1837 # evaluating the name of the download file
1838
1839 if ( $allvariableshashref->{'AOODOWNLOADNAME'} )
1840 {

--- 30 unchanged lines hidden (view full) ---

1871 {
1872 $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$scriptfilename, $includepatharrayref, 0);
1873 }
1874
1875 if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find script file $scriptfilename!", "create_download_sets"); }
1876 my $scriptfile = installer::files::read_file($$scriptref);
1877
1878 $installer::logger::Lang->printf("Found script file %s: %s \n", $scriptfilename, $$scriptref);
1836 installer::systemactions::create_directory($downloaddir);
1837
1838 $installer::globals::saveinstalldir = $downloaddir;
1839
1840 # evaluating the name of the download file
1841
1842 if ( $allvariableshashref->{'AOODOWNLOADNAME'} )
1843 {

--- 30 unchanged lines hidden (view full) ---

1874 {
1875 $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$scriptfilename, $includepatharrayref, 0);
1876 }
1877
1878 if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find script file $scriptfilename!", "create_download_sets"); }
1879 my $scriptfile = installer::files::read_file($$scriptref);
1880
1881 $installer::logger::Lang->printf("Found script file %s: %s \n", $scriptfilename, $$scriptref);
1879
1882
1880 # add product name into script template
1881 put_productname_into_script($scriptfile, $allvariableshashref);
1882
1883 # replace linenumber in script template
1884 put_linenumber_into_script($scriptfile);
1885
1886 # create tar file
1887 my $temporary_tarfile_name = $downloaddir . $installer::globals::separator . 'installset.tar';
1888 my $size = tar_package($installationdir, $temporary_tarfile_name, $getuidlibrary);
1889 installer::exiter::exit_program("ERROR: Could not create tar file $temporary_tarfile_name!", "create_download_sets") unless $size;
1890
1891 # calling sum to determine checksum and size of the tar file
1892 my $sumout = call_sum($temporary_tarfile_name);
1883 # add product name into script template
1884 put_productname_into_script($scriptfile, $allvariableshashref);
1885
1886 # replace linenumber in script template
1887 put_linenumber_into_script($scriptfile);
1888
1889 # create tar file
1890 my $temporary_tarfile_name = $downloaddir . $installer::globals::separator . 'installset.tar';
1891 my $size = tar_package($installationdir, $temporary_tarfile_name, $getuidlibrary);
1892 installer::exiter::exit_program("ERROR: Could not create tar file $temporary_tarfile_name!", "create_download_sets") unless $size;
1893
1894 # calling sum to determine checksum and size of the tar file
1895 my $sumout = call_sum($temporary_tarfile_name);
1893
1896
1894 # writing checksum and size into scriptfile
1895 put_checksum_and_size_into_script($scriptfile, $sumout);
1897 # writing checksum and size into scriptfile
1898 put_checksum_and_size_into_script($scriptfile, $sumout);
1896
1899
1897 # saving the script file
1898 my $newscriptfilename = determine_scriptfile_name($downloadname);
1899 $newscriptfilename = save_script_file($downloaddir, $newscriptfilename, $scriptfile);
1900
1901 $installer::logger::Info->printf("... including installation set into %s ... \n", $newscriptfilename);
1902 # Append tar file to script
1903 include_tar_into_script($newscriptfilename, $temporary_tarfile_name);
1904 }

--- 12 unchanged lines hidden (view full) ---

1917 $installer::logger::Lang->print("\n");
1918 $installer::logger::Lang->printf("No NSIS SDK found. Skipping the generation of NSIS file.\n");
1919 $installer::logger::Info->print("... no NSIS SDK found. Skipping the generation of NSIS file ... \n");
1920 return $downloaddir;
1921 }
1922
1923 # copy language files into nsis directory and translate them
1924 copy_and_translate_nsis_language_files($nsispath, $localnsisdir, $languagesarrayref, $allvariableshashref);
1900 # saving the script file
1901 my $newscriptfilename = determine_scriptfile_name($downloadname);
1902 $newscriptfilename = save_script_file($downloaddir, $newscriptfilename, $scriptfile);
1903
1904 $installer::logger::Info->printf("... including installation set into %s ... \n", $newscriptfilename);
1905 # Append tar file to script
1906 include_tar_into_script($newscriptfilename, $temporary_tarfile_name);
1907 }

--- 12 unchanged lines hidden (view full) ---

1920 $installer::logger::Lang->print("\n");
1921 $installer::logger::Lang->printf("No NSIS SDK found. Skipping the generation of NSIS file.\n");
1922 $installer::logger::Info->print("... no NSIS SDK found. Skipping the generation of NSIS file ... \n");
1923 return $downloaddir;
1924 }
1925
1926 # copy language files into nsis directory and translate them
1927 copy_and_translate_nsis_language_files($nsispath, $localnsisdir, $languagesarrayref, $allvariableshashref);
1925
1928
1926 # find and read the nsi file template
1927 my $templatefilename = "downloadtemplate.nsi";
1928
1929 my $templateref = "";
1930
1931 if ( $installer::globals::include_pathes_read )
1932 {
1933 $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$templatefilename, $includepatharrayref, 0);

--- 16 unchanged lines hidden (view full) ---

1950 put_javafilename_into_template($templatefile, $allvariableshashref);
1951 put_windows_productversion_into_template($templatefile, $allvariableshashref);
1952 put_windows_productpath_into_template($templatefile, $allvariableshashref, $languagestringref, $localnsisdir);
1953 put_outputfilename_into_template($templatefile, $downloadname);
1954 put_filelist_into_template($templatefile, $installationdir);
1955 put_language_list_into_template($templatefile, $languagesarrayref);
1956 put_nsis_path_into_template($templatefile, $localnsisdir);
1957 put_output_path_into_template($templatefile, $downloaddir);
1929 # find and read the nsi file template
1930 my $templatefilename = "downloadtemplate.nsi";
1931
1932 my $templateref = "";
1933
1934 if ( $installer::globals::include_pathes_read )
1935 {
1936 $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$templatefilename, $includepatharrayref, 0);

--- 16 unchanged lines hidden (view full) ---

1953 put_javafilename_into_template($templatefile, $allvariableshashref);
1954 put_windows_productversion_into_template($templatefile, $allvariableshashref);
1955 put_windows_productpath_into_template($templatefile, $allvariableshashref, $languagestringref, $localnsisdir);
1956 put_outputfilename_into_template($templatefile, $downloadname);
1957 put_filelist_into_template($templatefile, $installationdir);
1958 put_language_list_into_template($templatefile, $languagesarrayref);
1959 put_nsis_path_into_template($templatefile, $localnsisdir);
1960 put_output_path_into_template($templatefile, $downloaddir);
1958
1961
1959 my $nsifilename = save_script_file($localnsisdir, $templatefilename, $templatefile);
1960
1961 $installer::logger::Info->printf("... created NSIS file %s ... \n", $nsifilename);
1962 my $nsifilename = save_script_file($localnsisdir, $templatefilename, $templatefile);
1963
1964 $installer::logger::Info->printf("... created NSIS file %s ... \n", $nsifilename);
1962
1965
1963 # starting the NSIS SDK to create the download file
1966 # starting the NSIS SDK to create the download file
1964 call_nsis($nsispath, $nsifilename);
1967 call_nsis($nsispath, $nsifilename);
1965 }
1968 }
1966
1969
1967 return $downloaddir;
1968}
1969
1970####################################################
1971# Creating AOO upload tree
1972####################################################
1973
1974sub create_download_link_tree

--- 8 unchanged lines hidden (view full) ---

1983 installer::logger::include_header_into_logfile("Creating download hard link:");
1984 $installer::logger::Lang->print("\n");
1985 $installer::logger::Lang->add_timestamp("Performance Info: Creating hard link, start");
1986
1987 if ( is_supported_platform() )
1988 {
1989 my $versionstring = "";
1990 # Already defined $installer::globals::oooversionstring and $installer::globals::ooodownloadfilename ?
1970 return $downloaddir;
1971}
1972
1973####################################################
1974# Creating AOO upload tree
1975####################################################
1976
1977sub create_download_link_tree

--- 8 unchanged lines hidden (view full) ---

1986 installer::logger::include_header_into_logfile("Creating download hard link:");
1987 $installer::logger::Lang->print("\n");
1988 $installer::logger::Lang->add_timestamp("Performance Info: Creating hard link, start");
1989
1990 if ( is_supported_platform() )
1991 {
1992 my $versionstring = "";
1993 # Already defined $installer::globals::oooversionstring and $installer::globals::ooodownloadfilename ?
1991
1994
1992 if ( ! $installer::globals::oooversionstring ) { $versionstring = get_current_version(); }
1993 else { $versionstring = $installer::globals::oooversionstring; }
1995 if ( ! $installer::globals::oooversionstring ) { $versionstring = get_current_version(); }
1996 else { $versionstring = $installer::globals::oooversionstring; }
1994
1997
1995 # Is $versionstring empty? If yes, there is nothing to do now.
1996
1997 $installer::logger::Lang->printf("Version string is set to: %s\n", $versionstring);
1998 # Is $versionstring empty? If yes, there is nothing to do now.
1999
2000 $installer::logger::Lang->printf("Version string is set to: %s\n", $versionstring);
1998
2001
1999 if ( $versionstring )
2000 {
2001 # Now the downloadfilename has to be set (if not already done)
2002 my $destdownloadfilename = "";
2003 if ( ! $installer::globals::ooodownloadfilename ) { $destdownloadfilename = set_download_filename($languagestringref, $versionstring, $allvariableshashref); }
2004 else { $destdownloadfilename = $installer::globals::ooodownloadfilename; }
2005
2006 if ( $destdownloadfilename )

--- 4 unchanged lines hidden (view full) ---

2011
2012 my $sourcedownloadfile = $downloaddir . $installer::globals::separator . $installer::globals::downloadfilename;
2013
2014 $installer::logger::Lang->printf("Setting source download file name: %s\n", $sourcedownloadfile);
2015
2016 create_link_tree($sourcedownloadfile, $destdownloadfilename, $versionstring);
2017 # my $md5sumoutput = call_md5sum($downloadfile);
2018 # my $md5sum = get_md5sum($md5sumoutput);
2002 if ( $versionstring )
2003 {
2004 # Now the downloadfilename has to be set (if not already done)
2005 my $destdownloadfilename = "";
2006 if ( ! $installer::globals::ooodownloadfilename ) { $destdownloadfilename = set_download_filename($languagestringref, $versionstring, $allvariableshashref); }
2007 else { $destdownloadfilename = $installer::globals::ooodownloadfilename; }
2008
2009 if ( $destdownloadfilename )

--- 4 unchanged lines hidden (view full) ---

2014
2015 my $sourcedownloadfile = $downloaddir . $installer::globals::separator . $installer::globals::downloadfilename;
2016
2017 $installer::logger::Lang->printf("Setting source download file name: %s\n", $sourcedownloadfile);
2018
2019 create_link_tree($sourcedownloadfile, $destdownloadfilename, $versionstring);
2020 # my $md5sumoutput = call_md5sum($downloadfile);
2021 # my $md5sum = get_md5sum($md5sumoutput);
2019
2022
2020 }
2021 }
2022 else
2023 {
2024 $installer::logger::Lang->printf("Version string is empty. Nothing to do!\n");
2025 }
2023 }
2024 }
2025 else
2026 {
2027 $installer::logger::Lang->printf("Version string is empty. Nothing to do!\n");
2028 }
2026 }
2029 }
2027 else
2028 {
2029 $installer::logger::Lang->printf("Platform not used for hard linking. Nothing to do!\n");
2030 }
2031
2032 $installer::logger::Lang->add_timestamp("Performance Info: Creating hard link, stop");
2033}
2034
20351;
2030 else
2031 {
2032 $installer::logger::Lang->printf("Platform not used for hard linking. Nothing to do!\n");
2033 }
2034
2035 $installer::logger::Lang->add_timestamp("Performance Info: Creating hard link, stop");
2036}
2037
20381;