1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24package installer::globals;
25
26############################################
27# Global settings
28############################################
29
30BEGIN
31{
32	$prog="make_installer.pl";
33
34	@noMSLocaleLangs = (
35        "br",
36        "bs",
37        "dz",
38        "gu",
39        "km",
40        "nr",
41        "ns",
42        "nso",
43        "rw",
44        "ss",
45        "st",
46        "tg",
47        "ts",
48        "tn",
49        "ve",
50        "xh",
51        "zu",
52        "ne",
53        "bn",
54        "bn-BD",
55        "bn-IN",
56        "lo",
57        "cy",
58        "ku",
59        "as-IN",
60        "te-IN",
61        "ml-IN",
62        "mr-IN",
63        "ur-IN",
64        "ta-IN",
65        "or-IN",
66        "ti-ER",
67        "eo",
68        "ka",
69        "ga",
70        "uk",
71        "gd",
72        "my",
73        "mai",
74        "brx",
75        "dgo",
76        "kok",
77        "mni",
78        "ca-XV",
79        "sat",
80        "ug",
81        "om",
82        "si",
83        "or",
84        "oc",
85        "ml",
86        "as",
87        "ast",
88        "ht",
89        "jbo",
90        "fur",
91        "ny",
92        "so",
93        "kab",
94        "tk"
95    );
96	@items_at_modules = ("Files", "Dirs", "Unixlinks");
97	@asianlanguages = ("ja", "ko", "zh-CN", "zh-TW");
98	@bidilanguages = ("ar", "he");
99
100	$ziplistname = "";
101	$pathfilename = "";
102	$setupscriptname = "";
103	$headerfilename = "";
104	$shellscriptsfilename = "";
105	$product = "";
106	$languagelist = "";
107	$added_english = 0;
108	$set_office_start_language = 0;
109	$solarjavaset = 0;
110
111	$destdir = "";
112	$rootpath = "";
113
114	$required_dotnet_version = "2.0.0.0";
115	$productextension = "";
116	@languageproducts = ();
117	$build = "";
118	$minor = "";
119	$lastminor = "";
120	$compiler = "";
121	$pro = 0;
122	$dounzip = 1;
123	$languages_defined_in_productlist = 0;
124	$setupscript_defined_in_productlist = 0;
125	$islinux = 0;
126	$issolaris = 0;
127	$ismacosx = 0;
128	$isos2 = 0;
129	$iswindowsbuild = 0;
130	$islinuxbuild = 0;
131	$islinuxrpmbuild = 0;
132	$islinuxdebbuild = 0;
133	$islinuxintelrpmbuild = 0;
134	$islinuxppcrpmbuild = 0;
135	$islinuxinteldebbuild = 0;
136	$islinuxppcdebbuild = 0;
137	$islinuxx86_64rpmbuild = 0;
138	$islinuxx86_64debbuild = 0;
139	$issolarisbuild = 0;
140	$issolarispkgbuild = 0;
141	$issolarissparcbuild = 0;
142	$issolarisx86build = 0;
143	$isfreebsdbuild = 0;
144	$isfreebsdpkgbuild = 0;
145	$ismacbuild = 0;
146	$ismacdmgbuild = 0;
147	$unpackpath = "";
148	$idttemplatepath = "";
149	$idtlanguagepath = "";
150	$packjobref = "";
151	$buildid = "Not set";
152	$guidcounter = 1000; # for uniqueness of guids
153	$fontsfolder = "FontsFolder";
154	$fontsfoldername = "Fonts";
155	$fontsdirparent = "";
156	$fontsdirname = "";
157	$fontsdirhostname = "truetype";
158	$officefolder = "OfficeFolder";
159	$officemenufolder = "OfficeMenuFolder";
160	$startupfolder = "StartupFolder";
161	$startmenufolder = "StartMenuFolder";
162	$desktopfolder = "DesktopFolder";
163	$programfilesfolder = "ProgramFilesFolder";
164	$commonfilesfolder = "CommonFilesFolder";
165	$commonappdatafolder = "CommonAppDataFolder";
166	$localappdatafolder = "LocalAppDataFolder";
167	$templatefolder = "TemplateFolder";
168	$templatefoldername = "Templates";
169	$programmenufolder = "ProgramMenuFolder";
170	$systemfolder = "SystemFolder";
171	$encodinglistname = "msi-encodinglist.txt";
172	$msiencoding = "";	# hash reference for msi encodings
173	$msilanguage = "";	# hash reference for msi languages LCID
174	$sofficeiconadded = 0;
175	$temppath = "";
176	$globaltempdirname = "ooopackaging";
177	$cyg_temppath = "";
178	$temppathdefined = 0;
179	$jdstemppathdefined = 0;
180	$packageversion = 1;
181	$packagerevision = 1;
182	$rpm = "";
183	$rpmcommand = "";
184	$rpmquerycommand = "";
185	$rpminfologged = 0;
186	$debian = "";
187	$installertypedir = "";
188	$controlledmakecabversion = "5";
189	$saved_packages_path = "";
190	$max_lang_length = 50;
191	$globalblock = "Globals";
192	$rootmodulegid = "";
193	%alllangmodules = ();
194	$englishlicenseset = 0;
195	$englishlicense = "";
196	$englishsolarislicensename = "LICENSE";
197	$solarisdontcompress = 0;
198	$patharray = "";
199
200	$is_special_epm = 0;
201	$epm_in_path = 0;
202	$epm_path = "";
203	$epmoutpath = "";
204	$upx_in_path = 0;
205	$upxfile = "";
206	$simple = 0;
207	$simpledefaultuserdir = "\$ORIGIN/..";
208	$call_epm = 1;
209	$packageformat = "";
210	$packagename = "";
211	$packagelist = "";
212	$addpackagelist = "";
213	$is_unix_multi = 0;
214	$unixmultipath = "";
215	$unixmultipath_orig = "";
216	$alllanguagesinproductarrayref = "";
217	$shiptestdirectory = "";
218	$makelinuxlinkrpm = 0;
219	$linuxlinkrpmprocess = 0;
220	$add_required_package = "";
221	$linuxrespin = 0;
222	@linuxpatchfiles = ();
223	$linuxlibrarybaselevel = "1";
224	$linuxlibrarypatchlevel = "1.1";
225	@linuxlinks = ();
226	@linkrpms = ();
227	$archiveformat = "";
228	$minorupgradekey = "";
229	$updatelastsequence = 0;
230	$updatesequencecounter = 0;
231	$updatedatabase = 0;
232	$updatedatabasepath = "";
233	$pfffileexists = 0;
234	$pffcabfilename = "ooobasis3.0_pff.cab";
235	$mergemodulenumber = 0;
236	%allmergemodulefilesequences = ();
237	%newupdatefiles = ();
238	%allusedupdatesequences = ();
239	%mergemodulefiles = ();
240	$mergefiles_added_into_collector = 0;
241	$creating_windows_installer_patch = 0;
242
243	$strip = 1;
244
245	$globallogging = 0;
246	$globalloggingform21 = 1;
247	$logfilename = "logfile.log";	# the default logfile name for global errors
248	@logfileinfo = ();
249	@errorlogfileinfo = ();
250	@globallogfileinfo = ();
251	$ignore_error_in_logfile = 0;
252	$exitlog = "";
253	$globalinfo_copied = 0;
254	$quiet = 0;
255	$nodownload = 0;
256	$writetotemp = 0;
257	$useminor = 0;
258	$followme_from_directory = 0;
259	$internal_cabinet_signing = 0;
260
261	$debug = 0;
262	$debugfilename = "debug.txt";
263	$checksumfilename = "checksum.txt";
264	@functioncalls = ();
265
266	$ismultilingual = 0;
267	@multilanguagemodules = ();
268	$languagemodulesbase = "gid_Module_Root_";
269	%alluniquefilenames = ();
270	%alllcuniquefilenames = ();
271	%uniquefilenamesequence = ();
272	%dependfilenames = ();
273	$isopensourceproduct = 1;
274	$manufacturer = "";
275	$longmanufacturer = "";
276	$sundirname = "Oracle";
277	$codefilename = "codes.txt";
278	$componentfilename = "components.txt";
279	$productcode = "";
280	$upgradecode = "";
281	$msiproductversion = "";
282	$msimajorproductversion = "";
283	$created_new_component_guid = 0;
284	@allddffiles = ();
285	$infodirectory = "";
286	@currentcontent = ();
287	@installsetcontent = ();
288	%xpdpackageinfo = ();
289	$signfiles_checked = 0;
290	$dosign = 0;
291	$pwfile = "";
292	$pwfile = "";
293	$pfxfile = "";
294
295	%mergemodules = ();
296	%merge_media_line = ();
297	%merge_allfeature_hash = ();
298	%merge_alldirectory_hash = ();
299	%copy_msm_files = ();
300	$mergefeaturecollected = 0;
301	$mergedirectoriescollected = 0;
302	$lastsequence_before_merge = 0;
303	$lastcabfilename = "";
304
305	$createdxpddefaultlang = 0;
306	$xpddir = "";
307	$productxpdfile = "setup.xpd";
308	$xpd_files_prepared = 0;
309	$defaultlanguage = "";
310	# @emptyxpdparents = ();
311	@createdxpdfiles = ();
312	@allxpdfiles = ();
313	$isxpdplatform = 0;
314	$javalanguagepath = "";
315	$javasettozero = 0;
316	$addlicensefile = 1;
317	$addsystemintegration = 0;
318	$addjavainstaller = 0;
319	$added_directories = 0;
320	$makedownload = 1;
321	$makejds = 1;
322	$jdsexcludefilename = "";
323	$jds_language_controlled = 0;
324	$correct_jds_language = 0;
325	@installsetfiles = ();
326	@binarytableonlyfiles = ();
327	@allscpactions = ();
328	$languagepackaddon = "LanguagePack";
329	$patchaddon = "Patch";
330	$ooodownloadfilename = "";
331	$downloadfilename = "";
332	$downloadfileextension = "";
333	$followmeinfofilename = "";
334	$oooversionstring = "";
335	$shellnewfilesadded = 0;
336	%multilingual_only_modules = ();
337	%application_modules = ();
338	$defaultinstallorder = 1000;
339	$defaultsystemintinstallorder = 1200;
340
341	$is_copy_only_project = 0;
342	$is_simple_packager_project = 0;
343	$patch_user_dir = 0;
344	$addchildprojects = 0;
345	$languagepack = 0;
346	$devsnapshotbuild = 0;
347	$tab = 0;
348	$patch = 0;
349	$patchincludepath = "";
350	$refresh_includepathes = 0;
351	$include_pathes_read = 0;
352	$patchfilelistname = "patchfilelist.txt";
353	@patchfilecollector = ();
354	$nopatchfilecollector = "";
355	@userregistrycollector = ();
356	$addeduserregitrykeys = 0;
357	$poolpathset = 0;
358	$poolpath = 0;
359	$poollockfilename = "";
360	$poolcheckfilename = "";
361	%poolshiftedpackages = ();
362	%poolpackages = ();
363	%createpackages = ();
364	$processhaspoolcheckfile = 0;
365	$processhaspoollockfile = 0;
366	$newpcfcontentcalculated = 0;
367	$sessionid = 0;
368	$sessionidset = 0;
369	$savelockfilecontent = "";
370	$savelockfilename = "";
371	$getuidpath = "";
372	$getuidpathset = 0;
373	$newpcfcontent = "";
374	%pcfdifflist = ();
375	@pcfdiffcomment = ();
376	@epmdifflist = ();
377	$desktoplinkexists = 0;
378	$sundirexists = 0;
379	$analyze_spellcheckerlanguage = 0;
380	%spellcheckerlanguagehash = ();
381	%spellcheckerfilehash = ();
382	$registryrootcomponent = "";
383	%allcomponents = ();
384	%allcomponents_in_this_database = ();
385	%allshortcomponents = ();
386	%allregistrycomponents_ = ();
387	%allregistrycomponents_in_this_database_ = ();
388	%allshortregistrycomponents = ();
389	%allregistryidentifier = ();
390
391	$installlocationdirectory = "";
392	$installlocationdirectoryset = 0;
393	$vendordirectory = "";
394	$vendordirectoryset = 0;
395	$officeinstalldirectory = "";
396	$officeinstalldirectoryset = 0;
397	$basisinstalldirectory = "";
398	$basisinstalldirectoryset = 0;
399	$ureinstalldirectory = "";
400	$ureinstalldirectoryset = 0;
401	$rootbrandpackage = "";
402	$rootbrandpackageset = 0;
403	$officedirhostname = "";
404	$basisdirhostname = "";
405	$uredirhostname = "";
406	$sundirhostname = "";
407	$officedirgid = "";
408	$basisdirgid = "";
409	$uredirgid = "";
410	$sundirgid = "";
411
412	%sign_extensions = ("dll" => "1", "exe" => "1", "cab" => "1");
413	%treestyles = ();
414	%installlocations = ("INSTALLLOCATION" => "1");
415	%treelayername = ();
416	%hostnametreestyles = ();
417	%treeconditions = ();
418	%usedtreeconditions = ();
419	%moduledestination = ();
420
421	$one_cab_file = 0;
422	$fix_number_of_cab_files = 1;
423	$cab_file_per_component = 0;
424	$cabfilecompressionlevel = 2;
425	$number_of_cabfiles = 1;	# only for $fix_number_of_cab_files = 1
426	$include_cab_in_msi = 0;
427	$use_packages_for_cabs = 0;
428	$msidatabasename = "";
429	$prepare_winpatch = 0;
430	$previous_idt_dir = "";
431	$updatepack = 0;
432	$msitranpath = "";
433	$insert_file_at_end = 0;
434	$newfilesexist = 0;
435	$usesharepointpath = 0;
436	%newfilescollector = ();
437
438	$saveinstalldir = "";
439	$csp_installdir = "";       # global installdir of createsimplepackage() in simplepackage.pm
440	$csp_installlogdir = "";    # global installlogdir of createsimplepackage() in simplepackage.pm
441	$csp_languagestring = "";   # global languagestring of createsimplepackage() in simplepackage.pm
442	$localunpackdir = "";
443	$localinstalldirset = 0;
444	$localinstalldir = "";
445
446	$javafilename = "";
447	$javafilename2 = "";
448	$javafilename3 = "";
449	$javafile = "";
450	$urefile = "";
451
452	$postprocess_specialepm = 0;
453	$postprocess_standardepm = 0;
454	$mergemodules_analyzed = 0;
455
456	$starttime = "";
457
458	@solarispatchscripts = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall", "postinstall", "preinstall", "i.none");
459	@solarispatchscriptsforextensions = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall_extensions", "postinstall_extensions", "preinstall", "i.none");
460	@solarispatchfiles = (".diPatch", "patchinfo");
461	@environmentvariables = ( "SOLARVERSION", "GUI", "WORK_STAMP", "OUTPATH", "LOCAL_OUT", "LOCAL_COMMON_OUT" );
462	@packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" );
463	@languagepackfeature =();
464	@featurecollector =();
465	$msiassemblyfiles = "";
466	$nsisfilename = "Nsis";
467	$macinstallfilename = "macinstall.ulf";
468	$nsis204 = 0;
469	$nsis231 = 0;
470	$unicodensis = 0;
471	$linuxlinkrpms = "";
472	$extensioninstalldir = "gid_Dir_Share_Extension_Install";
473	@languagenames = ();
474	@requiredpackages = ();
475	%componentcondition = ();
476	%componentid = ();
477	%comparecomponentname = ();
478	%languageproperties = ();
479	%allcabinets = ();
480	%allcabinetassigns = ();
481	%cabfilecounter = ();
482	%lastsequence = ();
483	%dontdeletecomponents = ();
484	%allcalculated_guids = ();
485	%calculated_component_guids = ();
486	%base_independent_components = ();
487	%all_english_languagestrings = ();
488	%all_required_english_languagestrings = ();
489
490	@forced_properties = ("SERVICETAG_PRODUCTNAME", "SERVICETAG_PRODUCTVERSION", "SERVICETAG_PARENTNAME", "SERVICETAG_SOURCE", "SERVICETAG_URN");
491
492	@removedirs = ();
493	@jdsremovedirs = ();
494	@emptypackages = ();
495	%fontpackageexists = ();
496
497    $exithandler = undef;
498
499	$plat = $^O;
500
501	if ( $plat =~ /cygwin/i )
502	{
503		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
504		$checksumfile = "so_checksum";
505		$unopkgfile = "unopkg.exe";
506		$separator = "/";
507		$pathseparator = "\:";
508		$libextension = "\.dll";
509		$isunix = 0;
510		$iswin = 1;
511                $archiveformat = ".zip";
512		%savedmapping = ();
513		%savedrevmapping = ();
514		%savedrev83mapping = ();
515		%saved83dirmapping = ();
516	}
517	elsif ( $plat =~ /os2/i )
518	{
519		print "Setup OS/2 platform\n";
520		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
521		$checksumfile = "so_checksum";
522		$unopkgfile = "unopkg.bin";
523		$separator = "/";
524		$pathseparator = "\:";
525		$libextension = "\.dll";
526		$isunix = 0;
527		$iswin = 0;
528		$isos2 = 1;
529                $archiveformat = ".zip";
530	}
531	else
532	{
533		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
534		$checksumfile = "so_checksum";
535		$unopkgfile = "unopkg";
536		$separator = "/";
537		$pathseparator = "\:";
538		if ( $plat =~ /darwin/i )
539		{
540			$libextension = "\.dylib";
541		}
542		else
543		{
544			$libextension = "\.so";
545		}
546		$archiveformat = ".tar.gz";
547		$isunix = 1;
548		$iswin = 0;
549	}
550	# WRAPCMD is gone - remove this and all related
551	# $installer::globals::wrapcmd entries
552	$wrapcmd = "";
553
554	if ( $plat =~ /linux/i ) { $islinux = 1; }
555	if ( $plat =~ /kfreebsd/i ) { $islinux = 1; }
556	if ( $plat =~ /solaris/i ) { $issolaris = 1; }
557    if ( $plat =~ /darwin/i ) { $ismacosx = 1; }
558	if ( $plat =~ /os2/i ) { $isos2 = 1; }
559
560	# ToDo: Needs to be expanded for additional platforms
561
562}
563
5641;
565