You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2021/11/16 18:43:07 UTC

[openoffice] branch AOO42X updated: Fix for the Windows (MSI) installer.

This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO42X by this push:
     new 82a16ed  Fix for the Windows (MSI) installer.
82a16ed is described below

commit 82a16ed696b76dd00bd1fc6751ef6ccdc1a31287
Author: mseidel <ms...@apache.org>
AuthorDate: Tue Nov 16 19:24:00 2021 +0100

    Fix for the Windows (MSI) installer.
    
    The problem was that after 4.1.10 the productversion inside the msi was
    "higher" than the one from AOO42X.
    
    So for AOO 4.1.11 it is 4.111.9808. For AOO 4.2.0 it was 4.20.9823 (111 > 20).
    
    This patch corrects the version number to 4.200.9823 (111 < 200).
    
    Credits go to Arrigo for this patch!
    
    (cherry picked from commit c1467797f39776453dad050af6d4bc996c2269b2)
---
 main/solenv/bin/modules/installer/windows/msiglobal.pm | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/main/solenv/bin/modules/installer/windows/msiglobal.pm b/main/solenv/bin/modules/installer/windows/msiglobal.pm
index cc4782e..e2ce927 100644
--- a/main/solenv/bin/modules/installer/windows/msiglobal.pm
+++ b/main/solenv/bin/modules/installer/windows/msiglobal.pm
@@ -1677,27 +1677,35 @@ sub set_msiproductversion
 	my ( $allvariables ) = @_;
 
 	my $productversion = $allvariables->{'PRODUCTVERSION'};
+	my $productmajor;
+	my $productminor; # It must be 3 digits long
 
 	if (( $productversion =~ /^\s*\d+\s*$/ ) && ( $productversion > 255 )) { $productversion = $productversion%256; }
 
 	if ( $productversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
 	{
-		$productversion = $1 . "\." . $2 . $3 . "\." . $installer::globals::buildid;		
+		my $productmicro = $3;
+		$productmajor = $1;
+		$productminor = $2;
+		$productmicro = "0" . $productmicro while ( length ( $productminor . $productmicro ) < 3 );
+		$productminor .= $productmicro;
 	}
 	elsif  ( $productversion =~ /^\s*(\d+)\.(\d+)\s*$/ )
 	{
-		$productversion = $1 . "\." . $2 . "\." . $installer::globals::buildid;	
+		$productmajor = $1;
+		$productminor = $2;
 	}
 	else
 	{
-		my $productminor = "00";
 		if (( $allvariables->{'PACKAGEVERSION'} ) && ( $allvariables->{'PACKAGEVERSION'} ne "" ))
 		{
 			if ( $allvariables->{'PACKAGEVERSION'} =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ ) { $productminor = $2; }
 		}
 				
-		$productversion = $productversion . "\." . $productminor . "\." . $installer::globals::buildid;	
+		$productmajor = $productversion;
 	}
+	$productminor .= "0" while ( length( $productminor ) < 3);
+	$productversion = $productmajor . "\." . $productminor . "\." . $installer::globals::buildid;
 	
 	$installer::globals::msiproductversion = $productversion;