diff options
author | Andras Timar <atimar@suse.com> | 2011-12-06 19:28:21 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2011-12-06 19:28:21 +0100 |
commit | 2ba4a4bf6384cd57664d316dd479bddfa38760d6 (patch) | |
tree | aeed652a7d29749a5e96b90c3ae77856a965f547 /solenv/bin | |
parent | 48c5739700039acdb247d70de8472b27c4113b73 (diff) |
remove NSIS support
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/modules/installer/download.pm | 823 | ||||
-rw-r--r-- | solenv/bin/modules/installer/followme.pm | 2 | ||||
-rw-r--r-- | solenv/bin/modules/installer/globals.pm | 4 |
3 files changed, 0 insertions, 829 deletions
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm index 0d14737bfa6d..246adea59484 100644 --- a/solenv/bin/modules/installer/download.pm +++ b/solenv/bin/modules/installer/download.pm @@ -775,375 +775,6 @@ sub resolve_variables_in_downloadname return $downloadname; } -################################################################## -# Windows: Replacing one placeholder with the specified value -################################################################## - -sub replace_one_variable -{ - my ($templatefile, $placeholder, $value) = @_; - - my $infoline = "Replacing $placeholder by $value in nsi file\n"; - push( @installer::globals::logfileinfo, $infoline); - - for ( my $i = 0; $i <= $#{$templatefile}; $i++ ) - { - ${$templatefile}[$i] =~ s/$placeholder/$value/g; - } - -} - -######################################################################################## -# Converting a string to a unicode string -######################################################################################## - -sub convert_to_unicode -{ - my ($string) = @_; - - my $unicodestring = ""; - - my $stringlength = length($string); - - for ( my $i = 0; $i < $stringlength; $i++ ) - { - $unicodestring = $unicodestring . substr($string, $i, 1); - $unicodestring = $unicodestring . chr(0); - } - - return $unicodestring; -} - -################################################################## -# Windows: Setting nsis version is necessary because of small -# changes in nsis from version 2.0.4 to 2.3.1 -################################################################## - -sub set_nsis_version -{ - my ($nshfile) = @_; - - my $searchstring = "\$\{LangFileString\}"; # occurs only in nsis 2.3.1 or similar - - for ( my $i = 0; $i <= $#{$nshfile}; $i++ ) - { - if ( ${$nshfile}[$i] =~ /\Q$searchstring\E/ ) - { - # this is nsis 2.3.1 or similar - $installer::globals::nsis231 = 1; - $installer::globals::unicodensis = 0; - last; - } - } - - # checking unicode version - $searchstring = convert_to_unicode($searchstring); - - for ( my $i = 0; $i <= $#{$nshfile}; $i++ ) - { - if ( ${$nshfile}[$i] =~ /\Q$searchstring\E/ ) - { - # this is nsis 2.3.1 or similar - $installer::globals::nsis231 = 1; - $installer::globals::unicodensis = 1; - last; - } - } - - if ( ! $installer::globals::nsis231 ) { $installer::globals::nsis204 = 1; } -} - -################################################################## -# Windows: Including the product name into nsi template -################################################################## - -sub put_windows_productname_into_template -{ - my ($templatefile, $variableshashref) = @_; - - my $productname = $variableshashref->{'PRODUCTNAME'}; - $productname =~ s/\.//g; # OpenOffice.org -> OpenOfficeorg - - replace_one_variable($templatefile, "PRODUCTNAMEPLACEHOLDER", $productname); -} - -################################################################## -# Windows: Substituting the path to a file into the nsi template -################################################################## - -sub substitute_path_into_template -{ - my ($templatefile, $includepatharrayref, $allvariables, $var, $subst) = @_; - - if ( ! $allvariables->{$var} ) { $var =~ s/_.*$//; } # _BR suffix ? - if ( ! $allvariables->{$var} ) { installer::exiter::exit_program("ERROR: $var not defined in product definition!", "substitute_path_into_template"); } - my $filename = $allvariables->{$var}; - - my $completefilenameref = ""; - - if ( $installer::globals::include_pathes_read ) - { - $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0); - } - else - { - $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0); - } - - if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "substitute_path_into_template"); } - - if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; } - - replace_one_variable($templatefile, $subst, $$completefilenameref); -} - -################################################################## -# Windows: substitute a variable into the nsi template -################################################################## -sub substitute_variable_into_template($$$$) -{ - my ($templatefile, $variableshashref, $varname, $subst) = @_; - - my $var = ""; - if ( $variableshashref->{$varname} ) { $var = $variableshashref->{$varname}; } - - replace_one_variable($templatefile, $subst, $var); -} - -################################################################## -# Windows: Including the product version into nsi template -################################################################## - -sub put_windows_productpath_into_template -{ - my ($templatefile, $variableshashref, $languagestringref, $localnsisdir) = @_; - - my $productpath = $variableshashref->{'PROPERTYTABLEPRODUCTNAME'}; - - if (length($locallangs) > $installer::globals::max_lang_length) { $locallangs = "multi lingual"; } - - if ( ! $installer::globals::languagepack || ! $installer::globals::helppack ) { $productpath = $productpath . " (" . sprintf('%x', time()) . ")"; } - - replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER", $productpath); -} - -################################################################## -# Windows: Including download file name into nsi template -################################################################## - -sub put_outputfilename_into_template -{ - my ($templatefile, $downloadname) = @_; - - $installer::globals::downloadfileextension = ".exe"; - $downloadname = $downloadname . $installer::globals::downloadfileextension; - $installer::globals::downloadfilename = $downloadname; - - replace_one_variable($templatefile, "DOWNLOADNAMEPLACEHOLDER", $downloadname); -} - -################################################################## -# Windows: Generating the file list in nsi file format -################################################################## - -sub get_file_list -{ - my ( $basedir ) = @_; - - my @filelist = (); - - my $alldirs = installer::systemactions::get_all_directories($basedir); - unshift(@{$alldirs}, $basedir); # $basedir is the first directory in $alldirs - - for ( my $i = 0; $i <= $#{$alldirs}; $i++ ) - { - my $onedir = ${$alldirs}[$i]; - - # Syntax: - # SetOutPath "$INSTDIR" - - my $relativedir = $onedir; - $relativedir =~ s/\Q$basedir\E//; - - my $oneline = " " . "SetOutPath" . " " . "\"\$INSTDIR" . $relativedir . "\"" . "\n"; - - if ( $^O =~ /cygwin/i ) { - $oneline =~ s/\//\\/g; - } - push(@filelist, $oneline); - - # Collecting all files in the specific directory - - my $files = installer::systemactions::get_all_files_from_one_directory($onedir); - - for ( my $j = 0; $j <= $#{$files}; $j++ ) - { - my $onefile = ${$files}[$j]; - - my $fileline = " " . "File" . " " . "\"" . $onefile . "\"" . "\n"; - - if ( $^O =~ /cygwin/i ) { - $fileline =~ s/\//\\/g; - } - push(@filelist, $fileline); - } - } - - return \@filelist; -} - -################################################################## -# Windows: Including list of all files into nsi template -################################################################## - -sub put_filelist_into_template -{ - my ($templatefile, $installationdir) = @_; - - my $filelist = get_file_list($installationdir); - - my $filestring = ""; - - for ( my $i = 0; $i <= $#{$filelist}; $i++ ) - { - $filestring = $filestring . ${$filelist}[$i]; - } - - $filestring =~ s/\s*$//; - - replace_one_variable($templatefile, "ALLFILESPLACEHOLDER", $filestring); -} - -################################################################## -# Windows: NSIS uses specific language names -################################################################## - -sub nsis_language_converter -{ - my ($language) = @_; - - my $nsislanguage = ""; - - # Assign language used by NSIS. - # The files "$nsislanguage.nsh" and "$nsislanguage.nlf" - # are needed in the NSIS environment. - # Directory: <NSIS-Dir>/Contrib/Language files - if ( $language eq "en-US" ) { $nsislanguage = "English"; } - elsif ( $language eq "sq" ) { $nsislanguage = "Albanian"; } - elsif ( $language eq "ar" ) { $nsislanguage = "Arabic"; } - elsif ( $language eq "bg" ) { $nsislanguage = "Bulgarian"; } - elsif ( $language eq "ca" ) { $nsislanguage = "Catalan"; } - elsif ( $language eq "hr" ) { $nsislanguage = "Croatian"; } - elsif ( $language eq "cs" ) { $nsislanguage = "Czech"; } - elsif ( $language eq "da" ) { $nsislanguage = "Danish"; } - elsif ( $language eq "nl" ) { $nsislanguage = "Dutch"; } - elsif ( $language eq "de" ) { $nsislanguage = "German"; } - elsif ( $language eq "de-LU" ) { $nsislanguage = "Luxembourgish"; } - elsif ( $language eq "et" ) { $nsislanguage = "Estonian"; } - elsif ( $language eq "fa" ) { $nsislanguage = "Farsi"; } - elsif ( $language eq "el" ) { $nsislanguage = "Greek"; } - elsif ( $language eq "fi" ) { $nsislanguage = "Finnish"; } - elsif ( $language eq "fr" ) { $nsislanguage = "French"; } - elsif ( $language eq "hu" ) { $nsislanguage = "Hungarian"; } - elsif ( $language eq "he" ) { $nsislanguage = "Hebrew"; } - elsif ( $language eq "is" ) { $nsislanguage = "Icelandic"; } - elsif ( $language eq "id" ) { $nsislanguage = "Indonesian"; } - elsif ( $language eq "it" ) { $nsislanguage = "Italian"; } - elsif ( $language eq "lv" ) { $nsislanguage = "Latvian"; } - elsif ( $language eq "lt" ) { $nsislanguage = "Lithuanian"; } - elsif ( $language eq "mk" ) { $nsislanguage = "Macedonian"; } - elsif ( $language eq "mn" ) { $nsislanguage = "Mongolian"; } - elsif ( $language eq "no" ) { $nsislanguage = "Norwegian"; } - elsif ( $language eq "no-NO" ) { $nsislanguage = "Norwegian"; } - elsif ( $language eq "es" ) { $nsislanguage = "Spanish"; } - elsif ( $language eq "sl" ) { $nsislanguage = "Slovenian"; } - elsif ( $language eq "sv" ) { $nsislanguage = "Swedish"; } - elsif ( $language eq "sk" ) { $nsislanguage = "Slovak"; } - elsif ( $language eq "pl" ) { $nsislanguage = "Polish"; } - elsif ( $language eq "pt-BR" ) { $nsislanguage = "PortugueseBR"; } - elsif ( $language eq "pt" ) { $nsislanguage = "Portuguese"; } - elsif ( $language eq "ro" ) { $nsislanguage = "Romanian"; } - elsif ( $language eq "ru" ) { $nsislanguage = "Russian"; } - elsif ( $language eq "sh" ) { $nsislanguage = "SerbianLatin"; } - elsif ( $language eq "sr" ) { $nsislanguage = "Serbian"; } - elsif ( $language eq "sr-SP" ) { $nsislanguage = "Serbian"; } - elsif ( $language eq "uk" ) { $nsislanguage = "Ukrainian"; } - elsif ( $language eq "tr" ) { $nsislanguage = "Turkish"; } - elsif ( $language eq "ja" ) { $nsislanguage = "Japanese"; } - elsif ( $language eq "ko" ) { $nsislanguage = "Korean"; } - elsif ( $language eq "th" ) { $nsislanguage = "Thai"; } - elsif ( $language eq "zh-CN" ) { $nsislanguage = "SimpChinese"; } - elsif ( $language eq "zh-TW" ) { $nsislanguage = "TradChinese"; } - else { - my $infoline = "NSIS language_converter : Could not find nsis language for $language!\n"; - push( @installer::globals::logfileinfo, $infoline); - $nsislanguage = "English"; - } - - return $nsislanguage; -} - -################################################################## -# Windows: Including list of all languages into nsi template -################################################################## - -sub put_language_list_into_template -{ - my ($templatefile, $languagesarrayref) = @_; - - my $alllangstring = ""; - my %nsislangs; - - for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ ) - { - my $onelanguage = ${$languagesarrayref}[$i]; - my $nsislanguage = nsis_language_converter($onelanguage); - $nsislangs{$nsislanguage}++; - } - - foreach my $nsislanguage ( keys(%nsislangs) ) - { - # Syntax: !insertmacro MUI_LANGUAGE "English" - my $langstring = "\!insertmacro MUI_LANGUAGE_PACK " . $nsislanguage . "\n"; - if ( $nsislanguage eq "English" ) - { - $alllangstring = $langstring . $alllangstring; - } - else - { - $alllangstring = $alllangstring . $langstring; - } - } - - $alllangstring =~ s/\s*$//; - - replace_one_variable($templatefile, "ALLLANGUAGESPLACEHOLDER", $alllangstring); -} - -################################################################## -# Windows: Collecting all identifier from mlf file -################################################################## - -sub get_identifier -{ - my ( $mlffile ) = @_; - - my @identifier = (); - - for ( my $i = 0; $i <= $#{$mlffile}; $i++ ) - { - my $oneline = ${$mlffile}[$i]; - - if ( $oneline =~ /^\s*\[(.+)\]\s*$/ ) - { - my $identifier = $1; - push(@identifier, $identifier); - } - } - - return \@identifier; -} - ############################################################## # Returning the complete block in all languages # for a specified string @@ -1215,85 +846,6 @@ sub get_language_string_from_language_block } ################################################################## -# Windows: Replacing strings in NSIS nsh file -# nsh file syntax: -# !define MUI_TEXT_DIRECTORY_TITLE "Zielverzeichnis ausw�hlen" -################################################################## - -sub replace_identifier_in_nshfile -{ - my ( $nshfile, $identifier, $newstring, $nshfilename, $onelanguage ) = @_; - - if ( $installer::globals::nsis231 ) - { - $newstring =~ s/\\r/\$\\r/g; # \r -> $\r in modern nsis versions - $newstring =~ s/\\n/\$\\n/g; # \n -> $\n in modern nsis versions - } - - for ( my $i = 0; $i <= $#{$nshfile}; $i++ ) - { - if ( ${$nshfile}[$i] =~ /\s+\Q$identifier\E\s+\"(.+)\"\s*$/ ) - { - my $oldstring = $1; - ${$nshfile}[$i] =~ s/\Q$oldstring\E/$newstring/; - my $infoline = "NSIS replacement in $nshfilename ($onelanguage): $oldstring \-\> $newstring\n"; - push( @installer::globals::logfileinfo, $infoline); - } - } -} - -################################################################## -# Windows: Replacing strings in NSIS nlf file -# nlf file syntax (2 lines): -# # ^DirSubText -# Zielverzeichnis -################################################################## - -sub replace_identifier_in_nlffile -{ - my ( $nlffile, $identifier, $newstring, $nlffilename, $onelanguage ) = @_; - - for ( my $i = 0; $i <= $#{$nlffile}; $i++ ) - { - if ( ${$nlffile}[$i] =~ /^\s*\#\s+\^\s*\Q$identifier\E\s*$/ ) - { - my $next = $i+1; - my $oldstring = ${$nlffile}[$next]; - ${$nlffile}[$next] = $newstring . "\n"; - $oldstring =~ s/\s*$//; - my $infoline = "NSIS replacement in $nlffilename ($onelanguage): $oldstring \-\> $newstring\n"; - push( @installer::globals::logfileinfo, $infoline); - } - } -} - -################################################################## -# Windows: Translating the NSIS nsh and nlf file -################################################################## - -sub translate_nsh_nlf_file -{ - my ($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage) = @_; - - # Analyzing the mlf file, collecting all Identifier - my $allidentifier = get_identifier($mlffile); - - $onelanguage = "en-US" if ( $nsislanguage eq "English" && $onelanguage ne "en-US"); - for ( my $i = 0; $i <= $#{$allidentifier}; $i++ ) - { - my $identifier = ${$allidentifier}[$i]; - my $language_block = get_language_block_from_language_file($identifier, $mlffile); - my $newstring = get_language_string_from_language_block($language_block, $onelanguage); - - # removing mask - $newstring =~ s/\\\'/\'/g; - - replace_identifier_in_nshfile($nshfile, $identifier, $newstring, $nshfilename, $onelanguage); - replace_identifier_in_nlffile($nlffile, $identifier, $newstring, $nlffilename, $onelanguage); - } -} - -################################################################## # Converting utf 16 file to utf 8 ################################################################## @@ -1351,303 +903,6 @@ sub convert_utf8_to_utf16 installer::systemactions::copy_one_file($filename, $savfilename); } -################################################################## -# Converting text string to utf 16 -################################################################## - -sub convert_textstring_to_utf16 -{ - my ( $textstring, $localnsisdir, $shortfilename ) = @_; - - my $filename = $localnsisdir . $installer::globals::separator . $shortfilename; - my @filecontent = (); - push(@filecontent, $textstring); - installer::files::save_file($filename, \@filecontent); - convert_utf8_to_utf16($filename); - my $newfile = installer::files::read_file($filename); - my $utf16string = ""; - if ( ${$newfile}[0] ne "" ) { $utf16string = ${$newfile}[0]; } - - return $utf16string; -} - -################################################################## -# Windows: Copying NSIS language files to local nsis directory -################################################################## - -sub copy_and_translate_nsis_language_files -{ - my ($nsispath, $localnsisdir, $languagesarrayref, $allvariables) = @_; - - my $nlffilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Language\ files" . $installer::globals::separator; - my $nshfilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Modern\ UI" . $installer::globals::separator . "Language files" . $installer::globals::separator; - - my $infoline = ""; - - for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ ) - { - my $onelanguage = ${$languagesarrayref}[$i]; - my $nsislanguage = nsis_language_converter($onelanguage); - - # Copying the nlf file - my $sourcepath = $nlffilepath . $nsislanguage . "\.nlf"; - if ( ! -f $sourcepath ) { installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files"); } - my $nlffilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nlf"; - if ( $^O =~ /cygwin/i ) { $nlffilename =~ s/\//\\/g; } - installer::systemactions::copy_one_file($sourcepath, $nlffilename); - - # Copying the nsh file - # In newer nsis versions, the nsh file is located next to the nlf file - $sourcepath = $nshfilepath . $nsislanguage . "\.nsh"; - if ( ! -f $sourcepath ) - { - # trying to find the nsh file next to the nlf file - $sourcepath = $nlffilepath . $nsislanguage . "\.nsh"; - if ( ! -f $sourcepath ) - { - installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files"); - } - } - my $nshfilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nsh"; - if ( $^O =~ /cygwin/i ) { $nshfilename =~ s/\//\\/g; } - installer::systemactions::copy_one_file($sourcepath, $nshfilename); - - # Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN -> MUI_LANGUAGEFILE_PACK_BEGIN - my $nshfile = installer::files::read_file($nshfilename); - set_nsis_version($nshfile); - - if ( $installer::globals::unicodensis ) - { - $infoline = "This is Unicode NSIS!\n"; - push( @installer::globals::logfileinfo, $infoline); - convert_utf16_to_utf8($nshfilename); - convert_utf16_to_utf8($nlffilename); - $nshfile = installer::files::read_file($nshfilename); # read nsh file again - } - - replace_one_variable($nshfile, "MUI_LANGUAGEFILE_BEGIN", "MUI_LANGUAGEFILE_PACK_BEGIN"); - - # find the ulf file for translation - my $mlffile = get_translation_file($allvariables); - - # Translate the files - my $nlffile = installer::files::read_file($nlffilename); - translate_nsh_nlf_file($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage); - - installer::files::save_file($nshfilename, $nshfile); - installer::files::save_file($nlffilename, $nlffile); - - if ( $installer::globals::unicodensis ) - { - convert_utf8_to_utf16($nshfilename); - convert_utf8_to_utf16($nlffilename); - } - } - -} - -################################################################## -# Windows: Including the nsis path into the nsi template -################################################################## - -sub put_nsis_path_into_template -{ - my ($templatefile, $nsisdir) = @_; - - replace_one_variable($templatefile, "NSISPATHPLACEHOLDER", $nsisdir); -} - -################################################################## -# Windows: Including the output path into the nsi template -################################################################## - -sub put_output_path_into_template -{ - my ($templatefile, $downloaddir) = @_; - - if ( $^O =~ /cygwin/i ) { $downloaddir =~ s/\//\\/g; } - - replace_one_variable($templatefile, "OUTPUTDIRPLACEHOLDER", $downloaddir); -} - -################################################################## -# Windows: Only allow specific code for nsis 2.0.4 or nsis 2.3.1 -################################################################## - -sub put_version_specific_code_into_template -{ - my ($templatefile) = @_; - - my $subst204 = ""; - my $subst231 = ""; - - if ( $installer::globals::nsis204 ) - { - $subst231 = ";"; - } - else - { - $subst204 = ";"; - } - - replace_one_variable($templatefile, "\#204\#", $subst204); - replace_one_variable($templatefile, "\#231\#", $subst231); -} - -################################################################## -# Windows: Finding the path to the nsis SDK -################################################################## - -sub get_path_to_nsis_sdk -{ - my $vol; - my $dir; - my $file; - my $nsispath = ""; - - if ( $ENV{'NSIS_PATH'} ) { - $nsispath = $ENV{'NSIS_PATH'}; - } elsif ( $ENV{'SOLARROOT'} ) { - $nsispath = $ENV{'SOLARROOT'} . $installer::globals::separator . "NSIS"; - } else { - # do we have nsis already in path ? - @paths = split(/:/, $ENV{'PATH'}); - foreach $paths (@paths) { - $paths =~ s/[\/\\]+$//; # remove trailing slashes; - $nsispath = $paths . "/nsis"; - - if ( -x $nsispath ) { - $nsispath = $paths; - last; - } - else { - $nsispath = ""; - } - } - } - if ( $ENV{'NSISSDK_SOURCE'} ) { - installer::logger::print_warning( "NSISSDK_SOURCE is deprecated. use NSIS_PATH instead.\n" ); - $nsispath = $ENV{'NSISSDK_SOURCE'}; # overriding the NSIS SDK with NSISSDK_SOURCE - } - - if ( $nsispath eq "" ) - { - installer::logger::print_message( "... no Environment variable \"SOLARROOT\", \"NSIS_PATH\" or \"NSISSDK_SOURCE\" found and NSIS not found in path!", "get_path_to_nsis_sdk"); - } elsif ( ! -d $nsispath ) - { - installer::exiter::exit_program("ERROR: NSIS path $nsispath does not exist!", "get_path_to_nsis_sdk"); - } - - return $nsispath; -} - -################################################################## -# Windows: Executing NSIS to create the installation set -################################################################## - -sub call_nsis -{ - my ( $nsispath, $nsifile ) = @_; - - my $makensisexe = $nsispath . $installer::globals::separator . "makensis.exe"; - - installer::logger::print_message( "... starting $makensisexe ... \n" ); - - if( $^O =~ /cygwin/i ) { $nsifile =~ s/\\/\//g; } - - my $systemcall = "$makensisexe /V4 /DMUI_VERBOSE=4 $nsifile |"; - - my $infoline = "Systemcall: $systemcall\n"; - push( @installer::globals::logfileinfo, $infoline); - - my @nsisoutput = (); - - open (NSI, "$systemcall"); - while (<NSI>) {push(@nsisoutput, $_); } - close (NSI); - - my $returnvalue = $?; # $? contains the return value of the systemcall - - if ($returnvalue) - { - $infoline = "ERROR: $systemcall !\n"; - push( @installer::globals::logfileinfo, $infoline); - } - else - { - $infoline = "Success: $systemcall\n"; - push( @installer::globals::logfileinfo, $infoline); - } - - for ( my $i = 0; $i <= $#nsisoutput; $i++ ) { push( @installer::globals::logfileinfo, "$nsisoutput[$i]"); } - -} - -################################################################################# -# Replacing one variable in one files -################################################################################# - -sub replace_one_variable_in_translationfile -{ - my ($translationfile, $variable, $searchstring) = @_; - - for ( my $i = 0; $i <= $#{$translationfile}; $i++ ) - { - ${$translationfile}[$i] =~ s/\%$searchstring/$variable/g; - } -} - -################################################################################# -# Replacing the variables in the translation file -################################################################################# - -sub replace_variables -{ - my ($translationfile, $variableshashref) = @_; - - # we want to substitute FOO_BR before FOO to avoid floating _BR suffixes - foreach $key (sort { length ($b) <=> length ($a) } keys %{$variableshashref}) - { - my $value = $variableshashref->{$key}; - - # special handling for PRODUCTVERSION, if $allvariables->{'POSTVERSIONEXTENSION'} - if (( $key eq "PRODUCTVERSION" ) && ( $variableshashref->{'POSTVERSIONEXTENSION'} )) { $value = $value . " " . $variableshashref->{'POSTVERSIONEXTENSION'}; } - - replace_one_variable_in_translationfile($translationfile, $value, $key); - } -} - -######################################################### -# Getting the translation file for the nsis installer -######################################################### - -sub get_translation_file -{ - my ($allvariableshashref) = @_; - my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::nsisfilename; - if ( $installer::globals::unicodensis ) { $translationfilename = $translationfilename . ".uulf"; } - else { $translationfilename = $translationfilename . ".mlf"; } - if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_translation_file"); } - my $translationfile = installer::files::read_file($translationfilename); - replace_variables($translationfile, $allvariableshashref); - - my $infoline = "Reading translation file: $translationfilename\n"; - push( @installer::globals::logfileinfo, $infoline); - - return $translationfile; -} - -#################################################### -# Removing english, if it was added before -#################################################### - -sub remove_english_for_nsis_installer -{ - my ($languagestringref, $languagesarrayref) = @_; - - @{$languagesarrayref} = ("en-US"); # only english for NSIS installer! -} - #################################################### # Creating link tree for upload #################################################### @@ -1711,9 +966,6 @@ sub create_download_sets installer::logger::include_header_into_logfile("Creating download installation sets:"); - # special handling for installation sets, to which english was added automatically - if ( $installer::globals::added_english ) { remove_english_for_nsis_installer($languagestringref, $languagesarrayref); } - my $firstdir = $installationdir; installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir); @@ -1807,81 +1059,6 @@ sub create_download_sets include_tar_into_script($newscriptfilename, $temporary_tarfile_name); } } - else # Windows specific part - { - my $localnsisdir = installer::systemactions::create_directories("nsis", $languagestringref); - # push(@installer::globals::removedirs, $localnsisdir); - - # find nsis in the system - my $nsispath = get_path_to_nsis_sdk(); - - if ( $nsispath eq "" ) { - # If nsis is not found just skip the rest of this function - # and do not create the NSIS file. - $infoline = "\nNo NSIS SDK found. Skipping the generation of NSIS file.\n"; - push(@installer::globals::logfileinfo, $infoline); - installer::logger::print_message( "... no NSIS SDK found. Skipping the generation of NSIS file ... \n" ); - return $downloaddir; - } - - # copy language files into nsis directory and translate them - copy_and_translate_nsis_language_files($nsispath, $localnsisdir, $languagesarrayref, $allvariableshashref); - - # find and read the nsi file template - my $templatefilename = "downloadtemplate.nsi"; - - my $templateref = ""; - - if ( $installer::globals::include_pathes_read ) - { - $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$templatefilename, $includepatharrayref, 0); - } - else - { - $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$templatefilename, $includepatharrayref, 0); - } - - if ($$templateref eq "") { installer::exiter::exit_program("ERROR: Could not find nsi template file $templatefilename!", "create_download_sets"); } - my $templatefile = installer::files::read_file($$templateref); - - # add product name into script template - put_windows_productname_into_template($templatefile, $allvariableshashref); - @path_substs = ( - 'DOWNLOADBANNER' => 'BANNERBMPPLACEHOLDER', - 'DOWNLOADBITMAP' => 'WELCOMEBMPPLACEHOLDER', - 'DOWNLOADSETUPICO' => 'SETUPICOPLACEHOLDER' - ); - while (@path_substs) { - my $var= shift @path_substs; - my $val = shift @path_substs; - substitute_path_into_template($templatefile, $includepatharrayref, - $allvariableshashref, $var, $val); - } - %var_substs = ( - 'OOOVENDOR' => 'PUBLISHERPLACEHOLDER', - 'STARTCENTER_INFO_URL' => 'WEBSITEPLACEHOLDER', - 'WINDOWSJAVAFILENAME' => 'WINDOWSJAVAFILENAMEPLACEHOLDER', - 'PRODUCTVERSION' => 'PRODUCTVERSIONPLACEHOLDER' - ); - for $var (keys %var_substs) { - substitute_variable_into_template($templatefile, $allvariableshashref, - $var, $var_substs{$var}); - } - put_windows_productpath_into_template($templatefile, $allvariableshashref, $languagestringref, $localnsisdir); - put_outputfilename_into_template($templatefile, $downloadname); - put_filelist_into_template($templatefile, $installationdir); - put_language_list_into_template($templatefile, $languagesarrayref); - put_nsis_path_into_template($templatefile, $localnsisdir); - put_output_path_into_template($templatefile, $downloaddir); - put_version_specific_code_into_template($templatefile); - - my $nsifilename = save_script_file($localnsisdir, $templatefilename, $templatefile); - - installer::logger::print_message( "... created NSIS file $nsifilename ... \n" ); - - # starting the NSIS SDK to create the download file - call_nsis($nsispath, $nsifilename); - } return $downloaddir; } diff --git a/solenv/bin/modules/installer/followme.pm b/solenv/bin/modules/installer/followme.pm index 535ac31588ff..f7b1890cf2a8 100644 --- a/solenv/bin/modules/installer/followme.pm +++ b/solenv/bin/modules/installer/followme.pm @@ -94,7 +94,6 @@ sub save_followme_info push(@filecontent, "globals:product: $installer::globals::product\n"); push(@filecontent, "globals:minor: $installer::globals::minor\n"); push(@filecontent, "globals:lastminor: $installer::globals::lastminor\n"); - push(@filecontent, "globals:nsisfilename: $installer::globals::nsisfilename\n"); # Saving file installer::files::save_file($downloadinfodir . $installer::globals::separator . $downloadinfofilename, \@filecontent); @@ -197,7 +196,6 @@ sub read_followme_info if ( $name eq "product" ) { $installer::globals::product = $value; } if ( $name eq "minor" ) { $installer::globals::minor = $value; } if ( $name eq "lastminor" ) { $installer::globals::lastminor = $value; } - if ( $name eq "nsisfilename" ) { $installer::globals::nsisfilename = $value; } } } diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 00c42271ec76..9913967f153a 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -455,11 +455,7 @@ BEGIN @helppackfeature =(); @featurecollector =(); $msiassemblyfiles = ""; - $nsisfilename = "Nsis"; $macinstallfilename = "macinstall.ulf"; - $nsis204 = 0; - $nsis231 = 0; - $unicodensis = 0; $linuxlinkrpms = ""; $extensioninstalldir = "gid_Dir_Share_Extension_Install"; @languagenames = (); |