From: Antoine ELIAS Date: Fri, 1 Mar 2013 14:56:18 +0000 (+0100) Subject: Fix bug 11639 : unistall removed ALL scilab registry information. X-Git-Tag: 5.4.1~310 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=776eeeee99d00b399183c127a8e48198f256975f Fix bug 11639 : unistall removed ALL scilab registry information. set LASTINSTALL key to most recent version already installed. Change-Id: Ie3c2083cd712e8fd9f9a78de49e42135f212f504 --- diff --git a/scilab/CHANGES_5.4.X b/scilab/CHANGES_5.4.X index 9b557e4..0abcca0 100644 --- a/scilab/CHANGES_5.4.X +++ b/scilab/CHANGES_5.4.X @@ -288,6 +288,8 @@ Bug fixes * Bug #11569 fixed - F5 to navigate in the dock was incompatible with SciNotes. So replace F5 by shift+F6 to go to the previous tab. +* Bug #11639 fixed - Uninstall removed all scilab registry information. + * Bug #11711 fixed - xclick and xgetmouse did not work under Mac OS X. * Bug #11778 fixed - Bad color_map dims did not return an error. diff --git a/scilab/tools/innosetup/code.iss b/scilab/tools/innosetup/code.iss index 9203a10..fc25f25 100644 --- a/scilab/tools/innosetup/code.iss +++ b/scilab/tools/innosetup/code.iss @@ -84,25 +84,18 @@ function DoTasksJustAfterInstall: Boolean; end; //------------------------------------------------------------------------------ function GetJREVersion(): String; - begin +begin Result := ''; - if Is64BitInstallMode() then - begin - RegQueryStringValue( HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', Result ); - end; -// 2 cas : - if IsWin64() then + if Is64BitInstallMode() or not IsWin64() then begin - // Scilab 32 bits sur Windows 64 bits - RegQueryStringValue( HKLM, 'SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment', 'CurrentVersion', Result ); + //64 bits installation or 32 bits OS -> same registry path + RegQueryStringValue( HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', Result ); + end else begin + // Scilab 32 bits sur Windows 64 bits + RegQueryStringValue( HKLM, 'SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment', 'CurrentVersion', Result ); end - else - begin - // Scilab 32 bits sur Windows 32 bits - RegQueryStringValue( HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', Result ); - end; - end; +end; //------------------------------------------------------------------------------ function CheckJREVersion(): Boolean; var @@ -271,6 +264,26 @@ function NextButtonClick(CurPageID: Integer): Boolean; end; end; //------------------------------------------------------------------------------ +procedure DeinitializeUninstall; +var + Names: TArrayOfString; + iLen: Integer; +begin + //read registry to find others scilab installation in the same arch + if RegGetSubkeyNames(HKLM, 'Software\Scilab', Names) then + begin + iLen := length(Names); + if iLen > 0 then + begin + RegWriteStringValue(HKLM, 'Software\Scilab', 'LASTINSTALL', Names[iLen - 1]); + end else begin + //no other install in the same arch + //remove LASTINSTALL key and Scilab registry folder ( auto ) + RegDeleteValue(HKLM, 'Software\Scilab', 'LASTINSTALL'); + end; + end; +end; +//------------------------------------------------------------------------------ function InitializeSetup: Boolean; Var Version: TWindowsVersion; diff --git a/scilab/tools/innosetup/registry.iss b/scilab/tools/innosetup/registry.iss index 81a32eb..501c17c 100644 --- a/scilab/tools/innosetup/registry.iss +++ b/scilab/tools/innosetup/registry.iss @@ -22,7 +22,7 @@ ;http://msdn2.microsoft.com/en-us/library/bb776820.aspx ;------------------------------------------------------------------------------- ;Scilab PATH -Root: HKLM; Subkey: "SOFTWARE\Scilab"; ValueType: string; ValueData: {#ScilabName}; Flags: uninsdeletekey noerror; ValueName: LASTINSTALL +Root: HKLM; Subkey: "SOFTWARE\Scilab"; ValueType: string; ValueData: {#ScilabName}; Flags: noerror; ValueName: LASTINSTALL ;------------------------------------------------------------------------------- Root: HKLM; Subkey: "SOFTWARE\Scilab\{#ScilabName}"; ValueType: string; ValueData: {app}; Flags: createvalueifdoesntexist uninsdeletekey noerror; ValueName: SCIPATH Root: HKLM; Subkey: "SOFTWARE\Scilab\{#ScilabName}"; ValueType: string; ValueData: {cm:LANGUAGE}; Flags: createvalueifdoesntexist uninsdeletekey noerror; ValueName: LANGUAGE