Skip to content

Commit 45fcb9c

Browse files
committed
Add warning about running on Platform 7
1 parent f142219 commit 45fcb9c

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

Setup/Conform6.iss

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ Name: "..\BuildConform.cmd"; Flags: CmdPrompt
9898

9999
[Code]
100100
const
101-
REQUIRED_PLATFORM_VERSION = 6.5; // Set this to the minimum required ASCOM Platform version for this application
101+
MINIMUM_PLATFORM_VERSION = 6.5; // Set this to the minimum required ASCOM Platform version for this application
102+
MAXIMUM_PLATFORM_VERSION = 6.6; // This must be a number that is larger than the highest release version of Platform 6
102103
103104
//
104105
// Function to return the ASCOM Platform's version number as a double.
@@ -125,16 +126,20 @@ end;
125126
function InitializeSetup(): Boolean;
126127
var
127128
PlatformVersionNumber : double;
128-
begin
129+
begin
129130
Result := FALSE; // Assume failure
130131
PlatformVersionNumber := PlatformVersion(); // Get the installed Platform version as a double
131-
If PlatformVersionNumber >= REQUIRED_PLATFORM_VERSION then // Check whether we have the minimum required Platform or newer
132+
If (PlatformVersionNumber >= MINIMUM_PLATFORM_VERSION) and (PlatformVersionNumber <= MAXIMUM_PLATFORM_VERSION) then // Check whether we have the minimum required Platform or newer and the maximum or older Platform
132133
Result := TRUE
133134
else
134-
if PlatformVersionNumber = 0.0 then
135-
MsgBox('No ASCOM Platform is installed. Please install Platform ' + Format('%3.1f', [REQUIRED_PLATFORM_VERSION]) + ' or later from http://www.ascom-standards.org', mbCriticalError, MB_OK)
136-
else
137-
MsgBox('This version of Conform requires ASCOM Platform ' + Format('%3.1f', [REQUIRED_PLATFORM_VERSION]) + ' or later, but Platform '+ Format('%3.1f', [PlatformVersionNumber]) + ' is installed.' #13#13 'Please install the latest Platform before continuing; you will find it at https://www.ascom-standards.org', mbCriticalError, MB_OK);
135+
If PlatformVersionNumber = 0.0 then
136+
MsgBox('No ASCOM Platform is installed. Please install Platform ' + Format('%3.1f', [MINIMUM_PLATFORM_VERSION]) + ' or later from http://www.ascom-standards.org', mbCriticalError, MB_OK)
137+
else begin
138+
If PlatformVersionNumber < MINIMUM_PLATFORM_VERSION then
139+
MsgBox('This version of Conform requires ASCOM Platform ' + Format('%3.1f', [MINIMUM_PLATFORM_VERSION]) + ' or ' + Format('%3.1f', [MAXIMUM_PLATFORM_VERSION]) + ', but Platform '+ Format('%3.1f', [PlatformVersionNumber]) + ' is installed.' #13#13 'Please install Platform 6.5 or 6.6 to use this Conform version (Please note that this version will not work on Platform 7).', mbCriticalError, MB_OK)
140+
else
141+
MsgBox('This version of Conform only runs on ASCOM Platform ' + Format('%3.1f', [MINIMUM_PLATFORM_VERSION]) + ' and ' + Format('%3.1f', [MAXIMUM_PLATFORM_VERSION]) + ', but Platform '+ Format('%3.1f', [PlatformVersionNumber]) + ' is installed.' #13#13 'For Platform 7, please use a later version of Conform or preferably Conform Universal, which has greater functionality.', mbCriticalError, MB_OK);
142+
end;
138143
end;
139144
140145
// Code to enable the installer to uninstall previous versions of itself when a new version is installed

0 commit comments

Comments
 (0)