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