summaryrefslogtreecommitdiff
path: root/solenv/bin/modules
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-09-26 18:53:30 +0200
committerAndras Timar <atimar@suse.com>2012-09-26 18:59:13 +0200
commit0475a7904978566dfb9f6e83497392b3841c0efc (patch)
tree68749a6e1f6e954f22850bf295060ce7e8028140 /solenv/bin/modules
parenta99ddfdc2f3b1abef56c61ab727b602d38a2413b (diff)
use utf-8 instead of legacy code pages in all msi tables (related: fdo#39595)
Change-Id: Ib2dc00c024762800fdb74ffb376d92a8583d44ad
Diffstat (limited to 'solenv/bin/modules')
-rw-r--r--solenv/bin/modules/installer.pm13
-rw-r--r--solenv/bin/modules/installer/control.pm32
-rw-r--r--solenv/bin/modules/installer/globals.pm3
-rw-r--r--solenv/bin/modules/installer/windows/idtglobal.pm33
-rw-r--r--solenv/bin/modules/installer/windows/language.pm23
-rw-r--r--solenv/bin/modules/installer/windows/msiglobal.pm98
6 files changed, 21 insertions, 181 deletions
diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm
index c2cd8ab8cbbc..025d47189305 100644
--- a/solenv/bin/modules/installer.pm
+++ b/solenv/bin/modules/installer.pm
@@ -297,10 +297,10 @@ sub run {
if ($installer::globals::languages_defined_in_productlist) { installer::languages::get_info_about_languages($allsettingsarrayref); }
#####################################
- # Windows requires the encoding list
+ # Windows requires the LCID list
#####################################
- if ( $installer::globals::iswindowsbuild ) { installer::control::read_encodinglist($includepatharrayref); }
+ if ( $installer::globals::iswindowsbuild ) { installer::control::read_lcidlist($includepatharrayref); }
#####################################################################
# Including additional inc files for variable settings, if defined
@@ -1603,15 +1603,10 @@ sub run {
push(@installer::globals::logfileinfo, $infoline);
}
- # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
-
- installer::windows::idtglobal::setencoding($languageidtdir, $onelanguage);
-
# setting bidi attributes, if required
-
if ( $is_rtl ) { installer::windows::idtglobal::setbidiattributes($languageidtdir, $onelanguage); }
- # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
+ # setting the condition, that at least one module is selected
installer::windows::idtglobal::set_multilanguageonly_condition($languageidtdir);
# include the license text into the table Control.idt
@@ -1679,8 +1674,6 @@ sub run {
# validating the database # ToDo
- my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.mlf");
-
installer::windows::msiglobal::write_summary_into_msi_database($msifilename, $onelanguage, $languagefile, $allvariableshashref);
# copy msi database into installation directory
diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm
index 7975bd926fd0..78b055bca986 100644
--- a/solenv/bin/modules/installer/control.pm
+++ b/solenv/bin/modules/installer/control.pm
@@ -408,53 +408,41 @@ sub check_logfile
}
#############################################################
-# Reading the Windows list file for language encodings
+# Reading the Windows list file for Windows language codes
+# Encoding field is no longer used. We use UTF-8 everywhere.
#############################################################
-sub read_encodinglist
+sub read_lcidlist
{
my ($patharrayref) = @_;
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$installer::globals::lcidlistname, $patharrayref , 0);
- my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$installer::globals::encodinglistname, $patharrayref , 0);
+ if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Did not find Windows LCID list $installer::globals::lcidlistname!", "read_lcidlist"); }
- if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Did not find Windows encoding list $installer::globals::encodinglistname!", "read_encodinglist"); }
-
- my $infoline = "Found encoding file: $$fileref\n";
+ my $infoline = "Found LCID file: $$fileref\n";
push(@installer::globals::globallogfileinfo, $infoline);
- my $encodinglist = installer::files::read_file($$fileref);
-
- my %msiencoding = ();
+ my $lcidlist = installer::files::read_file($$fileref);
my %msilanguage = ();
- # Controlling the encoding list
-
- for ( my $i = 0; $i <= $#{$encodinglist}; $i++ )
+ for ( my $i = 0; $i <= $#{$lcidlist}; $i++ )
{
- my $line = ${$encodinglist}[$i];
+ my $line = ${$lcidlist}[$i];
if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line
-
if ( $line =~ /^$/ ) { next; } # this is an empty line
-
if ( $line =~ /^(.*?)(\#.*)$/ ) { $line = $1; } # removing comments after "#"
-
if ( $line =~ /^\s*([\w-]+)\s*(\d+)\s*(\d+)\s*$/ )
{
my $onelanguage = $1;
- my $codepage = $2;
my $windowslanguage = $3;
-
- $msiencoding{$onelanguage} = $codepage;
$msilanguage{$onelanguage} = $windowslanguage;
}
else
{
- installer::exiter::exit_program("ERROR: Wrong syntax in Windows encoding list $installer::globals::encodinglistname in line $i.", "read_encodinglist");
+ installer::exiter::exit_program("ERROR: Wrong syntax in Windows LCID list $installer::globals::lcidlistname in line $i.", "read_lcidlist");
}
}
-
- $installer::globals::msiencoding = \%msiencoding;
$installer::globals::msilanguage = \%msilanguage;
}
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index ab570e580077..23ac86e304ee 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -87,8 +87,7 @@ BEGIN
$templatefoldername = "Templates";
$programmenufolder = "ProgramMenuFolder";
$systemfolder = "SystemFolder";
- $encodinglistname = "msi-encodinglist.txt";
- $msiencoding = ""; # hash reference for msi encodings
+ $lcidlistname = "msi-encodinglist.txt";
$msilanguage = ""; # hash reference for msi languages LCID
$sofficeiconadded = 0;
$temppath = "";
diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm
index da70c1139234..b29004e4fb55 100644
--- a/solenv/bin/modules/installer/windows/idtglobal.pm
+++ b/solenv/bin/modules/installer/windows/idtglobal.pm
@@ -440,7 +440,7 @@ sub write_idt_header
push(@{$idtref}, $oneline);
$oneline = "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n";
push(@{$idtref}, $oneline);
- $oneline = "WINDOWSENCODINGTEMPLATE\tFeature\tFeature\n";
+ $oneline = "65001\tFeature\tFeature\n";
push(@{$idtref}, $oneline);
}
@@ -480,7 +480,7 @@ sub write_idt_header
push(@{$idtref}, $oneline);
$oneline = "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n";
push(@{$idtref}, $oneline);
- $oneline = "WINDOWSENCODINGTEMPLATE\tShortcut\tShortcut\n";
+ $oneline = "65001\tShortcut\tShortcut\n";
push(@{$idtref}, $oneline);
}
@@ -1357,35 +1357,6 @@ sub include_subdir_into_componenttable
}
##################################################################
-# Setting the encoding in all idt files. Replacing the
-# variable WINDOWSENCODINGTEMPLATE
-##################################################################
-
-sub setencoding
-{
- my ( $languageidtdir, $onelanguage ) = @_;
-
- my $encoding = installer::windows::language::get_windows_encoding($onelanguage);
-
- # collecting all idt files in the directory $languageidtdir and substituting the string
-
- my $idtfiles = installer::systemactions::find_file_with_file_extension("idt", $languageidtdir);
-
- for ( my $i = 0; $i <= $#{$idtfiles}; $i++ )
- {
- my $onefilename = $languageidtdir . $installer::globals::separator . ${$idtfiles}[$i];
- my $onefile = installer::files::read_file($onefilename);
-
- for ( my $j = 0; $j <= $#{$onefile}; $j++ )
- {
- ${$onefile}[$j] =~ s/WINDOWSENCODINGTEMPLATE/$encoding/g;
- }
-
- installer::files::save_file($onefilename, $onefile);
- }
-}
-
-##################################################################
# Setting the condition, that at least one module is selected.
# All modules with flag SHOW_MULTILINGUAL_ONLY were already
# collected. In table ControlE.idt, the string
diff --git a/solenv/bin/modules/installer/windows/language.pm b/solenv/bin/modules/installer/windows/language.pm
index a95bed94517c..33e42ee5470a 100644
--- a/solenv/bin/modules/installer/windows/language.pm
+++ b/solenv/bin/modules/installer/windows/language.pm
@@ -47,27 +47,4 @@ sub get_windows_language
return $windowslanguage;
}
-####################################################
-# Determining the Windows language ANSI-Codepage
-# English: 1252
-####################################################
-
-sub get_windows_encoding
-{
- my ($language) = @_;
-
- my $windowsencoding = "";
-
- if ( $installer::globals::msiencoding->{$language} ) { $windowsencoding = $installer::globals::msiencoding->{$language}; }
-
- if ( $windowsencoding eq "" ) { $windowsencoding = "0"; } # setting value, if the language is not listed in the encodinglist
-
- if ( $windowsencoding eq "0" ) { $windowsencoding = "65001"; } # languages with "0" have to be available in UTF-8 (65001)
-
- # Asian multilingual installation sets need a code neutral Windows Installer database -> $windowsencoding = 0
- if (( $language eq "en-US" ) && (( $installer::globals::product =~ /suitemulti/i ) || ( $installer::globals::product =~ /officemulti/i ) || ( $installer::globals::product =~ /c05office/i ) || ( $installer::globals::added_english ))) { $windowsencoding = "0"; }
-
- return $windowsencoding;
-}
-
1;
diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm
index c7bbf550eaf0..0a898edfc34c 100644
--- a/solenv/bin/modules/installer/windows/msiglobal.pm
+++ b/solenv/bin/modules/installer/windows/msiglobal.pm
@@ -508,21 +508,6 @@ sub create_msi_database
}
}
-#####################################################################
-# Returning the value from sis.mlf for Summary Information Stream
-#####################################################################
-
-sub get_value_from_sis_lng
-{
- my ($language, $languagefile, $searchstring) = @_;
-
- my $language_block = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $languagefile);
- my $newstring = installer::windows::idtglobal::get_language_string_from_language_block($language_block, $language, $searchstring);
- $newstring = "\"" . $newstring . "\"";
-
- return $newstring;
-}
-
#################################################################
# Returning the msi version for the Summary Information Stream
#################################################################
@@ -544,24 +529,6 @@ sub get_wordcount_for_sis
}
#################################################################
-# Returning the codepage for the Summary Information Stream
-#################################################################
-
-sub get_codepage_for_sis
-{
- my ( $language ) = @_;
-
- my $codepage = installer::windows::language::get_windows_encoding($language);
-
- # Codepage 65001 does not work in Summary Information Stream
- if ( $codepage == 65001 ) { $codepage = 0; }
-
- # my $codepage = "1252"; # determine dynamically in a function
- # my $codepage = "65001"; # UTF-8
- return $codepage;
-}
-
-#################################################################
# Returning the template for the Summary Information Stream
#################################################################
@@ -603,19 +570,6 @@ sub get_packagecode_for_sis
}
#################################################################
-# Returning the title for the Summary Information Stream
-#################################################################
-
-sub get_title_for_sis
-{
- my ( $language, $languagefile, $searchstring ) = @_;
-
- my $title = get_value_from_sis_lng($language, $languagefile, $searchstring );
-
- return $title;
-}
-
-#################################################################
# Returning the author for the Summary Information Stream
#################################################################
@@ -643,45 +597,6 @@ sub get_subject_for_sis
return $subject;
}
-#################################################################
-# Returning the comment for the Summary Information Stream
-#################################################################
-
-sub get_comment_for_sis
-{
- my ( $language, $languagefile, $searchstring ) = @_;
-
- my $comment = get_value_from_sis_lng($language, $languagefile, $searchstring );
-
- return $comment;
-}
-
-#################################################################
-# Returning the keywords for the Summary Information Stream
-#################################################################
-
-sub get_keywords_for_sis
-{
- my ( $language, $languagefile, $searchstring ) = @_;
-
- my $keywords = get_value_from_sis_lng($language, $languagefile, $searchstring );
-
- return $keywords;
-}
-
-######################################################################
-# Returning the application name for the Summary Information Stream
-######################################################################
-
-sub get_appname_for_sis
-{
- my ( $language, $languagefile, $searchstring ) = @_;
-
- my $appname = get_value_from_sis_lng($language, $languagefile, $searchstring );
-
- return $appname;
-}
-
######################################################################
# Returning the security for the Summary Information Stream
######################################################################
@@ -713,19 +628,16 @@ sub write_summary_into_msi_database
$msiinfo = "$ENV{'OUTDIR_FOR_BUILD'}/bin/msiinfo.exe";
}
- my $sislanguage = "en-US"; # title, comment, keyword, and appname are always in English
-
my $msiversion = get_msiversion_for_sis();
- my $codepage = get_codepage_for_sis($language);
+ my $codepage = 0; # PID_CODEPAGE summary property in a signed short, therefore it is impossible to set 65001 here.
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 $title = "\"Installation database\"";
my $author = get_author_for_sis();
my $subject = get_subject_for_sis($allvariableshashref);
- my $comment = get_comment_for_sis($sislanguage,$languagefile, "OOO_SIS_COMMENT");
- $comment =~ s/\[ProductName\]/$allvariableshashref->{'PRODUCTNAME'}/;
- my $keywords = get_keywords_for_sis($sislanguage,$languagefile, "OOO_SIS_KEYWORDS");
- my $appname = get_appname_for_sis($sislanguage,$languagefile, "OOO_SIS_APPNAME");
+ my $comment = $allvariableshashref->{'PRODUCTNAME'};
+ my $keywords = "\"Install,MSI\"";
+ my $appname = "\"Windows Installer\"";
my $security = get_security_for_sis();
my $wordcount = get_wordcount_for_sis();