)ô InstallMk2 Version 1.00 15-May-2005 ô (C) Jon Ripley, 2005 /ô This code may be used and modified freely : ô PROC_Install(lib$) ô Purpose: >ô Load a library if it is present on the local machine +ô No error given if operation fails Ý ò_Install(lib$):ê f%:f%=£ ô FN_Install(lib$) Cô Purpose: Load a library if it is present on the local machine ô Returns: 7ô TRUE - Library exists and has been INSTALLed )ô FALSE - Library cannot be found Ý ¤_Install(lib$):ê f%:f%=¹ ê libf%,tmp$ $tmp$=lib$:ok%=¤_FileExists(tmp$) Iç ¬ ok% tmp$=¤_ReadBB4WInstallPath+"LIB\"+lib$:ok%=¤_FileExists(tmp$) 3ç ¬ ok% tmp$="LIB\"+lib$:ok%=¤_FileExists(tmp$) 6ç ¬ ok% tmp$="..\LIB\"+lib$:ok%=¤_FileExists(tmp$) ç ok% Œ tmp$ ç f% Œ =ok% ‹ á : ô FN_FileExists(file$) +ô Purpose: Test the existence of a file ô Returns: 9ô TRUE - if the the file pointed to by f$ exists ,ô FALSE - if the file does not exist Ý ¤_FileExists(file$) ê h%,ok% h%=Žfile$:ok%=h%:ç ok% Ù#h% =(ok%<>0) : ô FN_BB4WIsInstalled >ô Purpose: Determine if BBC BASIC for Windows is installed ô Returns: 4ô TRUE - BBC BASIC for Windows is installed 8ô FALSE - BBC BASIC for Windows is not installed Ý ¤_BB4WIsInstalled ê ok%,tmp$ tmp$=¤_ReadBB4WInstallPath 4ç tmp$<>"" Œ ok%=¤_FileExists(tmp$+"bbcwin.exe") =ok% : ô FN_ReadBB4WInstallPath ?ô Purpose: Read the BBC BASIC for Windows installation path ô Returns: Jô The path to the BBC BASIC for Windows installation directory or, Aô a NULL string if BBC BASIC for Windows is not installed Ý ¤_ReadBB4WInstallPath ê hkey%,res%,lbuf%,type% %lbuf%=255:Þ buf% ê lbuf%:?buf%=13 \ "RegOpenKeyEx", &80000002, "Software\Microsoft\Windows\Help", 0, &20001, ^hkey% ¸ res% ç res%=0 Œ L "RegQueryValueEx", hkey%, "bbcwin.hlp", 0, ^type%, buf%, ^lbuf% ¸ res% "ç res%=0 Œ buf%?(lbuf%-1) = 13  "RegCloseKey", hkey% Í =$buf% ÿÿ