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