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	$devsnapshotbuild = 0;
350	$tab = 0;
351	$patch = 0;
352	$patchincludepath = "";
353	$refresh_includepathes = 0;
354	$include_pathes_read = 0;
355	$patchfilelistname = "patchfilelist.txt";
356	@patchfilecollector = ();
357	$nopatchfilecollector = "";
358	@userregistrycollector = ();
359	$addeduserregitrykeys = 0;
360	$poolpathset = 0;
361	$poolpath = 0;
362	$poollockfilename = "";
363	$poolcheckfilename = "";
364	%poolshiftedpackages = ();
365	%poolpackages = ();
366	%createpackages = ();
367	$processhaspoolcheckfile = 0;
368	$processhaspoollockfile = 0;
369	$newpcfcontentcalculated = 0;
370	$sessionid = 0;
371	$sessionidset = 0;
372	$savelockfilecontent = "";
373	$savelockfilename = "";
374	$getuidpath = "";
375	$getuidpathset = 0;
376	$newpcfcontent = "";
377	%pcfdifflist = ();
378	@pcfdiffcomment = ();
379	@epmdifflist = ();
380	$desktoplinkexists = 0;
381	$sundirexists = 0;
382	$analyze_spellcheckerlanguage = 0;
383	%spellcheckerlanguagehash = ();
384	%spellcheckerfilehash = ();
385	$registryrootcomponent = "";
386	%allcomponents = ();
387	%allcomponents_in_this_database = ();
388	%allshortcomponents = ();
389	%allregistrycomponents_ = ();
390	%allregistrycomponents_in_this_database_ = ();
391	%allshortregistrycomponents = ();
392	%allregistryidentifier = ();
393
394	$installlocationdirectory = "";
395	$installlocationdirectoryset = 0;
396	$vendordirectory = "";
397	$vendordirectoryset = 0;
398	$officeinstalldirectory = "";
399	$officeinstalldirectoryset = 0;
400	$basisinstalldirectory = "";
401	$basisinstalldirectoryset = 0;
402	$ureinstalldirectory = "";
403	$ureinstalldirectoryset = 0;
404	$rootbrandpackage = "";
405	$rootbrandpackageset = 0;
406	$officedirhostname = "";
407	$basisdirhostname = "";
408	$uredirhostname = "";
409	$sundirhostname = "";
410	$officedirgid = "";
411	$basisdirgid = "";
412	$uredirgid = "";
413	$sundirgid = "";
414
415	%sign_extensions = ("dll" => "1", "exe" => "1", "cab" => "1");
416	%treestyles = ();
417	%installlocations = ("INSTALLLOCATION" => "1");
418	%treelayername = ();
419	%hostnametreestyles = ();
420	%treeconditions = ();
421	%usedtreeconditions = ();
422	%moduledestination = ();
423
424	$one_cab_file = 0;
425	$fix_number_of_cab_files = 1;
426	$cab_file_per_component = 0;
427	$cabfilecompressionlevel = 2;
428	$number_of_cabfiles = 1;	# only for $fix_number_of_cab_files = 1
429	$include_cab_in_msi = 0;
430	$use_packages_for_cabs = 0;
431	$msidatabasename = "";
432	$prepare_winpatch = 0;
433	$previous_idt_dir = "";
434	$updatepack = 0;
435	$msitranpath = "";
436	$insert_file_at_end = 0;
437	$newfilesexist = 0;
438	$usesharepointpath = 0;
439	%newfilescollector = ();
440
441	$saveinstalldir = "";
442	$csp_installdir = "";       # global installdir of createsimplepackage() in simplepackage.pm
443	$csp_installlogdir = "";    # global installlogdir of createsimplepackage() in simplepackage.pm
444	$csp_languagestring = "";   # global languagestring of createsimplepackage() in simplepackage.pm
445	$localunpackdir = "";
446	$localinstalldirset = 0;
447	$localinstalldir = "";
448
449	$javafilename = "";
450	$javafilename2 = "";
451	$javafilename3 = "";
452	$javafile = "";
453	$urefile = "";
454
455	$postprocess_specialepm = 0;
456	$postprocess_standardepm = 0;
457	$mergemodules_analyzed = 0;
458
459	$starttime = "";
460
461	@solarispatchscripts = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall", "postinstall", "preinstall", "i.none");
462	@solarispatchscriptsforextensions = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall_extensions", "postinstall_extensions", "preinstall", "i.none");
463	@solarispatchfiles = (".diPatch", "patchinfo");
464	@environmentvariables = ( "SOLARVERSION", "GUI", "WORK_STAMP", "OUTPATH", "LOCAL_OUT", "LOCAL_COMMON_OUT" );
465	@packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" );
466	@languagepackfeature =();
467	@featurecollector =();
468	$msiassemblyfiles = "";
469	$nsisfilename = "Nsis";
470	$macinstallfilename = "macinstall.ulf";
471	$nsis204 = 0;
472	$nsis231 = 0;
473	$unicodensis = 0;
474	$linuxlinkrpms = "";
475	$extensioninstalldir = "gid_Dir_Share_Extension_Install";
476	@languagenames = ();
477	@requiredpackages = ();
478	%componentcondition = ();
479	%componentid = ();
480	%comparecomponentname = ();
481	%languageproperties = ();
482	%allcabinets = ();
483	%allcabinetassigns = ();
484	%cabfilecounter = ();
485	%lastsequence = ();
486	%dontdeletecomponents = ();
487	%allcalculated_guids = ();
488	%calculated_component_guids = ();
489	%base_independent_components = ();
490	%all_english_languagestrings = ();
491	%all_required_english_languagestrings = ();
492
493	@forced_properties = ("SERVICETAG_PRODUCTNAME", "SERVICETAG_PRODUCTVERSION", "SERVICETAG_PARENTNAME", "SERVICETAG_SOURCE", "SERVICETAG_URN");
494
495	@removedirs = ();
496	@jdsremovedirs = ();
497	@emptypackages = ();
498	%fontpackageexists = ();
499
500    $exithandler = undef;
501
502	$plat = $^O;
503
504	if ( $plat =~ /cygwin/i )
505	{
506		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
507		$checksumfile = "so_checksum";
508		$unopkgfile = "unopkg.exe";
509		$separator = "/";
510		$pathseparator = "\:";
511		$libextension = "\.dll";
512		$isunix = 0;
513		$iswin = 1;
514                $archiveformat = ".zip";
515		%savedmapping = ();
516		%savedrevmapping = ();
517		%savedrev83mapping = ();
518		%saved83dirmapping = ();
519	}
520	else
521	{
522		$zippath = "zip";					# Has to be in the path: /usr/bin/zip
523		$checksumfile = "so_checksum";
524		$unopkgfile = "unopkg";
525		$separator = "/";
526		$pathseparator = "\:";
527		if ( $plat =~ /darwin/i )
528		{
529			$libextension = "\.dylib";
530		}
531		else
532		{
533			$libextension = "\.so";
534		}
535		$archiveformat = ".tar.gz";
536		$isunix = 1;
537		$iswin = 0;
538	}
539	# WRAPCMD is gone - remove this and all related
540	# $installer::globals::wrapcmd entries
541	$wrapcmd = "";
542
543	if ( $plat =~ /linux/i ) { $islinux = 1; }
544	if ( $plat =~ /kfreebsd/i ) { $islinux = 1; }
545	if ( $plat =~ /solaris/i ) { $issolaris = 1; }
546    if ( $plat =~ /darwin/i ) { $ismacosx = 1; }
547
548	# ToDo: Needs to be expanded for additional platforms
549
550}
551
5521;
553