summaryrefslogtreecommitdiff
path: root/javainstaller2/src/Properties
diff options
context:
space:
mode:
authorIngo Schmidt <is@openoffice.org>2006-12-20 13:59:14 +0000
committerIngo Schmidt <is@openoffice.org>2006-12-20 13:59:14 +0000
commit3124a2fc3ec080ad0dfe18a268ea9e4f8e59f048 (patch)
tree5025eb2ef4eab946e1e194b6aee9fa465d01795a /javainstaller2/src/Properties
parent5f6ce9535fd3dd67d4d8e2c9a4321076fdc22250 (diff)
#i65425# Java installer, disabled
Diffstat (limited to 'javainstaller2/src/Properties')
-rwxr-xr-xjavainstaller2/src/Properties/create_property.pl276
-rwxr-xr-xjavainstaller2/src/Properties/makefile.mk56
-rwxr-xr-xjavainstaller2/src/Properties/setupfiles_template.properties24
-rwxr-xr-xjavainstaller2/src/Properties/setupstrings_template.properties110
4 files changed, 466 insertions, 0 deletions
diff --git a/javainstaller2/src/Properties/create_property.pl b/javainstaller2/src/Properties/create_property.pl
new file mode 100755
index 000000000000..a688d6f44445
--- /dev/null
+++ b/javainstaller2/src/Properties/create_property.pl
@@ -0,0 +1,276 @@
+: # -*- perl -*-
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+# create java installer property files for all languages defined in jlf file
+
+use Cwd;
+use File::Copy;
+
+if( $#ARGV < 2 )
+ {
+ print <<ENDHELP;
+USAGE: $0 <separator> <jlf_file_path> <outputpath>
+ <separator>: separator, used on the platform (slash or backslash)
+ <jlf_file_path>: path, in which the jlf file(s) can be found
+ <outputpath>: path, in which the property files will be created
+ENDHELP
+ exit;
+ }
+
+$separator = $ARGV[0];
+$inputpath = $ARGV[1];
+$outputpath = $ARGV[2];
+
+$inputpath =~ s/\Q$separator\E\s*$//;
+$outputpath =~ s/\Q$separator\E\s*$//;
+
+if ( ! -d $outputpath ) { mkdir $outputpath; }
+
+print "Separator: $separator \n";
+print "Input path: $inputpath \n";
+print "Output path: $outputpath \n";
+
+my $localdir = cwd();
+my $all_template_files = read_directory($localdir, "properties");
+my $all_jlf_files = read_directory($inputpath, "jlf");
+my $defaultlanguage = "en-US";
+my $missing_jlf_file = "setupfiles.jlf";
+my $alllanguages = get_all_languages($all_jlf_files);
+my @allnewpropertyfiles = ();
+
+for ( my $i = 0; $i <= $#{$all_template_files}; $i++ )
+{
+ my $template_file_name = ${$all_template_files}[$i];
+ my $complete_template_file_name = $localdir . $separator . $template_file_name;
+ my $jlf_file_name = get_jlf_file_name($template_file_name);
+ my $complete_jlf_file_name = $inputpath . $separator . $jlf_file_name;
+ print "Using template file: $complete_template_file_name\n";
+ my $jlf_file = "";
+ if ( ! ( $jlf_file_name eq $missing_jlf_file ))
+ {
+ print "Using translation file: $complete_jlf_file_name\n";
+ $jlf_file = read_file($complete_jlf_file_name);
+ }
+
+ for ( my $j = 0; $j <= $#{$alllanguages}; $j++ )
+ {
+ my $language = ${$alllanguages}[$j];
+ my $template_file = read_file($complete_template_file_name);
+ my $stringhash = create_string_hash($jlf_file, $language);
+ create_property_file($template_file, $stringhash);
+ my $filename = generate_filename($template_file_name, $language);
+
+ if ( $language eq $defaultlanguage )
+ {
+ # Creating language indenpendent english file
+ make_propertyfile_language_independent($template_file);
+ $filename = generate_filename($template_file_name, "");
+ save_file($outputpath, $filename, $template_file);
+ }
+ else
+ {
+ # Saving the non-english files
+ save_file($outputpath, $filename, $template_file);
+ }
+ }
+}
+
+exit;
+
+sub main::read_directory
+{
+ my ($dir, $ext) = @_;
+
+ my @content = ();
+ my $direntry;
+ opendir(DIR, $dir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+ next if ( ! ( $direntry =~ /\.\Q$ext\E\s*$/ ));
+
+ # my $completeentry = $dir . $separator . $direntry;
+ # push(@content, $completeentry);
+ push(@content, $direntry);
+ }
+
+ closedir(DIR);
+ return \@content;
+}
+
+sub main::read_file
+{
+ my ($filename) = @_;
+
+ open( IN, "<$filename" ) || die "cannot open $filename";
+ my @content = <IN>;
+ close( IN );
+
+ return \@content;
+}
+
+sub main::get_jlf_file_name
+{
+ my ($tempfilename) = @_;
+
+ my $jlffilename = "";
+
+ if ( $tempfilename =~ /^\s*(\w+)_template/ ) { $tempfilename = $1; }
+ $jlffilename = $tempfilename . "\.jlf";
+
+ return $jlffilename;
+}
+
+sub main::get_all_languages
+{
+ my ($alljlffiles) = @_;
+
+ my @languages = ();
+ my $record = 0;
+
+ my $first_jlf_file_name = $inputpath . $separator . ${$alljlffiles}[0];
+ my $jlffile = read_file($first_jlf_file_name);
+
+ for ( my $i = 0; $i <= $#{$jlffile}; $i++ )
+ {
+ if (( ${$jlffile}[$i] =~ /^\s*\[.*]\s*$/ ) && ( $record )) { last; }
+ if (( ${$jlffile}[$i] =~ /^\s*\[.*]\s*$/ ) && ( $record == 0 )) { $record = 1; }
+
+ if (( $record ) && ( ${$jlffile}[$i] =~ /^\s*(.+?)\s*\=/ ))
+ {
+ $language = $1;
+ push(@languages, $language);
+ }
+ }
+
+ my $languagestring = "";
+ for ( my $i = 0; $i <= $#languages; $i++ ) { $languagestring = $languagestring . $languages[$i] . ","; }
+ $languagestring =~ s/,\s*$//;
+ print "Languages: $languagestring\n";
+
+ return \@languages;
+}
+
+sub main::create_string_hash
+{
+ my ($jlffile, $language) = @_;
+
+ my %stringhash = ();
+ my $key = "";
+ my $value_defined = 0;
+
+ for ( my $i = 0; $i <= $#{$jlffile}; $i++ )
+ {
+ if ( ${$jlffile}[$i] =~ /^\s*\[(.*)\]\s*$/ )
+ {
+ $key = $1;
+ $value_defined = 0;
+ }
+
+ if (( ${$jlffile}[$i] =~ /^\s*\Q$defaultlanguage\E\s*=\s*\"(.*)\"\s*$/ ) && ( ! $value_defined ))
+ {
+ $value = $1; # defaulting to english
+ $stringhash{$key} = $value;
+ }
+
+ if (( ${$jlffile}[$i] =~ /^\s*\Q$language\E\s*=\s*\"(.*)\"\s*$/ ) && ( ! $value_defined ))
+ {
+ $value = $1;
+ $stringhash{$key} = $value;
+ $value_defined = 1;
+ }
+ }
+
+ # additional replacement for ${LANGUAGE}, not defined in jlf file
+ my $languagekey = "LANGUAGE";
+ $stringhash{$languagekey} = $language;
+
+ # print_hash(\%stringhash);
+
+ return \%stringhash;
+}
+
+sub main::print_hash
+{
+ my ( $hashref ) = @_;
+
+ print "Hash contains:\n";
+
+ my $key;
+ foreach $key (keys %{$hashref} ) { print "Key: $key, Value: $hashref->{$key}\n"; }
+}
+
+sub main::create_property_file
+{
+ my ($template_file, $stringhash) = @_;
+
+ for ( my $i = 0; $i <= $#{$template_file}; $i++ )
+ {
+ if ( ${$template_file}[$i] =~ /\$\{(\w+)\}/ )
+ {
+ my $key = $1;
+
+ if ( exists($stringhash->{$key}) )
+ {
+ my $value = $stringhash->{$key};
+ ${$template_file}[$i] =~ s/\$\{\Q$key\E\}/$value/g;
+ }
+ else
+ {
+ print "Error: No value found for key: $key\n";
+ exit;
+ }
+ }
+ }
+}
+
+sub main::generate_filename
+{
+ my ($template_file_name, $onelanguage) = @_;
+
+ my $filename = $template_file_name;
+
+ if ( $onelanguage )
+ {
+ $onelanguage =~ s/-/_/; # zh-TW -> zh_TW
+ $onelanguage = "_" . $onelanguage;
+ $filename =~ s/_template\./$onelanguage\./;
+ }
+ else
+ {
+ $filename =~ s/_template//;
+ }
+
+ return $filename;
+}
+
+sub make_propertyfile_language_independent
+{
+ my ($property_file) = @_;
+
+ for ( my $i = 0; $i <= $#{$property_file}; $i++ )
+ {
+# if ( ${$property_file}[$i] =~ /^\s*#/ ) # only comment lines
+# {
+ ${$property_file}[$i] =~ s/_\Q$defaultlanguage\E//;
+# }
+ }
+}
+
+sub main::save_file
+{
+ my ($outputpath, $filename, $filecontent) = @_;
+
+ $filename = $outputpath . $separator . $filename;
+
+ if ( open( OUT, ">$filename" ) )
+ {
+ print OUT @{$filecontent};
+ close( OUT);
+ }
+
+ push(@allnewpropertyfiles, $filename);
+ print "Created file: $filename\n";
+}
diff --git a/javainstaller2/src/Properties/makefile.mk b/javainstaller2/src/Properties/makefile.mk
new file mode 100755
index 000000000000..de842b0b8f0e
--- /dev/null
+++ b/javainstaller2/src/Properties/makefile.mk
@@ -0,0 +1,56 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1 $
+#
+# last change: $Author: is $ $Date: 2006-12-20 14:45:03 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=javainstaller2
+TARGET=create_property_files
+
+INPUT=java_ulffiles
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+ALLTAR: $(MISC)$/setupstrings.properties
+
+$(MISC)$/setupstrings.properties : create_property.pl $(COMMONMISC)$/$(INPUT)$/setupstrings.jlf setupstrings_template.properties setupfiles_template.properties
+ $(PERL) create_property.pl $/ $(COMMONMISC)$/$(INPUT) $(MISC)
diff --git a/javainstaller2/src/Properties/setupfiles_template.properties b/javainstaller2/src/Properties/setupfiles_template.properties
new file mode 100755
index 000000000000..37a3997aa7bf
--- /dev/null
+++ b/javainstaller2/src/Properties/setupfiles_template.properties
@@ -0,0 +1,24 @@
+#
+# setupfiles_${LANGUAGE}.properties
+#
+String_Helpfile_AcceptLicense=AcceptLicense_${LANGUAGE}.html
+String_Helpfile_ChooseComponents=ChooseComponents_${LANGUAGE}.html
+String_Helpfile_ChooseDirectory=ChooseDirectory_${LANGUAGE}.html
+String_Helpfile_ChooseInstallationType=ChooseInstallationType_${LANGUAGE}.html
+String_Helpfile_InstallationImminent=InstallationImminent_${LANGUAGE}.html
+String_Helpfile_InstallationOngoing=InstallationOngoing_${LANGUAGE}.html
+String_Helpfile_Prologue=Prologue_${LANGUAGE}.html
+String_Helpfile_UninstallationPrologue=UninstallationPrologue_${LANGUAGE}.html
+String_Helpfile_ChooseUninstallationType=ChooseUninstallationType_${LANGUAGE}.html
+String_Helpfile_ChooseUninstallationComponents=ChooseUninstallationComponents_${LANGUAGE}.html
+String_Helpfile_UninstallationImminent=UninstallationImminent_${LANGUAGE}.html
+String_Helpfile_UninstallationOngoing=UninstallationOngoing_${LANGUAGE}.html
+String_License_Filename=LICENSE_${LANGUAGE}.html
+Icon_Previous=Icons/Back.gif
+Icon_Next=Icons/Forward.gif
+Icon_Install=Icons/Install.png
+Icon_Installed=Icons/Installed.png
+Icon_DontInstall=Icons/DontInstall.png
+Icon_DontKnow=Icons/DontKnow.png
+Icon_Remove=Icons/Remove.png
+
diff --git a/javainstaller2/src/Properties/setupstrings_template.properties b/javainstaller2/src/Properties/setupstrings_template.properties
new file mode 100755
index 000000000000..287799721f38
--- /dev/null
+++ b/javainstaller2/src/Properties/setupstrings_template.properties
@@ -0,0 +1,110 @@
+#
+# setupstrings_${LANGUAGE}.properties
+#
+
+String_Previous=${STRING_PREVIOUS}
+String_Next=${STRING_NEXT}
+String_Cancel=${STRING_CANCEL}
+String_Decline=${STRING_DECLINE}
+String_Finish=${STRING_FINISH}
+String_Install=${STRING_INSTALL}
+String_Uninstall=${STRING_UNINSTALL}
+String_Help=${STRING_HELP}
+String_OK=${STRING_OK}
+String_Error=${STRING_ERROR}
+String_File_Not_Found=${STRING_FILE_NOT_FOUND}
+String_ApplicationTitle=${STRING_APPLICATIONTITLE}
+String_ApplicationTitleUninstallation=${STRING_APPLICATIONTITLEUNINSTALLATION}
+String_Cancel_Dialog_Title=${STRING_CANCEL_DIALOG_TITLE}
+String_Cancel_Dialog=${STRING_CANCEL_DIALOG}
+String_Cancel_Dialog_Uninstallation=${STRING_CANCEL_DIALOG_UNINSTALLATION}
+String_Stop_Dialog=${STRING_STOP_DIALOG}
+String_Stop_Dialog_Title=${STRING_STOP_DIALOG_TITLE}
+String_Stop_Dialog_Uninstallation=${STRING_STOP_DIALOG_UNINSTALLATION}
+String_Stop_Dialog_Title_Uninstallation=${STRING_STOP_DIALOG_TITLE_UNINSTALLATION}
+String_AcceptLicense=${STRING_ACCEPTLICENSE}
+String_AcceptLicense1=${STRING_ACCEPTLICENSE1}
+String_AcceptLicense2=${STRING_ACCEPTLICENSE2}
+String_AcceptLicense3=${STRING_ACCEPTLICENSE3}
+String_ChooseDirectory1=${STRING_CHOOSEDIRECTORY1}
+String_ChooseDirectory1_Update=${STRING_CHOOSEDIRECTORY1_UPDATE}
+String_ChooseDirectory1_Maintain=${STRING_CHOOSEDIRECTORY1_MAINTAIN}
+String_ChooseDirectory2=${STRING_CHOOSEDIRECTORY2}
+String_ChooseDirectory3=${STRING_CHOOSEDIRECTORY3}
+String_ChooseDirectory4_Question_Title=${STRING_CHOOSEDIRECTORY4_QUESTION_TITLE}
+String_ChooseDirectory5_Question_Message=${STRING_CHOOSEDIRECTORY5_QUESTION_MESSAGE}
+String_ChooseDirectory6=${STRING_CHOOSEDIRECTORY6}
+String_ChooseDirectory_No_Write_Access=${STRING_CHOOSEDIRECTORY_NO_WRITE_ACCESS}
+String_ChooseDirectory_Not_Allowed=${STRING_CHOOSEDIRECTORY_NOT_ALLOWED}
+String_ChooseDirectory_No_Success=${STRING_CHOOSEDIRECTORY_NO_SUCCESS}
+String_ChooseComponents1=${STRING_CHOOSECOMPONENTS1}
+String_ChooseComponents1_Maintain=${STRING_CHOOSECOMPONENTS1_MAINTAIN}
+String_ChooseComponents2=${STRING_CHOOSECOMPONENTS2}
+String_ChooseComponents3=${STRING_CHOOSECOMPONENTS3}
+String_ChooseComponents4=${STRING_CHOOSECOMPONENTS4}
+String_ChooseInstallationType1=${STRING_CHOOSEINSTALLATIONTYPE1}
+String_ChooseInstallationType2=${STRING_CHOOSEINSTALLATIONTYPE2}
+String_ChooseInstallationType3=${STRING_CHOOSEINSTALLATIONTYPE3}
+String_ChooseInstallationType4=${STRING_CHOOSEINSTALLATIONTYPE4}
+String_ChooseInstallationType5=${STRING_CHOOSEINSTALLATIONTYPE5}
+String_ChooseInstallationType6=${STRING_CHOOSEINSTALLATIONTYPE6}
+String_ChooseInstallationType7=${STRING_CHOOSEINSTALLATIONTYPE7}
+String_InstallationImminent1=${STRING_INSTALLATIONIMMINENT1}
+String_InstallationImminent1_Update=${STRING_INSTALLATIONIMMINENT1_UPDATE}
+String_InstallationImminent2=${STRING_INSTALLATIONIMMINENT2}
+String_InstallationOngoing1=${STRING_INSTALLATIONONGOING1}
+String_InstallationOngoing3=${STRING_INSTALLATIONONGOING3}
+String_InstallationOngoing_PackagePath_Not_Found=${STRING_INSTALLATIONONGOING_PACKAGEPATH_NOT_FOUND}
+String_Analyzing_Database1=${STRING_ANALYZING_DATABASE1}
+String_Analyzing_Database2=${STRING_ANALYZING_DATABASE2}
+String_Prologue1=${STRING_PROLOGUE1}
+String_Prologue2=${STRING_PROLOGUE2}
+String_Prologue3=${STRING_PROLOGUE3}
+String_InstallationCompleted1=${STRING_INSTALLATIONCOMPLETED1}
+String_InstallationCompleted1_Abort=${STRING_INSTALLATIONCOMPLETED1_ABORT}
+String_InstallationCompleted1_Error=${STRING_INSTALLATIONCOMPLETED1_ERROR}
+String_InstallationCompleted2=${STRING_INSTALLATIONCOMPLETED2}
+String_InstallationCompleted2_Abort=${STRING_INSTALLATIONCOMPLETED2_ABORT}
+String_InstallationCompleted2_Error=${STRING_INSTALLATIONCOMPLETED2_ERROR}
+String_InstallationCompleted3=${STRING_INSTALLATIONCOMPLETED3}
+String_InstallationCompleted_Button=${STRING_INSTALLATIONCOMPLETED_BUTTON}
+String_UninstallationPrologue2=${STRING_UNINSTALLATIONPROLOGUE2}
+String_UninstallationPrologue_Wrong_Privileges_Current_Root=${STRING_UNINSTALLATION_PROLOGUE_WRONG_PRIVILEGES_CURRENT_ROOT}
+String_UninstallationPrologue_Wrong_Privileges_Current_User=${STRING_UNINSTALLATION_PROLOGUE_WRONG_PRIVILEGES_CURRENT_USER}
+String_ChooseUninstallationType1=${STRING_CHOOSEUNINSTALLATIONTYPE1}
+String_ChooseUninstallationType2=${STRING_CHOOSEUNINSTALLATIONTYPE2}
+String_ChooseUninstallationType3=${STRING_CHOOSEUNINSTALLATIONTYPE3}
+String_ChooseUninstallationType4=${STRING_CHOOSEUNINSTALLATIONTYPE4}
+String_ChooseUninstallationType5=${STRING_CHOOSEUNINSTALLATIONTYPE5}
+String_ChooseUninstallationType6=${STRING_CHOOSEUNINSTALLATIONTYPE6}
+String_ChooseUninstallationComponents2=${STRING_CHOOSEUNINSTALLATIONCOMPONENTS2}
+String_UninstallationImminent1=${STRING_UNINSTALLATIONIMMINENT1}
+String_UninstallationImminent2=${STRING_UNINSTALLATIONIMMINENT2}
+String_UninstallationOngoing1=${STRING_UNINSTALLATIONONGOING1}
+String_UninstallationCompleted1=${STRING_UNINSTALLATIONCOMPLETED1}
+String_UninstallationCompleted1_Abort=${STRING_UNINSTALLATIONCOMPLETED1_ABORT}
+String_UninstallationCompleted1_Error=${STRING_UNINSTALLATIONCOMPLETED1_ERROR}
+String_UninstallationCompleted2=${STRING_UNINSTALLATIONCOMPLETED2}
+String_UninstallationCompleted2_Partial=${STRING_UNINSTALLATIONCOMPLETED2_PARTIAL}
+String_UninstallationCompleted2_Abort=${STRING_UNINSTALLATIONCOMPLETED2_ABORT}
+String_UninstallationCompleted2_Error=${STRING_UNINSTALLATIONCOMPLETED2_ERROR}
+String_InstallerFactory_Os_Not_Supported=${STRING_INSTALLERFACTORY_OS_NOT_SUPPORTED}
+String_Newer_Version_Installed_Found=${STRING_NEWER_VERSION_INSTALLED_FOUND}
+String_Newer_Version_Installed_Remove=${STRING_NEWER_VERSION_INSTALLED_REMOVE}
+String_Newer_Version_Database=${STRING_NEWER_VERSION_DATABASE}
+String_Newer_Version_Tip=${STRING_NEWER_VERSION_TIP}
+String_Root_Privileges_Required_1=${STRING_ROOT_PRIVILEGES_REQUIRED_1}
+String_Root_Privileges_Required_2=${STRING_ROOT_PRIVILEGES_REQUIRED_2}
+String_Discspace_Insufficient=${STRING_DISCSPACE_INSUFFICIENT}
+String_Discspace_Required=${STRING_DISCSPACE_REQUIRED}
+String_Discspace_Available=${STRING_DISCSPACE_AVAILABLE}
+String_Discspace_Tip=${STRING_DISCSPACE_TIP}
+String_Packageformat_Not_Supported=${STRING_PACKAGEFORMAT_NOT_SUPPORTED}
+String_Operating_System=${STRING_OPERATING_SYSTEM}
+String_Packageformat=${STRING_PACKAGEFORMAT}
+String_Nothing_To_Install=${STRING_NOTHING_TO_INSTALL}
+String_No_Components_Selected_1=${STRING_NO_COMPONENTS_SELECTED_1}
+String_No_Components_Selected_2=${STRING_NO_COMPONENTS_SELECTED_2}
+String_Nothing_To_Uninstall=${STRING_NOTHING_TO_UNINSTALL}
+String_No_Uninstallcomponents_Selected_1=${STRING_NO_UNINSTALLCOMPONENTS_SELECTED_1}
+String_No_Uninstallcomponents_Selected_2=${STRING_NO_UNINSTALLCOMPONENTS_SELECTED_2}