From cf32b759738f74788c29f721a5d49f43e4a5ab09 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 5 Feb 2011 18:51:20 +0200 Subject: [PATCH 1/3] Set remotes plugin to disabled to prevent triggering of paranoia from paranoid Windows users. --- resources/windows/OpenLP.reg | Bin 1670 -> 1670 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/resources/windows/OpenLP.reg b/resources/windows/OpenLP.reg index 503e718a201e3cfc34aad41d9a43f173fa11776d..0ceee96684508fdc7352996fb24e981b8803c2aa 100644 GIT binary patch delta 17 YcmZqUZR6eG!pdkc`95pv delta 23 fcmZqUZR6eG!aBKujcu|4Q^aH&Hjc@wSnmJ;RG0@> From 5f7d570b6533ae5f247f326a0c63a239652c43b2 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 5 Feb 2011 18:52:03 +0200 Subject: [PATCH 2/3] Add some code to the installer to uninstall the previous install of OpenLP. --- resources/windows/OpenLP-2.0.iss | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/resources/windows/OpenLP-2.0.iss b/resources/windows/OpenLP-2.0.iss index 94ee4fc22..fbb36009a 100644 --- a/resources/windows/OpenLP-2.0.iss +++ b/resources/windows/OpenLP-2.0.iss @@ -86,3 +86,56 @@ Root: HKCU; SubKey: Software\OpenLP\OpenLP\presentations; ValueType: dword; Valu Root: HKCU; SubKey: Software\OpenLP\OpenLP\remotes; ValueType: dword; ValueName: status; ValueData: $00000001 Root: HKCU; SubKey: Software\OpenLP\OpenLP\songs; ValueType: dword; ValueName: status; ValueData: $00000001 Root: HKCU; SubKey: Software\OpenLP\OpenLP\songusage; ValueType: dword; ValueName: status; ValueData: $00000001 + + +[Code] +function GetUninstallString(): String; +var + sUnInstPath: String; + sUnInstallString: String; +begin + sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1'); + sUnInstallString := ''; + if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then + RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString); + Result := sUnInstallString; +end; + +function IsUpgrade(): Boolean; +begin + Result := (GetUninstallString() <> ''); +end; + +// Return Values: +// 1 - uninstall string is empty +// 2 - error executing the UnInstallString +// 3 - successfully executed the UnInstallString +function UnInstallOldVersion(): Integer; +var + sUnInstallString: String; + iResultCode: Integer; +begin + Result := 0; + sUnInstallString := GetUninstallString(); + if sUnInstallString <> '' then + begin + sUnInstallString := RemoveQuotes(sUnInstallString); + if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then + Result := 3 + else + Result := 2; + end + else + Result := 1; +end; + +procedure CurStepChanged(CurStep: TSetupStep); +begin + if (CurStep=ssInstall) then + begin + if (IsUpgrade()) then + begin + UnInstallOldVersion(); + end; + end; +end; From aaa7a549e2933cedc41f9c871355c3d9ea0b1b3f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 5 Feb 2011 21:04:56 +0200 Subject: [PATCH 3/3] Fixed up registry entries in setup script. --- resources/windows/OpenLP-2.0.iss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/windows/OpenLP-2.0.iss b/resources/windows/OpenLP-2.0.iss index fbb36009a..a85b41187 100644 --- a/resources/windows/OpenLP-2.0.iss +++ b/resources/windows/OpenLP-2.0.iss @@ -83,11 +83,10 @@ Root: HKCU; SubKey: Software\OpenLP\OpenLP\custom; ValueType: dword; ValueName: Root: HKCU; SubKey: Software\OpenLP\OpenLP\images; ValueType: dword; ValueName: status; ValueData: $00000001 Root: HKCU; SubKey: Software\OpenLP\OpenLP\media; ValueType: dword; ValueName: status; ValueData: $00000001 Root: HKCU; SubKey: Software\OpenLP\OpenLP\presentations; ValueType: dword; ValueName: status; ValueData: $00000001 -Root: HKCU; SubKey: Software\OpenLP\OpenLP\remotes; ValueType: dword; ValueName: status; ValueData: $00000001 +Root: HKCU; SubKey: Software\OpenLP\OpenLP\remotes; ValueType: dword; ValueName: status; ValueData: $00000000 Root: HKCU; SubKey: Software\OpenLP\OpenLP\songs; ValueType: dword; ValueName: status; ValueData: $00000001 Root: HKCU; SubKey: Software\OpenLP\OpenLP\songusage; ValueType: dword; ValueName: status; ValueData: $00000001 - [Code] function GetUninstallString(): String; var