summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-04-27 21:45:48 +0200
committerAndras Timar <atimar@suse.com>2012-04-27 22:01:31 +0200
commit5525fb3ab80d0899de8eabe11498e3ee75ca0ceb (patch)
tree2478da1fc81c5025076d785afd34d2922c35c263
parent778d80bc2c37e4549daff2cc1f74f8665235407b (diff)
fdo#48087 get real version numbers from executables for the File table of MSI
This is only a partial fix to the bug, the second part will be the creation and population of MsiFileHash table.
-rw-r--r--instsetoo_native/util/openoffice.lst8
-rw-r--r--solenv/bin/modules/installer/windows/file.pm32
2 files changed, 11 insertions, 29 deletions
diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index 7c41ebff37e9..770154a1fd69 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -17,8 +17,6 @@ Globals
BASISPACKAGEPREFIX libobasis
UREPACKAGEPREFIX libreoffice
SOLSUREPACKAGEPREFIX libreoffice
- USE_FILEVERSION 1
- LIBRARYVERSION 9.4.0
REGISTRATION_HOST https://registration.libreoffice.org/RegistrationWeb
REGISTRATIONURL http://survey.libreoffice.org/user/index.php
PROGRESSBARCOLOR 126,170,23
@@ -76,8 +74,6 @@ LibreOffice
BETAUPGRADECODE
STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A}
CHANGETARGETDIR 1
- USE_FILEVERSION 1
- LIBRARYVERSION 9.4.0
PATCHCODEFILE ooo_patchcodes.txt
STARTCENTER_ADDFEATURE_URL http://extensions.libreoffice.org/
STARTCENTER_INFO_URL http://www.libreoffice.org/
@@ -136,8 +132,6 @@ LibreOffice_Dev
BETAUPGRADECODE
STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A}
CHANGETARGETDIR 1
- USE_FILEVERSION 1
- LIBRARYVERSION 9.4.0
PATCHCODEFILE ooodev_patchcodes.txt
CODEFILENAME codes_ooodev.txt
LOCALUSERDIR $ORIGIN/..
@@ -404,8 +398,6 @@ OxygenOffice
BETAUPGRADECODE
STUBUPGRADECODE {0E7B27B8-D658-4BF9-98D6-EC361582EB4A}
CHANGETARGETDIR 1
- USE_FILEVERSION 1
- LIBRARYVERSION 9.4.0
PATCHCODEFILE ooo_patchcodes.txt
PROGRESSBARCOLOR 126,170,23
PROGRESSSIZE 430,5
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
index 0519b06757c9..910887669c37 100644
--- a/solenv/bin/modules/installer/windows/file.pm
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -553,32 +553,22 @@ sub get_fileversion
my $fileversion = "";
- if ( $allvariables->{'USE_FILEVERSION'} )
+ if ( $onefile->{'Name'} =~ /\.bin$|\.com$|\.dll$|\.exe$|\.pyd$/ )
{
- if ( ! $allvariables->{'LIBRARYVERSION'} ) { installer::exiter::exit_program("ERROR: USE_FILEVERSION is set, but not LIBRARYVERSION", "get_fileversion"); }
- my $libraryversion = $allvariables->{'LIBRARYVERSION'};
- if ( $libraryversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
+ open (EXE, "<$onefile->{'sourcepath'}");
+ binmode EXE;
+ {local $/ = undef; $exedata = <EXE>;}
+ close EXE;
+
+ my $binaryfileversion = "(V\x00S\x00_\x00V\x00E\x00R\x00S\x00I\x00O\x00N\x00_\x00I\x00N\x00F\x00O\x00\x00\x00\x00\x00\xbd\x04\xef\xfe\x00\x00\x01\x00)(........)";
+
+ if ($exedata =~ /$binaryfileversion/ms)
{
- my $major = $1;
- my $minor = $2;
- my $micro = $3;
- my $concat = 100 * $minor + $micro;
- $libraryversion = $major . "\." . $concat;
+ my ($header, $subversion, $version, $vervariant, $microversion) = ($1,unpack( "vvvv", $2));
+ $fileversion = $version . "." . $subversion . "." . $microversion . "." . $vervariant;
}
- my $vendornumber = 0;
- if ( $allvariables->{'VENDORPATCHVERSION'} ) { $vendornumber = $allvariables->{'VENDORPATCHVERSION'}; }
- $fileversion = $libraryversion . "\." . $installer::globals::buildid . "\." . $vendornumber;
- if ( $onefile->{'FileVersion'} ) { $fileversion = $onefile->{'FileVersion'}; } # overriding FileVersion in scp
-
- # if ( $styles =~ /\bFONT\b/ )
- # {
- # my $newfileversion = installer::windows::font::get_font_version($onefile->{'sourcepath'});
- # if ( $newfileversion != 0 ) { $fileversion = $newfileversion; }
- # }
}
- if ( $installer::globals::prepare_winpatch ) { $fileversion = ""; } # Windows patches do not allow this version # -> who says so?
-
return $fileversion;
}