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	$languageproduct = undef;
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	$pfffileexists = 0;
230	$pffcabfilename = "ooobasis3.0_pff.cab";
231	$mergefiles_added_into_collector = 0;
232	$creating_windows_installer_patch = 0;
233
234	$strip = 1;
235
236	$globallogging = 0;
237	$logfilename = "logfile.log";	# the default logfile name for global errors
238#	@logfileinfo = ();
239#	@errorlogfileinfo = ();
240#	@globallogfileinfo = ();
241	$ignore_error_in_logfile = 0;
242	$exitlog = "";
243	$globalinfo_copied = 0;
244	$quiet = 0;
245	$nodownload = 0;
246	$writetotemp = 0;
247	$useminor = 0;
248	$followme_from_directory = 0;
249	$internal_cabinet_signing = 0;
250
251	$debug = 0;
252	$debugfilename = "debug.txt";
253	$checksumfilename = "checksum.txt";
254	@functioncalls = ();
255
256	$ismultilingual = 0;
257	@multilanguagemodules = ();
258	$languagemodulesbase = "gid_Module_Root_";
259	%alluniquefilenames = ();
260	%alllcuniquefilenames = ();
261	%uniquefilenamesequence = ();
262	%dependfilenames = ();
263	$isopensourceproduct = 1;
264	$manufacturer = "";
265	$longmanufacturer = "";
266	$sundirname = "Oracle";
267	$codefilename = "codes.txt";
268	$componentfilename = "components.txt";
269	$productcode = "";
270	$upgradecode = "";
271	$msiproductversion = "";
272	$msimajorproductversion = "";
273	$created_new_component_guid = 0;
274	@allddffiles = ();
275	$infodirectory = "";
276	@currentcontent = ();
277	@installsetcontent = ();
278	%xpdpackageinfo = ();
279	$signfiles_checked = 0;
280	$dosign = 0;
281	$pwfile = "";
282	$pwfile = "";
283	$pfxfile = "";
284
285	%merge_media_line = ();
286	%merge_allfeature_hash = ();
287	%merge_alldirectory_hash = ();
288	%copy_msm_files = ();
289	$mergefeaturecollected = 0;
290	$mergedirectoriescollected = 0;
291	$lastsequence_before_merge = 0;
292	$lastcabfilename = "";
293
294	$createdxpddefaultlang = 0;
295	$xpddir = "";
296	$productxpdfile = "setup.xpd";
297	$xpd_files_prepared = 0;
298	$defaultlanguage = "";
299	# @emptyxpdparents = ();
300	@createdxpdfiles = ();
301	@allxpdfiles = ();
302	$isxpdplatform = 0;
303	$javalanguagepath = "";
304	$javasettozero = 0;
305	$addlicensefile = 1;
306	$addsystemintegration = 0;
307	$addjavainstaller = 0;
308	$added_directories = 0;
309	$makedownload = 1;
310	$makejds = 1;
311	$jdsexcludefilename = "";
312	$jds_language_controlled = 0;
313	$correct_jds_language = 0;
314	@installsetfiles = ();
315	@binarytableonlyfiles = ();
316	@allscpactions = ();
317	$languagepackaddon = "LanguagePack";
318	$patchaddon = "Patch";
319	$ooodownloadfilename = "";
320	$downloadfilename = "";
321	$downloadfileextension = "";
322	$followmeinfofilename = "";
323	$oooversionstring = "";
324	$shellnewfilesadded = 0;
325	%multilingual_only_modules = ();
326	%application_modules = ();
327	$defaultinstallorder = 1000;
328	$defaultsystemintinstallorder = 1200;
329
330	$is_copy_only_project = 0;
331	$is_simple_packager_project = 0;
332	$patch_user_dir = 0;
333	$addchildprojects = 0;
334	$languagepack = 0;
335	$devsnapshotbuild = 0;
336	$tab = 0;
337	$patch = 0;
338	$patchincludepath = "";
339	$refresh_includepathes = 0;
340	$include_pathes_read = 0;
341	$patchfilelistname = "patchfilelist.txt";
342	@patchfilecollector = ();
343	$nopatchfilecollector = "";
344	@userregistrycollector = ();
345	$addeduserregitrykeys = 0;
346	$poolpathset = 0;
347	$poolpath = 0;
348	$poollockfilename = "";
349	$poolcheckfilename = "";
350	%poolshiftedpackages = ();
351	%poolpackages = ();
352	%createpackages = ();
353	$processhaspoolcheckfile = 0;
354	$processhaspoollockfile = 0;
355	$newpcfcontentcalculated = 0;
356	$sessionid = 0;
357	$sessionidset = 0;
358	$savelockfilecontent = "";
359	$savelockfilename = "";
360	$getuidpath = "";
361	$getuidpathset = 0;
362	$newpcfcontent = "";
363	%pcfdifflist = ();
364	@pcfdiffcomment = ();
365	@epmdifflist = ();
366	$desktoplinkexists = 0;
367	$sundirexists = 0;
368	$analyze_spellcheckerlanguage = 0;
369	%spellcheckerlanguagehash = ();
370	%spellcheckerfilehash = ();
371	$registryrootcomponent = "";
372	%allcomponents = ();
373	%allcomponents_in_this_database = ();
374	%allshortcomponents = ();
375	%allregistrycomponents_ = ();
376	%allregistrycomponents_in_this_database_ = ();
377	%allshortregistrycomponents = ();
378	%allregistryidentifier = ();
379
380	$installlocationdirectory = "";
381	$installlocationdirectoryset = 0;
382	$vendordirectory = "";
383	$vendordirectoryset = 0;
384	$officeinstalldirectory = "";
385	$officeinstalldirectoryset = 0;
386	$basisinstalldirectory = "";
387	$basisinstalldirectoryset = 0;
388	$ureinstalldirectory = "";
389	$ureinstalldirectoryset = 0;
390	$rootbrandpackage = "";
391	$rootbrandpackageset = 0;
392	$officedirhostname = "";
393	$basisdirhostname = "";
394	$uredirhostname = "";
395	$sundirhostname = "";
396	$officedirgid = "";
397	$basisdirgid = "";
398	$uredirgid = "";
399	$sundirgid = "";
400
401	%sign_extensions = ("dll" => "1", "exe" => "1", "cab" => "1");
402	%treestyles = ();
403	%installlocations = ("INSTALLLOCATION" => "1");
404	%treelayername = ();
405	%hostnametreestyles = ();
406	%treeconditions = ();
407	%usedtreeconditions = ();
408	%moduledestination = ();
409
410	$fix_number_of_cab_files = 1;
411	$cabfilecompressionlevel = 2;
412	$number_of_cabfiles = 1;	# only for $fix_number_of_cab_files = 1
413	$include_cab_in_msi = 0;
414	$msidatabasename = "";
415	$prepare_winpatch = 0;
416	$previous_idt_dir = "";
417	$updatepack = 0;
418	$msitranpath = "";
419	$insert_file_at_end = 0;
420	$newfilesexist = 0;
421	$usesharepointpath = 0;
422	%newfilescollector = ();
423
424	$saveinstalldir = "";
425	$csp_installdir = "";       # global installdir of createsimplepackage() in simplepackage.pm
426	$csp_installlogdir = "";    # global installlogdir of createsimplepackage() in simplepackage.pm
427	$csp_languagestring = "";   # global languagestring of createsimplepackage() in simplepackage.pm
428	$localunpackdir = "";
429	$localinstalldirset = 0;
430	$localinstalldir = "";
431
432	$javafilename = "";
433	$javafilename2 = "";
434	$javafilename3 = "";
435	$javafile = "";
436	$urefile = "";
437
438	$postprocess_specialepm = 0;
439	$postprocess_standardepm = 0;
440
441	$starttime = "";
442
443	@solarispatchscripts = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall", "postinstall", "preinstall", "i.none");
444	@solarispatchscriptsforextensions = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall_extensions", "postinstall_extensions", "preinstall", "i.none");
445	@solarispatchfiles = (".diPatch", "patchinfo");
446	@environmentvariables = ( "SOLARVERSION", "GUI", "WORK_STAMP", "OUTPATH", "LOCAL_OUT", "LOCAL_COMMON_OUT" );
447	@packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" );
448	@languagepackfeature =();
449	@featurecollector =();
450	$msiassemblyfiles = "";
451	$nsisfilename = "Nsis";
452	$macinstallfilename = "macinstall.ulf";
453	$nsis204 = 0;
454	$nsis231 = 0;
455	$unicodensis = 0;
456	$linuxlinkrpms = "";
457	$extensioninstalldir = "gid_Dir_Share_Extension_Install";
458	@languagenames = ();
459	@requiredpackages = ();
460	%componentcondition = ();
461	%componentid = ();
462	%comparecomponentname = ();
463	%languageproperties = ();
464	%allcabinets = ();
465	%allcabinetassigns = ();
466	%cabfilecounter = ();
467	%lastsequence = ();
468	%dontdeletecomponents = ();
469	%allcalculated_guids = ();
470	%calculated_component_guids = ();
471	%base_independent_components = ();
472	%all_english_languagestrings = ();
473	%all_required_english_languagestrings = ();
474
475	@forced_properties = ("SERVICETAG_PRODUCTNAME", "SERVICETAG_PRODUCTVERSION", "SERVICETAG_PARENTNAME", "SERVICETAG_SOURCE", "SERVICETAG_URN");
476
477	@removedirs = ();
478	@jdsremovedirs = ();
479	@emptypackages = ();
480	%fontpackageexists = ();
481
482    $exithandler = undef;
483
484	$plat = $^O;
485
486	if ( $plat =~ /cygwin/i )
487	{
488		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
489		$checksumfile = "so_checksum";
490		$unopkgfile = "unopkg.exe";
491		$separator = "/";
492		$pathseparator = "\:";
493		$libextension = "\.dll";
494		$isunix = 0;
495		$iswin = 1;
496        $archiveformat = ".zip";
497		%savedmapping = ();
498		%savedrevmapping = ();
499		%savedrev83mapping = ();
500		%saved83dirmapping = ();
501	}
502	elsif ( $plat =~ /os2/i )
503	{
504		print "Setup OS/2 platform\n";
505		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
506		$checksumfile = "so_checksum";
507		$unopkgfile = "unopkg.bin";
508		$separator = "/";
509		$pathseparator = "\:";
510		$libextension = "\.dll";
511		$isunix = 0;
512		$iswin = 0;
513		$isos2 = 1;
514        $archiveformat = ".zip";
515	}
516	else
517	{
518		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
519		$checksumfile = "so_checksum";
520		$unopkgfile = "unopkg";
521		$separator = "/";
522		$pathseparator = "\:";
523		if ( $plat =~ /darwin/i )
524		{
525			$libextension = "\.dylib";
526		}
527		else
528		{
529			$libextension = "\.so";
530		}
531		$archiveformat = ".tar.gz";
532		$isunix = 1;
533		$iswin = 0;
534	}
535	# WRAPCMD is gone - remove this and all related
536	# $installer::globals::wrapcmd entries
537	$wrapcmd = "";
538
539	if ( $plat =~ /linux/i ) { $islinux = 1; }
540	if ( $plat =~ /kfreebsd/i ) { $islinux = 1; }
541	if ( $plat =~ /solaris/i ) { $issolaris = 1; }
542    if ( $plat =~ /darwin/i ) { $ismacosx = 1; }
543	if ( $plat =~ /os2/i ) { $isos2 = 1; }
544
545	# ToDo: Needs to be expanded for additional platforms
546
547}
548
5491;
550