-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATCS.iss
executable file
·119 lines (107 loc) · 4.45 KB
/
ATCS.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Astrometric Instruments ATCS X2 Driver"
#define MyAppVersion "1.6"
#define MyAppPublisher "RTI-Zone"
#define MyAppURL "https://rti-zone.org"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{75D76F1E-19D9-4825-95EB-28830C840A84}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:TSXInstallDir}\Resources\Common
DefaultGroupName={#MyAppName}
; Need to customise these
; First is where you want the installer to end up
OutputDir=installer
; Next is the name of the installer
OutputBaseFilename=ATCS_X2_Installer
; Final one is the icon you would like on the installer. Comment out if not needed.
SetupIconFile=rti_zone_logo.ico
Compression=lzma
SolidCompression=yes
; We don't want users to be able to select the drectory since read by TSXInstallDir below
DisableDirPage=yes
; Uncomment this if you don't want an uninstaller.
;Uninstallable=no
CloseApplications=yes
DirExistsWarning=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Dirs]
Name: "{app}\Plugins\MountPlugIns";
Name: "{app}\Plugins64\MountPlugIns";
[Files]
Source: "mountlist ATCS.txt"; DestDir: "{app}\Miscellaneous Files"; Flags: ignoreversion
Source: "mountlist ATCS.txt"; DestDir: "{app}\Miscellaneous Files"; Flags: ignoreversion; DestName: "mountlist64 ATCS.txt"
; 32 bits
Source: "libATCS\Win32\Release\libATCS.dll"; DestDir: "{app}\Plugins\MountPlugIns"; Flags: ignoreversion
Source: "ATCS.ui"; DestDir: "{app}\Plugins\MountPlugIns"; Flags: ignoreversion
Source: "Astrometric.png"; DestDir: "{app}\Plugins\MountPlugIns"; Flags: ignoreversion
; 64 bits
Source: "libATCS\x64\Release\libATCS.dll"; DestDir: "{app}\Plugins64\MountPlugIns"; Flags: ignoreversion; Check: DirExists(ExpandConstant('{app}\Plugins64\MountPlugIns'))
Source: "ATCS.ui"; DestDir: "{app}\Plugins64\MountPlugIns"; Flags: ignoreversion; Check: DirExists(ExpandConstant('{app}\Plugins64\MountPlugIns'))
Source: "Astrometric.png"; DestDir: "{app}\Plugins64\MountPlugIns"; Flags: ignoreversion; Check: DirExists(ExpandConstant('{app}\Plugins64\MountPlugIns'))
[Code]
{* Below are functions to read TheSkyXInstallPath.txt and confirm that the directory does exist
This is then used in the DefaultDirName above
*}
function FindFile(RootPath: string; FileName: string): string;
var
FindRec: TFindRec;
FilePath: string;
begin
{ Log(Format('Searching %s for %s', [RootPath, FileName])); }
if FindFirst(RootPath + '\*', FindRec) then
begin
try
repeat
if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
begin
FilePath := RootPath + '\' + FindRec.Name;
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then
begin
Result := FindFile(FilePath, FileName);
if Result <> '' then Exit;
end
else
if CompareText(FindRec.Name, FileName) = 0 then
begin
Log(Format('Found %s', [FilePath]));
Result := FilePath;
Exit;
end;
end;
until not FindNext(FindRec);
finally
FindClose(FindRec);
end;
end
else
begin
Log(Format('Failed to list %s', [RootPath]));
end;
end;
function TSXInstallDir(Param: String) : String;
var
TheSkyXInstallPath: String;
Location: String;
LoadResult: Boolean;
begin
TheSkyXInstallPath := FindFile(ExpandConstant('{userdocs}') + '\Software Bisque', 'TheSkyXInstallPath.txt');
{ Check that could open the file}
if Length(TheSkyXInstallPath)=0 then
RaiseException('Unable to find the installation path for The Sky X :' + TheSkyXInstallPath);
LoadResult := LoadStringFromFile(TheSkyXInstallPath, Location)
{Check that the file exists}
if not DirExists(Location) then
RaiseException('The SkyX installation directory ' + Location + ' does not exist');
Result := Location;
end;