summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorSander Vesik <svesik@openoffice.org>2004-04-20 11:32:05 +0000
committerSander Vesik <svesik@openoffice.org>2004-04-20 11:32:05 +0000
commit046eec7b44d4f8623f1f239c8e743365a5a26dcd (patch)
tree554bb6d84d21f6f846b8c335eda13f7d9369e72d /solenv
parent450a0d8c9f5874f27923d657db4423f597796062 (diff)
INTEGRATION: CWS newscpzip2 (1.1.2); FILE ADDED
2004/03/31 12:33:02 is 1.1.2.1: #i25325# new native packaging process
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/modules/installer/windows/createfolder.pm149
-rw-r--r--solenv/bin/modules/installer/windows/directory.pm241
-rw-r--r--solenv/bin/modules/installer/windows/feature.pm266
3 files changed, 656 insertions, 0 deletions
diff --git a/solenv/bin/modules/installer/windows/createfolder.pm b/solenv/bin/modules/installer/windows/createfolder.pm
new file mode 100644
index 000000000000..897eb47de45e
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/createfolder.pm
@@ -0,0 +1,149 @@
+#*************************************************************************
+#
+# $RCSfile: createfolder.pm,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: svesik $ $Date: 2004-04-20 12:31:37 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 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
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+package installer::windows::createfolder;
+
+use installer::existence;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning directory for createfolder table.
+##############################################################
+
+sub get_createfolder_directory
+{
+ my ($onedir) = @_;
+
+ my $uniquename = $onedir->{'uniquename'};
+
+ return $uniquename;
+}
+
+##############################################################
+# Returning component for createfolder table.
+##############################################################
+
+sub get_createfolder_component
+{
+ my ($onedir, $filesref) = @_;
+
+ # Directories do not belong to a module.
+ # Therefore they can only belong to the root module and
+ # will be added to a component at the root module.
+ # All directories will be added to the component
+ # containing the file "gid_File_Lib_Vcl"
+
+ my $vclgid = "gid_File_Lib_Vcl";
+ my $onefile = installer::existence::get_specified_file($filesref, $vclgid);
+
+ return $onefile->{'componentname'};
+}
+
+####################################################################################
+# Creating the file CreateFo.idt dynamically for creation of empty directories
+# Content:
+# Directory_ Component_
+####################################################################################
+
+sub create_createfolder_table
+{
+ my ($dirref, $filesref, $basedir) = @_;
+
+ my @createfoldertable = ();
+
+ my $infoline;
+
+ installer::windows::idtglobal::write_idt_header(\@createfoldertable, "createfolder");
+
+ for ( my $i = 0; $i <= $#{$dirref}; $i++ )
+ {
+ my $onedir = ${$dirref}[$i];
+
+ my $styles = "";
+
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if ( $styles =~ /\bCREATE\b/ )
+ {
+ my %directory = ();
+
+ $directory{'Directory_'} = get_createfolder_directory($onedir);
+ $directory{'Component_'} = get_createfolder_component($onedir, $filesref);
+
+ my $oneline = $directory{'Directory_'} . "\t" . $directory{'Component_'} . "\n";
+
+ push(@createfoldertable, $oneline);
+ }
+ }
+
+ # Saving the file
+
+ my $createfoldertablename = $basedir . $installer::globals::separator . "CreateFo.idt";
+ installer::files::save_file($createfoldertablename ,\@createfoldertable);
+ $infoline = "Created idt file: $createfoldertablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
new file mode 100644
index 000000000000..0057de479456
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -0,0 +1,241 @@
+#*************************************************************************
+#
+# $RCSfile: directory.pm,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: svesik $ $Date: 2004-04-20 12:31:51 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 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
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+package installer::windows::directory;
+
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::windows::idtglobal;
+
+##############################################################
+# Adding unique directory names to the directory collection
+##############################################################
+
+sub create_unique_directorynames
+{
+ my ($directoryref) = @_;
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $uniquename = $onedir->{'HostName'};
+ # get_path_from_fullqualifiedname(\$uniqueparentname);
+ # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs
+
+ $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
+
+ my $uniqueparentname = $uniquename;
+
+ if ( $uniqueparentname =~ /^\s*(.*)\_(.*?)\s*$/ ) # the underline is now the separator
+ {
+ $uniqueparentname = $1;
+ }
+ else
+ {
+ $uniqueparentname = $installer::globals::officefolder; # parent for program, share, user, ...
+ }
+
+ $uniquename =~ s/\-/\_/g; # making "-" to "_"
+ $uniqueparentname =~ s/\-/\_/g; # making "-" to "_"
+
+ $onedir->{'uniquename'} = $uniquename;
+ $onedir->{'uniqueparentname'} = $uniqueparentname;
+ }
+}
+
+#####################################################
+# Creating the defaultdir for the file Director.idt
+#####################################################
+
+sub create_defaultdir_directorynames
+{
+ my ($directoryref) = @_;
+
+ my @shortnames = ();
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $hostname = $onedir->{'HostName'};
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$hostname); # making program/classes to classes
+ my $shortstring = installer::windows::idtglobal::make_eight_three_conform($hostname, "dir", \@shortnames);
+
+ my $defaultdir;
+
+ if ( $shortstring eq $hostname )
+ {
+ $defaultdir = $hostname;
+ }
+ else
+ {
+ $defaultdir = $shortstring . "|" . $hostname;
+ }
+
+ $onedir->{'defaultdir'} = $defaultdir;
+ }
+}
+
+###############################################
+# Fill content into the directory table
+###############################################
+
+sub create_directorytable_from_collection
+{
+ my ($directorytableref, $directoryref) = @_;
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $hostname = $onedir->{'HostName'};
+ my $dir = "";
+
+ if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
+
+ if (( $dir eq "PREDEFINED_PROGDIR" ) && ( $hostname eq "" )) { next; } # removing files from root directory
+
+ my $oneline = $onedir->{'uniquename'} . "\t" . $onedir->{'uniqueparentname'} . "\t" . $onedir->{'defaultdir'} . "\n";
+
+ push(@{$directorytableref}, $oneline);
+ }
+}
+
+###############################################
+# Defining the root installation structure
+###############################################
+
+sub add_root_directories
+{
+ my ($directorytableref, $allvariableshashref) = @_;
+
+ my $oneline = "TARGETDIR\t\tSourceDir\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::programfilesfolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ my $manufacturer = $installer::globals::manufacturer;
+ my $shortmanufacturer = installer::windows::idtglobal::make_eight_three_conform($manufacturer, "dir"); # third parameter not used
+ $shortmanufacturer =~ s/\s/\_/g; # changing empty space to underline
+
+ $oneline = "INSTALLLOCATION\t$installer::globals::programfilesfolder\t$shortmanufacturer|$manufacturer\n";
+ push(@{$directorytableref}, $oneline);
+
+ my $productname = $allvariableshashref->{'PRODUCTNAME'};
+ my $productversion = $allvariableshashref->{'PRODUCTVERSION'};
+ my $productkey = $productname . " " . $productversion;
+ my $shortproductkey = installer::windows::idtglobal::make_eight_three_conform($productkey, "dir"); # third parameter not used
+ $shortproductkey =~ s/\s/\_/g; # changing empty space to underline
+
+ $oneline = "$installer::globals::officefolder\tINSTALLLOCATION\t$shortproductkey|$productkey\n";
+ push(@{$directorytableref}, $oneline);
+
+ if (!($installer::globals::product =~ /ada/i )) # the following directories not for ada products, FAKE?
+ {
+ $oneline = "$installer::globals::programmenufolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::officemenufolder\t$installer::globals::programmenufolder\t$shortproductkey|$productkey\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::fontsfolder\tINSTALLLOCATION\t$installer::globals::fontsfoldername\n";
+ push(@{$directorytableref}, $oneline);
+ }
+}
+
+###############################################
+# Creating the file Director.idt dynamically
+###############################################
+
+sub create_directory_table
+{
+ my ($directoryref, $basedir, $allvariableshashref) = @_;
+
+ # Structure of the directory table:
+ # Directory Directory_Parent DefaultDir
+ # Directory is a unique identifier
+ # Directory_Parent is the unique identifier of the parent
+ # DefaultDir is .:APPLIC~1|Application Data with
+ # Before ":" : [sourcedir]:[destdir] (not programmed yet)
+ # After ":" : 8+3 and not 8+3 the destination directory name
+
+ my @directorytable = ();
+ my $infoline;
+
+ create_unique_directorynames($directoryref);
+ create_defaultdir_directorynames($directoryref); # only destdir!
+ installer::windows::idtglobal::write_idt_header(\@directorytable, "directory");
+ add_root_directories(\@directorytable, $allvariableshashref);
+ create_directorytable_from_collection(\@directorytable, $directoryref);
+
+ # Saving the file
+
+ my $directorytablename = $basedir . $installer::globals::separator . "Director.idt";
+ installer::files::save_file($directorytablename ,\@directorytable);
+ $infoline = "Created idt file: $directorytablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/feature.pm b/solenv/bin/modules/installer/windows/feature.pm
new file mode 100644
index 000000000000..62d3abca67f4
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/feature.pm
@@ -0,0 +1,266 @@
+#*************************************************************************
+#
+# $RCSfile: feature.pm,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: svesik $ $Date: 2004-04-20 12:32:05 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 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
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+package installer::windows::feature;
+
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning the gid for a feature.
+# Attention: Maximum length
+##############################################################
+
+sub get_feature_gid
+{
+ my ($onefeature) = @_;
+
+ my $gid = "";
+
+ if ( $onefeature->{'gid'} ) { $gid = $onefeature->{'gid'}; }
+
+ # Attention: Maximum feature length is 38!
+ installer::windows::idtglobal::shorten_feature_gid(\$gid);
+
+ return $gid
+}
+
+##############################################################
+# Returning the gid of the parent.
+# Attention: Maximum length
+##############################################################
+
+sub get_feature_parent
+{
+ my ($onefeature) = @_;
+
+ my $parentgid = "";
+
+ if ( $onefeature->{'ParentID'} ) { $parentgid = $onefeature->{'ParentID'}; }
+
+ # The modules, hanging directly below the root, have to be root modules.
+ # Only then it is possible to make the "real" root module invisible by
+ # setting the display to "0".
+
+ if ( $parentgid eq "gid_Module_Root" ) { $parentgid = ""; }
+
+ # Attention: Maximum feature length is 38!
+ installer::windows::idtglobal::shorten_feature_gid(\$parentgid);
+
+ return $parentgid
+}
+
+##############################################################
+# Returning the display for a feature.
+# 0: Feature is not shown
+# odd: subfeatures are shown
+# even: subfeatures are not shown
+##############################################################
+
+sub get_feature_display
+{
+ my ($onefeature) = @_;
+
+ my $display;
+ my $parentid = "";
+
+ if ( $onefeature->{'ParentID'} ) { $parentid = $onefeature->{'ParentID'}; }
+
+ if ( $parentid eq "" )
+ {
+ $display = "0"; # root module is not visible
+ }
+ elsif ( $onefeature->{'gid'} eq "gid_Module_Prg") # program module shows subfeatures
+ {
+ $display = "1"; # root module shows subfeatures
+ }
+ else
+ {
+ $display = "2"; # all other modules do not show subfeatures
+ }
+
+ return $display
+}
+
+##############################################################
+# Returning the level for a feature.
+##############################################################
+
+sub get_feature_level
+{
+ my ($onefeature) = @_;
+
+ my $level = "20"; # the default
+
+ my $localdefault = "";
+
+ if ( $onefeature->{'Default'} ) { $localdefault = $onefeature->{'Default'}; }
+
+ if ( $localdefault eq "NO" ) # explicitely set Default = "NO"
+ {
+ $level = "200"; # deselected in default installation, base is 100
+ }
+
+ return $level
+}
+
+##############################################################
+# Returning the directory for a feature.
+##############################################################
+
+sub get_feature_directory
+{
+ my ($onefeature) = @_;
+
+ my $directory;
+
+ my $parentid = "";
+
+ if ( $onefeature->{'ParentID'} ) { $parentid = $onefeature->{'ParentID'}; }
+
+ if (( $parentid eq "" ) || ( $parentid eq "gid_Module_Root" )) # This is the root module and the modules directly below the root
+ {
+ $directory = "INSTALLLOCATION";
+ }
+ else
+ {
+ $directory = "";
+ }
+
+ return $directory
+}
+
+##############################################################
+# Returning the directory for a feature.
+##############################################################
+
+sub get_feature_attributes
+{
+ my ($onefeature) = @_;
+
+ my $attributes;
+
+ $attributes = "8"; # no advertising of features.
+
+ return $attributes
+}
+
+#################################################################################
+# Creating the file Feature.idt dynamically
+# Content:
+# Feature Feature_Parent Title Description Display Level Directory_ Attributes
+#################################################################################
+
+sub create_feature_table
+{
+ my ($modulesref, $basedir, $languagesarrayref) = @_;
+
+ for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$m];
+
+ my $infoline;
+
+ my @featuretable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@featuretable, "feature");
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+
+ # Controlling the language!
+ # Only language independent folderitems or folderitems with the correct language
+ # will be included into the table
+
+ if (! (!(( $onefeature->{'ismultilingual'} )) || ( $onefeature->{'specificlanguage'} eq $onelanguage )) ) { next; }
+
+ my %feature = ();
+
+ $feature{'feature'} = get_feature_gid($onefeature);
+ $feature{'feature_parent'} = get_feature_parent($onefeature);
+ # if ( $onefeature->{'ParentID'} eq "" ) { $feature{'feature_parent'} = ""; } # Root has no parent
+ $feature{'Title'} = $onefeature->{'Name'};
+ $feature{'Description'} = $onefeature->{'Description'};
+ $feature{'Display'} = get_feature_display($onefeature);
+ $feature{'Level'} = get_feature_level($onefeature);
+ $feature{'Directory_'} = get_feature_directory($onefeature);
+ $feature{'Attributes'} = get_feature_attributes($onefeature);
+
+ my $oneline = $feature{'feature'} . "\t" . $feature{'feature_parent'} . "\t" . $feature{'Title'} . "\t"
+ . $feature{'Description'} . "\t" . $feature{'Display'} . "\t" . $feature{'Level'} . "\t"
+ . $feature{'Directory_'} . "\t" . $feature{'Attributes'} . "\n";
+
+ push(@featuretable, $oneline);
+ }
+
+ # Saving the file
+
+ my $featuretablename = $basedir . $installer::globals::separator . "Feature.idt" . "." . $onelanguage;
+ installer::files::save_file($featuretablename ,\@featuretable);
+ $infoline = "Created idt file: $featuretablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+1; \ No newline at end of file