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