root/trunk/scripts/windows/logtalk.iss

Revision 4662, 21.2 KB (checked in by pmoura, 6 days ago)

Updated copyright notice.

  • Property svn:eol-style set to native
Line 
1; Script generated by the Inno Setup Script Wizard.
2
3#define MyAppName "Logtalk"
4#define MyAppVerName "Logtalk 2.35.0"
5#define MyAppPublisher "Logtalk.org"
6#define MyAppURL "http://logtalk.org"
7#define MyAppUrlName "Logtalk Web Site.url"
8#define MyAppRegURL "http://logtalk.org/regform.html"
9#define MyAppRegUrlName "Logtalk Registration.url"
10
11#define LOGTALKHOME "{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,LOGTALKHOME|{pf}\Logtalk}"
12#define LOGTALKUSER "{reg:HKCU\Environment,LOGTALKUSER|{userdocs}\Logtalk}"
13
14#define MyBaseDir "C:\lgtsvn"
15
16[Setup]
17AppName={#MyAppName}
18AppVerName={#MyAppVerName}
19AppPublisher={#MyAppPublisher}
20AppPublisherURL={#MyAppURL}
21AppSupportURL={#MyAppURL}
22AppUpdatesURL={#MyAppURL}
23ChangesEnvironment=yes
24DefaultDirName={#LOGTALKHOME}
25DefaultGroupName={#MyAppName}
26DisableProgramGroupPage=yes
27LicenseFile={#MyBaseDir}\LICENSE.txt
28InfoBeforeFile={#MyBaseDir}\README.txt
29OutputBaseFilename=lgt2350
30Compression=lzma
31SolidCompression=yes
32PrivilegesRequired=none
33
34VersionInfoVersion=2.35.0
35VersionInfoCopyright=© Paulo Moura, 1998-2009
36
37AllowRootDirectory=yes
38UninstallFilesDir="{userdocs}\Logtalk uninstaller"
39
40MinVersion=0,5.0
41
42[Types]
43Name: "full"; Description: "Full installation (recommended)"
44Name: "base"; Description: "Base system installation"
45Name: "user"; Description: "User data files installation (must be run by all end-users)"
46Name: "prolog"; Description: "Prolog integration (see documentation for compatibility details)"
47Name: "custom"; Description: "Custom installation"; Flags: iscustom
48
49[Components]
50Name: "base"; Description: "Base system"; Types: full base custom; Flags: disablenouninstallwarning
51Name: "user"; Description: "User data files"; Types: full user custom; Flags: checkablealone disablenouninstallwarning
52Name: "user\backup"; Description: "Backup current user data files"; Types: full user custom; Flags: disablenouninstallwarning
53Name: "prolog"; Description: "Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
54Name: "prolog\bp"; Description: "B-Prolog integration (version 7.1 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
55Name: "prolog\ciao"; Description: "Ciao Prolog integration (version 1.10#5 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
56Name: "prolog\cxprolog"; Description: "CxProlog integration (version 0.97.2 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
57Name: "prolog\eclipse"; Description: "ECLiPSe integration (versions 5.10, 6.0)"; Types: full prolog custom; Flags: disablenouninstallwarning
58Name: "prolog\gprolog"; Description: "GNU Prolog integration (version 1.3.0 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
59Name: "prolog\plc"; Description: "K-Prolog integration (version 6.0.4)"; Types: full prolog custom; Flags: disablenouninstallwarning
60Name: "prolog\quintus"; Description: "Quintus Prolog integration (version 3.5; implies patching Logtalk)"; Types: full prolog custom; Flags: disablenouninstallwarning
61Name: "prolog\sicstus"; Description: "SICStus Prolog integration (versions 3.12.x, 4.0.x)"; Types: full prolog custom; Flags: disablenouninstallwarning
62Name: "prolog\swi"; Description: "SWI-Prolog integration (version 5.6.44 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
63Name: "prolog\xsb"; Description: "XSB integration (version 3.1 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
64Name: "prolog\yap"; Description: "YAP integration (version 5.1.3 or later)"; Types: full prolog custom; Flags: disablenouninstallwarning
65
66[Tasks]
67Name: registration; Description: "&Register {#MyAppName} (opens a web page; requires an Internet connection)"; Components: base user
68Name: shortcut; Description: "&Create a desktop shortcut to the Logtalk user folder"; Components: user
69
70[Languages]
71Name: "english"; MessagesFile: "compiler:Default.isl"
72
73[Messages]
74BeveledLabel=Logtalk 2.35.0 © Paulo Moura, 1998-2009
75
76[Dirs]
77Name: {code:GetLgtUserDir}; Components: user; Flags: uninsneveruninstall
78Name: "{userdocs}\Logtalk uninstaller"
79
80[Files]
81Source: "{#MyBaseDir}\*"; Excludes: ".*,CVS"; DestDir: "{app}"; Components: base; Flags: ignoreversion recursesubdirs createallsubdirs
82
83Source: "{#MyBaseDir}\configs\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\configs"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
84Source: "{#MyBaseDir}\contributions\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\contributions"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
85Source: "{#MyBaseDir}\examples\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\examples"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
86Source: "{#MyBaseDir}\libpaths\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\libpaths"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
87Source: "{#MyBaseDir}\library\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\library"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
88Source: "{#MyBaseDir}\xml\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\xml"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
89
90Source: "{#MyBaseDir}\VERSION.txt"; DestDir: "{code:GetLgtUserDir}"; DestName: "VERSION.txt"; Components: user; Flags: ignoreversion uninsneveruninstall
91Source: "{#MyBaseDir}\configs\amzi.pl"; DestDir: "{code:GetLgtUserDir}\configs"; DestName: "amzi.pro"; Components: user; Flags: ignoreversion uninsneveruninstall
92Source: "{#MyBaseDir}\libpaths\libpaths.pl"; DestDir: "{code:GetLgtUserDir}\libpaths"; DestName: "libpaths_no_env_var.pl"; Components: user; Flags: ignoreversion uninsneveruninstall
93
94Source: "{#MyBaseDir}\scripts\*.bat"; DestDir: "{win}"; Components: base; Flags: ignoreversion
95Source: "{#MyBaseDir}\xml\*.bat"; DestDir: "{win}"; Components: base; Flags: ignoreversion
96
97[INI]
98Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}"; Components: base
99Filename: "{app}\{#MyAppRegUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppRegURL}"; Components: base
100
101[Icons]
102Name: "{group}\Bibliography"; Filename: "{app}\BIBLIOGRAPHY.bib"; Components: base
103Name: "{group}\Documentation"; Filename: "{app}\manuals\index.html"; Components: base
104Name: "{group}\License"; Filename: "{app}\LICENSE.txt"; Components: base
105Name: "{group}\Release Notes"; Filename: "{app}\RELEASE_NOTES.txt"; Components: base
106Name: "{group}\Read Me"; Filename: "{app}\README.txt"; Components: base
107Name: "{group}\Customization instructions"; Filename: "{app}\CUSTOMIZE.txt"; Components: base
108
109Name: "{group}\Web Site"; Filename: "{#MyAppUrl}"; Components: base
110
111Name: "{group}\Logtalk - B-Prolog"; Filename: "{code:GetBPExePath}"; Parameters: "-g ""consult('$LOGTALKHOME/integration/logtalk_bp.pl'), $bp_top_level"""; Comment: "Runs Logtalk with B-Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\bp; Flags: createonlyiffileexists
112
113Name: "{group}\Logtalk - Ciao Prolog"; Filename: "{code:GetCiaoExePath}"; Parameters: "-l ""$LOGTALKHOME/integration/logtalk_ciao.pl"""; Comment: "Runs Logtalk with Ciao Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\ciao; Flags: createonlyiffileexists
114
115Name: "{group}\Logtalk - CxProlog"; Filename: "{code:GetCxExePath}"; Parameters: "--goal ""silent_consult('%LOGTALKHOME%/integration/logtalk_cx.pl')"""; Comment: "Runs Logtalk with CxProlog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\cxprolog; Flags: createonlyiffileexists
116
117Name: "{group}\Logtalk - ECLiPSe 5.10"; Filename: "{code:GetEclipse5ExePath}"; Parameters: "-b ""%LOGTALKHOME%\integration\logtalk_eclipse5.pl"""; Comment: "Runs Logtalk with ECLiPSe 5.10"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\eclipse; Flags: createonlyiffileexists
118
119Name: "{group}\Logtalk - ECLiPSe 6.0"; Filename: "{code:GetEclipse6ExePath}"; Parameters: "-b ""%LOGTALKHOME%\integration\logtalk_eclipse6.pl"""; Comment: "Runs Logtalk with ECLiPSe 6.0"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\eclipse; Flags: createonlyiffileexists
120
121Name: "{group}\Logtalk - GNU Prolog"; Filename: "{code:GetGPExePath}"; Parameters: "--init-goal ""['$LOGTALKUSER/configs/gnu.pl', '$LOGTALKHOME/integration/logtalk_gp.pl', '$LOGTALKUSER/libpaths/libpaths.pl']"""; Comment: "Runs Logtalk with GNU Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\gprolog; Flags: createonlyiffileexists
122
123Name: "{group}\Logtalk - K-Prolog"; Filename: "{code:GetKPExePath}"; Parameters: "-h 4096k -l 2048k -g 4096k -e ""(consult('$LOGTALKHOME/integration/logtalk_plc6.pl'), '$root')."""; Comment: "Runs Logtalk with K-Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\plc; Flags: createonlyiffileexists
124
125Name: "{group}\Logtalk - Quintus Prolog"; Filename: "{code:GetQuintusExePath}"; Parameters: "+l ""%LOGTALKHOME%\integration\logtalk_quintus.pl"" +z ""%LOGTALKHOME%"" ""%LOGTALKUSER%"""; Comment: "Runs Logtalk with Quintus Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\quintus; Flags: createonlyiffileexists
126
127Name: "{group}\Logtalk - SICStus Prolog 3.12"; Filename: "{code:GetSP3ExePath}"; Parameters: "-l ""%LOGTALKHOME%\integration\logtalk_sicstus3.pl"""; Comment: "Runs Logtalk with SICStus Prolog 3.12"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\sicstus; Flags: createonlyiffileexists
128
129Name: "{group}\Logtalk - SICStus Prolog 4.0"; Filename: "{code:GetSP4ExePath}"; Parameters: "-l ""%LOGTALKHOME%\integration\logtalk_sicstus4.pl"""; Comment: "Runs Logtalk with SICStus Prolog 4.0"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\sicstus; Flags: createonlyiffileexists
130
131Name: "{group}\Logtalk - SWI-Prolog"; Filename: "{code:GetSWIExePath}"; Parameters: "-f ""%LOGTALKHOME%\integration\logtalk_swi.pl"""; Comment: "Runs Logtalk with SWI-Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\swi; Flags: createonlyiffileexists
132
133Name: "{group}\Logtalk - XSB"; Filename: "C:\XSB\config\x86-pc-windows\bin\xsb.exe"; Parameters: "-l -e ""['%LOGTALKUSER%\\configs\\xsb.pl', '%LOGTALKHOME%\\compiler\\logtalk.pl', '%LOGTALKUSER%\\libpaths\\libpaths.pl']."""; Comment: "Runs Logtalk with XSB"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\xsb; Flags: createonlyiffileexists
134
135Name: "{group}\Logtalk - XSB-MT"; Filename: "C:\XSB\config\i686-pc-cygwin-mt\bin\xsb.exe"; Parameters: "--shared_predicates -l -e ""['%LOGTALKUSER%\\configs\\xsb.pl', '%LOGTALKHOME%\\compiler\\logtalk.pl', '%LOGTALKUSER%\\libpaths\\libpaths.pl']."""; Comment: "Runs Logtalk with XSB-MT"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\xsb; Flags: createonlyiffileexists
136
137Name: "{group}\Logtalk - YAP"; Filename: "{code:GetYAPExePath}"; Parameters: "-l ""$LOGTALKHOME/integration/logtalk_yap.pl"""; Comment: "Runs Logtalk with YAP"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\yap; Flags: createonlyiffileexists
138
139Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: base
140
141Name: "{code:GetLgtUserDir}\manuals"; Filename: "{app}\manuals"; Components: user
142Name: "{code:GetLgtUserDir}\wenv"; Filename: "{app}\wenv"; Components: user
143
144Name: "{userdesktop}\Logtalk user files"; Filename: "{code:GetLgtUserDir}"; Components: user; Tasks: shortcut
145
146[Registry]
147Root: HKLM; Subkey: "Software\Logtalk"; ValueType: dword; ValueName: "Version"; ValueData: "2350"; Components: base; Flags: deletevalue uninsdeletevalue
148Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "LOGTALKHOME"; ValueData: "{app}"; Components: base; Flags: deletevalue uninsdeletevalue
149Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "LOGTALKUSER"; ValueData: "{code:GetLgtUserDir}"; Flags: deletevalue uninsdeletevalue
150
151[Run]
152Filename: "{app}\RELEASE_NOTES.txt"; Description: "View the release notes"; Components: base user; Flags: postinstall shellexec skipifsilent
153Filename: "{app}\CUSTOMIZE.txt"; Description: "Read the customization instructions for completing your setup"; Components: base user; Flags: postinstall shellexec skipifsilent
154
155Filename: "{app}\{#MyAppRegUrlName}"; Flags: shellexec nowait; Tasks: registration
156
157[UninstallDelete]
158Type: filesandordirs; Name: "{app}"; Components: base
159Type: filesandordirs; Name: "{group}"; Components: base
160
161[Code]
162var
163  LgtUserDirPage: TInputDirWizardPage;
164  WarningPage: TOutputMsgWizardPage;
165  Explanation, Warning: String;
166
167procedure InitializeWizard;
168var
169  Version, InstalledVersion: Cardinal;
170  LOGTALKHOME: String;
171begin
172  Explanation := 'Select the folder in which Setup should install Logtalk user data files, then click Next.'
173                 + Chr(13) + Chr(13)
174                 + 'These files allows each user to independently customize Logtalk and to freely modify the provided programming examples.'
175                 + Chr(13) + Chr(13)
176                 + 'A copy of these files must exist in the user home folder in order to use the Logtalk-Prolog integration scripts available from the Start Menu.'
177                 + Chr(13) + Chr(13)
178                 + 'Addtional end-users may use this installer to make a copy of these files on their home folders after a full installation of Logtalk.';
179  LgtUserDirPage := CreateInputDirPage(wpSelectDir,
180    'Select folder for Logtalk user data files', 'Where should Logtalk user data files be installed?',
181    Explanation,
182    False, 'New Folder');
183  LgtUserDirPage.Add('');
184  LgtUserDirPage.Values[0] := ExpandConstant('{#LOGTALKUSER}');
185  if not IsAdminLoggedOn then
186  begin
187    Warning := 'Full installation of Logtalk requires an administrative user.'
188               + Chr(13) + Chr(13)
189               + 'If the base Logtalk system is already installed, you may proceed in order to setup Logtalk for you as an end-user.'
190               + Chr(13) + Chr(13)
191               + 'If Logtalk is already set for you, this installer will make a backup copy of your current files (if you choose the same installation folder) and will restore all user data files to their default, pristine state.';
192    WarningPage := CreateOutputMsgPage(wpWelcome,
193  'Information', 'Please read the following important information before continuing.', Warning);
194  end;
195  if RegQueryDWordValue(HKLM, 'Software\Logtalk\', 'Version', Version) then
196    InstalledVersion := Version
197  else if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\', 'LOGTALKHOME', LOGTALKHOME) and DirExists(LOGTALKHOME) then
198    InstalledVersion := 0
199  else
200    InstalledVersion := -1;
201  if IsAdminLoggedOn and (InstalledVersion >= 0) and (InstalledVersion < 2340) then
202  begin
203    Warning := 'You have an older version of Logtalk installed whose configuration files are incompatible with this new version (configuration files are stored in your Logtalk user data folder).'
204               + Chr(13) + Chr(13)
205               + 'You must updade your Logtalk user data folder by performing a full installation.'
206               + Chr(13) + Chr(13)
207               + 'All aditional Logtalk users on your computer must also use this installer to update their Logtalk user data folders.';
208    WarningPage := CreateOutputMsgPage(wpWelcome,
209  'Warning', 'Logtalk user data folder update required.', Warning);
210  end
211end;
212
213function GetLgtUserDir(Param: String): String;
214begin
215  Result := LgtUserDirPage.Values[0]
216end;
217
218function GetCurrentDate(Param: String): String;
219begin
220  Result := GetDateTimeString('dddddd tt', '-', '-')
221end;
222
223function ShouldSkipPage(PageID: Integer): Boolean;
224begin
225  if (PageID = wpSelectDir) and not IsAdminLoggedOn then
226    Result := True
227  else if (PageID = wpSelectComponents) and not IsAdminLoggedOn then
228  begin
229    WizardForm.TypesCombo.ItemIndex := 2;
230    WizardForm.TypesCombo.OnChange(nil);
231    Result := True
232  end
233  else if (PageID = wpReady) and not IsAdminLoggedOn then
234    Result := True
235  else
236    Result := False;
237end;
238
239procedure CurStepChanged(CurStep: TSetupStep);
240begin
241  if (CurStep = ssInstall) and DirExists(LgtUserDirPage.Values[0]) and (pos('backup', WizardSelectedComponents(False)) > 0) then
242    RenameFile(LgtUserDirPage.Values[0], LgtUserDirPage.Values[0] + ' backup ' + GetDateTimeString('dddddd tt', '-', '-'))
243end;
244
245function GetBPExePath(Param: String): String;
246var
247  BPDIR: String;
248  Warning: String;
249begin
250  if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\', 'BPDIR', BPDIR) then
251    Result := BPDIR + '\bp.bat'
252  else begin
253    Warning := 'Failed to detect B-Prolog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
254    MsgBox(Warning, mbError, MB_OK);
255    Result := 'lgt_exe_does_not_exist'
256  end
257end;
258
259function GetCiaoExePath(Param: String): String;
260var
261  CiaoDir: String;
262  Warning: String;
263begin
264  if RegQueryStringValue(HKLM, 'Software\Ciao Prolog\', 'ciao_dir', CiaoDir) then
265    Result := CiaoDir + '\shell\ciaosh.cpx'
266  else begin
267    Warning := 'Failed to detect Ciao Prolog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
268    MsgBox(Warning, mbError, MB_OK);
269    Result := 'lgt_exe_does_not_exist'
270  end
271end;
272
273function GetCxExePath(Param: String): String;
274var
275  CxDir: String;
276  Warning: String;
277begin
278  if RegQueryStringValue(HKLM, 'SOFTWARE\CxProlog\', 'CXPROLOGDIR', CxDir) then
279    Result := CxDir + '\cxprolog.exe'
280  else begin
281    Warning := 'Failed to detect CxProlog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
282    MsgBox(Warning, mbError, MB_OK);
283    Result := 'lgt_exe_does_not_exist'
284  end
285end;
286
287function GetEclipse5ExePath(Param: String): String;
288var
289  ECLIPSEDIR: String;
290  Warning: String;
291begin
292  if RegQueryStringValue(HKLM, 'Software\IC-Parc\Eclipse\5.10\', 'ECLIPSEDIR', ECLIPSEDIR) then
293    Result := ECLIPSEDIR + '\lib\i386_nt\eclipse.exe'
294  else begin
295    Warning := 'Failed to detect ECLiPSe Prolog 5 installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
296    MsgBox(Warning, mbError, MB_OK);
297    Result := 'lgt_exe_does_not_exist'
298  end
299end;
300
301function GetEclipse6ExePath(Param: String): String;
302var
303  ECLIPSEDIR: String;
304  Warning: String;
305begin
306  if RegQueryStringValue(HKLM, 'Software\IC-Parc\Eclipse\6.0\', 'ECLIPSEDIR', ECLIPSEDIR) then
307    Result := ECLIPSEDIR + '\lib\i386_nt\eclipse.exe'
308  else begin
309    Warning := 'Failed to detect ECLiPSe Prolog 6 installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
310    MsgBox(Warning, mbError, MB_OK);
311    Result := 'lgt_exe_does_not_exist'
312  end
313end;
314
315function GetGPExePath(Param: String): String;
316var
317  RootPath: String;
318  Warning: String;
319begin
320  if RegQueryStringValue(HKCU, 'Software\GnuProlog\', 'RootPath', RootPath) then
321    Result := RootPath + '\bin\gprolog.exe'
322  else begin
323    Warning := 'Failed to detect GNU Prolog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
324    MsgBox(Warning, mbError, MB_OK);
325    Result := 'lgt_exe_does_not_exist'
326  end
327end;
328
329function GetKPExePath(Param: String): String;
330var
331  Path: String;
332  Warning: String;
333begin
334  Path := GetEnv('PLC') + '\plc.exe';
335  if FileExists(Path) then
336    Result := Path
337  else begin
338    Warning := 'Failed to detect K-Prolog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
339    MsgBox(Warning, mbError, MB_OK);
340    Result := 'lgt_exe_does_not_exist'
341  end
342end;
343
344function GetQuintusExePath(Param: String): String;
345var
346  Path: String;
347  Warning: String;
348begin
349  Path := GetEnv('Quintus') + '\bin\ix86\qpwin.exe';
350  if FileExists(Path) then
351    Result := Path
352  else begin
353    Warning := 'Failed to detect Quintus Prolog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
354    MsgBox(Warning, mbError, MB_OK);
355    Result := 'lgt_exe_does_not_exist'
356  end
357end;
358
359function GetSP3ExePath(Param: String): String;
360var
361  SP_PATH: String;
362  Warning: String;
363begin
364  if RegQueryStringValue(HKLM, 'Software\SICS\SICStus3.12_win32\', 'SP_PATH', SP_PATH) then
365    Result := SP_PATH + '\bin\spwin.exe'
366  else begin
367    Warning := 'Failed to detect SICStus Prolog 3 installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
368    MsgBox(Warning, mbError, MB_OK);
369    Result := 'lgt_exe_does_not_exist'
370  end
371end;
372
373function GetSP4ExePath(Param: String): String;
374var
375  SP_PATH: String;
376  Warning: String;
377begin
378  if RegQueryStringValue(HKLM, 'Software\SICS\SICStus4.0_win32\', 'SP_PATH', SP_PATH) then
379    Result := SP_PATH + '\bin\spwin.exe'
380  else begin
381    Warning := 'Failed to detect SICStus Prolog 4 installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
382    MsgBox(Warning, mbError, MB_OK);
383    Result := 'lgt_exe_does_not_exist'
384  end
385end;
386
387function GetSWIExePath(Param: String): String;
388var
389  Home: String;
390  Warning: String;
391begin
392  if RegQueryStringValue(HKLM, 'Software\SWI\Prolog\', 'home', Home) then
393    Result := Home + '\bin\plwin.exe'
394  else begin
395    Warning := 'Failed to detect SWI-Prolog installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
396    MsgBox(Warning, mbError, MB_OK);
397    Result := 'lgt_exe_does_not_exist'
398  end
399end;
400
401function GetYAPExePath(Param: String): String;
402var
403  Home: String;
404  Warning: String;
405begin
406  if RegQueryStringValue(HKLM, 'Software\YAP\Prolog\', 'home', Home) then
407    Result := Home + '\bin\yap.exe'
408  else begin
409    Warning := 'Failed to detect YAP installation.' + Chr(13) + 'Logtalk integration shortcut not created.';
410    MsgBox(Warning, mbError, MB_OK);
411    Result := 'lgt_exe_does_not_exist'
412  end
413end;
Note: See TracBrowser for help on using the browser.