summaryrefslogtreecommitdiff
path: root/solenv/bin/modules/installer/windows
diff options
context:
space:
mode:
Diffstat (limited to 'solenv/bin/modules/installer/windows')
-rw-r--r--solenv/bin/modules/installer/windows/component.pm16
-rw-r--r--solenv/bin/modules/installer/windows/directory.pm107
-rw-r--r--solenv/bin/modules/installer/windows/file.pm232
-rw-r--r--solenv/bin/modules/installer/windows/idtglobal.pm22
-rw-r--r--solenv/bin/modules/installer/windows/msiglobal.pm109
5 files changed, 403 insertions, 83 deletions
diff --git a/solenv/bin/modules/installer/windows/component.pm b/solenv/bin/modules/installer/windows/component.pm
index 38989858a4b6..4ab5aac68954 100644
--- a/solenv/bin/modules/installer/windows/component.pm
+++ b/solenv/bin/modules/installer/windows/component.pm
@@ -193,7 +193,7 @@ sub get_registry_component_directory
sub get_file_component_attributes
{
- my ($componentname, $filesref) = @_;
+ my ($componentname, $filesref, $allvariables) = @_;
my $attributes;
@@ -240,6 +240,9 @@ sub get_file_component_attributes
$attributes = 4; # Files in shellnew dir and in non advertised startmenu entries must have user registry key as KeyPath
}
+ # Adding 256, if this is a 64 bit installation set.
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes = $attributes + 256; }
+
return $attributes
}
@@ -251,12 +254,15 @@ sub get_file_component_attributes
sub get_registry_component_attributes
{
- my ($componentname) = @_;
+ my ($componentname, $allvariables) = @_;
my $attributes;
$attributes = 4;
+ # Adding 256, if this is a 64 bit installation set.
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $attributes = $attributes + 256; }
+
if ( exists($installer::globals::dontdeletecomponents{$componentname}) ) { $attributes = $attributes + 16; }
return $attributes
@@ -381,7 +387,7 @@ sub get_component_keypath
sub create_component_table
{
- my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref) = @_;
+ my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref, $allvariables) = @_;
my @componenttable = ();
@@ -402,7 +408,7 @@ sub create_component_table
$onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
$onecomponent{'directory'} = get_file_component_directory($onecomponent{'name'}, $filesref, $dirref);
if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; }
- $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref);
+ $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref, $allvariables);
$onecomponent{'condition'} = get_file_component_condition($onecomponent{'name'}, $filesref);
$onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $filesref, $componentidkeypathhashref);
@@ -421,7 +427,7 @@ sub create_component_table
$onecomponent{'name'} = ${$allregistrycomponents}[$i];
$onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
$onecomponent{'directory'} = get_registry_component_directory();
- $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'});
+ $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'}, $allvariables);
$onecomponent{'condition'} = get_component_condition($onecomponent{'name'});
$onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $registryref, $componentidkeypathhashref);
diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
index ba6f9a3b75bd..f7b13747e3bf 100644
--- a/solenv/bin/modules/installer/windows/directory.pm
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -77,19 +77,78 @@ sub overwrite_programfilesfolder
}
##############################################################
+# Maximum length of directory name is 72.
+# Taking care of underlines, which are the separator.
+##############################################################
+
+sub make_short_dir_version
+{
+ my ($longstring, $length, $displayname) = @_;
+
+ my $shortstring = "";
+ my $infoline = "";
+ my $savestring = $longstring;
+
+ # Splitting the string at each "underline" and allowing only $length characters per directory name.
+ # Checking also uniqueness and length.
+
+ my $stringarray = installer::converter::convert_stringlist_into_array_without_newline(\$longstring, "_");
+
+ foreach my $onestring ( @{$stringarray} )
+ {
+ my $partstring = "";
+
+ if ( $onestring =~ /\-/ )
+ {
+ my $localstringarray = installer::converter::convert_stringlist_into_array_without_newline(\$onestring, "-");
+ foreach my $onelocalstring ( @{$localstringarray} )
+ {
+ if ( length($onelocalstring) > $length ) { $onelocalstring = substr($onelocalstring, 0, $length); }
+ $partstring = $partstring . "-" . $onelocalstring;
+ }
+ $partstring =~ s/^\s*\-//;
+ }
+ else
+ {
+ if ( length($onestring) > $length ) { $partstring = substr($onestring, 0, $length); }
+ else { $partstring = $onestring; }
+ }
+
+ $shortstring = $shortstring . "_" . $partstring;
+ }
+
+ $shortstring =~ s/^\s*\_//;
+
+ if ( length($shortstring) > 72 )
+ {
+ my $shortlength = length($shortstring);
+ $infoline = "WARNING: Failed to create unique directory name with less than 72 characters: \"$displayname\" ($shortstring ($shortlength)).\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ return $shortstring;
+}
+
+##############################################################
# Adding unique directory names to the directory collection
##############################################################
sub create_unique_directorynames
{
- my ($directoryref) = @_;
+ my ($directoryref, $allvariables) = @_;
$installer::globals::officeinstalldirectoryset = 0;
+ my %conversionhash = ();
+ my $infoline = "";
+ my $errorcount = 0;
+
for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
{
my $onedir = ${$directoryref}[$i];
- my $uniquename = $onedir->{'HostName'};
+ my $hostname = $onedir->{'HostName'};
+
+ my $uniquename = $hostname;
my $styles = "";
if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
# get_path_from_fullqualifiedname(\$uniqueparentname);
@@ -101,6 +160,42 @@ sub create_unique_directorynames
$uniquename =~ s/\_//g; # removing existing underlines
$uniquename =~ s/\.//g; # removing dots in directoryname
$uniquename =~ s/\Q$installer::globals::separator\E/\_/g; # replacing slash and backslash with underline
+ $uniquename =~ s/OpenOffice/OO/g;
+ $uniquename =~ s/_registry/_rgy/g;
+ $uniquename =~ s/_registration/_rgn/g;
+ $uniquename =~ s/_extension/_ext/g;
+ $uniquename =~ s/_frame/_frm/g;
+ $uniquename =~ s/_table/_tbl/g;
+ $uniquename =~ s/_chart/_crt/g;
+
+ my $startlength = 5;
+
+ if ( ! $allvariables->{'NOSHORTDIRECTORYNAMES'} )
+ {
+ # This process does not work for SDK, because of its long and similar pathes
+ $uniquename = make_short_dir_version($uniquename, $startlength, $hostname); # taking care of underlines!
+ }
+
+ if ( exists($installer::globals::alluniquedirectorynames{$uniquename}) )
+ {
+ # This is an error, that must stop the packaging process
+ $errorcount++;
+
+ $infoline = "$errorcount: Already existing unique directory: $uniquename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "$errorcount: First full directory: $conversionhash{$uniquename}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "$errorcount: Current full directory: $hostname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $conversionhash{$uniquename} = $hostname;
+
+ $installer::globals::alluniquedirectorynames{$uniquename} = 1;
+
+ # Important: The unique parent is generated from the string $uniquename. Therefore counters
+ # like adding "_1" is not allowed to achive uniqueness, because this depends from other directories
+ # and does not deliver always the same result.
my $uniqueparentname = $uniquename;
@@ -147,6 +242,11 @@ sub create_unique_directorynames
$installer::globals::vendordirectoryset = 1;
}
}
+
+ if ( $errorcount > 0 )
+ {
+ installer::exiter::exit_program("ERROR: Failed to create unique directory names.", "create_unique_directorynames");
+ }
}
#####################################################
@@ -434,8 +534,9 @@ sub create_directory_table
my $infoline;
overwrite_programfilesfolder($allvariableshashref);
- create_unique_directorynames($directoryref);
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1.log", $directoryref); }
+ create_unique_directorynames($directoryref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1a.log", $directoryref); }
create_defaultdir_directorynames($directoryref, $shortdirnamehashref); # only destdir!
if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_2.log", $directoryref); }
set_installlocation_directory($directoryref, $allvariableshashref);
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
index 10666be7460c..b679d8b46e2b 100644
--- a/solenv/bin/modules/installer/windows/file.pm
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -170,6 +170,40 @@ sub assign_sequencenumbers_to_files
}
}
+#########################################################
+# Create a shorter version of a long component name,
+# because maximum length in msi database is 72.
+# Attention: In multi msi installation sets, the short
+# names have to be unique over all packages, because
+# this string is used to create the globally unique id
+# -> no resetting of
+# %installer::globals::allshortcomponents
+# after a package was created.
+#########################################################
+
+sub generate_new_short_componentname
+{
+ my ($componentname) = @_;
+
+ my $shortcomponentname = "";
+ my $counter = 1;
+
+ my $startversion = substr($componentname, 0, 60); # taking only the first 60 characters
+ $startversion = $startversion . "_";
+
+ $shortcomponentname = $startversion . $counter;
+
+ while ( exists($installer::globals::allshortcomponents{$shortcomponentname}) )
+ {
+ $counter++;
+ $shortcomponentname = $startversion . $counter;
+ }
+
+ $installer::globals::allshortcomponents{$shortcomponentname} = 1;
+
+ return $shortcomponentname;
+}
+
###############################################
# Generating the component name from a file
###############################################
@@ -178,77 +212,139 @@ sub get_file_component_name
{
my ($fileref, $filesref) = @_;
- # In this function exists the rule to create components from files
- # Rule:
- # Two files get the same componentid, if:
- # both have the same destination directory.
- # both have the same "gid" -> both were packed in the same zip file
- # All other files are included into different components!
-
- # my $componentname = $fileref->{'gid'} . "_" . $fileref->{'Dir'};
-
- # $fileref->{'Dir'} is not sufficient! All files in a zip file have the same $fileref->{'Dir'},
- # but can be in different subdirectories.
- # Solution: destination=share\Scripts\beanshell\Capitalise\capitalise.bsh
- # in which the filename (capitalise.bsh) has to be removed and all backslashes (slashes) are
- # converted into underline.
-
- my $destination = $fileref->{'destination'};
- installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
- $destination =~ s/\s//g;
- $destination =~ s/\\/\_/g;
- $destination =~ s/\//\_/g;
- $destination =~ s/\_\s*$//g; # removing ending underline
-
- my $componentname = $fileref->{'gid'} . "__" . $destination;
-
- # Files with different languages, need to be packed into different components.
- # Then the installation of the language specific component is determined by a language condition.
-
- if ( $fileref->{'ismultilingual'} )
- {
- my $officelanguage = $fileref->{'specificlanguage'};
- $componentname = $componentname . "_" . $officelanguage;
- }
-
- $componentname = lc($componentname); # componentnames always lowercase
-
- $componentname =~ s/\-/\_/g; # converting "-" to "_"
- $componentname =~ s/\./\_/g; # converting "-" to "_"
-
- # Attention: Maximum length for the componentname is 72
-
- $componentname =~ s/gid_file_/g_f_/g;
- $componentname =~ s/_extra_/_e_/g;
- $componentname =~ s/_config_/_c_/g;
- $componentname =~ s/_org_openoffice_/_o_o_/g;
- $componentname =~ s/_program_/_p_/g;
- $componentname =~ s/_typedetection_/_td_/g;
- $componentname =~ s/_linguistic_/_l_/g;
- $componentname =~ s/_module_/_m_/g;
- $componentname =~ s/_optional_/_opt_/g;
- $componentname =~ s/_packages/_pack/g;
- $componentname =~ s/_menubar/_mb/g;
- $componentname =~ s/_common_/_cm_/g;
- $componentname =~ s/_export_/_exp_/g;
- $componentname =~ s/_table_/_tb_/g;
- $componentname =~ s/_sofficecfg_/_sc_/g;
- $componentname =~ s/_startmodulecommands_/_smc_/g;
- $componentname =~ s/_drawimpresscommands_/_dic_/g;
- $componentname =~ s/_basiccommands_/_bac_/g;
- $componentname =~ s/_basicidecommands_/_baic_/g;
- $componentname =~ s/_genericcommands_/_genc_/g;
- $componentname =~ s/_bibliographycommands_/_bibc_/g;
- $componentname =~ s/_share_/_s_/g;
- $componentname =~ s/_modules_/_ms_/g;
- $componentname =~ s/_uiconfig_zip_/_ucz_/g;
- $componentname =~ s/_soffice_cfg_/_sc_/g;
-
- # All this is not necessary for files, which have the flag ASSIGNCOMPOMENT
+ my $componentname = "";
+
+ # Special handling for files with ASSIGNCOMPOMENT
my $styles = "";
if ( $fileref->{'Styles'} ) { $styles = $fileref->{'Styles'}; }
- if ( $styles =~ /\bASSIGNCOMPOMENT\b/ ) { $componentname = get_component_from_assigned_file($fileref->{'AssignComponent'}, $filesref); }
+ if ( $styles =~ /\bASSIGNCOMPOMENT\b/ )
+ {
+ $componentname = get_component_from_assigned_file($fileref->{'AssignComponent'}, $filesref);
+ }
+ else
+ {
+ # In this function exists the rule to create components from files
+ # Rule:
+ # Two files get the same componentid, if:
+ # both have the same destination directory.
+ # both have the same "gid" -> both were packed in the same zip file
+ # All other files are included into different components!
+
+ # my $componentname = $fileref->{'gid'} . "_" . $fileref->{'Dir'};
+
+ # $fileref->{'Dir'} is not sufficient! All files in a zip file have the same $fileref->{'Dir'},
+ # but can be in different subdirectories.
+ # Solution: destination=share\Scripts\beanshell\Capitalise\capitalise.bsh
+ # in which the filename (capitalise.bsh) has to be removed and all backslashes (slashes) are
+ # converted into underline.
+
+ my $destination = $fileref->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ $destination =~ s/\s//g;
+ $destination =~ s/\\/\_/g;
+ $destination =~ s/\//\_/g;
+ $destination =~ s/\_\s*$//g; # removing ending underline
+
+ $componentname = $fileref->{'gid'} . "__" . $destination;
+
+ # Files with different languages, need to be packed into different components.
+ # Then the installation of the language specific component is determined by a language condition.
+
+ if ( $fileref->{'ismultilingual'} )
+ {
+ my $officelanguage = $fileref->{'specificlanguage'};
+ $componentname = $componentname . "_" . $officelanguage;
+ }
+
+ $componentname = lc($componentname); # componentnames always lowercase
+
+ $componentname =~ s/\-/\_/g; # converting "-" to "_"
+ $componentname =~ s/\./\_/g; # converting "-" to "_"
+
+ # Attention: Maximum length for the componentname is 72
+ # %installer::globals::allcomponents_in_this_database : resetted for each database
+ # %installer::globals::allcomponents : not resetted for each database
+ # Component strings must be unique for the complete product, because they are used for
+ # the creation of the globally unique identifier.
+
+ my $fullname = $componentname; # This can be longer than 72
+
+ if (( exists($installer::globals::allcomponents{$fullname}) ) && ( ! exists($installer::globals::allcomponents_in_this_database{$fullname}) ))
+ {
+ # This is not allowed: One component cannot be installed with different packages.
+ installer::exiter::exit_program("ERROR: Component \"$fullname\" is already included into another package. This is not allowed.", "get_file_component_name");
+ }
+
+ if ( exists($installer::globals::allcomponents{$fullname}) )
+ {
+ $componentname = $installer::globals::allcomponents{$fullname};
+ }
+ else
+ {
+ if ( length($componentname) > 72 )
+ {
+ # Using md5sum needs much time
+ # chomp(my $shorter = `echo $componentname | md5sum | sed -e "s/ .*//g"`);
+ # $componentname = "comp_$shorter";
+ $componentname = generate_new_short_componentname($componentname); # This has to be unique for the complete product, not only one package
+ }
+
+ $installer::globals::allcomponents{$fullname} = $componentname;
+ $installer::globals::allcomponents_in_this_database{$fullname} = 1;
+ }
+
+ # $componentname =~ s/gid_file_/g_f_/g;
+ # $componentname =~ s/_extra_/_e_/g;
+ # $componentname =~ s/_config_/_c_/g;
+ # $componentname =~ s/_org_openoffice_/_o_o_/g;
+ # $componentname =~ s/_program_/_p_/g;
+ # $componentname =~ s/_typedetection_/_td_/g;
+ # $componentname =~ s/_linguistic_/_l_/g;
+ # $componentname =~ s/_module_/_m_/g;
+ # $componentname =~ s/_optional_/_opt_/g;
+ # $componentname =~ s/_packages/_pack/g;
+ # $componentname =~ s/_menubar/_mb/g;
+ # $componentname =~ s/_common_/_cm_/g;
+ # $componentname =~ s/_export_/_exp_/g;
+ # $componentname =~ s/_table_/_tb_/g;
+ # $componentname =~ s/_sofficecfg_/_sc_/g;
+ # $componentname =~ s/_soffice_cfg_/_sc_/g;
+ # $componentname =~ s/_startmodulecommands_/_smc_/g;
+ # $componentname =~ s/_drawimpresscommands_/_dic_/g;
+ # $componentname =~ s/_basiccommands_/_bac_/g;
+ # $componentname =~ s/_basicidecommands_/_baic_/g;
+ # $componentname =~ s/_genericcommands_/_genc_/g;
+ # $componentname =~ s/_bibliographycommands_/_bibc_/g;
+ # $componentname =~ s/_gentiumbookbasicbolditalic_/_gbbbi_/g;
+ # $componentname =~ s/_share_/_s_/g;
+ # $componentname =~ s/_extension_/_ext_/g;
+ # $componentname =~ s/_extensions_/_exs_/g;
+ # $componentname =~ s/_modules_/_ms_/g;
+ # $componentname =~ s/_uiconfig_zip_/_ucz_/g;
+ # $componentname =~ s/_productivity_/_pr_/g;
+ # $componentname =~ s/_wizard_/_wz_/g;
+ # $componentname =~ s/_import_/_im_/g;
+ # $componentname =~ s/_javascript_/_js_/g;
+ # $componentname =~ s/_template_/_tpl_/g;
+ # $componentname =~ s/_tplwizletter_/_twl_/g;
+ # $componentname =~ s/_beanshell_/_bs_/g;
+ # $componentname =~ s/_presentation_/_bs_/g;
+ # $componentname =~ s/_columns_/_cls_/g;
+ # $componentname =~ s/_python_/_py_/g;
+
+ # $componentname =~ s/_tools/_ts/g;
+ # $componentname =~ s/_transitions/_trs/g;
+ # $componentname =~ s/_scriptbinding/_scrb/g;
+ # $componentname =~ s/_spreadsheet/_ssh/g;
+ # $componentname =~ s/_publisher/_pub/g;
+ # $componentname =~ s/_presenter/_pre/g;
+ # $componentname =~ s/_registry/_reg/g;
+
+ # $componentname =~ s/screen/sc/g;
+ # $componentname =~ s/wordml/wm/g;
+ # $componentname =~ s/openoffice/oo/g;
+ }
return $componentname;
}
diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm
index 64dc2f34a12a..453464a3ae36 100644
--- a/solenv/bin/modules/installer/windows/idtglobal.pm
+++ b/solenv/bin/modules/installer/windows/idtglobal.pm
@@ -90,10 +90,8 @@ sub get_next_free_number
}
until (!($alreadyexists));
- if (( $counter > 9 ) && ( length($name) > 6 ))
- {
- $dontsave = 1;
- }
+ if (( $counter > 9 ) && ( length($name) > 6 )) { $dontsave = 1; }
+ if (( $counter > 99 ) && ( length($name) > 5 )) { $dontsave = 1; }
if (!($dontsave))
{
@@ -192,6 +190,14 @@ sub make_eight_three_conform
$name =~ s/\s*$//; # removing ending whitespaces
$name = $name . "\~";
$number = get_next_free_number($name, $shortnamesref);
+
+ if ( $number > 99 )
+ {
+ $name = substr($name, 0, 4); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+ }
}
$name = $name . "$number";
@@ -224,6 +230,14 @@ sub make_eight_three_conform
$name =~ s/\s*$//; # removing ending whitespaces
$name = $name . "\~";
$number = get_next_free_number($name, $shortnamesref);
+
+ if ( $number > 99 )
+ {
+ $name = substr($name, 0, 4); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+ }
}
$name = $name . "$number";
diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm
index 716f63499a02..dbb6e051aa29 100644
--- a/solenv/bin/modules/installer/windows/msiglobal.pm
+++ b/solenv/bin/modules/installer/windows/msiglobal.pm
@@ -785,11 +785,16 @@ sub get_codepage_for_sis
sub get_template_for_sis
{
- my ( $language ) = @_;
+ my ( $language, $allvariables ) = @_;
my $windowslanguage = installer::windows::language::get_windows_language($language);
- my $value = "\"Intel;" . $windowslanguage; # adding the Windows language
+ my $architecture = "Intel";
+
+ # Adding 256, if this is a 64 bit installation set.
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 )) { $architecture = "x64"; }
+
+ my $value = "\"" . $architecture . ";" . $windowslanguage; # adding the Windows language
$value = $value . "\""; # adding ending '"'
@@ -927,7 +932,7 @@ sub write_summary_into_msi_database
my $msiversion = get_msiversion_for_sis();
my $codepage = get_codepage_for_sis($language);
- my $template = get_template_for_sis($language);
+ my $template = get_template_for_sis($language, $allvariableshashref);
my $guid = get_packagecode_for_sis();
my $title = get_title_for_sis($sislanguage,$languagefile, "OOO_SIS_TITLE");
my $author = get_author_for_sis();
@@ -1669,6 +1674,104 @@ sub set_uuid_into_component_table
}
+#########################################################################
+# Adding final 64 properties into msi database, if required.
+# RegLocator : +16 in type column to search in 64 bit registry.
+# All conditions: "VersionNT" -> "VersionNT64" (several tables).
+# Already done: "+256" in Attributes column of table "Component".
+# Still following: Setting "x64" instead of "Intel" in Summary
+# Information Stream of msi database in "get_template_for_sis".
+#########################################################################
+
+sub prepare_64bit_database
+{
+ my ($basedir, $allvariables) = @_;
+
+ my $infoline = "";
+
+ if (( $allvariables->{'64BITPRODUCT'} ) && ( $allvariables->{'64BITPRODUCT'} == 1 ))
+ {
+ # 1. Beginning with table "RegLocat.idt". Adding "16" to the type.
+
+ my $reglocatfile = "";
+ my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
+
+ if ( -f $reglocatfilename )
+ {
+ my $saving_required = 0;
+ $reglocatfile = installer::files::read_file($reglocatfilename);
+
+ for ( my $i = 3; $i <= $#{$reglocatfile}; $i++ ) # ignoring the first three lines
+ {
+ my $oneline = ${$reglocatfile}[$i];
+
+ if ( $oneline =~ /^\s*\#/ ) { next; } # this is a comment line
+ if ( $oneline =~ /^\s*$/ ) { next; }
+
+ if ( $oneline =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(\d+)\s*$/ )
+ {
+ # Syntax: Signature_ Root Key Name Type
+ my $sig = $1;
+ my $root = $2;
+ my $key = $3;
+ my $name = $4;
+ my $type = $5;
+
+ $type = $type + 16;
+
+ my $newline = $sig . "\t" . $root . "\t" . $key . "\t" . $name . "\t" . $type . "\n";
+ ${$reglocatfile}[$i] = $newline;
+
+ $saving_required = 1;
+ }
+ }
+
+ if ( $saving_required )
+ {
+ # Saving the files
+ installer::files::save_file($reglocatfilename ,$reglocatfile);
+ $infoline = "Making idt file 64 bit conform: $reglocatfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # 2. Replacing all occurences of "VersionNT" by "VersionNT64"
+
+ my @versionnt_files = ("Componen.idt", "InstallE.idt", "InstallU.idt", "LaunchCo.idt");
+
+ foreach my $onefile ( @versionnt_files )
+ {
+ my $fullfilename = $basedir . $installer::globals::separator . $onefile;
+
+ if ( -f $fullfilename )
+ {
+ my $saving_required = 0;
+ $filecontent = installer::files::read_file($fullfilename);
+
+ for ( my $i = 3; $i <= $#{$filecontent}; $i++ ) # ignoring the first three lines
+ {
+ my $oneline = ${$filecontent}[$i];
+
+ if ( $oneline =~ /\bVersionNT\b/ )
+ {
+ ${$filecontent}[$i] =~ s/\bVersionNT\b/VersionNT64/g;
+ $saving_required = 1;
+ }
+ }
+
+ if ( $saving_required )
+ {
+ # Saving the files
+ installer::files::save_file($fullfilename ,$filecontent);
+ $infoline = "Making idt file 64 bit conform: $fullfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ }
+
+}
+
#################################################################
# Include all cab files into the msi database.
# This works only on Windows