Show
Ignore:
Timestamp:
09/26/08 09:12:41 (3 months ago)
Author:
pmoura
Message:

Updated the Windows installer to warn the user when it fails to detect the installation of the selected Prolog compilers. Fixed a bug where the creation of the K-Prolog integration shortcut could fail when performing a custom installation.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/scripts/windows/logtalk.iss

    r4466 r4475  
    121121Name: "{group}\Logtalk - GNU Prolog"; Filename: "{code:GetGPExePath}"; Parameters: "--init-goal ""['$LOGTALKUSER/configs/gnu.config', '$LOGTALKHOME/integration/logtalk_gp.pl', '$LOGTALKUSER/libpaths/libpaths.pl']"""; Comment: "Runs Logtalk with GNU Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\gprolog; Flags: createonlyiffileexists 
    122122 
    123 Name: "{group}\Logtalk - K-Prolog"; Filename: "{code:GetKPExePath}"; Parameters: "-h 4096k -l 2048k -g 4096k -e ""(consult('$LOGTALKHOME/integration/logtalk_plc5.pl'), '$root')."""; Comment: "Runs Logtalk with K-Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\gprolog; Flags: createonlyiffileexists 
     123Name: "{group}\Logtalk - K-Prolog"; Filename: "{code:GetKPExePath}"; Parameters: "-h 4096k -l 2048k -g 4096k -e ""(consult('$LOGTALKHOME/integration/logtalk_plc5.pl'), '$root')."""; Comment: "Runs Logtalk with K-Prolog"; WorkingDir: "{code:GetLgtUserDir}"; Components: prolog\plc; Flags: createonlyiffileexists 
    124124 
    125125Name: "{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 
     
    246246var 
    247247  BPDIR: String; 
     248  Warning: String; 
    248249begin 
    249250  if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\', 'BPDIR', BPDIR) then 
    250251    Result := BPDIR + '\bp.bat' 
    251   else 
    252     Result := 'lgt_exe_does_not_exist' 
     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 
    253257end; 
    254258 
     
    256260var 
    257261  CiaoDir: String; 
     262  Warning: String; 
    258263begin 
    259264  if RegQueryStringValue(HKLM, 'Software\Ciao Prolog\', 'ciao_dir', CiaoDir) then 
    260265    Result := CiaoDir + '\shell\ciaosh.cpx' 
    261   else 
    262     Result := 'lgt_exe_does_not_exist' 
     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 
    263271end; 
    264272 
     
    266274var 
    267275  CxDir: String; 
    268 begin 
    269   if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\', 'CXPROLOG_DIR', CxDir) then 
     276  Warning: String; 
     277begin 
     278  if RegQueryStringValue(HKLM, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\', 'CXPROLOGDIR', CxDir) then 
    270279    Result := CxDir + '\cxprolog.exe' 
    271   else 
    272     Result := 'lgt_exe_does_not_exist' 
     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 
    273285end; 
    274286 
     
    276288var 
    277289  ECLIPSEDIR: String; 
     290  Warning: String; 
    278291begin 
    279292  if RegQueryStringValue(HKLM, 'Software\IC-Parc\Eclipse\5.10\', 'ECLIPSEDIR', ECLIPSEDIR) then 
    280293    Result := ECLIPSEDIR + '\lib\i386_nt\eclipse.exe' 
    281   else 
    282     Result := 'lgt_exe_does_not_exist' 
     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 
    283299end; 
    284300 
     
    286302var 
    287303  ECLIPSEDIR: String; 
     304  Warning: String; 
    288305begin 
    289306  if RegQueryStringValue(HKLM, 'Software\IC-Parc\Eclipse\6.0\', 'ECLIPSEDIR', ECLIPSEDIR) then 
    290307    Result := ECLIPSEDIR + '\lib\i386_nt\eclipse.exe' 
    291   else 
    292     Result := 'lgt_exe_does_not_exist' 
     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 
    293313end; 
    294314 
     
    296316var 
    297317  RootPath: String; 
     318  Warning: String; 
    298319begin 
    299320  if RegQueryStringValue(HKCU, 'Software\GnuProlog\', 'RootPath', RootPath) then 
    300321    Result := RootPath + '\bin\gprolog.exe' 
    301   else 
    302     Result := 'lgt_exe_does_not_exist' 
     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 
    303327end; 
    304328 
    305329function GetKPExePath(Param: String): String; 
    306 begin 
    307     Result := GetEnv('PLC') + '\plc.exe' 
     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 
    308342end; 
    309343 
    310344function GetQuintusExePath(Param: String): String; 
    311 begin 
    312     Result := GetEnv('Quintus') + '\bin\ix86\qpwin.exe' 
     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 
    313357end; 
    314358 
     
    316360var 
    317361  SP_PATH: String; 
     362  Warning: String; 
    318363begin 
    319364  if RegQueryStringValue(HKLM, 'Software\SICS\SICStus3.12_win32\', 'SP_PATH', SP_PATH) then 
    320365    Result := SP_PATH + '\bin\spwin.exe' 
    321   else 
    322     Result := 'lgt_exe_does_not_exist' 
     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 
    323371end; 
    324372 
     
    326374var 
    327375  SP_PATH: String; 
     376  Warning: String; 
    328377begin 
    329378  if RegQueryStringValue(HKLM, 'Software\SICS\SICStus4.0_win32\', 'SP_PATH', SP_PATH) then 
    330379    Result := SP_PATH + '\bin\spwin.exe' 
    331   else 
    332     Result := 'lgt_exe_does_not_exist' 
     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 
    333385end; 
    334386 
     
    336388var 
    337389  Home: String; 
     390  Warning: String; 
    338391begin 
    339392  if RegQueryStringValue(HKLM, 'Software\SWI\Prolog\', 'home', Home) then 
    340393    Result := Home + '\bin\plwin.exe' 
    341   else 
    342     Result := 'lgt_exe_does_not_exist' 
     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 
    343399end; 
    344400 
     
    346402var 
    347403  Home: String; 
     404  Warning: String; 
    348405begin 
    349406  if RegQueryStringValue(HKLM, 'Software\YAP\Prolog\', 'home', Home) then 
    350407    Result := Home + '\bin\yap.exe' 
    351   else 
    352     Result := 'lgt_exe_does_not_exist' 
    353 end; 
     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;