summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
authorIngo Schmidt <is@openoffice.org>2009-10-29 10:49:03 +0000
committerIngo Schmidt <is@openoffice.org>2009-10-29 10:49:03 +0000
commitfaf0b92ddb466599ccef0817b352c5e46bd5464c (patch)
tree0c76f845111ae88ab775020575912b9bfbaf2575 /setup_native
parent231a6f00440bba2b0135493215b52dbf07c8054e (diff)
#i106333# using local msidb.exe
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/scripts/admin.pl32
1 files changed, 31 insertions, 1 deletions
diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl
index 3bf63f3091c1..ec8890a51f24 100644
--- a/setup_native/scripts/admin.pl
+++ b/setup_native/scripts/admin.pl
@@ -46,6 +46,7 @@ BEGIN
$savetemppath = "";
$msiinfo_available = 0;
$path_displayed = 0;
+ $localmsidbpath = "";
$plat = $^O;
@@ -150,6 +151,31 @@ sub controlparameter
}
#############################################################################
+# The program msidb.exe can be located next to the Perl program. Then it is
+# not neccessary to find it in the PATH variable.
+#############################################################################
+
+sub check_local_msidb
+{
+ my $msidbname = "msidb.exe";
+ my $perlprogramm = $0;
+ my $path = $perlprogramm;
+ get_path_from_fullqualifiedname(\$path);
+ $path =~ s/\\\s*$//;
+ $path =~ s/\/\s*$//;
+
+ my $msidbpath = "";
+ if ( $path =~ /^\s*$/ ) { $msidbpath = $msidbname; }
+ else { $msidbpath = $path . $separator . $msidbname; }
+
+ if ( -f $msidbpath )
+ {
+ $localmsidbpath = $msidbpath;
+ print "Using $msidbpath (next to \"admin.pl\")\n";
+ }
+}
+
+#############################################################################
# Converting a string list with separator $listseparator
# into an array
#############################################################################
@@ -198,7 +224,8 @@ sub check_system_path
}
my $patharrayref = convert_stringlist_into_array(\$pathvariable, $local_pathseparator);
- my @needed_files_in_path = ("msidb.exe", "expand.exe");
+ my @needed_files_in_path = ("expand.exe");
+ if ( $localmsidbpath eq "" ) { push(@needed_files_in_path, "msidb.exe"); } # not found locally -> search in path
my @optional_files_in_path = ("msiinfo.exe");
print("\nChecking required files:\n");
@@ -486,6 +513,7 @@ sub extract_tables_from_database
my ($fullmsidatabasepath, $workdir, $tablelist) = @_;
my $msidb = "msidb.exe"; # Has to be in the path
+ if ( $localmsidbpath ) { $msidb = $localmsidbpath; }
my $infoline = "";
my $systemcall = "";
my $returnvalue = "";
@@ -552,6 +580,7 @@ sub extract_cabs_from_database
my $infoline = "";
my $fullsuccess = 1;
my $msidb = "msidb.exe"; # Has to be in the path
+ if ( $localmsidbpath ) { $msidb = $localmsidbpath; }
my @all_excluded_cabfiles = ();
@@ -1256,6 +1285,7 @@ $starttime = time();
getparameter();
controlparameter();
+check_local_msidb();
check_system_path();
my $temppath = get_temppath();