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	$fix_number_of_cab_files = 1;
422	$cabfilecompressionlevel = 2;
423	$number_of_cabfiles = 1;	# only for $fix_number_of_cab_files = 1
424	$include_cab_in_msi = 0;
425	$use_packages_for_cabs = 0;
426	$msidatabasename = "";
427	$prepare_winpatch = 0;
428	$previous_idt_dir = "";
429	$updatepack = 0;
430	$msitranpath = "";
431	$insert_file_at_end = 0;
432	$newfilesexist = 0;
433	$usesharepointpath = 0;
434	%newfilescollector = ();
435
436	$saveinstalldir = "";
437	$csp_installdir = "";       # global installdir of createsimplepackage() in simplepackage.pm
438	$csp_installlogdir = "";    # global installlogdir of createsimplepackage() in simplepackage.pm
439	$csp_languagestring = "";   # global languagestring of createsimplepackage() in simplepackage.pm
440	$localunpackdir = "";
441	$localinstalldirset = 0;
442	$localinstalldir = "";
443
444	$javafilename = "";
445	$javafilename2 = "";
446	$javafilename3 = "";
447	$javafile = "";
448	$urefile = "";
449
450	$postprocess_specialepm = 0;
451	$postprocess_standardepm = 0;
452	$mergemodules_analyzed = 0;
453
454	$starttime = "";
455
456	@solarispatchscripts = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall", "postinstall", "preinstall", "i.none");
457	@solarispatchscriptsforextensions = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall_extensions", "postinstall_extensions", "preinstall", "i.none");
458	@solarispatchfiles = (".diPatch", "patchinfo");
459	@environmentvariables = ( "SOLARVERSION", "GUI", "WORK_STAMP", "OUTPATH", "LOCAL_OUT", "LOCAL_COMMON_OUT" );
460	@packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" );
461	@languagepackfeature =();
462	@featurecollector =();
463	$msiassemblyfiles = "";
464	$nsisfilename = "Nsis";
465	$macinstallfilename = "macinstall.ulf";
466	$nsis204 = 0;
467	$nsis231 = 0;
468	$unicodensis = 0;
469	$linuxlinkrpms = "";
470	$extensioninstalldir = "gid_Dir_Share_Extension_Install";
471	@languagenames = ();
472	@requiredpackages = ();
473	%componentcondition = ();
474	%componentid = ();
475	%comparecomponentname = ();
476	%languageproperties = ();
477	%allcabinets = ();
478	%allcabinetassigns = ();
479	%cabfilecounter = ();
480	%lastsequence = ();
481	%dontdeletecomponents = ();
482	%allcalculated_guids = ();
483	%calculated_component_guids = ();
484	%base_independent_components = ();
485	%all_english_languagestrings = ();
486	%all_required_english_languagestrings = ();
487
488	@forced_properties = ("SERVICETAG_PRODUCTNAME", "SERVICETAG_PRODUCTVERSION", "SERVICETAG_PARENTNAME", "SERVICETAG_SOURCE", "SERVICETAG_URN");
489
490	@removedirs = ();
491	@jdsremovedirs = ();
492	@emptypackages = ();
493	%fontpackageexists = ();
494
495    $exithandler = undef;
496
497	$plat = $^O;
498
499	if ( $plat =~ /cygwin/i )
500	{
501		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
502		$checksumfile = "so_checksum";
503		$unopkgfile = "unopkg.exe";
504		$separator = "/";
505		$pathseparator = "\:";
506		$libextension = "\.dll";
507		$isunix = 0;
508		$iswin = 1;
509        $archiveformat = ".zip";
510		%savedmapping = ();
511		%savedrevmapping = ();
512		%savedrev83mapping = ();
513		%saved83dirmapping = ();
514	}
515	elsif ( $plat =~ /os2/i )
516	{
517		print "Setup OS/2 platform\n";
518		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
519		$checksumfile = "so_checksum";
520		$unopkgfile = "unopkg.bin";
521		$separator = "/";
522		$pathseparator = "\:";
523		$libextension = "\.dll";
524		$isunix = 0;
525		$iswin = 0;
526		$isos2 = 1;
527        $archiveformat = ".zip";
528	}
529	else
530	{
531		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
532		$checksumfile = "so_checksum";
533		$unopkgfile = "unopkg";
534		$separator = "/";
535		$pathseparator = "\:";
536		if ( $plat =~ /darwin/i )
537		{
538			$libextension = "\.dylib";
539		}
540		else
541		{
542			$libextension = "\.so";
543		}
544		$archiveformat = ".tar.gz";
545		$isunix = 1;
546		$iswin = 0;
547	}
548	# WRAPCMD is gone - remove this and all related
549	# $installer::globals::wrapcmd entries
550	$wrapcmd = "";
551
552	if ( $plat =~ /linux/i ) { $islinux = 1; }
553	if ( $plat =~ /kfreebsd/i ) { $islinux = 1; }
554	if ( $plat =~ /solaris/i ) { $issolaris = 1; }
555    if ( $plat =~ /darwin/i ) { $ismacosx = 1; }
556	if ( $plat =~ /os2/i ) { $isos2 = 1; }
557
558	# ToDo: Needs to be expanded for additional platforms
559
560}
561
5621;
563