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