home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Bonus / lotus123rel9 / install.dsk / TOOLKIT.LSS < prev    next >
Text File  |  1998-05-20  |  263KB  |  7,519 lines

  1. ''**********************************************************************
  2. ''
  3. ''   Module Name:   cominst\toolkit\toolkit.lss
  4. ''
  5. ''   Module Code:   COMINST
  6. ''
  7. ''   Author:        Dave Dupre
  8. ''
  9. ''   Change History:
  10. ''   $Log:   //frontline/INSTLOG/CI/cominst/toolkit/toolkit.lss  $
  11. '' 
  12. ''    Rev 1.284   20 May 1998 18:21:38   jpappas
  13. '' Changed RemovePriorVersion to use cinstnod.ini if installing over Node
  14. '' 
  15. ''    Rev 1.283   12 May 1998 15:04:12   jpappas
  16. '' Added back the /S argument to RemovePriorVersion
  17. '' 
  18. ''    Rev 1.282   30 Apr 1998 09:35:32   jpappas
  19. '' Reworked RemovePriorVersion to use latest uninstall exe from lotustmp dir
  20. '' 
  21. ''    Rev 1.281   23 Apr 1998 17:43:04   ihachem
  22. '' 123 SPR# 56031 - 123suite uninstall bug from Joshua Sherwood (CR: RMenteiro)
  23. '' 
  24. ''    Rev 1.280   07 Apr 1998 14:41:40   jpappas
  25. '' Removed /S for 96 uninstalls
  26. '' 
  27. ''    Rev 1.279   07 Jan 1998 09:55:38   jpappas
  28. '' Added another Else clause to RemovePriorVersion function for 97 Installs
  29. '' 
  30. ''    Rev 1.278   03 Jul 1997 12:08:28   cmoy
  31. '' Modified creation of silent uninstall command string to use version of uninstall specified in registry
  32. '' 
  33. ''    Rev 1.277   02 Jul 1997 11:24:26   jdonohue
  34. '' CAndo (Japan) changes:
  35. '' Uninstall name loaded from string
  36. '' Replaced LEN calls with LENBP
  37. '' 
  38. ''    Rev 1.276   30 Jun 1997 12:13:02   jdonohue
  39. '' Regedit command line string path in quotes in all cases(Lot_RegisterREGTemplate)
  40. '' 
  41. ''    Rev 1.275   30 Jun 1997 09:06:28   jdonohue
  42. '' Lot_RegisterREGTemplate must have two different arguments
  43. '' 
  44. ''    Rev 1.274   27 Jun 1997 16:36:24   jdonohue
  45. '' Implemented Lot_RegisterREGTemplate registry file processing
  46. '' 
  47. ''    Rev 1.273   26 Jun 1997 16:02:00   cmoy
  48. '' changed hardcoding of lunin10.exe to use global variable gUNINSTALLEXE instead
  49. '' 
  50. ''    Rev 1.272   26 Jun 1997 15:45:20   jdonohue
  51. '' Ref: RWIS36HHHN
  52. '' Allow up to 255 characters in any user entered path
  53. '' 
  54. ''    Rev 1.271   26 Jun 1997 13:33:38   jdonohue
  55. '' Ref SPR: JJML38BQSW
  56. '' Made directory not static in Lot_GetInstallDir, since it wasn't getting
  57. '' refreshed when install mode changed server/standard
  58. '' Added CinstallIniError routine to tell pathname of cinstall.ini file not found
  59. '' 
  60. ''    Rev 1.270   19 Jun 1997 13:55:20   jdonohue
  61. '' Added functions Lot_RegisterOCX and Lot_RegisterOCX2 to support unregistration of OCX
  62. '' 
  63. ''    Rev 1.269   17 Jun 1997 13:28:42   jdonohue
  64. '' Added FixupSharedDLLCount
  65. '' 
  66. ''    Rev 1.268   13 Nov 1996 16:29:08   jdonohue
  67. '' Changed Lot_RegisterTypeLib to New_RegisterTypeLib (Scott Matsumoto version)
  68. '' Changed Old_RegisterTypeLib to Lot_RegisterTypeLib (original version)
  69. '' 
  70. ''    Rev 1.267   13 Nov 1996 12:21:08   jdonohue
  71. '' Adopted Scott Matsumoto's function for registering type libraries into
  72. '' Lot_RegisterTypeLib; renamed former toolkit function Old_RegisterTypeLib
  73. '' 
  74. ''    Rev 1.266   12 Nov 1996 15:22:28   jdonohue
  75. '' Ref. SPR: KAO3B8MB9
  76. '' Added Scott Matsimoto function RegisterTypeLib to Lot_RegisterTypeLib to
  77. '' complete type library registration
  78. '' 
  79. ''    Rev 1.265   25 Oct 1996 13:39:06   jdonohue
  80. '' Put miscellaneous objects in 'miscobj.ini' to circumvent 64K limit on 'cinstall.ini'
  81. '' 
  82. ''    Rev 1.264   19 Jul 1996 14:42:04   jdonohue
  83. '' Moved IncrementSharedDLLCount from main.lss to toolkit.lss
  84. '' 
  85. ''    Rev 1.263   11 Jul 1996 19:11:22   glutz
  86. '' Added SUB Lot_TurnOffNodeOptSections for cases where Suite does
  87. '' not surface the nodenodeoptions callback.
  88. '' 
  89. ''    Rev 1.262   05 Jul 1996 10:33:38   dfristro
  90. '' Changed IsDirWritable to IsPathWritable in Lot_GetNetHardDrive and
  91. '' Lot_GetLocalHardDrive.  This means we no longer insist that the dir exists,
  92. '' only that it can be created.
  93. '' 
  94. ''    Rev 1.261   14 Jun 1996 17:51:30   dfristro
  95. '' Simplified error message for excessive path length (SID_ERR_PATHLEN) to
  96. '' fix SPR RWIS36HHHN.
  97. '' 
  98. ''    Rev 1.260   14 Jun 1996 11:20:42   glutz
  99. '' SPR AFOG366LGN, Lot_AreAnyNodeOptionsAvail() was looking for reigistered
  100. '' options for each product instead of checking cinstall.ini.
  101. '' 
  102. ''    Rev 1.259   13 Jun 1996 08:31:54   glutz
  103. '' Took drive mapping out of IsPathWritable, changed order of checks in
  104. '' ValidateEditBox.
  105. '' 
  106. ''    Rev 1.258   10 Jun 1996 15:02:40   mhishinu
  107. '' Replaced two LEFT calls with LEFTBP to fix DBCS bug.
  108. '' 
  109. ''    Rev 1.257   10 Jun 1996 11:04:04   jdonohue
  110. '' Moved Lot_TrimEndSlash to setupapi.lss
  111. '' 
  112. ''    Rev 1.256   07 Jun 1996 14:56:10   jdonohue
  113. '' Ref SPR:  HAS2XQP8D
  114. '' Save number of installed objects, rather than counting cinstall.ini every time
  115. '' Use nulltrim on arguments in Lot_RegisterObject
  116. '' 
  117. ''    Rev 1.255   06 Jun 1996 11:36:42   jdonohue
  118. '' Ref SPR:  CDWT359P53
  119. '' Don't write miscellaneous object in cinstall.ini for registry uninstall key --
  120. '' this is automatically taken care of by uninstall
  121. '' 
  122. ''    Rev 1.254   05 Jun 1996 09:30:40   jdonohue
  123. '' Changed uninstall entry to delete entire uninstall entry, not just uninstallstring
  124. '' 
  125. ''    Rev 1.253   23 May 1996 12:21:34   jdonohue
  126. '' Replaced LEFTBP calls with LEFT
  127. '' 
  128. ''    Rev 1.252   16 May 1996 14:17:12   glutz
  129. '' RemovePriorVersion() buffers calls until told to execute.
  130. '' 
  131. ''    Rev 1.251   15 May 1996 13:21:32   jdonohue
  132. '' Ref SPR: MSUN35PJBG
  133. '' Changed Winhelp call argument from "Overview" to "Install"
  134. '' 
  135. ''    Rev 1.250   02 May 1996 10:04:08   jdonohue
  136. '' Ref SPR: RDOEHL4E94
  137. ''          PNOT2XUJRK
  138. '' Changed handling of writing uninstall string so that quotes are placed around
  139. '' arguments if the Windows new shell in use (Windows 95 and NT V. 4.0); quotes
  140. '' are NOT used for Windows NT 3.51 because of a bug in the MS Setup toolkit that
  141. '' truncates the command line with quotes.  So embedded spaces and other special
  142. '' characters (such as -) are NOT supported under Windows NT 3.51
  143. '' 
  144. ''    Rev 1.249   02 May 1996 09:22:04   glutz
  145. '' Added function RemovePriorVersion() for sspawning Uninstall.
  146. '' 
  147. ''    Rev 1.248   26 Apr 1996 08:51:38   jdonohue
  148. '' Ref SPR: CDWT34ULDZ
  149. '' Added missing function DL_SetOraclePath (probably obsolete)
  150. '' 
  151. ''    Rev 1.247   11 Apr 1996 09:04:26   glutz
  152. '' Lot_FixupSourceDirectories check for sections in copy list.
  153. '' 
  154. ''    Rev 1.246   10 Apr 1996 16:26:20   jdonohue
  155. '' Added error checking to Lot_FixupSourceDirectories and OneUp
  156. '' 
  157. ''    Rev 1.245   10 Apr 1996 12:45:40   jdonohue
  158. '' Removed comments in Lot_FixupSourceDirectories -- enable stripping of path components
  159. '' 
  160. ''    Rev 1.244   05 Apr 1996 14:28:50   jdonohue
  161. '' Use new function FGetSectionFileList to get font filenames even if they
  162. '' have been renamed in the .INF file
  163. '' 
  164. ''    Rev 1.243   04 Apr 1996 21:41:46   glutz
  165. '' Added function Lot_AreAnyNodeOptionsAvail().
  166. '' 
  167. ''    Rev 1.242   04 Apr 1996 13:34:06   jdonohue
  168. '' Backed out fix for embedded spaces in pathnames (adding quotes) so that NT
  169. '' 3.51 uninstall icon will work for Suite 97 Beta 
  170. '' 
  171. ''    Rev 1.241   01 Apr 1996 15:10:14   jdonohue
  172. '' For Smartsuite, remove two levels of directory in MarkFixupSourceDirectory
  173. '' 
  174. ''    Rev 1.240   29 Mar 1996 16:25:26   jdonohue
  175. '' Added function OneUp which is called in Lot_FixupSourceDirectories to remove
  176. '' the last path element from the Smartmasters type destination symbol
  177. '' 
  178. ''    Rev 1.239   04 Mar 1996 08:32:08   jdonohue
  179. '' Remove 16 bit shared component support -- pass 1 : eliminate LOTUSAPP
  180. '' 
  181. ''    Rev 1.238   27 Feb 1996 15:32:24   jdonohue
  182. '' Added Lot_RegisterTypeLib that creates registry entries for Type Libraries
  183. '' 
  184. ''    Rev 1.237   15 Feb 1996 19:12:24   jdonohue
  185. '' Do not initialize LOTUSFONTSDIR
  186. '' 
  187. ''    Rev 1.236   31 Jan 1996 15:26:12   jdonohue
  188. '' Added code to delete the Product entries under Smartsuite for a single product
  189. '' install so that uninstall will work
  190. '' 
  191. ''    Rev 1.235   30 Jan 1996 15:04:50   jdonohue
  192. '' Added registry key value "InfFileName" for products in suite uninstall
  193. '' 
  194. ''    Rev 1.234   25 Jan 1996 16:28:22   jdonohue
  195. '' Added registry key under Products for prod/ver that are part of suite
  196. '' Added preliminary code for enabling single uninstall icon for suite
  197. '' Register uninstall registry objects under first product rather than UINST
  198. '' 
  199. ''    Rev 1.233   23 Jan 1996 16:27:00   cmoy
  200. '' HISHI: Merged FE changes
  201. '' 
  202. ''    Rev 1.232   19 Jan 1996 17:08:26   jdonohue
  203. '' Initialize SYM_LOTUSFONTSDIR$ in InitializeWinWinSysDir
  204. '' Add uninstall object for uninstall string
  205. '' 
  206. ''    Rev 1.231   18 Jan 1996 13:35:56   jdonohue
  207. '' Added function Lot_RegisterFonts to provide automatic font registration
  208. '' Removed functions Lot_AddFontByID and Lot_AddFontByName, not needed anymore
  209. '' 
  210. ''    Rev 1.230   17 Jan 1996 14:19:30   glutz
  211. '' Added SUB ComboSelChanged and FUNCTION GetPathFromComboEdit.
  212. '' 
  213. ''    Rev 1.229   04 Jan 1996 15:52:58   jdonohue
  214. '' Ref SPR: TBAT2WAT6P
  215. '' Don't test InOrOut flag if file in copy list in Lot_WhereIsFeature -- this
  216. '' allows previously installed files to be found
  217. '' 
  218. ''    Rev 1.228   02 Jan 1996 16:15:28   jdonohue
  219. '' Use SYM_LOTUSFONTSDIR$ for location of fonts directory in Lot_AddFontByName
  220. '' 
  221. ''    Rev 1.227   22 Dec 1995 15:02:44   jdonohue
  222. '' Removed all references to SYM_PARENTDIR$ -- is now SYM_BASEDIR$ for all
  223. '' Added Function Lot_RegIni for future use
  224. '' 
  225. '' 
  226. ''    Rev 1.226   21 Dec 1995 14:09:16   jdonohue
  227. '' Added subs Lot_AddFontByID and Lot_AddFontByName.  These functions register a
  228. '' font with Windows and add to registry. It is assumed all fonts are installed
  229. '' to the Windows system directory
  230. '' 
  231. ''    Rev 1.225   14 Dec 1995 15:42:18   jdonohue
  232. '' Save original install directory location in  Lot_GetInstallDir instead of
  233. '' Lot_GetDestDirValueFromInstallini
  234. '' 
  235. ''    Rev 1.224   13 Dec 1995 16:29:54   jdonohue
  236. '' Ref SPR: PNOT2XUJRK
  237. '' Added quotes around pathname strings in command line to uninstall in
  238. '' Lot_RegisterUninstaller
  239. '' 
  240. ''    Rev 1.223   12 Dec 1995 11:29:48   jdonohue
  241. '' SPR Ref: TBAT2XLLZN
  242. '' Modified Lot_GetDestDirValueFromInstallini per Brian O'Donovan's suggestion t
  243. '' preserve the location of the cinstall.ini file in a static variable; this
  244. '' should point to the correct cinstall.ini for MLC installs as well
  245. '' 
  246. ''    Rev 1.222   11 Dec 1995 17:38:38   jdonohue
  247. '' Added PopulateCOBJECTLIST function to construct a list of objects in .INI 
  248. '' file; check list before creating miscellaneous object
  249. '' 
  250. ''    Rev 1.221   11 Dec 1995 14:06:32   jdonohue
  251. '' Lot_FixupSourceDirectories: added check for null source or destination
  252. '' 
  253. ''    Rev 1.220   11 Dec 1995 13:59:14   jdonohue
  254. '' Added subs Lot_FixupSourceDirectories and MarkFixupSourceDirSymbol for settin
  255. '' correct source location for node installs
  256. '' 
  257. ''    Rev 1.219   08 Nov 1995 16:58:30   tveerapp
  258. '' Fixes fot SPR#RMOO2xQQDY
  259. '' 
  260. ''    Rev 1.218   27 Oct 1995 17:07:26   glutz
  261. '' Lot_CheckPath does a NullTrim before proceeding.
  262. '' 
  263. ''    Rev 1.217   Oct 24 1995 16:55:18   cmoy
  264. '' removed eof char
  265. '' 
  266. ''    Rev 1.216   Oct 24 1995 16:25:58   mzgripce
  267. '' added Lot_CallWinhelp32 subroutine
  268. '' 
  269. ''    Rev 1.215   13 Oct 1995 15:41:14   amontalv
  270. '' For some reason the routine FGetListLength() was losing the symbol passed to it
  271. '' if it was called a second time.  We put a check in to make sure it doesn't.
  272. '' 
  273. ''    Rev 1.214   27 Sep 1995 11:18:44   jdonohue
  274. '' Don't change the destination directory symbols for non-server language instal
  275. '' 
  276. ''    Rev 1.213   22 Sep 1995 15:46:06   tveerapp
  277. '' Fixed spr#TBAT2W9U2Q. Lot_whereisfetaure was extended to look in the net
  278. '' components directory.
  279. '' 
  280. ''    Rev 1.212   22 Sep 1995 15:07:24   jdonohue
  281. '' Remove SYM_LOTUSUSERDIR$ processing
  282. '' 
  283. ''    Rev 1.211   15 Sep 1995 19:59:20   amontalv
  284. '' Added Lot_GetVol() and Lot_SplitAnyPath().
  285. '' 
  286. ''    Rev 1.210   14 Sep 1995 15:35:04   amontalv
  287. '' Don't register system path!
  288. '' 
  289. ''    Rev 1.209   14 Sep 1995 14:58:22   amontalv
  290. '' Added comments
  291. '' 
  292. ''    Rev 1.208   13 Sep 1995 17:03:06   amontalv
  293. '' Moved Lot_RegAppPath from setupapi.lss to toolkit.lss and also added a parameter.
  294. '' Lot_RegAppPath now register the registry entry .
  295. '' 
  296. ''    Rev 1.207   13 Sep 1995 14:20:22   glutz
  297. '' Added function GetLastPathComponent.
  298. '' 
  299. ''    Rev 1.206   12 Sep 1995 18:56:24   glutz
  300. '' Cleaned up some error reporting in ValidatePath, ValidateEditBox and
  301. '' ValidateBrowse.
  302. '' 
  303. ''    Rev 1.205   12 Sep 1995 11:55:54   tveerapp
  304. '' Added Lot_SaveFeaturesInInstNodeIni(), PopulateCINSTNODELIST .
  305. '' 
  306. ''    Rev 1.204   12 Sep 1995 11:18:18   glutz
  307. '' In ValidatePath set SYM_LAST_ERROR_SID to readonly before calling
  308. '' IsPathWritable.
  309. '' 
  310. ''    Rev 1.203   08 Sep 1995 14:41:44   glutz
  311. '' In ValidatePath the call to Lot_cleanPath is indepenent of volume type.
  312. '' 
  313. ''    Rev 1.202   08 Sep 1995 12:38:42   glutz
  314. '' For SPR CCOL2UKQD7 ValidatePath calls Lot_CleanPath first thing for UNC paths
  315. '' 
  316. ''    Rev 1.201   07 Sep 1995 15:22:08   amontalv
  317. '' Chop off the end of icon names longer than 40 characters if in NT.
  318. '' 
  319. ''    Rev 1.200   07 Sep 1995 10:42:26   tveerapp
  320. '' Added fix for node install network mapping in Lot_GetDestDirFromInstallIni.
  321. '' 
  322. ''    Rev 1.199   31 Aug 1995 14:00:48   tveerapp
  323. '' Fixed GetSymbolValue arg when building cinstnod.ini path
  324. '' 
  325. ''    Rev 1.198   31 Aug 1995 12:58:10   tveerapp
  326. '' NodeInstIni file path was not built correctly.Fix for spr# DCRP2UWNLS
  327. '' 
  328. ''    Rev 1.197   28 Aug 1995 16:53:00   jdonohue
  329. '' Changed USERDIR to LOTUSUSERDIR, lotususr to lotuser
  330. '' 
  331. ''    Rev 1.196   28 Aug 1995 13:32:14   amontalv
  332. '' Changed the uninstall entry to always be under \HLM\SOFTWARE\Microsoft\Windows\...
  333. '' and not \HLM\SOFTWARE\Microsoft\Windows NT\... when in NT.  Microsoft does this
  334. '' and it avoids security issues.
  335. '' 
  336. ''    Rev 1.195   24 Aug 1995 07:55:58   jdonohue
  337. '' Added SYM_USERDIR and set it
  338. '' 
  339. ''    Rev 1.194   23 Aug 1995 15:35:32   cmoy
  340. '' Added CONST MAX_NO_DRIVE_COMBOS
  341. '' 
  342. ''    Rev 1.193   21 Aug 1995 15:41:40   amontalv
  343. '' Put name of registry keys into globals.lss
  344. '' 
  345. ''    Rev 1.192   16 Aug 1995 20:33:28   amontalv
  346. '' Added code to do error messages for registry.
  347. '' 
  348. ''    Rev 1.191   16 Aug 1995 12:27:46   mmeth
  349. '' fix for  SPR# DCRP2UWNS9
  350. '' The node install was trying to write the path to the install directory
  351. '' into the registry.  Instead, we needed to write the path to the 
  352. '' target directory.
  353. '' 
  354. ''    Rev 1.190   15 Aug 1995 12:32:34   glutz
  355. '' Had to set the text for "Path not writable" just before displaying message.
  356. '' 
  357. ''    Rev 1.189   14 Aug 1995 17:00:22   amontalv
  358. '' During creation of Uninstall program group icon, I needed to point to the file again
  359. '' in the fourth parameter.  I though that that was starting directory, but seems to
  360. '' deal with icon.
  361. '' 
  362. ''    Rev 1.188   14 Aug 1995 11:12:28   jdonohue
  363. '' Allow filenames with more than 12 characters in MakePath
  364. '' 
  365. ''    Rev 1.187   09 Aug 1995 12:01:46   cmoy
  366. '' Commented out ProdAcronym variable. This is  not used
  367. '' 
  368. ''    Rev 1.186   Aug 09 1995 11:49:16   cmoy
  369. '' remove declaration on LOT_WRITECRITICALDIRECTORIES
  370. '' 
  371. ''    Rev 1.185   08 Aug 1995 12:55:14   tveerapp
  372. '' Added Lot_WriteCriticalDirectories. It is called in Lot_SaveFeaturesInInstal
  373. '' Ini. 
  374. '' 
  375. ''    Rev 1.184   07 Aug 1995 11:49:32   tveerapp
  376. '' Added a new function Lot_GetDestDirSymFrom InstallIni().
  377. '' 
  378. ''    Rev 1.183   07 Aug 1995 09:14:02   mmeth
  379. '' Fixed a typo I put in wrt a comment character.
  380. '' 
  381. ''    Rev 1.182   07 Aug 1995 08:24:52   mmeth
  382. '' Part 2 of fix for SPR# JHOH2M4HZL:
  383. '' No longer check length of strings being written in Lot_WriteToRiFile.
  384. '' Because this C function now truncates the length to 80 bytes + terminator
  385. '' itsself.  ALso changed the length of buffers to 82 in Lot_ReadDefaultsfromRi
  386. '' to handle the 80 bytes of characters plus terminating character.
  387. '' 
  388. ''    Rev 1.181   05 Aug 1995 13:27:10   jdonohue
  389. '' Backed out code to eliminate non-network drives for server install
  390. '' 
  391. ''    Rev 1.180   04 Aug 1995 17:27:08   amontalv
  392. '' Fixed command for uninstall icon.
  393. '' 
  394. ''    Rev 1.179   04 Aug 1995 16:38:36   glutz
  395. '' More subtle changes to ValidatePath.
  396. '' 
  397. ''    Rev 1.178   04 Aug 1995 12:24:04   glutz
  398. '' Cleaned up a problem displaying errors from ValidatePath.
  399. '' 
  400. ''    Rev 1.177   04 Aug 1995 08:42:58   glutz
  401. '' Changed the way ValidatePath handle some error messages.
  402. '' 
  403. ''    Rev 1.176   03 Aug 1995 15:41:22   amontalv
  404. '' Added one to length of registry entry for Uninstall.
  405. '' 
  406. ''    Rev 1.175   03 Aug 1995 15:32:42   glutz
  407. '' Changing method for error mesaages in ValidatePath.
  408. '' 
  409. ''    Rev 1.174   02 Aug 1995 16:20:10   amontalv
  410. '' Changed uninstall flags.  /L -> /O and /P -> /L
  411. '' 
  412. ''    Rev 1.173   02 Aug 1995 10:03:44   glutz
  413. '' Added unc volumes to server list in Lot_GetDriveFreeSpaceList.
  414. '' 
  415. ''    Rev 1.172   01 Aug 1995 16:14:52   amontalv
  416. '' Added uninstall information for ininstall icon
  417. '' 
  418. ''    Rev 1.171   01 Aug 1995 11:04:04   glutz
  419. '' Changed the order of some of the checks in ValidatePath so that UNC roots
  420. '' would be checked before invalid path names.
  421. '' 
  422. ''    Rev 1.170   31 Jul 1995 15:00:26   jdonohue
  423. '' Moved Reg_??? functions to Register.lss
  424. '' Added code to select only network drives for server install
  425. '' 
  426. ''    Rev 1.169   31 Jul 1995 10:54:28   amontalv
  427. '' No change
  428. '' 
  429. ''    Rev 1.168   28 Jul 1995 11:59:26   glutz
  430. '' IsPathWritable now passes the UNC path to Lot_CheckPath.
  431. '' 
  432. ''    Rev 1.167   27 Jul 1995 16:18:42   pdonahue
  433. '' added code to surface new error message 
  434. '' 
  435. ''    Rev 1.166   27 Jul 1995 14:01:34   amontalv
  436. '' Added call to create icons for uninstall in WinNt.
  437. '' 
  438. ''    Rev 1.165   27 Jul 1995 11:04:28   amontalv
  439. '' Added call Lot_AddLinkIconToFolder so that icon information can be sent
  440. '' when creating a shortcut.
  441. '' 
  442. ''    Rev 1.164   24 Jul 1995 11:39:38   glutz
  443. '' Read sn.dat from temp directory.
  444. '' 
  445. ''    Rev 1.163   20 Jul 1995 12:58:52   jdonohue
  446. '' Changed CopyFile to FCopyFile, which calls Win32 CopyFile instead of MS-Setup
  447. '' FCopyOneFile
  448. '' 
  449. ''    Rev 1.162   20 Jul 1995 10:53:54   glutz
  450. '' GetFreeSpace now returns K bytes so I made changes accordingly.
  451. '' 
  452. ''    Rev 1.161   20 Jul 1995 08:02:48   jdonohue
  453. '' Added check for null string in ValidatePath
  454. '' 
  455. ''    Rev 1.160   19 Jul 1995 16:37:24   glutz
  456. '' lcbNeed is now K bytes based so I took the \ 1024 out of CheskForSpace.
  457. '' 
  458. ''    Rev 1.159   18 Jul 1995 09:17:26   glutz
  459. '' ValidateBrowse was not updating edit box for UNC paths.
  460. '' 
  461. ''    Rev 1.158   17 Jul 1995 16:38:06   glutz
  462. '' Added function ValidateBrowse to set the combo and edit boxes after a browse.
  463. '' 
  464. ''    Rev 1.157   17 Jul 1995 15:52:12   glutz
  465. '' ValidatePath was checking path length before it was cleaning the path
  466. '' This would allow installation to \flw\..\
  467. '' 
  468. ''    Rev 1.156   17 Jul 1995 15:32:36   amontalv
  469. '' Changed the prodno in Lot_AddLinkToFolder to always be 1.
  470. '' 
  471. ''    Rev 1.155   17 Jul 1995 13:51:50   amontalv
  472. '' Added "Overview" to Windows Help, so that we would have the new help look.
  473. '' 
  474. ''    Rev 1.154   17 Jul 1995 13:33:08   glutz
  475. '' All error messages concerning paths are suppressed if a UNC volume
  476. '' cannot be mapped to a drive letter.
  477. '' 
  478. ''    Rev 1.153   13 Jul 1995 11:25:34   tveerapp
  479. '' Modified the comments for Reg_GetObsFiles.
  480. '' 
  481. ''    Rev 1.152   13 Jul 1995 11:22:26   tveerapp
  482. '' Added Reg_SetObsFiles, RegGetObsFilesto support Obsolete files flag.
  483. '' 
  484. ''    Rev 1.151   12 Jul 1995 16:53:26   glutz
  485. '' Had to limit the length of the unc volume int the insufficient disk
  486. '' space dialog.
  487. '' 
  488. ''    Rev 1.150   11 Jul 1995 12:09:24   tveerapp
  489. '' Changed Lot_RegiterUinstallhandler, Lot_RegisterObjects to not
  490. '' register during a server, distrbution install.
  491. '' 
  492. ''    Rev 1.149   07 Jul 1995 15:58:32   glutz
  493. '' Added UNC volumes to CheckForSpace routine.
  494. '' 
  495. ''    Rev 1.148   06 Jul 1995 12:23:04   mzgripce
  496. '' change the destination of the uninstaller fron the components directory
  497. '' to the windows directory
  498. '' 
  499. ''    Rev 1.147   28 Jun 1995 15:54:36   tveerapp
  500. '' Fixed EXECUTE requiring Sub Initialize.
  501. '' 
  502. ''    Rev 1.146   27 Jun 1995 15:54:32   mzgripce
  503. '' put the execute string between sub initialize and end sub to enable 
  504. '' on error / error # handeling for share processing
  505. '' 
  506. ''    Rev 1.145   23 Jun 1995 17:09:24   mzgripce
  507. '' fixed jmoy2t4pny pert 2 by compensating if the user starts a path with no \
  508. '' 
  509. ''    Rev 1.144   23 Jun 1995 12:47:42   mzgripce
  510. '' add program_group class 
  511. '' 
  512. ''    Rev 1.143   23 Jun 1995 12:22:12   jdonohue
  513. '' Added FindResourceinDLL function, add global string for name of our generic
  514. '' dialog proc and use in AddToBillboardList (original argument not used)
  515. '' 
  516. ''    Rev 1.142   22 Jun 1995 17:27:08   mzgripce
  517. '' add hive class to register object
  518. '' 
  519. ''    Rev 1.141   22 Jun 1995 12:43:56   jdonohue
  520. '' Revised AddToBillboardList to look for resource in list of DLLs
  521. '' 
  522. ''    Rev 1.140   22 Jun 1995 10:59:00   mzgripce
  523. '' change the cinstnode.ini filename to cinstnod.ini 
  524. '' 
  525. ''    Rev 1.139   21 Jun 1995 14:27:28   glutz
  526. '' Added function ValidateEditBox to check edit box
  527. '' strings for valid letter drives or UNC volumes
  528. '' 
  529. ''    Rev 1.138   19 Jun 1995 18:45:18   mzgripce
  530. '' change lot_callShare to call the sharetools if share or share32 are supported
  531. '' 
  532. ''    Rev 1.137   19 Jun 1995 17:40:12   mzgripce
  533. '' change the key Display Name to DisplayName (for uninstaller)
  534. '' 
  535. ''    Rev 1.136   19 Jun 1995 16:39:44   mzgripce
  536. '' add Lot_RegisterObject
  537. '' 
  538. ''    Rev 1.135   19 Jun 1995 10:27:20   amontalv
  539. '' Put in code to add function to New Folder button and Remove Folder button.  Also
  540. '' fixed some of the selection problems in the tree list.
  541. '' 
  542. ''    Rev 1.134   15 Jun 1995 19:41:30   amontalv
  543. '' Checked for and changed integers passed to C functions.  Changed to longs.
  544. '' 
  545. ''    Rev 1.133   15 Jun 1995 17:52:20   amontalv
  546. '' The problem with the program groups and errors with installed features was that
  547. '' the C code FFindFirst() expected a integer that contained the flag for which to look.
  548. '' In LotusScript when we called this function we passed an integer, but an integer
  549. '' in Script is different than an integer in C.  The fix is to convert the Script
  550. '' integer to a long using Clng() at the call for the C function.
  551. '' 
  552. ''    Rev 1.132   13 Jun 1995 17:27:08   mzgripce
  553. '' import FWriteDestinationSymAndVal, write Lot_WriteDestinationSymAndVal 
  554. '' subroutine and call it in Lot_SaveFeature to register the dir symbols
  555. '' and their values for uninstall
  556. '' 
  557. ''    Rev 1.131   12 Jun 1995 15:10:30   tveerapp
  558. '' Added a check in the function Lot_TrimEndSlash. Checks if the
  559. '' string is of length > 0. Script's MID$ chokes on an empty path string.
  560. '' 
  561. ''    Rev 1.130   09 Jun 1995 17:05:42   mzgripce
  562. '' added Lot_Register_Uninstaller
  563. '' 
  564. ''    Rev 1.129   09 Jun 1995 15:08:54   amontalv
  565. '' Added code to set global variable in START.LSS to error condition value.
  566. '' 
  567. ''    Rev 1.128   09 Jun 1995 14:25:58   glutz
  568. '' Fixed unc mapping bug
  569. '' 
  570. ''    Rev 1.127   09 Jun 1995 11:28:38   jdonohue
  571. '' Send quit message to WinHelp
  572. '' 
  573. ''    Rev 1.126   08 Jun 1995 16:48:54   jdonohue
  574. '' Added cancel option for tight disk space message box
  575. '' 
  576. ''    Rev 1.123   07 Jun 1995 17:50:12   amontalv
  577. '' Set the Selected folder to the root only the first time that
  578. '' Reg_SetProgManagerGroup is called.
  579. '' 
  580. ''    Rev 1.122   07 Jun 1995 16:30:44   amontalv
  581. '' Changed the Win95 start folder so that it initializes
  582. '' earlier in the program.  This should make automation
  583. '' easier to implement for it.  There are still a couple of
  584. '' bugs that I need to work out, but I feel that I should
  585. '' check what I have now.
  586. '' 
  587. ''    Rev 1.121   07 Jun 1995 11:23:24   glutz
  588. '' ValidatePath and IsPathwritable now work with UNC volumes
  589. '' 
  590. ''    Rev 1.120   06 Jun 1995 15:59:28   amontalv
  591. '' We are experiencing problems with LotusScript when we fill buffers with
  592. '' nulls and then pass them to C routines.  For the time being, it is suggested
  593. '' that we fill our buffers with spaces.  To this end (and to make it
  594. '' easier to change back later) I have created a small LotusScript routine
  595. '' named CreateBuffer.  You use it any time you ordinarily would use
  596. '' STRING$(num, 0).  CreateBuffer() just needs the num, it decides what to
  597. '' fill the buffer with (sorry about the grammer).  Right now it fill the
  598. '' buffer with spaces.  Later we will change it back to nulls.  Also look
  599. '' at the routine NullTrim().  It will get rid of final nulls and spaces.
  600. '' You can use this when getting a buffer that has been changed or filled
  601. '' in a external C routine.
  602. '' 
  603. ''    Rev 1.119   06 Jun 1995 15:34:44   mzgripce
  604. '' added 3 fields ti the prods struct to support moreDirectories prompt and
  605. '' 4 CIT functions (one set and three gets) to register this data with CIT
  606. '' 
  607. ''    Rev 1.118   05 Jun 1995 18:15:22   tveerapp
  608. '' Removed SetTheComponentsDir. This is taken care of in InitShare32
  609. '' in share32.lss.
  610. '' 
  611. ''    Rev 1.117   05 Jun 1995 16:37:20   amontalv
  612. '' Made changes for migrating to LotusScript version 3.0.37.
  613. '' 
  614. ''    Rev 1.116   02 Jun 1995 14:49:06   tveerapp
  615. '' Changed IDC_HELP to IDC_CITHELP.
  616. '' 
  617. ''    Rev 1.115   02 Jun 1995 08:54:26   glutz
  618. '' Lot_checkPath calls Lot_SplitUNCPath
  619. '' 
  620. ''    Rev 1.114   01 Jun 1995 17:02:04   glutz
  621. '' Lot_GheckPath works with UNC paths
  622. '' 
  623. ''    Rev 1.113   01 Jun 1995 11:11:44   amontalv
  624. '' Added API function CreateLink to create shortcuts.  Also added functions
  625. '' to save and get the link path to support the CreateLink.  I also changed
  626. '' the startup program folder code to use the default dialog proc and changed
  627. '' the default dialog proc to process directory trees.
  628. '' 
  629. ''    Rev 1.112   31 May 1995 09:52:20   callanan
  630. '' Accessing help from the lotustmp dir not the current directory as the 
  631. '' current directory changes when you change drive.
  632. '' 
  633. ''    Rev 1.111   30 May 1995 15:43:34   amontalv
  634. '' Made a new function PopupWithFunction.  PopupModalDlg now calls this.  Needed to
  635. '' do this to call dialog with my own dialog function.
  636. '' 
  637. ''    Rev 1.110   30 May 1995 13:09:32   jdonohue
  638. '' Pass DLL list in argument to FDoDialog
  639. '' 
  640. ''    Rev 1.109   30 May 1995 10:00:00   amontalv
  641. '' Added routine PopupFolderDlg to put up the Win95 Program folder dialog.
  642. '' 
  643. ''    Rev 1.108   25 May 1995 20:43:40   amontalv
  644. '' Checked in for Greg Lutz.  He commented out code that validated path in order
  645. '' to get long file names.
  646. '' 
  647. ''    Rev 1.107   19 May 1995 19:06:00   glutz
  648. '' Added some comments to UNC functions
  649. '' 
  650. ''    Rev 1.106   18 May 1995 12:21:20   tveerapp
  651. '' Added SetTheComponentsDir stub.MZ to fill in contents.
  652. '' 
  653. ''    Rev 1.105   18 May 1995 10:37:46   jdonohue
  654. '' Fixed logic for AddToBillboardList with multiple resource DLLs
  655. '' 
  656. ''    Rev 1.104   17 May 1995 17:53:50   mzgripce
  657. '' Change Reg_SetLicenserSupport() and Reg_SetLicenseSelected() to eliminate
  658. '' Licenser support 
  659. '' 
  660. ''    Rev 1.103   16 May 1995 17:13:06   amontalv
  661. '' Had to change the name of the dialog proc to _FNameOrgDlgProc@16.
  662. '' 
  663. ''    Rev 1.102   16 May 1995 17:07:56   glutz
  664. '' Split all automation functions out to automate.lss
  665. '' 
  666. ''    Rev 1.101   16 May 1995 09:19:52   glutz
  667. '' Added wrappers for
  668. '' FAddToDriveFreeSpaceList
  669. '' FIsUnvalidatedUNCPath
  670. '' FisValidUNCPath
  671. '' Added SUB Lot_SplitUNCPath
  672. '' Added functions'
  673. '' Lot_IsUnvalidatedUNCPath
  674. '' Lot_IsValidUNCPath
  675. '' Modified
  676. '' IsPathWritable
  677. '' ValidatePath
  678. '' SelectDriveCombo
  679. '' 
  680. ''    Rev 1.100   15 May 1995 11:19:18   jdonohue
  681. '' Call SetUpApi in initialize function
  682. '' 
  683. ''    Rev 1.99   11 May 1995 16:55:58   tveerapp
  684. '' Added a global variable gLogFile$ . Commented out the calls
  685. '' to WriteToLogFile - this is no longer a function.
  686. '' 
  687. ''    Rev 1.98   03 May 1995 18:17:40   mzgripce
  688. '' fix the syntax errors 
  689. '' 
  690. ''    Rev 1.97   03 May 1995 11:45:56   tveerapp
  691. '' Fixed the cfbuild-c2build merge.
  692. '' 
  693. ''    Rev 1.96   02 May 1995 17:51:08   mzgripce
  694. '' fixed some syntax errors in new features 
  695. '' 
  696. ''    Rev 1.95   02 May 1995 12:53:34   cmoy
  697. '' Merged c2 into cf build
  698. '' 
  699. ''    Rev 1.88   27 Apr 1995 16:48:10   mheerman
  700. '' Removed debug print from help case.
  701. ''    Rev 1.92F  26 Apr 1995 17:33:42   mzgripce
  702. '' replace TwoMainDirFlag with ExtraProdDirsNum and change the 
  703. '' subroutine and function name that process it.
  704. '' 
  705. ''    Rev 1.91F  25 Apr 1995 17:10:46   mzgripce
  706. '' add a new field: TwoMainDirFlag to ProdInfo Structure
  707. '' add SUBROUTINE Reg_SetTwoMainDirFlag and FUNCTION Reg_GetProdSupportForTwo-
  708. '' MainDir()
  709. '' change Reg_RegisterProductNames to set TwoMainDirFlag to 0
  710. '' 
  711. ''    Rev 1.87   14 Apr 1995 16:03:16   amontalv
  712. '' Deleted code that took care of final null in nul terminated strings.
  713. ''    Rev 1.90F  25 Apr 1995 11:45:20   tveerapp
  714. '' Added Lot_AutoCustomizeShare().
  715. '' 
  716. ''    Rev 1.86   10 Apr 1995 17:58:42   amontalv
  717. '' Made changes to functions and to some callback routines.
  718. ''    Rev 1.89F  24 Apr 1995 14:02:08   tveerapp
  719. '' Fixed Lot_AutoInstallCustomize.
  720. '' 
  721. ''    Rev 1.88   19 Apr 1995 14:38:24   jdonohue
  722. '' Changed SYM_CUIDLL$ from DLL name to list of DLLs in PopupMod..Dialog and 
  723. '' AddToBillboardList
  724. '' 
  725. ''    Rev 1.87F  13 Apr 1995 10:46:36   mzgripce
  726. '' Add Share32 field to ProdInfo struct
  727. '' Change Reg_RegiserProductNames to set the default of Share32 to 0
  728. '' added: Lot_AreShare32ToolsSupported(); Lot_GetShare32ToolsSize()
  729. '' Reg_GetProdSupportForShare32(); Reg_SetShare32Flag()
  730. '' 
  731. ''    Rev 1.86F  13 Apr 1995 19:00:20   tveerapp
  732. '' Added Lot_AutoInstallCustomize.
  733. '' 
  734. ''    Rev 1.85   05 Apr 1995 19:53:52   amontalv
  735. '' Porting to 32 bit.
  736. '' 
  737. ''    Rev 1.84   31 Mar 1995 18:47:52   amontalv
  738. '' Had to add aliases to function names for LotusScript to find them in DLLs
  739. '' 
  740. ''    Rev 1.83   20 Jan 1995 16:42:48   tveerapp
  741. '' 
  742. '' Fixed spr# ccol2nsl4. In autogetsetlicenser,moved the if licselected% to the right place.
  743. '' 
  744. ''    Rev 1.82   17 Jan 1995 16:45:12   tveerapp
  745. '' 
  746. '' Replaced existing error message for AutoCheckForspace.
  747. '' Fixes spr# TVEN2NBNEP.
  748. '' 
  749. ''    Rev 1.81   14 Jan 1995 15:58:54   jplump
  750. '' 
  751. '' Removed else case in Lot_AutoSuiteAppSelect. Before this routine
  752. '' is called in main, there is a check to see if the product is a
  753. '' SUITE; if it is not, this routine is not called. Therefore, the
  754. '' else case (if not Suite) in this routine won't happen. If the logic
  755. '' in main changes not to check for Suite, then the else case should
  756. '' not post an error for the user, but return to main without looking
  757. '' for Suite Applications.
  758. '' 
  759. ''    Rev 1.80   13 Jan 1995 11:28:18   jplump
  760. '' 
  761. '' In Lot_AutoGetInstallType, added option 4 (node). This option really doesn't
  762. '' do anything if the user has already done a server install and is doing a 
  763. '' legitimate node install. However, if the user has not done a server install
  764. '' and puts 4 as the install type, an error will be displayed. This error tells
  765. '' the user that he must to a server install first.
  766. '' 
  767. '' 
  768. '' 
  769. ''    Rev 1.79   11 Jan 1995 10:28:24   tveerapp
  770. '' 
  771. '' Fixed the logic in the AutoNodeoptions processing. Changed the OR to AND.
  772. '' The error should be signaled only if it is neither a 1 nor a 0.
  773. '' 
  774. ''    Rev 1.78   10 Jan 1995 19:04:38   jplump
  775. '' 
  776. '' When processing values from RSP file in automation,
  777. '' added check for missing value before casting string
  778. '' to integer. This is a workaround for a bug in
  779. '' LotusScript. An empty string should be a 0 when 
  780. '' cast to an integer (CINT), but it is not.
  781. '' SPR JMOY2N7QVK
  782. '' 
  783. ''    Rev 1.77   09 Jan 1995 16:50:32   tveerapp
  784. '' 
  785. '' Removed redundant code from Lot_CheckRSPPath as a result of the preious change(1).
  786. '' 
  787. ''    Rev 1.76   09 Jan 1995 16:48:04   tveerapp
  788. '' 
  789. '' Two changes:
  790. '' 1. Fixed the default for Lot_CheckRSPPath's return value to be "".
  791. '' 2. Fixed spr# JHOH2N7PHF
  792. '' 
  793. ''    Rev 1.75   07 Jan 1995 18:26:02   jplump
  794. '' 
  795. '' Made changes to keyword and section processing in Lot_Auto???
  796. '' functions to reflect changes in auto.rsp due to DOC review.
  797. '' 
  798. '' 
  799. ''    Rev 1.74   07 Jan 1995 15:56:20   jplump
  800. '' 
  801. '' In Lot_AutoCheckRSPPath fixed problem with function
  802. '' returning and invalid path. Calling functions should
  803. '' expect an empty string as a return value if the path
  804. '' is invalid.
  805. '' 
  806. ''    Rev 1.73   30 Dec 1994 14:12:28   jplump
  807. '' 
  808. '' Removed section name from error case in Select Applications processing
  809. '' 
  810. ''    Rev 1.72   30 Dec 1994 14:00:40   jplump
  811. '' 
  812. '' Added Lot_Auto_CheckRSPPath to validate paths in the response file.
  813. '' If the user does not supply a path in the rsp file, he\she will get
  814. '' this message: "Automated Install Error. Response File: One or more
  815. '' product directory paths are invalid in section:      " If the user
  816. '' supplies a path that is invalid, the invalid path message will be
  817. '' displayed first, and then Automated Install Error.
  818. '' 
  819. '' 
  820. ''    Rev 1.71   23 Dec 1994 18:34:30   jplump
  821. '' 
  822. '' Changed automation errors to be resourced errors.
  823. '' 
  824. ''    Rev 1.70   23 Dec 1994 14:07:44   jplump
  825. '' 
  826. '' Added Lot_AutoGetSetLicenserInfo
  827. '' Removed print statements
  828. '' Enhanced AutoDebug function
  829. '' 
  830. '' 
  831. ''    Rev 1.69   22 Dec 1994 15:09:08   tveerapp
  832. '' 
  833. '' Added Error Msg to AutoCheckForSpace
  834. '' 
  835. ''    Rev 1.68   22 Dec 1994 14:27:16   tveerapp
  836. '' 
  837. '' Fixed a type mismatch
  838. '' 
  839. ''    Rev 1.67   22 Dec 1994 14:22:42   tveerapp
  840. '' 
  841. '' Modified Lot_AutoGetProductDestDir.. for suite.
  842. '' 
  843. ''    Rev 1.66   22 Dec 1994 13:28:26   tveerapp
  844. '' 
  845. '' Fixed Lot_AutoSuiteAppSelect function.
  846. '' 
  847. ''    Rev 1.65   22 Dec 1994 11:38:52   tveerapp
  848. '' 
  849. '' Changed Lot_Check path to ValidatePath in Lot_AutoGetProductDestDir.
  850. '' 
  851. ''    Rev 1.64   21 Dec 1994 17:18:34   tveerapp
  852. '' 
  853. '' Fixed a type mismatch
  854. '' 
  855. ''    Rev 1.63   21 Dec 1994 17:08:22   tveerapp
  856. '' 
  857. '' Added Lot_AutoProcessNodeOptions.
  858. '' 
  859. ''    Rev 1.62   21 Dec 1994 14:58:44   tveerapp
  860. '' 
  861. '' Removed an erroneous end case
  862. '' 
  863. ''    Rev 1.61   21 Dec 1994 14:56:12   tveerapp
  864. '' 
  865. '' Fixed a typo
  866. '' 
  867. ''    Rev 1.60   21 Dec 1994 13:10:00   tveerapp
  868. '' 
  869. '' Added a missing end if and Next
  870. '' 
  871. ''    Rev 1.59   21 Dec 1994 13:03:12   tveerapp
  872. '' 
  873. '' Added Lot_AutoSuiteAppSel function. Added Error messages that need to be resourced!!
  874. '' Modified Lot-AutoGetSIzeofInstall.
  875. '' 
  876. ''    Rev 1.58   21 Dec 1994 11:54:48   tveerapp
  877. '' 
  878. '' Modified Lot_AutoGetBase function. It returns the base directory instead of setting it.
  879. '' 
  880. ''    Rev 1.57   12 Dec 1994 11:36:34   tveerapp
  881. '' 
  882. '' Incorporated jill's changes to Lot_AutoGetProductDestinationDir and
  883. '' Lot_AutoWriteOutDebugFile. Remmed out the existing functions. These
  884. '' can be removed after verfication with jill.
  885. '' 
  886. ''    Rev 1.56   12 Dec 1994 11:05:08   mzgripce
  887. '' 
  888. '' Added 4 funcs:Lot_AutoChangeLotusAppDir(), Lot_AutoConsolidateLotusAppDir()
  889. '' Lot_AutoConsolidateMoveCopy(), Lot_AutoIsThisNetLotusApp() 
  890. '' 
  891. ''    Rev 1.55   08 Dec 1994 20:10:34   jplump
  892. '' Added Lot_AutoWriteOutDebugFile
  893. '' Fixed Lot_AutoGetProductDestDirSymbol to use prodno%
  894. '' 
  895. ''    Rev 1.54   06 Dec 1994 17:21:00   tveerapp
  896. '' 
  897. '' Modified Lot_GetKeyValFromResponseFile to set gAutoFile$ to thw
  898. '' value of the symbol processed by shell in the command line.
  899. '' 
  900. ''    Rev 1.53   06 Dec 1994 10:23:54   tveerapp
  901. '' 
  902. '' Added Lot_AutoCinfigureAutoExec function and AutoInstallReboot.
  903. '' 
  904. ''    Rev 1.52   05 Dec 1994 15:09:52   jplump
  905. '' Added Lot_AutoGetUserInfo
  906. '' 
  907. ''    Rev 1.51   02 Dec 1994 15:56:56   cmoy
  908. '' 
  909. '' Merged automation files
  910. '' 
  911. ''    Rev 1.50   02 Dec 1994 15:10:42   cmoy
  912. '' 
  913. ''    Rev 1.11   01 Dec 1994 17:30:54   tveerapp
  914. '' 
  915. '' Added The AutoCheckSpace function.
  916. '' 
  917. ''    Rev 1.10   01 Dec 1994 10:22:16   jplump
  918. '' Added character checking to Lot_AutoGetProgramGroup
  919. '' 
  920. '' 
  921. '' 
  922. ''    Rev 1.9   30 Nov 1994 10:19:56   tveerapp
  923. '' Modified RegisterCallback function to register a callback only when not
  924. '' in the automation mode.
  925. '' 
  926. ''    Rev 1.8   29 Nov 1994 14:27:22   tveerapp
  927. '' Added a check to Lot_GetKeyValFromResponseFile.
  928. '' 
  929. ''    Rev 1.7   29 Nov 1994 12:53:34   tveerapp
  930. '' 
  931. '' Added i%, nProds to the declartions.D
  932. '' 
  933. ''    Rev 1.6   29 Nov 1994 12:45:54   tveerapp
  934. '' Modified Lot_AutoGetSizeOFinstall function. It returns an integer.
  935. '' 
  936. ''    Rev 1.5   29 Nov 1994 11:42:18   jplump
  937. '' 
  938. '' Added functions:  Lot_AutoGetSizeOfInstall & 
  939. '' Lot_AutoGetProgramGroup.
  940. '' 
  941. ''    Rev 1.4   23 Nov 1994 16:27:40   tveerapp
  942. '' 
  943. '' Added Lot_AutoGetInstallType function used in main.
  944. '' 
  945. ''    Rev 1.3   23 Nov 1994 15:22:02   tveerapp
  946. '' 
  947. '' Modified PopupModal for Automation.
  948. '' 
  949. ''    Rev 1.2   23 Nov 1994 14:02:02   jplump
  950. '' Added Lot_AutoGetBaseDirSymbol
  951. '' 
  952. ''    Rev 1.1   22 Nov 1994 16:34:40   jplump
  953. '' 
  954. '' Added INIT symbol processor
  955. '' 
  956. ''    Rev 1.0   22 Nov 1994 16:26:10   jplump
  957. '' Initial Revision
  958. ''==========
  959. '' 
  960. ''    Rev 1.47   02 Nov 1994 18:33:34   jplump
  961. '' Resourced error message in ModifyAutoexec()
  962. '' SID_ERR_AUTOEXEC_NOT_COPIED
  963. '' 
  964. '' Jill Salter Plump
  965. '' 
  966. '' 
  967. ''    Rev 1.46   03 Oct 1994 11:12:12   tveerapp
  968. '' Fixed spr# 1023351. Makepath checks for 13 chars. and a \.
  969. '' If valid accepts it else returns an empty string.
  970. '' 
  971. ''    Rev 1.45   27 Sep 1994 13:05:56   cmoy
  972. '' Added constants needed for rebooting and restarting
  973. '' 
  974. ''    Rev 1.44   22 Sep 1994 09:35:42   mzgripce
  975. '' Add CDOptDefaultSelected in PRODINFO structure
  976. '' Write: SUB Reg_ReSetCDOptionSelected
  977. ''  SUB Reg_ReSetCDOptionSelectedToDefault
  978. ''  SUB Reg_ReSetAllOptSelToDefaults
  979. '' all functions for cd settings checking and change the funcs that populates 
  980. '' 
  981. ''    Rev 1.43   02 Aug 1994 11:17:58   mzgripce
  982. '' To fix Node Options bug I commented out the call to the sub
  983. '' Reg_ReSetAllNodeOptsToDefaults in the function 
  984. '' Lot_AreAnyNodeOptAvailToSrv()
  985. '' 
  986. ''    Rev 1.42   21 Jul 1994 18:09:34   thangv
  987. '' Modified return value of IsNotesinpath to be 1  if it is not in
  988. '' lotus.ini. (this will reduce the ocuurences of autoexec change dialog
  989. '' showing up).
  990. '' 
  991. ''    Rev 1.41   13 Jun 1994 17:20:12   cmoy
  992. '' 
  993. '' ADDED GETBOOTDRIVE FUNCTIONALITY
  994. '' 
  995. ''    Rev 1.40   08 Jun 1994 17:05:12   mmeth
  996. '' Fixed PopulateCINSTALLLIST.  The bug in here was that we weren't writing ov
  997. '' previous versions of cinstall.ini correctly. gNCINSTALL set to -1 instead o
  998. '' 
  999. ''    Rev 1.39   05 Jun 1994 20:21:36   ptilton
  1000. '' Added Global Subroutines for Setting OracleHomeDir & NotesDataDir
  1001. '' Symbols.  Moved functions for determining values for symbols from 
  1002. '' SHARE.LSS
  1003. '' 
  1004. ''    Rev 1.38   02 Jun 1994 12:35:32   thangv
  1005. '' 
  1006. '' Added TrimNetlotusapp function.
  1007. '' 
  1008. ''    Rev 1.37   31 May 1994 14:04:54   thangv
  1009. '' 
  1010. '' Added Showwaitcursor and restorecursor foe fine check in CheckforSpace.
  1011. '' 
  1012. ''    Rev 1.36   31 May 1994 13:40:04   mmeth
  1013. '' Added Function Calls for Suite to handle previous versions
  1014. '' 
  1015. ''    Rev 1.35   26 May 1994 07:25:00   mmeth
  1016. '' In CheckForSpace the variable notused1$ was refernced, but not declared.
  1017. '' 
  1018. ''    Rev 1.34   25 May 1994 17:10:12   cmoy
  1019. '' 
  1020. '' put up a please wait dialog in CheckForSpace
  1021. '' 
  1022. ''    Rev 1.33   24 May 1994 16:54:16   thangv
  1023. '' Set the tab to 50 from 75 in CheckForSpace.
  1024. '' 
  1025. ''    Rev 1.32   24 May 1994 15:47:18   mmeth
  1026. '' Fixed Performance problem having to do with reading and writing CINSTALL.IN
  1027. '' 
  1028. ''    Rev 1.31   23 May 1994 14:50:02   mzgripce
  1029. '' fix a bug in IsThe Featureinstalled 
  1030. '' 
  1031. ''    Rev 1.30   20 May 1994 17:24:44   mmeth
  1032. '' Modified Lot_IsTheFeatureInstalled. It uses a list (CINSTALL) and
  1033. '' works faster.
  1034. '' 
  1035. ''    Rev 1.29   12 May 1994 11:20:24   mmeth
  1036. '' Adding Icons for Lic and Install and using DoMsgBox instead of MessageBox
  1037. '' 
  1038. ''    Rev 1.28   29 Apr 1994 16:36:36   mzgripce
  1039. '' 
  1040. '' fixed spr # 28650
  1041. '' 
  1042. ''    Rev 1.27   28 Apr 1994 13:29:38   mzgripce
  1043. '' 
  1044. '' added Lot_IsDestVerNewerOrEqual()
  1045. '' 
  1046. ''    Rev 1.26   21 Apr 1994 15:32:40   mzgripce
  1047. '' 
  1048. '' implement the correct err message for too long path(SID_ERR_PATHLEN_...)
  1049. '' 
  1050. ''    Rev 1.25   20 Apr 1994 16:45:38   thangv
  1051. '' Modified Lot_AreAnyNodeOptionsAvailToSrv function to check
  1052. '' for any node options not being in the copylist.
  1053. '' 
  1054. ''    Rev 1.24   20 Apr 1994 16:23:20   mzgripce
  1055. '' 
  1056. '' Reject paths that are too long.
  1057. '' 
  1058. ''    Rev 1.23   19 Apr 1994 10:28:32   thangv
  1059. '' Added FremoveSymbol(IDC_TEXT) in Popupmodal function
  1060. '' when exit button is selected.
  1061. '' 
  1062. ''    Rev 1.22   13 Apr 1994 09:55:28   cmoy
  1063. '' 
  1064. '' Added SHAREEXE and Notes as fields in Registration Database
  1065. '' Added SUBS:
  1066. '' Reg_SetSHAREEXESupport
  1067. '' Reg_SetNotesSupport
  1068. '' Added FUNCTIONS:
  1069. '' Reg_GetSHAREEXESupport
  1070. '' Reg_GetNotesSupport
  1071. '' GetNotesPathfromLotusIni
  1072. '' IsNotesInPath
  1073. '' IsShareInAUTOEXEC
  1074. '' ModifyAutoexec
  1075. '' GetBootDrive
  1076. '' Added Constants
  1077. '' MANotes
  1078. '' MAShare
  1079. '' 
  1080. ''    Rev 1.21   07 Apr 1994 16:41:12   mmeth
  1081. '' changed return code for EXECUTE statement to a public variable
  1082. '' 
  1083. ''    Rev 1.20   07 Apr 1994 12:38:20   mmeth
  1084. '' Modified DOEXEC to EXECUTE.
  1085. '' 
  1086. ''    Rev 1.19   06 Apr 1994 16:28:06   mmeth
  1087. '' Added a list gEXTRA.  This list gets initialized with an etra 200000
  1088. '' bytes for the Windows drive.  This can be modified by the product groups if
  1089. '' necessary. 
  1090. '' 
  1091. ''    Rev 1.18   04 Apr 1994 18:02:18   mmeth
  1092. '' Took out share.lss depednancies for those products that don't need it.
  1093. '' 
  1094. ''    Rev 1.17   23 Mar 1994 10:11:08   mmeth
  1095. '' WhereIsFeature... fixed for SmartSuiteNode case &
  1096. '' SaveFeatureInstalled... was fixedso it would write without adding extra "\"
  1097. '' 
  1098. ''    Rev 1.16   23 Mar 1994 09:17:52   mzgripce
  1099. '' add LOOKONNETLOTUSAPP to whereIsFeature 
  1100. '' 
  1101. ''    Rev 1.15   18 Mar 1994 18:30:50   mzgripce
  1102. '' change Lot_WhereIsFeature and save Destination Directories for suit server
  1103. '' 
  1104. ''    Rev 1.14   11 Mar 1994 16:58:56   thangv
  1105. '' Added the Dist field in the Registration database
  1106. '' Added The Reg_Set.. and Reg_GetProd.. functions for dist.
  1107. '' 
  1108. ''    Rev 1.13   10 Mar 1994 17:24:54   mzgripce
  1109. '' add Lot_InitializeWinWinsysSym subroutine
  1110. '' 
  1111. ''    Rev 1.12   01 Mar 1994 17:08:30   mzgripce
  1112. '' CALL FIsKeywordInCopyList into Lot_SaveNodeOptionsInInstallIni
  1113. '' 
  1114. ''    Rev 1.11   01 Mar 1994 12:13:14   mzgripce
  1115. '' added NodeOptDefaultSelected to PRODINFO type def
  1116. '' change: Reg_RegisterProductNames and Reg_SetNodeOptionSelected
  1117. '' added: Reg_IsNodeOptionDefaultSelected
  1118. ''        Reg_ReSetNodeOptionSelectedToDefault
  1119. ''        Reg_ReSetNodeOptionSelected and
  1120. ''        Reg_ReSetAllNodeOptsSelToDefaults
  1121. '' 
  1122. ''    Rev 1.10   24 Feb 1994 12:56:12   tingmann
  1123. '' add lot_lcbsettabs
  1124. '' 
  1125. ''    Rev 1.9   23 Feb 1994 18:14:30   mzgripce
  1126. '' fix Lot_SaveTheNodeOptionsInInstallIni() (replace"1" with STR(1))
  1127. '' 
  1128. ''    Rev 1.8   22 Feb 1994 17:04:24   mzgripce
  1129. '' add Lot_AreAnyNodeOptAvailToSrv()
  1130. '' 
  1131. ''    Rev 1.7   17 Feb 1994 10:24:46   mmeth
  1132. '' Added Reg_SetAllowUserToChoseInSMartSUite
  1133. '' 
  1134. ''    Rev 1.6   16 Feb 1994 14:40:06   tingmann
  1135. '' add reg_getproductname,reg_getuiinorout, lot_lcbsetsel
  1136. '' 
  1137. ''    Rev 1.5   16 Feb 1994 12:13:46   tingmann
  1138. '' fix END statement problem when running from DOEXEC (in QUIT sub)
  1139. '' 
  1140. ''    Rev 1.4   15 Feb 1994 15:01:38   mmeth
  1141. '' added pvcs line for toolkit.lss &
  1142. ''
  1143. ''   Creation Date: Wednesday January 5, 1994
  1144. ''
  1145. ''   Copyright Lotus Development Corporation, (c) 1994
  1146. ''
  1147. ''
  1148. ''   Description:
  1149. ''      
  1150. ''
  1151. ''   Additional authors: MZ
  1152. ''
  1153. ''   Change History:
  1154. ''----------------------------------------------------------------------
  1155. ''   Date     Vers. Pgmr  SPR#  Change
  1156. ''----------------------------------------------------------------------
  1157. '' 02-16-94   0032  MZ         Added Lot_AreAnyNodeOptAvailToSrv()
  1158. ''!
  1159. '' 02-16-94   0031  TQI           Fix exit problem when calling QUIT during DOEXEC
  1160. '' 02-14-94   0030  MZ          Added Lot_IsAnyNodeOptAvailToNode() and
  1161. ''                              Lot_AreNodeOptAvailToNodeForProd()
  1162. ''                              Lot_GetNumOfNodeOptAvailToNodeForProd()
  1163. '' 02-11-94   0029  MZ          Added Lot_SaveTheNodeOptionsInInstallIni(),
  1164. ''                              Lot_GetLastNodeOptNumber() and
  1165. ''                              Lot_IsTheNodeOptionsAvailToNode() functions
  1166. '' 02-07-94   0028  MZ          move Lot_SaveFeaturesInstaledInInstallIni()
  1167. ''                              and Lot_GetLastFeatureNumber() from share.lss
  1168. '' 02-06-94   0027  MMETH       fixed Lot_Toggle... and MsgBox-> MessageB
  1169. '' 02-04-94   0026  MMETH       Added defaults for Reg DB.
  1170. '' 02-03-94   0025  MMETH       added Lot_WhereIsFeature also moved 
  1171. ''                              Lot_IstheFeatureInstall from toolkit.lss
  1172. '' 02-01-94   0024  MZ          ADDED Lot_GetGroupName and set
  1173. ''                              Prods(gCurrNumOfProds%).ProgManagerGroup="Lotus Applications"
  1174. '' 02-01-94   0024  MMETH       INSTALL_SOURCE still coming up empty.
  1175. '' 01-31-94   0023  MMETH       Cleaned up CallProductFunctions and Back
  1176. '' 01-30-94   0022  MMETH       Removed CreateCOuntDir from remmed out code
  1177. '' 01-28-94   0021  MZ          Add:Reg_SetLicenseSelected
  1178. ''                                  Reg_IsLicenseSelected
  1179. ''                                  Reg_SetCountDirectory
  1180. ''                                  Reg_GetCountDirectory
  1181. ''                                  Reg_SetBillboardNumber
  1182. ''                                  Reg_GetBillboardNumber
  1183. ''                              Change Reg_RegisterProductNames to set the 
  1184. ''                              BillboardNumber to 0
  1185. '' 01-28-94   0022  MMETH       Fixed CallProducts for "BACK"
  1186. '' 01-28-94   0021  DND         Added Reg_GetSystemFileSize and
  1187. ''                              Reg_SetSystemFileSize.
  1188. '' 01-27-94   0020  DND         Lot_GetChapterValStr returns empty
  1189. ''                              string if chapter is not found.
  1190. '' 01-25-94   0019  DND         Move SetRestartDir, RestartListEmpty,
  1191. ''                              and ExitExecRestart from setupapi.
  1192. '' 01-25-94   0018  MMETH       Added Lot_TrimEndSlash
  1193. '' 01-24-94   0017  MMETH       Fix GetTheRealProdDir
  1194. '' 01-24-94   0016  TQI         Capture function returns (lsi36)
  1195. '' 01-24-94   0015  MMETH       Move GetTheRealProd from share.lss
  1196. ''                              added prodno% parm, and modified implememntaion
  1197. '' 01-21-94   0014  MMETH       Added Parms to Lot_CallProducts
  1198. '' 01-20-94   0013  DND         CheckForSpace no longer pops modeless
  1199. '' 01-20-94   0012  MZ          Modify Reg_SetSelectedInstallType() to set to 
  1200. ''                              complete if custom and/or laptop is not a
  1201. ''                              valid choice for the product.
  1202. '' 01-19-94   0011  DND         Modified the GetFirstDrive functions so
  1203. ''                              they now return with the default dir.
  1204. ''                              Made the AllDrive function more effecient.
  1205. '' 01-19-94   0010  MMETH       Changed CallProd family to use Reg_GetProductAcronym
  1206. '' 01-19-94   0009  MZ          Change TRUE/FALSE to 1/0 in Reg_* SUB/FUNCs
  1207. '' 01-19-94   0009  MMeth       Use SYM_UPDATELIST$. 
  1208. ''                              Added Reg_GetNumberOfProducts.
  1209. '' 01-19-94   0008  DND         Lot_Get/SetCurrentProduct saves and returns
  1210. ''                              an integer. This makes life much easier
  1211. ''                              for toolkit. Changed 
  1212. ''                              Reg_SetSelectedInstallTypes to
  1213. ''                              Reg_SetSelectedInstallType. Fixed 
  1214. ''                              SelectDriveCombo to accept a path.
  1215. ''                              Lot_ExtractDriveLetter returns lower case.
  1216. '' 01-19-94   0008  TQI         Use doexec instead of execute
  1217. '' 01-18-94   0007  MZ          move Lot_CleanPath() to setupapi.lss
  1218. '' 01-18-94   0006  MZ          Put in the Product registration database
  1219. '' 01-18-94   0005  DND         Added Lot_CleanPath
  1220. '' 01-12-94   0004  MMETH       Changed Return code of CallProd to string
  1221. '' 01-12-94   0003  mmeth            Lot_CallProductFunctions (func_name$, always%, parms$)
  1222. '' 01-12-94   0002  tqi         option declare
  1223. '' 01-10-94   0001  MZ          Make all symbols Constants and put them
  1224. ''                              in GLOBALS.LSS
  1225. '' 01-05-94   0000  DND         Initial checkin
  1226. ''----------------------------------------------------------------------
  1227. ''
  1228. ''**********************************************************************
  1229.  
  1230. 'USE "SETUPAPI"
  1231. USE "START"
  1232. USE "REGISTER"
  1233. OPTION DECLARE
  1234. '************ User messages
  1235.  
  1236. PUBLIC CONST WM_COMMAND        = 273
  1237. PUBLIC CONST WM_USER           = 1024
  1238. PUBLIC CONST UM_PAINTMODELESS  = (WM_USER+1000)
  1239. PUBLIC CONST UM_REBOOTFLAG     = (WM_USER+503)
  1240. PUBLIC CONST UM_RESTARTWINDOWS = (WM_USER+504)
  1241.  
  1242.  
  1243. '** Return codes for drive type
  1244. PUBLIC CONST DRIVE_REMOVABLE = 2
  1245. PUBLIC CONST DRIVE_FIXED     = 3
  1246. PUBLIC CONST DRIVE_REMOTE    = 4
  1247.  
  1248. '** Function return codes
  1249. PUBLIC CONST SUCCESS = 1
  1250. PUBLIC CONST FAILURE = 0
  1251. PUBLIC CONST MANotes = 1   '** used in ModifyAutoexec
  1252. PUBLIC CONST MAShare = 2   '** used in ModifyAutoexec
  1253.  
  1254. '** These numbers must match those in lcomstf\sections.h of lcomstf.dll!!
  1255. PUBLIC CONST F_NOTHING    = 0
  1256. PUBLIC CONST F_CHAPTER    = 1
  1257. PUBLIC CONST F_NAME       = 2
  1258. PUBLIC CONST F_INOROUT    = 4
  1259. PUBLIC CONST F_DISPLAY    = 8
  1260. PUBLIC CONST F_COMPLETE   = 16
  1261. PUBLIC CONST F_LAPTOP     = 32
  1262. PUBLIC CONST F_CUSTOM     = 64
  1263. PUBLIC CONST F_TIPS       = 128
  1264. PUBLIC CONST F_HELP       = 256
  1265. PUBLIC CONST F_DESTDIR    = 512
  1266. PUBLIC CONST F_BITMAP     = 1024
  1267. PUBLIC CONST F_EXCEPTION  = 2048
  1268. PUBLIC CONST F_SHARE      = 4096
  1269. PUBLIC CONST F_KEYWORD    = 8192
  1270. PUBLIC CONST F_DESTDIRSYM = 16384
  1271.  
  1272. PUBLIC CONST RT_BITMAP  = 2     'This should be a MAKEINTRESOURCE(2) really
  1273. PUBLIC CONST RT_DIALOG  = 5     'This should be a MAKEINTRESOURCE(5) really
  1274. PUBLIC CONST RT_STRING  = 6     'This should be a MAKEINTRESOURCE(6) really
  1275.  
  1276. 'The decorated name for the generic dialog procedure in dlgproc.c  JMD
  1277. PUBLIC CONST FNAMEORGDLGPROC$="_FNameOrgDlgProc@16"
  1278.  
  1279. 'needed in callbacks
  1280. PUBLIC CONST MAX_NO_DRIVECOMBOS = 4
  1281.  
  1282. '*****
  1283. 'NEEDED FOR THE ARRAY CINSTALL
  1284. DECLARE SUB PopulateCINSTALLLIST
  1285. DIM CINSTALL LIST AS STRING
  1286. DIM gNCINSTALL%
  1287.  
  1288. 'NEEDED FOR THE ARRAY CINSTNODE
  1289. DECLARE SUB PopulateCINSTNODELIST
  1290. DIM CINSTNODE LIST AS STRING
  1291. DIM gNCINSTNODE%
  1292.  
  1293. 'NEEDED FOR THE ARRAY COBJECT
  1294. DECLARE SUB PopulateCOBJECTLIST(iniPath$)
  1295. DIM COBJECT LIST AS INTEGER
  1296. DIM gNCOBJECT%
  1297.         
  1298. %rem
  1299.  Moved to register.lss
  1300. '******************** Product Registration  struc, array and count *********
  1301. TYPE PRODINFO
  1302.     Acronym                    AS STRING
  1303.     Name                       AS STRING
  1304.     Complete                   AS INTEGER
  1305.     Custom                     AS INTEGER
  1306.     Laptop                     AS INTEGER
  1307.     SelectedType               AS STRING
  1308.     UIInOrOut                  AS INTEGER
  1309.     AllowUserToPickInSuite     AS INTEGER
  1310.     FullSize                   AS LONG
  1311.     MinSize                    AS LONG
  1312.     Share                      AS INTEGER
  1313.     Share32                    AS INTEGER
  1314.     DataLens                   AS INTEGER
  1315.     SQL                        AS INTEGER
  1316.     Paradox                    AS INTEGER
  1317.     CDOpt                      AS STRING
  1318.     CDOptSelected              AS STRING
  1319.     CDOptDefaultSelected       AS STRING
  1320.     NodeOpt                    AS STRING
  1321.     NodeOptSelected            AS STRING
  1322.     NodeOptDefaultSelected     AS STRING
  1323.     Srv                        AS INTEGER
  1324.     Dist                       AS INTEGER
  1325.     ExtraProdDirsNum           AS INTEGER
  1326.     License                    AS INTEGER
  1327.     LicenseSelected            AS INTEGER
  1328.     CountDirectory             AS STRING
  1329.     ATM                        AS INTEGER
  1330.     DirSymList                 AS STRING         'Should be populated in Init
  1331.     ProgManagerGroup           AS STRING
  1332.     ProgFolder                                              AS STRING
  1333.     SystemFileSize             AS LONG
  1334.     BillboardNumber            AS INTEGER
  1335.     SHAREEXE                   AS INTEGER
  1336.     Notes                      AS INTEGER
  1337.     PreviousVersion            AS STRING      'This is a string for future purposes
  1338.     MoreDirsCBName             AS STRING
  1339.     MoreDirsDlgID              AS INTEGER
  1340.     MoreDirsHlpID              AS LONG
  1341.     ObsoleteFiles              AS INTEGER      'This is can be a string for future enhancements
  1342. END TYPE
  1343.  
  1344. DIM Prods(gMaxNumOfProds) AS PRODINFO  
  1345. DIM gCurrNumOfProds%                      '** Number of products
  1346. DIM gCurrentProduct%                      '** The current product
  1347. %endrem
  1348.  
  1349. DIM ToolkitDebug%
  1350.  
  1351. '******************** Lotus DLL interface **************************
  1352.  
  1353. DECLARE PUBLIC FUNCTION FIsKeywordInCopyList LIB "lcomstf.dll" ALIAS "_FIsKeywordInCopyList@4" (ByVal szKeyword$) AS LONG
  1354. DECLARE PUBLIC FUNCTION FGetChapterFromKeyword LIB "lcomstf.dll" ALIAS "_FGetChapterFromKeyword@12" (ByVal szKeyword$, ByVal szChptname$, ByVal cbChptsize&) AS LONG
  1355. DECLARE PUBLIC FUNCTION FRemoveDir LIB "lcomstf.dll" ALIAS "_FRemoveDir@4" (ByVal szDir$) AS LONG
  1356. DECLARE PUBLIC FUNCTION FOpenInf LIB "lcomstf.dll" ALIAS "_FOpenInf@12" (ByVal szFile$,ByVal fCheck&,ByVal fCheckSyms&) AS LONG
  1357. DECLARE PUBLIC FUNCTION LcbGetChapterCost LIB "lcomstf.dll" ALIAS "_LcbGetChapterCost@16" (ByVal szchapter$,ByVal szextra$,ByVal szcost$, ByVal szneed$) AS LONG
  1358. DECLARE PUBLIC FUNCTION CbGetInfSectionKeyField LIB "lcomstf.dll" ALIAS "_CbGetInfSectionKeyField@20" (ByVal szSect$, ByVal szKey$, ByVal iField&, ByVal szBuf$, ByVal cbBuf&) AS LONG
  1359. DECLARE PUBLIC FUNCTION FMakeListInfSectionField LIB "lcomstf.dll" ALIAS "_FMakeListInfSectionField@12" (ByVal szSym$, ByVal szSect$, ByVal iField&) AS LONG
  1360. DECLARE PUBLIC FUNCTION FSetSymbolToListOfInfKeys LIB "lcomstf.dll" ALIAS "_FSetSymbolToListOfInfKeys@12" (ByVal szSym$, ByVal szSect$, ByVal fNulls&) AS LONG
  1361. DECLARE PUBLIC FUNCTION FAddSectionFilesToCopyList LIB "lcomstf.dll" ALIAS "_FAddSectionFilesToCopyList@12" (ByVal szSect$, ByVal szSrc$, ByVal szDest$) AS LONG
  1362. DECLARE PUBLIC FUNCTION FAddSectionKeyFileToCopyList LIB "lcomstf.dll" ALIAS "_FAddSectionKeyFileToCopyList@16" (ByVal szSect$, ByVal szKey$, ByVal szSrc$, ByVal szDest$) AS LONG
  1363. DECLARE PUBLIC FUNCTION FDumpCopyListToFile LIB "lcomstf.dll" ALIAS "_FDumpCopyListToFile@4" (ByVal szFile$) AS LONG
  1364. DECLARE PUBLIC SUB      ResetCopyList LIB "lcomstf.dll" ALIAS "_ResetCopyList@0" ()
  1365. DECLARE PUBLIC SUB      ResetFileCosts LIB "lcomstf.dll" ALIAS "_ResetFileCosts@0" ()
  1366. DECLARE PUBLIC FUNCTION FRemoveSectionFilesFromCopyList LIB "lcomstf.dll" ALIAS "_FRemoveSectionFilesFromCopyList@4" (ByVal szSect$) AS LONG
  1367. DECLARE PUBLIC FUNCTION FRemoveSectionKeyFileFromCopyList LIB "lcomstf.dll" ALIAS "_FRemoveSectionKeyFileFromCopyList@8" (ByVal szSect$, ByVal szKey$) AS LONG
  1368. DECLARE PUBLIC FUNCTION FSetBeepingMode LIB "lcomstf.dll" ALIAS "_FSetBeepingMode@4" (ByVal mode&) AS LONG
  1369. DECLARE PUBLIC SUB      ProSetPos LIB "lcomstf.dll" ALIAS "_ProSetPos@8" (ByVal x&, ByVal y&)
  1370. DECLARE PUBLIC FUNCTION GrcCopyFilesInCopyList LIB "lcomstf.dll" ALIAS "_GrcCopyFilesInCopyList@4" (ByVal hInstance&) AS LONG
  1371. DECLARE PUBLIC FUNCTION LcbGetCopyListCost LIB "lcomstf.dll" ALIAS "_LcbGetCopyListCost@12" (ByVal szExtraList$, ByVal szCostList$, ByVal szNeedList$) AS LONG
  1372. DECLARE PUBLIC FUNCTION FAddToBillboardList LIB "lcomstf.dll" ALIAS "_FAddToBillboardList@16" (ByVal szDll$, ByVal idDlg&, ByVal szProc$, ByVal lTicks&) AS LONG
  1373. DECLARE PUBLIC FUNCTION FClearBillboardList LIB "lcomstf.dll" ALIAS "_FClearBillboardList@0" () AS LONG
  1374. DECLARE PUBLIC FUNCTION SetCopyMode LIB "lcomstf.dll" ALIAS "_SetCopyMode@4" (ByVal fMode&) AS LONG
  1375. DECLARE PUBLIC FUNCTION GetCopyMode LIB "lcomstf.dll" ALIAS "_GetCopyMode@0" () AS LONG
  1376. DECLARE PUBLIC FUNCTION SetSizeCheckMode LIB "lcomstf.dll" ALIAS "_SetSizeCheckMode@4" (ByVal scmMode&) AS LONG
  1377. DECLARE PUBLIC FUNCTION LcbGetInfSectionSize LIB "lcomstf.dll" ALIAS "_LcbGetInfSectionSize@4" (ByVal szSect$)  AS LONG
  1378. DECLARE PUBLIC FUNCTION FSetSilent LIB "lcomstf.dll" ALIAS "_FSetSilent@4" (ByVal mode&) AS LONG
  1379. DECLARE PUBLIC FUNCTION ReadSerialNumber LIB "lcomstf.dll" ALIAS "_ReadSerialNumber@8" (ByVal szSrc$,ByVal szSerial$) AS LONG
  1380. DECLARE PUBLIC FUNCTION WriteUserRegistration LIB "lcomstf.dll" ALIAS "_WriteUserRegistration@16" (ByVal szRi$,ByVal szUser$,ByVal szCompany$,ByVal szSerial$) AS LONG
  1381. DECLARE PUBLIC FUNCTION ReadUserRegistration LIB "lcomstf.dll" ALIAS "_ReadUserRegistration@16" (ByVal szRi$,ByVal szUser$,ByVal szCompany$,ByVal szSerial$) AS LONG
  1382. DECLARE PUBLIC FUNCTION FPopulateLCB LIB "lcomstf.dll" ALIAS "_FPopulateLCB@8" (ByVal hDlg&,ByVal Chapter$) AS LONG
  1383. DECLARE PUBLIC FUNCTION FSetDateOfFile LIB "lcomstf.dll" ALIAS "_FSetDateOfFile@8" (ByVal szFile$,ByVal szDate$) AS LONG
  1384. DECLARE PUBLIC FUNCTION FGetFirstChild LIB "lcomstf.dll" ALIAS "_FGetFirstChild@12" (ByVal szChapter$,ByVal szFirsthapter$, ByVal nField&) AS LONG
  1385. DECLARE PUBLIC FUNCTION FGetFirst LIB "lcomstf.dll" ALIAS "_FGetFirst@12" (ByVal szChapter$,ByVal szFirsthapter$, ByVal nField&) AS LONG
  1386. DECLARE PUBLIC FUNCTION FGetChapterValStr LIB "lcomstf.dll" ALIAS "_FGetChapterValStr@16" (ByVal szChapter$,ByVal nField&, ByVal szBuf$,ByVal cbBuf&) AS LONG
  1387. DECLARE PUBLIC FUNCTION FGetChapterValInt LIB "lcomstf.dll" ALIAS "_FGetChapterValInt@12" (ByVal szChapter$,ByVal nField&, lpVal&) AS LONG
  1388. DECLARE PUBLIC FUNCTION FGetNextSibling LIB "lcomstf.dll" ALIAS "_FGetNextSibling@12" (ByVal szChapter$,ByVal szNextChapter$,ByVal nField&) AS LONG
  1389. DECLARE PUBLIC FUNCTION FGetNextChild LIB "lcomstf.dll" ALIAS "_FGetNextChild@4" (ByVal szNextChildChapter$) AS LONG
  1390. DECLARE PUBLIC FUNCTION FGetNext LIB "lcomstf.dll" ALIAS "_FGetNext@4" (ByVal szNextChapter$) AS LONG
  1391. DECLARE PUBLIC FUNCTION FToggleChapterFilesInCopyList LIB "lcomstf.dll" ALIAS "_FToggleChapterFilesInCopyList@4" (ByVal szChapter$) AS LONG
  1392. DECLARE PUBLIC FUNCTION LcbGetInfChapterSize LIB "lcomstf.dll" ALIAS "_LcbGetInfChapterSize@4" (ByVal szChapter$)  AS LONG
  1393. DECLARE PUBLIC FUNCTION FInitializeCopyList LIB "lcomstf.dll" ALIAS "_FInitializeCopyList@12" (ByVal szChpt$, ByVal szSourcedir$, ByVal nField&) AS LONG
  1394. DECLARE PUBLIC FUNCTION FRefreshDestination LIB "lcomstf.dll" ALIAS "_FRefreshDestination@4" (ByVal lpszSym$) AS LONG 
  1395. DECLARE PUBLIC FUNCTION FWriteDestinationSymAndVal LIB "lcomstf.dll" ALIAS "_FWriteDestinationSymAndVal@8" (ByVal lpszIniFile$,ByVal lpszIniSec$) AS LONG 
  1396. DECLARE PUBLIC FUNCTION FSetRestartDir LIB "lcomstf.dll" ALIAS "_FSetRestartDir@4" (ByVal szDir$) AS LONG
  1397. DECLARE PUBLIC FUNCTION FRestartListEmpty LIB "lcomstf.dll" ALIAS "_FRestartListEmpty@0" () AS LONG
  1398. DECLARE PUBLIC FUNCTION FExitExecRestart LIB "lcomstf.dll" ALIAS "_FExitExecRestart@0" () AS LONG
  1399. DECLARE PUBLIC FUNCTION Lot_CreateConsoleProcess LIB "lcomstf.dll" ALIAS "_Lot_CreateConsoleProcess@8" (ByVal lpExeName$, ByVal lpCommandLine$) AS INTEGER
  1400. DECLARE PUBLIC FUNCTION FGetSectionFileList LIB "lcomstf.dll" ALIAS "_FGetSectionFileList@12" (ByVal lpszSym$, ByVal lpszSection$, ByVal RenameFlag%) AS INTEGER
  1401.  
  1402. '****************  Tabs UI Declarations  *********************************
  1403.  
  1404. DECLARE PUBLIC FUNCTION DriveType LIB "mscuistf.dll" ALIAS "_DriveType@4" (ByVal drivetype&) AS LONG
  1405. DECLARE PUBLIC FUNCTION RegisterFunction LIB "mscuistf.dll"  ALIAS "_RegisterFunction@12" (ByVal sess&, ByVal modname$, ByVal fname$) AS INTEGER
  1406. DECLARE PUBLIC FUNCTION NotebookAddDlgPage LIB "mscuistf.dll" ALIAS "_NotebookAddDlgPage@24" (ByVal  hDlg&,_
  1407.      ByVal idNotebook&, ByVal  idDlg&, ByVal lpszDllName$, ByVal lpszDlgProc$,_
  1408.      ByVal lpszTab$) AS LONG
  1409. DECLARE PUBLIC FUNCTION FNotebookPageView LIB "mscuistf.dll" ALIAS "_FNotebookPageView@16" (ByVal hDlg&,_
  1410.             ByVal idNotebook&, ByVal  idDlg&, ByVal fShowPage&) AS LONG
  1411. DECLARE PUBLIC FUNCTION FNotebookTurnToPage LIB "mscuistf.dll" ALIAS "_FNotebookTurnToPage@12" (ByVal hDlg&,ByVal idNotebook&,ByVal id&) AS LONG
  1412. DECLARE PUBLIC FUNCTION NotebookGetPageHwnd LIB "mscuistf.dll" ALIAS "_NotebookGetPageHwnd@12" (ByVal hDlg&,ByVal idNotebook&,ByVal idPage&) AS LONG
  1413. DECLARE PUBLIC SUB      LCBResetContent LIB "mscuistf.dll" ALIAS "_LCBResetContent@4" (ByVal hDlg&)
  1414. DECLARE PUBLIC SUB      LCBSetRedraw LIB "mscuistf.dll" ALIAS "_LCBSetRedraw@8" (ByVal hDlg&, ByVal fRedraw&)
  1415. DECLARE PUBLIC FUNCTION LCBGetCount LIB "mscuistf.dll" ALIAS "_LCBGetCount@4" (ByVal hDlg&) AS LONG
  1416. DECLARE PUBLIC FUNCTION LCBAddItem LIB "mscuistf.dll" ALIAS "_LCBAddItem@8" (ByVal hDlg&, ByVal item$) AS LONG
  1417. DECLARE PUBLIC FUNCTION LCBReplaceItem LIB "mscuistf.dll" ALIAS "_LCBReplaceItem@16" (ByVal hDlg&, ByVal index&, ByVal itemnum&, ByVal item$) AS LONG
  1418. DECLARE PUBLIC FUNCTION LCBGetItem LIB "mscuistf.dll" ALIAS "_LCBGetItem@20" (ByVal hDlg&, ByVal index&, ByVal itemnum&, ByVal item$, ByVal itemmax&) AS LONG
  1419. DECLARE PUBLIC FUNCTION LCBToggleItem LIB "mscuistf.dll" ALIAS "_LCBToggleItem@8" (ByVal hDlg&, ByVal index&) AS LONG
  1420. DECLARE PUBLIC SUB      LCBSetSel LIB "mscuistf.dll" ALIAS "_LCBSetSel@8" (ByVal hDlg&, ByVal index&) 
  1421. DECLARE PUBLIC SUB      LCBSetTabs LIB "mscuistf.dll" ALIAS "_LCBSetTabs@20" (ByVal hDlg&, ByVal t1&,ByVal t2&,ByVal t3&,ByVal t4&)
  1422. DECLARE PUBLIC FUNCTION FGetDriveFreeSpaceList LIB "mscuistf.dll" ALIAS "_FGetDriveFreeSpaceList@4" (ByVal szSymbol$) AS LONG
  1423.  
  1424. '** UNC stuff
  1425. DECLARE PUBLIC FUNCTION FAddToDriveFreeSpaceList LIB "mscuistf.dll" ALIAS "_FAddToDriveFreeSpaceList@8" (ByVal szSymbol$,ByVal szNewItem$) AS LONG
  1426. DECLARE PUBLIC FUNCTION FIsUnvalidatedUNCPath LIB "mscuistf.dll" ALIAS "_FIsUnvalidatedUNCPath@4" (ByVal szPath$) AS LONG
  1427. DECLARE PUBLIC FUNCTION FIsValidUNCPath LIB "mscuistf.dll" ALIAS "_FIsValidUNCPath@4" (ByVal szPath$) AS LONG
  1428. DECLARE PUBLIC FUNCTION FGetGroupName LIB "mscuistf.dll" ALIAS "_FGetGroupName@12" (ByVal szGroupFileName$, ByVal szBuf$,ByVal cbBuf&) AS LONG
  1429. DECLARE PUBLIC FUNCTION RemovePriorVersion(ProdRegKeyName$,ProdVer$) AS INTEGER
  1430.  
  1431. '*************** Wrappers for MS functions that Lotus re-wrote **************
  1432.  
  1433. DECLARE PUBLIC SUB      ReadInfFile (szFile$)
  1434. DECLARE PUBLIC SUB      MakeListFromSectionKeys (szSymbol$, szSect$)
  1435. DECLARE PUBLIC SUB      MakeListFromSectionDate (szSym$, szSect$)
  1436. DECLARE PUBLIC SUB      MakeListFromSectionFilename (szSym$, szSect$)
  1437. DECLARE PUBLIC SUB      MakeListFromSectionSize (szSym$, szSect$)
  1438. DECLARE PUBLIC SUB      MakeListFromSectionVersion (szSym$, szSect$)
  1439. DECLARE PUBLIC FUNCTION SetSilentMode (mode%) AS INTEGER
  1440. DECLARE PUBLIC FUNCTION SetBeepingMode (mode%) AS INTEGER
  1441. DECLARE PUBLIC FUNCTION GetSectionKeyDate (szSect$, szKey$) AS STRING
  1442. DECLARE PUBLIC FUNCTION GetSectionKeyFilename (szSect$, szKey$) AS STRING
  1443. DECLARE PUBLIC FUNCTION GetSectionKeySize (szSect$, szKey$) AS LONG
  1444. DECLARE PUBLIC FUNCTION GetSectionKeyVersion (szSect$, szKey$) AS STRING
  1445. DECLARE PUBLIC SUB      RemoveDir (szDir$, cmo%)
  1446. DECLARE PUBLIC SUB      DumpCopyList (szFile$)
  1447. DECLARE PUBLIC SUB      ClearCopyList
  1448. DECLARE PUBLIC FUNCTION GetCopyListCost (szExtraList$, szCostList$, szNeedList$) AS LONG
  1449. DECLARE PUBLIC SUB      CopyFilesInCopyList
  1450. DECLARE PUBLIC SUB      AddSectionFilesToCopyList (szSect$, szSrc$, szDest$)
  1451. DECLARE PUBLIC SUB      AddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$)
  1452. DECLARE PUBLIC SUB      AddToBillboardList (szDll$, idDlg&, szProc$, lTicks&)
  1453. DECLARE PUBLIC SUB      AddBlankToBillboardList (lTicks&)
  1454. DECLARE PUBLIC SUB      ClearBillboardList
  1455. DECLARE PUBLIC SUB      SetCopyGaugePosition (x%, y%)
  1456. DECLARE PUBLIC SUB      SetRestartDir(szDir$)
  1457. DECLARE PUBLIC FUNCTION RestartListEmpty AS INTEGER
  1458. DECLARE PUBLIC FUNCTION ExitExecRestart AS INTEGER
  1459.  
  1460. '** Utility functions
  1461.  
  1462. DECLARE PUBLIC FUNCTION GetAbsPathFromIni(szFile$,szSect$,szKey$,nullflag%,invalidpathflag%) AS STRING
  1463. DECLARE PUBLIC FUNCTION MakePath (szDir$, szFile$) AS STRING
  1464. DECLARE PUBLIC SUB      ShowPathError (nmsg%, nDescription%, szPath$)
  1465. DECLARE PUBLIC SUB      ShowPathErrorNoDlgExit (nmsg%, nDescription%, szPath$)
  1466. DECLARE PUBLIC FUNCTION IsPathWritable (szPath$) AS INTEGER
  1467. DECLARE PUBLIC FUNCTION ValidatePath (szPath$) AS INTEGER
  1468. DECLARE PUBLIC FUNCTION RegisterCallback (ReturnStr$, FuncName$) AS INTEGER
  1469. DECLARE PUBLIC FUNCTION PopupModalDlg (Dlg%, HelpID&) AS STRING
  1470. DECLARE PUBLIC FUNCTION PopupModelessDlg (Dlg%, HelpID&) AS STRING
  1471. DECLARE PUBLIC FUNCTION SelectDriveCombo (ComboID$, path$) AS INTEGER
  1472. DECLARE PUBLIC FUNCTION CheckForSpace (DlgId%) AS INTEGER
  1473. DECLARE PUBLIC SUB      QUIT
  1474. DECLARE PUBLIC SUB      Lot_WriteDestinationSymAndVal(IniFileName$,IniSection$) 
  1475. DECLARE PUBLIC SUB      Lot_WriteCriticalDirectories (InstallIniFile$)
  1476. DECLARE PUBLIC FUNCTION Lot_WriteToRiFile (ripath$) AS INTEGER
  1477. DECLARE PUBLIC FUNCTION Lot_ReadDefaultsfromRi (default_ripath$) AS INTEGER
  1478. DECLARE PUBLIC FUNCTION Lot_AreShareToolsSupported () AS INTEGER
  1479. DECLARE PUBLIC FUNCTION Lot_AreShare32ToolsSupported () AS INTEGER
  1480. DECLARE PUBLIC FUNCTION Lot_CallSharedTool (func$) AS INTEGER
  1481. DECLARE PUBLIC FUNCTION GetNotesPathfromLotusIni() AS STRING
  1482. DECLARE PUBLIC FUNCTION IsNotesInPath() AS INTEGER
  1483. DECLARE PUBLIC FUNCTION IsShareInAUTOEXEC() AS INTEGER
  1484. DECLARE PUBLIC FUNCTION ModifyAutoexec(modflag%,directmod%,backup$) AS STRING
  1485. DECLARE PUBLIC FUNCTION GetBootDrive() AS STRING
  1486. DECLARE PUBLIC FUNCTION Lot_GetLotusNotesDataPath() AS STRING
  1487. DECLARE PUBLIC FUNCTION Lot_GetORACLEHomePath() AS STRING
  1488. DECLARE PUBLIC FUNCTION Lot_GetLotusNotesPrgPath() AS STRING
  1489. 'DECLARE PUBLIC FUNCTION GetLotusNotesDataPath(szFile$, szSect$, szKey$) AS STRING
  1490. DECLARE PUBLIC SUB      DL_SetOraclePath
  1491. DECLARE PUBLIC SUB      DL_SetNotesDataPath
  1492. DECLARE PUBLIC FUNCTION TrimNetlotusapp (ByVal path$) AS STRING
  1493. DECLARE PUBLIC FUNCTION GetLastPathComponent( ByVal szPath$) AS STRING
  1494. DECLARE PUBLIC SUB ComboSelChanged(BoxNo&, Inst%)
  1495. DECLARE PUBLIC FUNCTION GetPathFromComboEdit(hDlg&,BoxNo%) AS STRING
  1496. DECLARE PUBLIC FUNCTION OneUp(s$) AS STRING
  1497.  
  1498.  
  1499. '** Lotus functions
  1500.  
  1501. DECLARE PUBLIC FUNCTION Lot_GetLocalHardDrive (ProdSize&,DefaultDir$) AS STRING
  1502. DECLARE PUBLIC FUNCTION Lot_GetNetHardDrive (ProdSize&,DefaultDir$) AS STRING
  1503. DECLARE PUBLIC FUNCTION Lot_GetAllHardDrive(ProdSize&,DefaultDir$) AS STRING
  1504. DECLARE PUBLIC FUNCTION Lot_Dir  (szDir$) AS STRING
  1505. DECLARE PUBLIC FUNCTION Lot_GetChapterFromKeyword (szKeyword$) AS STRING
  1506. DECLARE PUBLIC FUNCTION Lot_CallProductFunctions (func_name$, BYVAL direction$, always%, back$, parms$) AS STRING
  1507. DECLARE PUBLIC FUNCTION Lot_CallOneProductFunction (prodno%, func_name$, BYVAL direction$, always%, parms$) AS STRING
  1508. DECLARE PUBLIC FUNCTION Lot_CheckPath (path$) AS INTEGER
  1509. DECLARE PUBLIC FUNCTION Lot_GetInfSectionSize (szSect$)  AS LONG
  1510. DECLARE PUBLIC SUB      Lot_RemoveSectionFilesFromCopyList (szSect$)
  1511. DECLARE PUBLIC SUB      Lot_RemoveSectionKeyFileFromCopyList (szSect$, szKey$)
  1512. DECLARE PUBLIC FUNCTION Lot_SetDateOfFile (szFile$, szDate$) AS INTEGER
  1513. DECLARE PUBLIC FUNCTION Lot_GetFirst (szChapt$, nFlag%) AS STRING
  1514. DECLARE PUBLIC FUNCTION Lot_GetNext () AS STRING
  1515. DECLARE PUBLIC FUNCTION Lot_AddPagetoNotebook (hDlg&,  Notebookid&, DlgId%,Tabstring$) AS INTEGER
  1516. DECLARE PUBLIC FUNCTION Lot_NotebookPageView (hDlg&,  Notebookid&, DlgId%, fShowPage%) AS INTEGER
  1517. DECLARE PUBLIC SUB      Lot_TurnToPage (hDlg&,Notebookid&, pageid%) 
  1518. DECLARE PUBLIC FUNCTION Lot_GetPagehandle  (hDlg&,Notebookid&,Pageid%) AS LONG
  1519. DECLARE PUBLIC SUB      Lot_LCBResetContent     (hDlg&)
  1520. DECLARE PUBLIC SUB      Lot_LCBSetRedraw        (hDlg&, fRedraw%)
  1521. DECLARE PUBLIC FUNCTION Lot_LCBGetCount    (hDlg&) AS INTEGER
  1522. DECLARE PUBLIC FUNCTION Lot_LCBAddItem     (hDlg&, item$) AS INTEGER
  1523. DECLARE PUBLIC FUNCTION Lot_LCBReplaceItem (hDlg&, index%, itemnum%, item$) AS INTEGER
  1524. DECLARE PUBLIC FUNCTION Lot_LCBGetItem     (hDlg&, index%, itemnum%) AS STRING
  1525. DECLARE PUBLIC FUNCTION Lot_LCBToggleItem  (hDlg&, index%) AS INTEGER
  1526. DECLARE PUBLIC SUB      Lot_LCBSetSel           (hDlg&, index%)
  1527. DECLARE PUBLIC SUB      Lot_LCBSetTabs           (hDlg&, t1%,t2%,t3%,t4%)
  1528. DECLARE PUBLIC FUNCTION Lot_GetFirstChild (szChapt$, nFlag%) AS STRING
  1529. DECLARE PUBLIC FUNCTION Lot_GetChapterValStr (szChapter$, nField%) AS STRING  
  1530. DECLARE PUBLIC FUNCTION Lot_GetChapterValInt (szChapter$,nField%) AS INTEGER  
  1531. DECLARE PUBLIC FUNCTION Lot_GetNextSibling (szChapter$,nField%) AS STRING
  1532. DECLARE PUBLIC FUNCTION Lot_GetNextChild () AS STRING
  1533. DECLARE PUBLIC FUNCTION Lot_GetInfChapterSize (szChapter$)  AS LONG
  1534. DECLARE PUBLIC SUB      Lot_ToggleChapterFilesInCopyList (szChapter$)  
  1535. DECLARE PUBLIC FUNCTION Lot_SetChapterFilesInCopyListInOrOut (szChapter$, InOrOut%)  AS INTEGER
  1536. DECLARE PUBLIC SUB      Lot_InitializeCopyList (chpt$, nField%) 
  1537. DECLARE PUBLIC SUB      Lot_RefreshDestination (symbol$) 
  1538. DECLARE PUBLIC SUB      Lot_GetDriveFreeSpaceList (szSymbol$)
  1539. DECLARE PUBLIC FUNCTION Lot_GetSharedToolsSize() AS INTEGER
  1540. DECLARE PUBLIC FUNCTION Lot_GetShared32ToolsSize() AS INTEGER
  1541. DECLARE PUBLIC FUNCTION Lot_MakeSizeString (size AS LONG) AS STRING
  1542. DECLARE PUBLIC FUNCTION Lot_ExtractDriveLetter (destdir$) AS STRING
  1543. DECLARE PUBLIC FUNCTION Lot_ExtractDirectory (destdir$) AS STRING
  1544. DECLARE PUBLIC FUNCTION Lot_GetGroupName ( szGroupFileName$) AS STRING  
  1545. DECLARE PUBLIC FUNCTION Lot_IsTheFeatureInstalled(s$) AS INTEGER
  1546. DECLARE PUBLIC FUNCTION Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  1547. DECLARE PUBLIC FUNCTION Lot_GetDestDirValueFromInstallini(DestDirSym$) AS STRING
  1548. DECLARE PUBLIC SUB Lot_InitializeWinWinsysSym () 
  1549. DECLARE PUBLIC SUB Lot_InitializeEXTRA ()
  1550. DECLARE PUBLIC FUNCTION Lot_IsDestVerNewerOrEqual(DestinationPath$,SourceVer1&,SourceVer2&,SourceVer3&,SourceVer4&) AS INTEGER
  1551. DECLARE PUBLIC SUB      Lot_CallWinhelp32 (prodno%, network$, SectionName$, DestDirSym$, FileName$) 
  1552. DECLARE PUBLIC SUB Lot_FixupSourceDirectories
  1553. DECLARE PUBLIC SUB MarkFixupSourceDirSymbol(szSubdirSymbol$)
  1554. DECLARE PUBLIC FUNCTION Lot_RegIni(RegFileName$) AS INTEGER
  1555. DECLARE PUBLIC SUB Lot_RegisterFonts()
  1556. DECLARE PUBLIC FUNCTION Lot_RegisterTypeLib(ID$, Version$, Description$, helppath$, filename$, flags%) AS INTEGER
  1557. DECLARE PUBLIC FUNCTION New_RegisterTypeLib(typelibname as string, helpdir as string) as long
  1558. DECLARE PUBLIC SUB IncrementSharedDLLCount(s$)
  1559. DECLARE PUBLIC SUB FixupSharedDLLCount(s$)
  1560. DECLARE PUBLIC FUNCTION Lot_RegisterOCX (OCXpath$) AS LONG
  1561. DECLARE PUBLIC FUNCTION Lot_RegisterOCX2 (FeatureKW$, OCXpath$) AS LONG
  1562. DECLARE PUBLIC FUNCTION Lot_RegisterREGTemplate(Keyword$, InFile$, OutFile$) AS INTEGER
  1563. DECLARE FUNCTION Lot_TranslateREGTemplate(InFile$, OutFile$) AS INTEGER
  1564.  
  1565. '** UNC stuff
  1566. DECLARE PUBLIC SUB Lot_SplitUNCPath (szFullPath$, szVol$, szDirPath$)
  1567. DECLARE PUBLIC FUNCTION Lot_AddToDriveFreeSpaceList (szSymbol$, szNewItem$) AS LONG
  1568. DECLARE PUBLIC FUNCTION Lot_IsUnvalidatedUNCPath (szPath$) AS LONG
  1569. DECLARE PUBLIC FUNCTION Lot_IsValidUNCPath (szPath$) AS LONG
  1570. DECLARE PUBLIC FUNCTION FMapUNCVolume LIB "mscuistf.dll" ALIAS "_FMapUNCVolume@8" (ByVal szUNCRoot$, ByVal szDrive$) AS LONG
  1571. DECLARE PUBLIC FUNCTION FUnmapUNCVolume LIB "mscuistf.dll" ALIAS "_FUnmapUNCVolume@4" (ByVal szDrive$) AS LONG
  1572. DECLARE PUBLIC FUNCTION ValidateEditBox (hDlg&, Ctrl%) AS INTEGER
  1573. DECLARE PUBLIC FUNCTION ValidateBrowse (hDlg&, Ctrl%) AS INTEGER
  1574. '** end UNC stuff
  1575.  
  1576. 'Registration functions moved to REGISTER.LSS
  1577.  
  1578. DECLARE PUBLIC FUNCTION Lot_GetCurrentProduct() AS INTEGER
  1579. DECLARE PUBLIC SUB      Lot_SetCurrentProduct(ProdNo%) 
  1580. DECLARE PUBLIC FUNCTION Lot_GetInstallDir() AS STRING
  1581. DECLARE PUBLIC FUNCTION Lot_GetTheRealProdDir(prodno%) AS STRING
  1582. DECLARE PUBLIC FUNCTION Lot_Readserialnumber () AS INTEGER
  1583. DECLARE PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstallIni() AS INTEGER
  1584. DECLARE PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstNodeIni() AS INTEGER
  1585. DECLARE PUBLIC FUNCTION Lot_SaveTheNodeOptionsInInstallIni() AS INTEGER
  1586. DECLARE PUBLIC FUNCTION Lot_IsTheNodeOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  1587. DECLARE PUBLIC FUNCTION Lot_AreAnyNodeOptionsAvail() AS INTEGER
  1588. DECLARE PUBLIC FUNCTION Lot_IsAnyNodeOptAvailToNode()AS INTEGER
  1589. DECLARE PUBLIC FUNCTION Lot_AreNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  1590. DECLARE PUBLIC FUNCTION Lot_GetNumOfNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  1591. DECLARE PUBLIC FUNCTION Lot_AreAnyNodeOptAvailToSrv() AS INTEGER
  1592. DECLARE PUBLIC SUB Lot_TurnOffAllNodeOptSections()
  1593. DECLARE PUBLIC FUNCTION Lot_SaveTheCDOptionsInInstallIni() AS INTEGER
  1594. DECLARE PUBLIC FUNCTION Lot_IsTheCDOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  1595. DECLARE PUBLIC FUNCTION Lot_IsAnyCDOptAvailToNode()AS INTEGER
  1596. DECLARE PUBLIC FUNCTION Lot_AreCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  1597. DECLARE PUBLIC FUNCTION Lot_GetNumOfCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  1598. DECLARE PUBLIC FUNCTION Lot_AreAnyCDOptAvailToSrv() AS INTEGER
  1599.  
  1600. '** Win95 uninstaller functions
  1601. DECLARE PUBLIC FUNCTION Lot_RegisterUninstaller(ProdRegKeyName$,ProdVer$,_
  1602.                         ProdDisplayedName$,ProdInfPath$,_
  1603.                         LogFlag%,AutoFlag%,_
  1604.                         LangID$,LogFile$,RspFile$,_
  1605.                         UserName$ ) AS INTEGER
  1606. DECLARE PUBLIC FUNCTION Lot_RegisterObject(FeatureKeyWord$,ClassOfObject$,_
  1607.                          ObjectPath$)
  1608.  
  1609. '** Resource splitting functions
  1610.  
  1611. DECLARE PUBLIC FUNCTION FindResourceinDLL (idDlg&, ResType%) AS STRING
  1612.  
  1613. '** Local functions
  1614.  
  1615. DECLARE PUBLIC SUB DisplayWhenSpaceIsTight(szCost$,szNeed$)
  1616. DECLARE FUNCTION Lot_GetLastFeatureNumber() AS INTEGER
  1617. DECLARE FUNCTION Lot_GetLastNodeOptNumber(s$) AS INTEGER
  1618. DECLARE FUNCTION Lot_GetLastCDOptNumber(s$) AS INTEGER
  1619. 'Don't make this generally available
  1620. DECLARE FUNCTION AddFontResource LIB "gdi32" alias "AddFontResourceA" (ByVal szFFile$) AS INTEGER
  1621. DECLARE SUB CinstallIniError(IniFile$, lineno%)  
  1622.  
  1623. '** Local globals
  1624.  
  1625. PUBLIC gEndStatementEncountered% ' TRUE when END statement encountered
  1626.  
  1627. '**************************************************************************
  1628.  
  1629. SUB INITIALIZE
  1630. '** Purpose:   Sets the begining of the Product registration array
  1631. '** Arguments:
  1632. '*************************************************************************
  1633.  gCurrNumOfProds% = 0
  1634.  gCurrentProduct% = 1
  1635.  
  1636. ' Set this TRUE for debugging output, FALSE for release
  1637.     ToolkitDebug% = TRUE
  1638.  
  1639. ' Moved from main because of symbol initialization in early LdString calls
  1640.  
  1641.     ON Error STFQUIT    GOTO MAINERROR
  1642.     ON Error STFERR     GOTO STFERR_
  1643.     ON Error STFTOGGLE  GOTO STFTOGGLEERR
  1644.  
  1645.     ToolKitInitalizeError& = 0
  1646.     SetUpAPI
  1647.  
  1648.     EXIT SUB
  1649.  
  1650. MAINERROR:
  1651.     ToolKitInitalizeError& = STFQUIT
  1652.     EXIT SUB
  1653.         
  1654. STFERR_:
  1655.     ToolKitInitalizeError& = STFERR
  1656.     EXIT SUB
  1657.  
  1658. STFTOGGLEERR:
  1659.     ToolKitInitalizeError& = STFTOGGLE
  1660.  
  1661. END SUB
  1662.  
  1663. PUBLIC FUNCTION Lot_GetSharedToolsSize() AS INTEGER
  1664. '** Purpose:
  1665. '**     Gets the size of the shared tools in Kb
  1666. '** Arguments:
  1667. '** Returns:
  1668. '**     the size or 0
  1669. '*************************************************************************
  1670.     DIM CurrChpt$, SharedID$, ShareSize&
  1671.  
  1672.     CurrChpt$ = Lot_GetFirst("", F_SHARE+F_INOROUT) 
  1673.     WHILE (CurrChpt$ <> "")
  1674.         SharedID$ = Lot_GetChapterValStr(CurrChpt$, F_SHARE)   
  1675.         IF SharedID$="IVCPROGRAM" OR _
  1676.      SharedID$="CONTAINERFILEPROGRAM" OR _
  1677.      SharedID$="DATALENSPROGRAM" OR _
  1678.      SharedID$="DATALENSDATA" OR _
  1679.      SharedID$="DIALOGEDITORPROGRAM" OR _
  1680.      SharedID$="DESKTOP" OR _
  1681.      SharedID$="DOCUMENTFILEFILTERSPROGRAM" OR _
  1682.      SharedID$="DOCUMENTFILEFILTERSFILTER" OR _
  1683.      SharedID$="GRAMMARCHECKERPROGRAM" OR _
  1684.      SharedID$="GRAMMARCHECKERDATA" OR _
  1685.      SharedID$="GRAPHICFILEFILTERSPROGRAM" OR _
  1686.      SharedID$="HYPHENATIONPROGRAM" OR _
  1687.      SharedID$="HYPHENATIONDATA" OR _
  1688.      SharedID$="ICONPALETTEPROGRAM" OR _
  1689.      SharedID$="INFOBOXPROGRAM" OR _
  1690.      SharedID$="SCRIPTPROGRAM" OR _
  1691.      SharedID$="MULTIMEDIAPROGRAM" OR _
  1692.      SharedID$="MULTIMEDIADATA" OR _
  1693.      SharedID$="SPELLCHECKERPROGRAM" OR _
  1694.      SharedID$="SPELLCHECKERDATA" OR _
  1695.      SharedID$="SPELLCHECKERUSER" OR _
  1696.      SharedID$="STATUSBARPROGRAM" OR _
  1697.      SharedID$="THESAURUSPROGRAM" OR _
  1698.      SharedID$="THESAURUSDATA" OR _
  1699.      SharedID$="TOOLSPROGRAM" OR _
  1700.      SharedID$="TOOLSDATA" OR _
  1701.      SharedID$="USERNAMESERVICESPROGRAM" OR _
  1702.      SharedID$="FILTERS" OR _
  1703.      SharedID$="EXCELFLT" THEN
  1704.      
  1705.          ShareSize& = ShareSize&+Lot_GetInfChapterSize(CurrChpt$)
  1706.  
  1707.         END IF
  1708.  
  1709.         CurrChpt$ = Lot_GetNext() 
  1710.  
  1711.     WEND
  1712.  
  1713.     Lot_GetSharedToolsSize = INT(ShareSize&/1024)
  1714.  
  1715. 'testint% = INT(ShareSize& / 1024)
  1716. 'Lot_GetSharedToolsSize = testint%
  1717. 'DoMsgBox("testint%", STR$(testint%), MB_OK)
  1718.  
  1719. END FUNCTION
  1720.  
  1721.  
  1722. PUBLIC FUNCTION Lot_GetShared32ToolsSize() AS INTEGER
  1723. '** Purpose:
  1724. '**     Gets the size of the shared tools for Win32 in Kb
  1725. '** Arguments:
  1726. '** Returns:
  1727. '**     the size or 0
  1728. '*************************************************************************
  1729.     DIM CurrChpt$, SharedID$, ShareSize&
  1730.  
  1731.     CurrChpt$ = Lot_GetFirst("", F_SHARE+F_INOROUT) 
  1732.     WHILE (CurrChpt$ <> "")
  1733.         SharedID$ = Lot_GetChapterValStr(CurrChpt$, F_SHARE)   
  1734.         IF SharedID$="WIN32IVCPROGRAM" OR _
  1735.      SharedID$="WIN32CONTAINERFILEPROGRAM" OR _
  1736.      SharedID$="WIN32DATALENSPROGRAM" OR _
  1737.      SharedID$="WIN32DATALENSDATA" OR _
  1738.      SharedID$="WIN32DIALOGEDITORPROGRAM" OR _
  1739.      SharedID$="WIN32DESKTOP" OR _
  1740.      SharedID$="WIN32DOCUMENTFILEFILTERSPROGRAM" OR _
  1741.      SharedID$="WIN32DOCUMENTFILEFILTERSFILTER" OR _
  1742.      SharedID$="WIN32GRAMMARCHECKERPROGRAM" OR _
  1743.      SharedID$="WIN32GRAMMARCHECKERDATA" OR _
  1744.      SharedID$="WIN32GRAPHICFILEFILTERSPROGRAM" OR _
  1745.      SharedID$="WIN32HYPHENATIONPROGRAM" OR _
  1746.      SharedID$="WIN32HYPHENATIONDATA" OR _
  1747.      SharedID$="WIN32ICONPALETTEPROGRAM" OR _
  1748.      SharedID$="WIN32INFOBOXPROGRAM" OR _
  1749.      SharedID$="WIN32SCRIPTPROGRAM" OR _
  1750.      SharedID$="WIN32MULTIMEDIAPROGRAM" OR _
  1751.      SharedID$="WIN32MULTIMEDIADATA" OR _
  1752.      SharedID$="WIN32SPELLCHECKERPROGRAM" OR _
  1753.      SharedID$="WIN32SPELLCHECKERDATA" OR _
  1754.      SharedID$="WIN32SPELLCHECKERUSER" OR _
  1755.      SharedID$="WIN32STATUSBARPROGRAM" OR _
  1756.      SharedID$="WIN32THESAURUSPROGRAM" OR _
  1757.      SharedID$="WIN32THESAURUSDATA" OR _
  1758.      SharedID$="WIN32TOOLSPROGRAM" OR _
  1759.      SharedID$="WIN32TOOLSDATA" OR _
  1760.      SharedID$="WIN32USERNAMESERVICESPROGRAM" OR _
  1761.      SharedID$="WIN32FILTERS" OR _
  1762.      SharedID$="WIN32EXCELFLT" THEN
  1763.      
  1764.          ShareSize& = ShareSize&+Lot_GetInfChapterSize(CurrChpt$)
  1765.  
  1766.         END IF
  1767.  
  1768.         CurrChpt$ = Lot_GetNext() 
  1769.  
  1770.     WEND
  1771.  
  1772.     Lot_GetShared32ToolsSize = INT(ShareSize&/1024)
  1773.  
  1774. 'testint% = INT(ShareSize& / 1024)
  1775. 'Lot_GetSharedToolsSize = testint%
  1776. 'DoMsgBox("testint%", STR$(testint%), MB_OK)
  1777.  
  1778. END FUNCTION
  1779.  
  1780.  
  1781. '*********************************************************
  1782.  
  1783. PUBLIC FUNCTION GetAbsPathFromIni(szFile$,szSect$,szKey$,nullflag%,invalidpathflag%) AS STRING
  1784. '** Purpose: This function is called whenever we need to retrieve a string
  1785. '**           from .ini file. Function returns a clean path (path returned from
  1786. '**           FCleanFatPath.    
  1787. '** Author:    JKK
  1788. '** Arguments:  Name of the .ini file, section name in the .ini file, key we
  1789. '**             are searching for and two integer flags, nullflag% & invalidpath%.
  1790. '**             Function puts up two error messages based on the value of nullflag%, and 
  1791. '**             invalidpath. 
  1792. '** Returns:   Function either returns null or the value of the string.
  1793. '**     
  1794. '*************************************************************************
  1795.   DIM rstring$, rv%, errText$
  1796.  
  1797.     GetAbsPathFromIni = ""
  1798.     rstring$ = GetIniKeyString(szFile$, szSect$, szKey$)
  1799.     If rstring$ <> "" Then
  1800.  
  1801.         rv% = Lot_CleanPath(rstring$)
  1802.  
  1803.         'tqi - I believe this trim should no longer be necessary, but no harm to leave it 
  1804.         errText$ =  NullTrim(szFile$)
  1805.         if rv% <> 0 Then
  1806.      GetAbsPathFromIni = rstring$
  1807.         elseif invalidpathflag% <> FALSE then
  1808.  
  1809.      ErrorMsg SID_ERR_GETINIKEYSTRING, errText$
  1810.      ERROR STFQUIT
  1811.  
  1812.         end if 
  1813.  
  1814.     elseif nullflag% <> FALSE then
  1815.  
  1816.         ErrorMsg SID_ERR_GETINIKEYSTRING, errText$
  1817.         ERROR STFQUIT
  1818.  
  1819.     else
  1820.         GetAbsPathFromIni = ""
  1821.     end if
  1822.  
  1823. END FUNCTION
  1824.  
  1825. PUBLIC FUNCTION MakePath (szDir$, szFile$) AS STRING
  1826. '** Purpose:
  1827. '**     Appends a file name to the end of a directory path,
  1828. '**     inserting a backslash character as needed.
  1829. '** Arguments:
  1830. '**     szDir$  - full directory path (with optional ending "\")
  1831. '**     szFile$ - filename to append to directory
  1832. '** Returns:
  1833. '**     Resulting fully qualified path name. (Lower Case)
  1834. '*************************************************************************
  1835.     DIM sz$
  1836.  
  1837.     IF szDir$ = "" THEN
  1838.         sz$ = szFile$
  1839.     ELSEIF szFile$ = "" THEN
  1840.         sz$ = szDir$
  1841.     ELSEIF LENBP(szFile$) > 12 THEN
  1842.         IF LENBP(szFile$) = 13 AND RIGHT$(szFile$,1) = "\" THEN
  1843.       sz$ = szDir$ + szFile$
  1844.         ELSE      
  1845. '       sz$ = ""
  1846.             sz$ = szDir$ + "\" + szFile$
  1847.         END IF
  1848.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1849.         sz$ = szDir$ + szFile$
  1850.     ELSE
  1851.         sz$ = szDir$ + "\" + szFile$
  1852.     END IF
  1853.  
  1854.     IF sz$ <> "" THEN
  1855.         MakePath = LCASE$(sz$)
  1856.     ELSE
  1857.         MakePath = sz$
  1858.     END IF
  1859.  
  1860.     
  1861.  
  1862. END FUNCTION
  1863.  
  1864. PUBLIC FUNCTION Lot_MakeSizeString(size&) AS STRING
  1865. '** Purpose:
  1866. '** Author:
  1867. '** Arguments:
  1868. '** Returns:
  1869. '**     
  1870. '*************************************************************************
  1871.     Lot_MakeSizeString = STR$(size&) + gStrK$
  1872. END FUNCTION
  1873. '*************************************************************************
  1874.  
  1875. PUBLIC FUNCTION Lot_ExtractDriveLetter(destdir$) AS STRING
  1876. '** Purpose:
  1877. '** Author:
  1878. '** Arguments:
  1879. '** Returns:
  1880. '**     
  1881. '*************************************************************************
  1882.   Lot_ExtractDriveLetter = LCASE$(MID$(destdir$, 1, 1))
  1883. END FUNCTION
  1884. '*************************************************************************
  1885.  
  1886. PUBLIC FUNCTION Lot_ExtractDirectory(destdir$) AS STRING
  1887. '** Purpose:
  1888. '** Author:
  1889. '** Arguments:
  1890. '** Returns:
  1891. '**     
  1892. '*************************************************************************
  1893.   Lot_ExtractDirectory = LCASE$(MID$(destdir$, 3))
  1894. END FUNCTION
  1895. '*************************************************************************
  1896. PUBLIC SUB      Lot_CallWinhelp32 (prodno%, network$, SectionName$, DestDirSym$, FileName$) 
  1897. '** Purpose:Calls winhelp32 to build GIDs at reinstall.
  1898. '** Author:MZ
  1899. '** Arguments:prodno%, 
  1900. '                    network$, 
  1901. '                    SectionName$, 
  1902. '                    DestDirSym$, 
  1903. '                    FileName$
  1904. '*************************************************************************
  1905. DIM ExecError%,CopyDestDir$
  1906.     IF GetListItem(SYM_INSTALLKINDS$, prodno%) = gREINSTALL$ THEN
  1907.           IF network$ = gSTANDARD$ OR network$ = gNODE$ THEN
  1908.               IF (Lot_IsTheFeatureInstalled(SectionName$) = 1) THEN
  1909.                   'CopyDestDir$ = GetSymbolValue(DestDirSym$)
  1910.                   CopyDestDir$ = Lot_WhereIsFeature(prodno%, SectionName$, FileName$)
  1911.             '     ExecError% = WinExec ("winhlp32 -g "+CopyDestDir$+FileName$, SW_HIDE)
  1912.                   ExecError% = WinExec ("winhlp32 -g "+CopyDestDir$+FileName$, SW_SHOW)
  1913.               END IF
  1914.           END IF
  1915.     END IF
  1916. END SUB
  1917.  
  1918.  
  1919. '** UNC stuff
  1920.  
  1921.  
  1922. PUBLIC SUB Lot_SplitUNCPath (szFullPath$, szVol$, szDirPath$)
  1923. '** Purpose:Splits a string into a UNC volume and a directory path
  1924. '** Author:GJL
  1925. '** Arguments:A path string, a string for the UNC vol
  1926. '**             a string for the resulting dir path
  1927. '** Returns:If UNC vol is invalid szVol will be empty
  1928. '**     
  1929. '*************************************************************************
  1930.     DIM StrOff&, tmp&
  1931.  
  1932.     StrOff& = INSTR( szFullPath$, "\\" )
  1933.     IF StrOff = 1 THEN
  1934.         StrOff& = INSTR( MID$(szFullPath$, 3), "\" )
  1935.         IF StrOff > 0 THEN
  1936.     tmp& = StrOff + 3
  1937.     StrOff& = StrOff + 3
  1938.     StrOff& = INSTR( MID$(szFullPath$, tmp&), "\" ) - 1
  1939.     IF StrOff& > 0 THEN
  1940.         StrOff& = StrOff& + tmp&
  1941.         szVol$ = LEFT$(szFullPath$, StrOff& - 1)
  1942.         szDirPath$ = MID$(szFullPath$, StrOff)
  1943.     ELSE
  1944.         szVol$ = szFullPath$
  1945.         szDirPath = ""
  1946.     END IF
  1947.         ELSE 
  1948.     szVol$ = ""
  1949.     szDirPath = ""
  1950.         END IF
  1951.     ELSE
  1952.     szVol$ = ""
  1953.     szDirPath$ = szFullPath$       
  1954.     END IF
  1955. END SUB
  1956. '** end UNC stuff
  1957.  
  1958. PUBLIC SUB Lot_SplitAnyPath (szFullPath$, szVol$, szDirPath$)
  1959. '** Purpose:Splits a string into a volume and a directory path
  1960. '** Author:
  1961. '** Arguments:A path string, a string for the vol
  1962. '**             a string for the resulting dir path
  1963. '** Returns: Volume and directory
  1964. '**     
  1965. '*************************************************************************
  1966.  
  1967.     If Lot_IsUnvalidatedUNCPath(szFullPath$) Then
  1968.         Lot_SplitUNCPath szFullPath$, szVol$, szDirPath$
  1969.     Else
  1970.         szVol$ = LEFT$(szFullPath$, 2)
  1971.         szDirPath$ = MID$(szFullPath$,3)
  1972.     End If
  1973. END SUB
  1974.  
  1975. '***********************************************************************
  1976. PUBLIC FUNCTION Lot_GetVol (szFullPath$)
  1977. '**  Description:  
  1978. '**      Return the volume whether it is UNC or local.
  1979. '**    
  1980. '**  Explicit Parameters:
  1981. '**      szFullPath$    The path from which to extract the path.
  1982. '**
  1983. '**  Implicit Parameters:
  1984. '**  Returns:  The volume.
  1985. '***********************************************************************
  1986.  
  1987.  
  1988.     DIM szVol$, szDirPath$
  1989.  
  1990.     Lot_SplitAnyPath szFullPath$, szVol$, szDirPath$
  1991.  
  1992.     Lot_GetVol = szVol$
  1993. END FUNCTION
  1994.  
  1995. '***********************************************************************
  1996. '**
  1997. '**  Name: ShowPathError
  1998. '**  Description:  
  1999. '**      Display a path error
  2000. '**    
  2001. '**  Explicit Parameters:
  2002. '**   nmsg&          The error message number to display. Use 0 if none
  2003. '**   nDescription%  The description of the message
  2004. '**   szPath$        The path with the problem
  2005. '**
  2006. '**  Out symbols:
  2007. '**    
  2008. '**  Implicit Parameters:
  2009. '**    
  2010. '***********************************************************************
  2011.  
  2012. PUBLIC SUB ShowPathError (nmsg%, nDescription%, szPath$)
  2013.     DIM sz$
  2014.  
  2015.     sz$ = CHR$(10) + CHR$(10) + "     " + szPath$
  2016.     sz$ = NullTrim$(sz$)
  2017.     IF nDescription% <> 0 THEN
  2018.         sz$ = sz$ + CHR$(10) + CHR$(10) + LdString(nDescription%)
  2019.     END IF
  2020.     ErrorMsg nmsg%, sz$
  2021.  
  2022. END SUB
  2023.  
  2024. '***********************************************************************
  2025. '**
  2026. '**  Name: ShowPathErrorNoDlgExit
  2027. '**  Description:  
  2028. '**      Display a path error and tell the dialog not to exit
  2029. '**    
  2030. '**  Explicit Parameters:
  2031. '**   nmsg&          The error message number to display. Use 0 if none
  2032. '**   nDescription&  The description of the message
  2033. '**   szPath$        The path with the problem
  2034. '**
  2035. '**  Out symbols:
  2036. '**   __LASTSTATUS   Set to "Q" to tell script not to quit   
  2037. '**    
  2038. '**  Implicit Parameters:
  2039. '**    
  2040. '***********************************************************************
  2041.  
  2042. PUBLIC SUB ShowPathErrorNoDlgExit (nmsg%, nDescription%, szPath$)
  2043.  
  2044.     ShowPathError nmsg%, nDescription%, szPath$
  2045.     SetListItem "__LASTSTATUS", 1, "Q"
  2046.  
  2047. END SUB
  2048.  
  2049. '***********************************************************************
  2050. '**
  2051. '**  Name: IsPathWritable
  2052. '**  Description:  
  2053. '**      Determine if we can write to a path.
  2054. '**    
  2055. '**  Explicit Parameters:
  2056. '**      szPath$     Pathname with no filename.
  2057. '**
  2058. '**  Out symbols:
  2059. '**    
  2060. '**  Implicit Parameters:
  2061. '**
  2062. '**  Returns: 1 if path is writable
  2063. '**    
  2064. '***********************************************************************
  2065.  
  2066.  
  2067. PUBLIC FUNCTION IsPathWritable (szPath$) AS INTEGER
  2068.  
  2069.     DIM sz$, cb%, i%, j%
  2070.  
  2071.     '** We can't check if the path is writable if the syntax is bad
  2072.     IsPathWritable = 0
  2073.      sz$=szPath$
  2074.     IF Lot_CheckPath(szPath$) <> FALSE THEN
  2075.         '** Strip any trailing backslash
  2076.         IF cb% > 3 AND RIGHT$(sz$,1) = "\" THEN
  2077.      cb% = LEN(sz$)
  2078.      sz$ = MID$(sz$,1,(cb%-1))
  2079.         END IF
  2080.  
  2081.         '** Back through the directories until we find a directory that exists
  2082.         DO
  2083.      '** If the directory exists then return if the directory is writable
  2084.      IF LEN(sz$) <= 3 OR DoesDirExist(sz$) = 1 THEN
  2085.          IsPathWritable = IsDirWritable(sz$)
  2086.          IF IsPathWritable = FALSE THEN
  2087.                   SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_DIR_READONLY)
  2088.                 END IF
  2089.          EXIT DO
  2090.      END IF
  2091.  
  2092.      '** If dir does not exists then strip off the last dir and try again
  2093.      i% = INSTR(sz$,"\")
  2094.      IF i% = 0 THEN EXIT DO
  2095.      DO
  2096.          j% = INSTR((i%+1),sz$,"\")
  2097.          IF j% = 0 THEN
  2098.              IF i% = 3 THEN
  2099.           sz$ = MID$(sz$,1,3)        '** Handle root special
  2100.              ELSE
  2101.           sz$ = MID$(sz$,1,(i%-1))   '** Strip last directory
  2102.              END IF
  2103.              EXIT DO
  2104.          END IF
  2105.          i% = j%
  2106.      LOOP
  2107.         LOOP
  2108.     END IF
  2109. END FUNCTION
  2110.  
  2111. '***********************************************************************
  2112. '**
  2113. '**  Name: ValidatePath
  2114. '**  Description:  
  2115. '**      Determine if path is valid and display errors
  2116. '**
  2117. '**      THIS FUNCTION SHOULD ONLY BE USED FOR DESTINATION PATHS!!!
  2118. '**    
  2119. '**  Explicit Parameters:
  2120. '**      szPath$     Pathname with no filename
  2121. '**
  2122. '**  Out symbols:
  2123. '**    
  2124. '**  Implicit Parameters:
  2125. '**
  2126. '**  Returns: 1 if path is valid
  2127. '**    
  2128. '***********************************************************************
  2129.  
  2130. PUBLIC FUNCTION ValidatePath (szPath$) AS INTEGER
  2131.  
  2132.     DIM difflen% , notused&
  2133.     DIM volPath$, dirPath$, writable%, dirPathType$
  2134.  
  2135.     ValidatePath = FALSE
  2136.     if szPath$ = "" then 
  2137.         Exit Function
  2138.     End if
  2139. %REM  
  2140.     DIM cch%
  2141.     cch% = LENBP(szPath$)
  2142.     difflen% = cch% + CINT(GetSymbolValue(SYM_DOSMAXPATHDIFF$))
  2143. %ENDREM  
  2144. 'JMD: Ref: RWIS36HHHN
  2145. 'Allow up to 255 characters in path
  2146. 'This includes the drive (2 characters) or UNC volume
  2147.     difflen% = LENBP(szPath$)
  2148.     SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_ERR_DIRSYNTAXDESCRLONG)
  2149. '*** UNC stuff
  2150.     '** If it's a UNC path do some checks
  2151.  
  2152.     IF Lot_CleanPath(szPath$) = FALSE THEN
  2153.       ShowPathError SID_ERR_DIRSYNTAX,_
  2154.             CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), szPath$
  2155.       szPath$ = NullTrim$(szPath$)
  2156.       EXIT FUNCTION
  2157.     END IF
  2158.     
  2159.     IF Lot_IsUnvalidatedUNCPath(szPath$) = TRUE THEN
  2160.  
  2161.       Lot_SplitUNCPath szPath$, volPath$, dirPath$
  2162.  
  2163.       IF Lot_IsvalidUNCPath(volPath$) = FALSE THEN
  2164.          ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, volPath$
  2165.  
  2166.       ELSEIF dirPath$ = "" OR Len(dirPath$) = 1 THEN
  2167.          ShowPathError SID_ERR_DIRSYNTAX, SID_ERR_DIRROOTDESCR, szPath$
  2168.  
  2169. '     ELSEIF Lot_CleanPath(szPath$) = FALSE THEN
  2170. '   ShowPathError SID_ERR_DIRSYNTAX,_
  2171. '        CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), szPath$
  2172.  
  2173. '** Make sure the path is not too long
  2174.       ELSEIF difflen% > MAX_DIR_PATH THEN
  2175.     '** This is only about the path length and might need a new message
  2176.          ErrorMsg SID_ERR_PATHLEN, ""
  2177.       ELSE
  2178.          SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_DIR_READONLY)
  2179.          writable% = IsPathWritable(szPath$)
  2180.          IF writable% = FALSE THEN
  2181.      ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, szPath$
  2182.             ValidatePAth = FALSE
  2183.          ELSE
  2184.             ValidatePath = TRUE 
  2185.          END IF
  2186.       END IF
  2187. '*** end UNC stuff
  2188.     ELSE
  2189. '*** Check letter drives
  2190.         '** Make sure the drive is valid
  2191.         IF (MID$(szPath$,2,1) = ":" AND IsDriveValid(szPath$) = FALSE) THEN
  2192.     ShowPathError SID_DRV_NOTEXIST, 0, MID$(szPath$,1,2)
  2193.  
  2194.         '** Make sure the syntax of the path name is correct
  2195. '      ELSEIF Lot_CleanPath(szPath$) = FALSE THEN
  2196. '    ShowPathError SID_ERR_DIRSYNTAX,_
  2197. '         CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), szPath$
  2198.         '** Make sure not installing to the root
  2199.         ELSEIF (LEN(szPath$) = 2) OR (LEN(szPath$) = 3 _
  2200.           AND MID$(szPath$,3,1) = "\") THEN
  2201.     ShowPathError SID_ERR_DIRSYNTAX, SID_ERR_DIRROOTDESCR, szPath$
  2202.  
  2203.       '** Make sure the path is not too long
  2204.         ELSEIF difflen% > MAX_DIR_PATH THEN
  2205.     '** This is only about the path length and might need a new message
  2206.     ErrorMsg SID_ERR_PATHLEN, ""
  2207.         ELSE
  2208.     '** Make sure the path is writable
  2209.  
  2210.     writable% = IsPathWritable(szPath$)
  2211.     IF writable% = FALSE THEN
  2212.              SetSymbolValue SYM_LAST_ERROR_SID$ , CStr(SID_DIR_READONLY)
  2213.       ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, szPath$
  2214.       ValidatePAth = FALSE
  2215.     ELSE
  2216.       ValidatePath = TRUE
  2217.     END IF
  2218.          END IF
  2219.     END IF
  2220.     szPath$ = NullTrim$(szPath$)
  2221. END FUNCTION
  2222.  
  2223. 'PUBLIC FUNCTION ValidateEditBox (hDlg&, Ctrl%) AS INTEGER
  2224. '** Purpose:check editbox text for valid volumes 
  2225. '** Author:
  2226. '** Arguments:
  2227. '** Returns:
  2228. '**     
  2229. '*************************************************************************
  2230. PUBLIC FUNCTION ValidateEditBox (hDlg&, Ctrl%) AS INTEGER
  2231.     DIM  eb$, vol$, path$, editbox$, combobox$, comboId%
  2232.  
  2233.     comboBox = "IDC_COMBO"+Right$(Str$(Ctrl%),1)
  2234.     editBox = "IDC_EDIT"+Right$(Str$(Ctrl%),1)
  2235.     comboId% = Ctrl% + 400
  2236. '**CB_GETCURSEL = 0x147 = 327
  2237.     ValidateEditBox = 1 + SendMessage(GetDlgItem(hDlg&,comboId%), 327, 0, 0)
  2238.     eb$=GetListItem("IDC_EDIT",Ctrl%)
  2239.     Lot_SplitUNCPath eb$, vol$, path$
  2240.     IF NOT vol$ = "" THEN
  2241. '** There is a UNC path in the edit box
  2242.         ValidateEditBox = SelectDriveCombo(combobox, vol$)
  2243.         IF ValidateEditBox = 0 THEN
  2244.           ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, vol$
  2245.                 EXIT FUNCTION
  2246.         END IF
  2247.         IF ValidatePath(eb$) = FALSE THEN
  2248.           ValidateEditBox = 0
  2249.           EXIT FUNCTION
  2250.         END IF
  2251.     ELSE
  2252.         IF MID$(eb$,2,1) = ":" THEN
  2253. '** There is a drive letter in the edit box
  2254.      ValidateEditBox = SelectDriveCombo (comboBox, eb$)
  2255.      IF ValidateEditBox = 0 THEN
  2256.          ShowPathError SID_DRV_NOTEXIST, 0, Left$(eb$,2)
  2257.      ELSE
  2258.          SetListItem "IDC_EDIT", Ctrl%, Lot_ExtractDirectory(eb$)
  2259.          AddListItem SYM_UPDATELIST$, editBox
  2260.      END IF
  2261.         ELSE 
  2262.      IF MID$(eb$,1,1) <> "\" THEN
  2263.          SetListItem "IDC_EDIT", Ctrl%, "\"+eb$
  2264.          AddListItem SYM_UPDATELIST$, editBox
  2265.         
  2266.      END IF
  2267.         END IF
  2268.     END IF
  2269. END FUNCTION
  2270.  
  2271. 'PUBLIC FUNCTION ValidateBrowse (hDlg&, Ctrl%) AS INTEGER
  2272. '** Purpose:check browse results text for valid volumes 
  2273. '** Author:
  2274. '** Arguments:
  2275. '** Returns:
  2276. '**     
  2277. '*************************************************************************
  2278. PUBLIC FUNCTION ValidateBrowse (hDlg&, Ctrl%) AS INTEGER
  2279.     DIM  eb$, vol$, path$, editbox$, combobox$, comboId%
  2280.  
  2281.     comboBox = "IDC_COMBO"+Right$(Str$(Ctrl%),1)
  2282.     editBox = "IDC_EDIT"+Right$(Str$(Ctrl%),1)
  2283.     comboId% = Ctrl% + 400
  2284. '**CB_GETCURSEL = 0x147 = 327
  2285.     ValidateBrowse = 1 + SendMessage(GetDlgItem(hDlg&,comboId%), 327, 0, 0)
  2286.     eb$=GetSymbolValue("SYM_BROWSE_RESULT")
  2287.     Lot_SplitUNCPath eb$, vol$, path$
  2288.     IF NOT vol$ = "" THEN
  2289.         IF ValidatePath(eb$) = FALSE THEN
  2290.           ValidateBrowse = FALSE
  2291.           EXIT FUNCTION
  2292.         END IF
  2293.         ValidateBrowse = SelectDriveCombo(combobox, vol$)
  2294.         IF ValidateBrowse = 0 THEN
  2295.           ShowPathError CInt(GetSymbolValue(SYM_LAST_ERROR_SID$)), 0, vol$
  2296.         ELSE
  2297.     SetListItem "IDC_EDIT", Ctrl%, eb$
  2298.     AddListItem SYM_UPDATELIST$, editBox
  2299.         END IF
  2300.         EXIT FUNCTION
  2301.     ELSE
  2302.         IF MID$(eb$,2,1) = ":" THEN
  2303.      ValidateBrowse = SelectDriveCombo (comboBox, eb$)
  2304.      IF ValidateBrowse = 0 THEN
  2305.          ShowPathError SID_DRV_NOTEXIST, 0, Left$(eb$,2)
  2306.      ELSE
  2307.          SetListItem "IDC_EDIT", Ctrl%, Lot_ExtractDirectory(eb$)
  2308.          AddListItem SYM_UPDATELIST$, editBox
  2309.      END IF
  2310.         ELSE 
  2311.      IF MID$(eb$,1,1) <> "\" THEN
  2312.          SetListItem "IDC_EDIT", Ctrl%, "\"+eb$
  2313.          AddListItem SYM_UPDATELIST$, editBox
  2314.         
  2315.      END IF
  2316.         END IF
  2317.     END IF
  2318. END FUNCTION
  2319.  
  2320.  
  2321.  
  2322.  
  2323. PUBLIC FUNCTION Lot_Dir  (szDir$) AS STRING
  2324. '** Purpose:
  2325. '** Author:
  2326. '** Arguments:
  2327. '** Returns:
  2328. '**     
  2329. '*************************************************************************
  2330.      DIM DirRet$
  2331.  
  2332.      DirRet$ = Dir$(szDir$)
  2333.      Lot_Dir = DirRet$
  2334. END FUNCTION
  2335.  
  2336. PUBLIC FUNCTION Lot_GetLocalHardDrive(ProdSize&,DefaultDir$) AS STRING
  2337. '** Purpose:
  2338. '**     Gets the first writable local hard disk with enough space e.g. D:
  2339. '** Arguments:
  2340. '**     ProdSize& the minimum size requirements for installing a product
  2341. '**     DefaultDir$  the default directory to install to
  2342. '** Returns:
  2343. '**     D:\ + DefaultDir$ or an empty string
  2344. '*************************************************************************
  2345.     DIM Length%, count%, lDrive$, SpaceAvail&
  2346.  
  2347.     Lot_GetLocalHardDrive = ""
  2348.     Length% = GetListLength(SYM_LOCALHARDDRIVES$)
  2349.     IF Length% = 0 THEN
  2350.         GetLocalHardDrivesList SYM_LOCALHARDDRIVES$
  2351.         Length% = GetListLength(SYM_LOCALHARDDRIVES$)
  2352.     END IF
  2353.     FOR count% = 1 TO Length%
  2354.         lDrive$     = GetListItem(SYM_LOCALHARDDRIVES$, count%)
  2355.         SpaceAvail& = GetFreeSpaceForDrive(lDrive$)
  2356.         lDrive$     = lDrive$ + ":\" + DefaultDir$
  2357.         IF SpaceAvail& > (ProdSize& \ 1024) AND IsPathWritable(lDrive$) THEN
  2358.      Lot_GetLocalHardDrive = LCASE$(lDrive$)
  2359.      EXIT FUNCTION
  2360.         END IF
  2361.     NEXT
  2362.  
  2363. END FUNCTION
  2364.  
  2365. PUBLIC FUNCTION Lot_GetNetHardDrive(ProdSize&,DefaultDir$) AS STRING
  2366. '** Purpose:
  2367. '**     Gets the first writable network hard disk with enough space e.g. D:
  2368. '** Arguments:
  2369. '**     ProdSize& the minimum size requirements for installing a product
  2370. '**     DefaultDir$  the default directory to install to
  2371. '** Returns:
  2372. '**     D:\ + DefaultDir$ or an empty string
  2373. '*************************************************************************
  2374.     DIM Length%, count%, lDrive$, SpaceAvail&
  2375.  
  2376.     Lot_GetNetHardDrive = ""
  2377.     GetNetworkDrivesList SYM_NETHARDDRIVES$
  2378.     Length% = GetListLength(SYM_NETHARDDRIVES$)
  2379.     FOR count% = 1 TO Length%
  2380.         lDrive$     = GetListItem(SYM_NETHARDDRIVES$, count%)
  2381.         SpaceAvail& = GetFreeSpaceForDrive(lDrive$)
  2382.         lDrive$     = lDrive$ + ":\" + DefaultDir$
  2383.         IF SpaceAvail& > (ProdSize& \ 1024) AND IsPathWritable(lDrive$) THEN
  2384.      Lot_GetNetHardDrive = LCASE$(lDrive$)
  2385.      EXIT FUNCTION
  2386.         END IF
  2387.     NEXT
  2388.  
  2389. END FUNCTION
  2390.  
  2391. PUBLIC FUNCTION Lot_GetAllHardDrive(ProdSize&,DefaultDir$) AS STRING
  2392. '** Purpose:
  2393. '**     Gets the first writable local or network hard disk with enough 
  2394. '**     space e.g. D:
  2395. '** Arguments:
  2396. '**     ProdSize& the minimum size requirements for installing a product
  2397. '**     DefaultDir$  the default directory to install to
  2398. '** Returns:
  2399. '**     D:\ + DefaultDir$ or an empty string
  2400. '*************************************************************************
  2401.  
  2402.     DIM   drv$
  2403.  
  2404.     drv$ = Lot_GetLocalHardDrive(ProdSize&, DefaultDir$)
  2405.     IF drv$ <> "" THEN
  2406.         Lot_GetAllHardDrive = drv$
  2407.     ELSE
  2408.         Lot_GetAllHardDrive = Lot_GetNetHardDrive(ProdSize&, DefaultDir$)
  2409.     END IF
  2410.  
  2411. END FUNCTION
  2412.  
  2413. PUBLIC FUNCTION Lot_GetChapterFromKeyword (szKeyword$) AS STRING
  2414. '** Purpose: Get the chapter # given the Chapter name
  2415. '** Author:
  2416. '** Arguments:
  2417. '** Returns:
  2418. '**     
  2419. '*************************************************************************
  2420.      DIM g_strbuf$
  2421.  
  2422.      g_strbuf$ = CreateBuffer(256)
  2423.      If FGetChapterFromKeyword(szKeyword$, g_strbuf$, 256) = 0 Then
  2424.          Lot_GetChapterFromKeyword = ""
  2425.      Else
  2426.          Lot_GetChapterFromKeyword = NullTrim(g_strbuf$)
  2427.      End If
  2428. END FUNCTION
  2429.  
  2430. PUBLIC Lot_CallExec_RC$ 
  2431.  
  2432. PUBLIC FUNCTION Lot_CallProductFunctions (func_name$, BYVAL direction$, always%, back$, parms$) AS STRING
  2433. '** Purpose:
  2434. '** Author:
  2435. '** Arguments:
  2436. '**     func_name$: Name of function + prod Acronym will be called.
  2437. '**     always%: IF TRUE then alwasy calls function, otherwise only if product is turned on.
  2438. '**     direction$: determines the direction: gBACK means start at the last callback.
  2439. '** Returns:
  2440. '**     
  2441. '*************************************************************************
  2442.   DIM n%, i%, lname$, prodcall$, notused%, incr%
  2443.  
  2444.   Lot_CallProductFunctions = ""
  2445.   n% = Reg_GetNumberOfProducts()
  2446.   If direction$ = gBACK Then
  2447.     i% = n%
  2448.     incr% = 1
  2449.   Else
  2450.     i% = 1
  2451.     incr% = -1
  2452.   End If
  2453.   WHILE (i%  >= 1 AND i% <= n%)
  2454.  
  2455.       lname$ = Reg_GetProductAcronym(i%)
  2456.       If lname$ <> "" AND (always% <> FALSE OR Prods(i%).UIInOrOut <> FALSE) Then
  2457.             '
  2458.             ' construct a lotus script statement for EXECUTE. It will look
  2459.             ' something like this:
  2460.             '     INIT123(i%, "server$", parms$)
  2461.             '
  2462.     If parms$ <> "" Then
  2463.         prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & i% & "," & |"| & GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| &  "," & parms$ & ")"
  2464.     Else
  2465.         prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & i% & "," & |"| &  GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| & ")"
  2466.     End If
  2467.      ' DOEXEC removed and replaced by EXECUTE!
  2468.             ' call DOEXEC, which acts like the script EXECUTE statement.
  2469.             ' The difference is that DOEXEC operates in the default module,
  2470.             ' while  EXECUTE creates a temporary module that disappears once the
  2471.             ' call is made.  The first parameter to DOEXEC is a module name,
  2472.             ' which is made into a "USE modname" statement, if that module 
  2473.             ' name has not yet been USE'd via DOEXEC. The second arg is the
  2474.             ' statement to be run. Note - the args must be call by value,
  2475.             ' not reference (can be done by enclosing args in parens)       
  2476.  
  2477.           gEndStatementEncountered% = FALSE
  2478.     '** TV : old execute : on error doesn't work
  2479.     'EXECUTE(|USE "| & lname$ & |" : | & prodcall$)
  2480.     '** TV : new 
  2481.     EXECUTE(|USE "| & lname$ & |" : SUB INITIALIZE : | & prodcall$ & |:END SUB|)
  2482.  
  2483.           '  this gEndStatementEncountered flag is necessary because the Lotus
  2484.           '  END statement, which normally exists the entire program, only
  2485.     '  exits the top-level routine running in DOEXEC.  So,
  2486.           '  check this flag here, to see if we hit an END during DOEXEC.
  2487.  
  2488.           IF gEndStatementEncountered% = TRUE THEN
  2489.             END                                            ' exit the program
  2490.           END IF
  2491.  
  2492.     direction$ = Lot_CallExec_RC$
  2493.     If direction$ = gBACK Then
  2494.         incr% = -1
  2495.     Else
  2496.         incr% = 1
  2497.     End If
  2498.       End If
  2499.  
  2500.       If direction$ = gBACK AND back$ = gALLPRODUCTS then
  2501.         Lot_CallProductFunctions = direction$
  2502.         Exit Function
  2503.       End If
  2504.  
  2505.       i% = i% + incr%
  2506.   WEND
  2507.  
  2508.   Lot_CallProductFunctions = direction$
  2509.  
  2510. END FUNCTION
  2511.  
  2512. PUBLIC FUNCTION Lot_CallOneProductFunction (prodno%, func_name$, BYVAL direction$, always%, parms$) AS STRING
  2513. '** Purpose:
  2514. '** Author:
  2515. '** Arguments:
  2516. '** Returns:
  2517. '**     
  2518. '*************************************************************************
  2519.   DIM lname$, prodcall$, notused%
  2520.  
  2521.   Lot_CallOneProductFunction = ""
  2522.   lname$ = Reg_GetProductAcronym(prodno%)
  2523.   If lname$ <> "" Then
  2524.       '
  2525.       ' construct a lotus script statement for EXECUTE. It will look
  2526.       ' something like this:
  2527.       '     USE "123":INIT123(prodno%, "server$", parms$)
  2528.       '
  2529.       If parms$ <> "" Then
  2530.     prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & prodno% & "," & |"| & GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| & "," & parms$ & ")"
  2531.       Else
  2532.     prodcall$ = "Lot_CallExec_RC$  = " & func_name$ & lname$ & "(" & prodno% & "," & |"| &  GetSymbolValue(SYM_NETWORK) & |"| & "," & |"| & direction$ & |"| & ")"
  2533.       End If
  2534.  
  2535.      ' DOEXEC removed and replaced by EXECUTE!
  2536.             ' call DOEXEC, which acts like the script EXECUTE statement.
  2537.             ' The difference is that DOEXEC operates in the default module,
  2538.             ' while  EXECUTE creates a temporary module that disappears once the
  2539.             ' call is made.  The first parameter to DOEXEC is a module name,
  2540.             ' which is made into a "USE modname" statement, if that module 
  2541.             ' name has not yet been USE'd via DOEXEC. The second arg is the
  2542.             ' statement to be run. Note - the args must be call by value,
  2543.             ' not reference (can be done by enclosing args in parens)       
  2544.             
  2545.         gEndStatementEncountered% = FALSE            ' see Lot_CallProductFunctions
  2546.  
  2547.         '** TV : old execute : on error doesn't work
  2548.         'EXECUTE(|USE "| & lname$ & |" : | & prodcall$)
  2549.         '** TV : new 
  2550.         EXECUTE(|USE "| & lname$ & |" : SUB INITIALIZE : | & prodcall$ & |:END SUB|)
  2551.     
  2552.  
  2553.         IF gEndStatementEncountered% = TRUE THEN
  2554.             END                                            ' exit the program
  2555.         END IF
  2556.  
  2557.       Lot_CallOneProductFunction = Lot_CallExec_RC$
  2558.  
  2559.  
  2560.   End If
  2561.  
  2562.  
  2563. END FUNCTION
  2564.  
  2565. '*************************************************************************
  2566. PUBLIC FUNCTION Lot_CheckPath (path$) AS INTEGER
  2567. '** Purpose:
  2568. '** Author:
  2569. '** Arguments:
  2570. '** Returns:
  2571. '**     
  2572. '*************************************************************************
  2573.     DIM ldrive$, vol$, unused$
  2574.  
  2575.     Lot_CheckPath = FALSE
  2576.     path$ = NullTrim( path$ )
  2577.     IF path$ <> "" THEN
  2578.         Lot_SplitUNCPath path$, vol$, unused$
  2579.         IF vol$ = "" THEN
  2580.         ldrive$ = Lot_ExtractDriveLetter(path$)
  2581.  
  2582.         IF IsDriveValid(ldrive$) <> FALSE AND Lot_CleanPath(path$) <> FALSE THEN 
  2583.             Lot_CheckPath = TRUE
  2584.         END IF
  2585.         ELSE
  2586.         IF Lot_CleanPath(path$) <> FALSE THEN 
  2587.         Lot_CheckPath = TRUE
  2588.         END IF
  2589.         END IF
  2590.     END IF
  2591.  
  2592. END FUNCTION
  2593.  
  2594. PUBLIC FUNCTION Lot_GetFirst (szChapt$, nFlag%) AS STRING
  2595. '** Purpose:
  2596. '** Author:
  2597. '** Arguments:
  2598. '** Returns:
  2599. '**     
  2600. '*************************************************************************
  2601.   DIM g_strbuf$, Length%
  2602.  
  2603.   g_strbuf$ = CreateBuffer(256)
  2604.   if FGetFirst(szChapt$,g_strbuf$,CLng(nFlag%)) = 0 then
  2605.       Lot_GetFirst = ""     
  2606.   else
  2607.      Lot_GetFirst = NullTrim(g_strbuf)
  2608.  end if
  2609.  
  2610.  
  2611. END FUNCTION
  2612. '*************************************************************
  2613.  
  2614. PUBLIC FUNCTION Lot_GetNext () AS STRING
  2615. '** Purpose:
  2616. '** Author:
  2617. '** Arguments:
  2618. '** Returns:
  2619. '**     
  2620. '*************************************************************************
  2621.       DIM g_strbuf$
  2622.   
  2623.      g_strbuf$ = CreateBuffer(256)
  2624.      if FGetNext(g_strbuf$) = 0 then
  2625.          Lot_GetNext = ""         
  2626.      else
  2627.          Lot_GetNext = NullTrim(g_strbuf$)
  2628.       end if
  2629.  
  2630. END FUNCTION
  2631. '*************************************************************************
  2632.  
  2633. PUBLIC FUNCTION Lot_SetDateOfFile (szFile$, szDate$) AS INTEGER
  2634. '** Purpose:
  2635. '** Author:
  2636. '** Arguments:
  2637. '** Returns:
  2638. '**     
  2639. '*************************************************************************
  2640.   if FSetDateOfFile(szFile$,szDate$) = 0 then
  2641.     Lot_SetDateOfFile = 0   
  2642.   else
  2643.       Lot_SetDateOfFile = 1
  2644.   end if
  2645.  
  2646.  
  2647. END FUNCTION
  2648. '*************************************************************
  2649.  
  2650. PUBLIC SUB Lot_RemoveSectionFilesFromCopyList (szSect$) 
  2651. '** Purpose:
  2652. '** Author:
  2653. '** Arguments:
  2654. '** Returns:
  2655. '**     
  2656. '*************************************************************************
  2657. %rem
  2658.      if FValidInfSect(szSect$) = 0 then
  2659.     n% = 1
  2660.      else
  2661.     n% = 0
  2662.      end if
  2663.      if n% > 0 then
  2664.     BadArgErr n%, "Lot_RemoveSectionFilesFromCopyList", szSect$
  2665.      end if
  2666. %endrem ''DEBUG
  2667.  
  2668.      IF FRemoveSectionFilesFromCopyList (szSect$) = 0 THEN
  2669.     ErrorMsg SID_ERR_LOT_RSFFCL, ""
  2670.     ERROR STFQUIT
  2671.      END IF
  2672. END SUB
  2673. '*************************************************************************
  2674.  
  2675. PUBLIC SUB Lot_RemoveSectionKeyFileFromCopyList (szSect$, szKey$) 
  2676. '** Purpose:
  2677. '** Author:
  2678. '** Arguments:
  2679. '** Returns:
  2680. '**     
  2681. '*************************************************************************
  2682. %rem
  2683.      if FValidInfSect(szSect$) = 0 then
  2684.     n% = 1
  2685.      elseif szKey$ = "" then
  2686.     n% = 2
  2687.      else
  2688.     n% = 0
  2689.      end if
  2690.      if n% > 0 then
  2691.     BadArgErr n%, "Lot_RemoveSectionKeyFileFromCopyList", szSect$+", "+szKey$
  2692.      end if
  2693. %endrem ''DEBUG
  2694.  
  2695.      IF FRemoveSectionKeyFileFromCopyList (szSect$, szKey$) = 0 THEN
  2696.     ErrorMsg SID_ERR_LOT_RSKFFCL, ""
  2697.     ERROR STFQUIT
  2698.      END IF
  2699. END SUB
  2700. '*************************************************************************
  2701.  
  2702. PUBLIC FUNCTION Lot_GetInfSectionSize (szSect$)  AS LONG
  2703. '** Purpose:
  2704. '** Author:
  2705. '** Arguments:
  2706. '** Returns:
  2707. '**     
  2708. '*************************************************************************
  2709. %rem
  2710.      if FValidInfSect(szSect$) = 0 then
  2711.     n% = 1
  2712.      else
  2713.     n% = 0
  2714.      end if
  2715.      if n% > 0 then
  2716.     ERROR STFQUIT
  2717.      end if
  2718. %endrem
  2719.      Lot_GetInfSectionSize = LcbGetInfSectionSize(szSect$)
  2720. END FUNCTION
  2721.  
  2722. '** DND: These functions need an ASSERT!!!!!!!
  2723.  
  2724. PUBLIC FUNCTION Lot_AddPagetoNotebook (hDlg&,  Notebookid&,DlgId%, Tabstring$)   AS INTEGER
  2725. '** Purpose:
  2726. '** Author:
  2727. '** Arguments:
  2728. '** Returns:
  2729. '**     
  2730. '*************************************************************************
  2731.     DIM Dll$
  2732.     Dll$ = FindResourceinDLL (CLng(DlgId%), RT_DIALOG)
  2733.     If Dll$ = "" then
  2734.         Dll$ = "mscuistf.dll"
  2735.     End if
  2736.     Lot_AddPagetoNotebook = NotebookAddDlgPage(hDlg&,  Notebookid&,CLng(DlgId%), Dll$,FNAMEORGDLGPROC$,Tabstring$) 
  2737.     IF Lot_AddPagetoNotebook = 0 THEN
  2738.         ErrorMsg 0, "Error creating notebook page"
  2739.         ERROR STFQUIT
  2740.     END IF
  2741. END FUNCTION
  2742. '*************************************************************************
  2743.  
  2744. PUBLIC FUNCTION Lot_NotebookPageView (hDlg&,  Notebookid&, DlgId%, fShowPage%) AS INTEGER
  2745. '** Purpose:
  2746. '** Author:
  2747. '** Arguments:
  2748. '** Returns:
  2749. '**     
  2750. '*************************************************************************
  2751.     Lot_NotebookPageView = FNotebookPageView (hDlg&,  Notebookid&, CLng(DlgId%), CLng(fShowPage%))
  2752.     IF Lot_NotebookPageView = 0 THEN
  2753.         ErrorMsg 0, "Error viewing notebook page"
  2754.         ERROR STFQUIT
  2755.     END IF
  2756. END FUNCTION
  2757. '*************************************************************************
  2758.  
  2759. PUBLIC SUB Lot_TurnToPage (hDlg&,Notebookid&, pageid%) 
  2760. '** Purpose:
  2761. '** Author:
  2762. '** Arguments:
  2763. '** Returns:
  2764. '**     
  2765. '*************************************************************************
  2766.     IF  FNotebookTurnToPage(hDlg&,Notebookid&, CLng(pageid%)) <> 1 THEN
  2767.         ErrorMsg 0, "Error turning notebook page"
  2768.         ERROR STFQUIT
  2769.     END IF
  2770. END SUB
  2771. '*************************************************************************
  2772.  
  2773. PUBLIC FUNCTION Lot_GetPagehandle  (hDlg&,Notebookid&,Pageid%) AS LONG
  2774. '** Purpose:
  2775. '** Author:
  2776. '** Arguments:
  2777. '** Returns:
  2778. '**     
  2779. '*************************************************************************
  2780.     Lot_GetPagehandle = NotebookGetPageHwnd(hDlg&,Notebookid&,CLng(Pageid%)) 
  2781.     IF Lot_GetPagehandle = 0 THEN
  2782.         ErrorMsg 0, "Error getting the notebook page handle"
  2783.         ERROR STFQUIT
  2784.     END IF
  2785. END FUNCTION
  2786. '*************************************************************************
  2787.  
  2788. PUBLIC SUB Lot_LCBResetContent(hDlg&)
  2789. '** Purpose:
  2790. '** Author:
  2791. '** Arguments:
  2792. '** Returns:
  2793. '**     
  2794. '*************************************************************************
  2795.   LCBResetContent hDlg&
  2796. END SUB
  2797. '*************************************************************************
  2798.  
  2799. PUBLIC SUB Lot_LCBSetRedraw (hDlg&, fRedraw%)
  2800. '** Purpose:
  2801. '** Author:
  2802. '** Arguments:
  2803. '** Returns:
  2804. '**     
  2805. '*************************************************************************
  2806.   LCBSetRedraw hDlg&, CLng(fRedraw%)
  2807. END SUB
  2808. '*************************************************************************
  2809.  
  2810. PUBLIC FUNCTION Lot_LCBGetCount (hDlg&) AS INTEGER
  2811.  
  2812. '** Purpose:
  2813. '** Author:
  2814. '** Arguments:
  2815. '** Returns:
  2816. '**     
  2817. '*************************************************************************
  2818.  
  2819.     Lot_LCBGetCount = LCBGetCount(hDlg&)
  2820.  
  2821. END FUNCTION
  2822. '*************************************************************************
  2823.  
  2824. PUBLIC FUNCTION Lot_LCBAddItem (hDlg&, item$) AS INTEGER
  2825. '** Purpose:
  2826. '** Author:
  2827. '** Arguments:
  2828. '** Returns:
  2829. '**     
  2830. '*************************************************************************
  2831.      DIM rc%
  2832.  
  2833.     rc% = LCBAddItem (hDlg&, item$)
  2834.     If (rc% = 0) Then
  2835.         ErrorMsg 0, "Could not Add Item: "+item$+" to LCB on DLG: "+STR$(hDlg&)
  2836.         ERROR STFQUIT
  2837.     End If
  2838.     Lot_LCBAddItem= rc%
  2839.  
  2840. END FUNCTION
  2841. '*************************************************************************
  2842.  
  2843. PUBLIC FUNCTION Lot_LCBReplaceItem (hDlg&, index%, itemnum%, item$) AS INTEGER
  2844. '** Purpose:
  2845. '** Author:
  2846. '** Arguments:
  2847. '** Returns:
  2848. '**     
  2849. '*************************************************************************
  2850.     DIM rc%
  2851.  
  2852.     rc% = LCBReplaceItem (hDlg&, CLng(index%), CLng(itemnum%), item$)
  2853.     Lot_LCBReplaceItem = rc%
  2854.  
  2855. END FUNCTION
  2856. '*************************************************************************
  2857.  
  2858. PUBLIC FUNCTION Lot_LCBGetItem (hDlg&, index%, itemnum%) AS STRING
  2859. '** Purpose:
  2860. '** Author:
  2861. '** Arguments:
  2862. '** Returns:
  2863. '**???     
  2864. '*************************************************************************
  2865. DIM rc%
  2866. DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2867.  
  2868.      rc% = LCBGetItem (hDlg&, CLng(index%), CLng(itemnum%), szValue$, cbSymValMax)
  2869.      Lot_LCBGetItem = NullTrim(szValue$)
  2870.  
  2871. END FUNCTION
  2872. '*************************************************************************
  2873.  
  2874. PUBLIC FUNCTION Lot_LCBToggleItem  (hDlg&, index%) AS INTEGER
  2875. '** Purpose:
  2876. '** Author:
  2877. '** Arguments:
  2878. '** Returns:
  2879. '**     
  2880. '*************************************************************************
  2881.     DIM rc%
  2882.  
  2883.     rc% = LCBToggleItem (hDlg&, CLng(index%))
  2884.     Lot_LCBToggleItem = rc%
  2885.  
  2886. END FUNCTION
  2887.  
  2888. '*************************************************************************
  2889.  
  2890. PUBLIC SUB Lot_LCBSetSel (hDlg&, index%)
  2891. ' wrapper 
  2892. '*************************************************************************
  2893.   LCBSetSel hDlg&, CLng(index%)
  2894. END SUB
  2895.  
  2896. '*************************************************************************
  2897.  
  2898. PUBLIC SUB Lot_LCBSetTabs (hDlg&, t1%, t2%, t3%, t4%)
  2899. ' wrapper 
  2900. '*************************************************************************
  2901.   LCBSetTabs hDlg&, CLng(t1%), CLng(t2%), CLng(t3%), CLng(t4%)
  2902. END SUB
  2903.  
  2904. '*************************************************************************
  2905.  
  2906. PUBLIC FUNCTION Lot_GetFirstChild (szChapt$, nFlag%) AS STRING
  2907. '** Purpose:
  2908. '** Author:
  2909. '** Arguments:
  2910. '** Returns:
  2911. '**     
  2912. '*************************************************************************
  2913. DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2914.  
  2915.      if FGetFirstChild(szChapt$, szValue$, CLng(nFlag%)) = 0 then
  2916.      Lot_GetFirstChild = ""         
  2917.      else
  2918.      Lot_GetFirstChild = NullTrim(szValue$ )
  2919.      end if
  2920.  
  2921. END FUNCTION
  2922. '*************************************************************************
  2923.  
  2924. PUBLIC FUNCTION Lot_GetGroupName ( szGroupFileName$) AS STRING  
  2925. '** Purpose:
  2926. '** Author:
  2927. '** Arguments:
  2928. '** Returns:
  2929. '**     
  2930. '*************************************************************************
  2931.     DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2932.  
  2933.     IF FGetGroupName(szGroupFileName$, szValue$, cbSymValMax) = 0 THEN
  2934.         Lot_GetGroupName = ""
  2935.     ELSE
  2936.         Lot_GetGroupName = NullTrim(szValue$)
  2937.     END IF
  2938.  
  2939. END FUNCTION
  2940. '*************************************************************************
  2941.  
  2942. PUBLIC FUNCTION Lot_GetChapterValStr (szChapter$, nField%)  AS STRING 
  2943. '** Purpose:
  2944. '** Author:
  2945. '** Arguments:
  2946. '** Returns:
  2947. '**     
  2948. '*************************************************************************
  2949.     DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2950.  
  2951.     IF FGetChapterValStr(szChapter$, CLng(nField%), szValue$, cbSymValMax) = 0 THEN
  2952.         Lot_GetChapterValStr = ""
  2953.     ELSE
  2954.         Lot_GetChapterValStr = NullTrim(szValue$)
  2955.     END IF
  2956.  
  2957. END FUNCTION
  2958. '*************************************************************************
  2959.  
  2960. PUBLIC FUNCTION Lot_GetChapterValInt (szChapter$,nField%) AS INTEGER  
  2961. '** Purpose:
  2962. '** Author:
  2963. '** Arguments:
  2964. '** Returns:
  2965. '**     
  2966. '*************************************************************************
  2967.     DIM lpVal&
  2968.     
  2969.     if FGetChapterValInt(szChapter$, CLng(nField%),lpVal&) = 0 then
  2970.         Lot_GetChapterValInt = -1    
  2971.     else
  2972.         Lot_GetChapterValInt = CInt(lpVal&)
  2973.     end if
  2974.  
  2975. END FUNCTION
  2976. '*************************************************************************
  2977.  
  2978. PUBLIC FUNCTION Lot_GetNextSibling (szChapter$,nField%) AS STRING
  2979. '** Purpose:
  2980. '** Author:
  2981. '** Arguments:
  2982. '** Returns:
  2983. '**     
  2984. '*************************************************************************
  2985. DIM szValue As String : szValue = CreateBuffer(cbSymValMax)
  2986.  
  2987.      if FGetNextSibling(szChapter$, szValue$,CLng(nField%)) = 0 then
  2988.          Lot_GetNextSibling = ""  
  2989.      else
  2990.          Lot_GetNextSibling = NullTrim(szValue$)
  2991.      end if
  2992.  
  2993. END FUNCTION
  2994. '*************************************************************************
  2995.  
  2996. PUBLIC FUNCTION Lot_GetNextChild () AS STRING
  2997. '** Purpose:
  2998. '** Author:
  2999. '** Arguments:
  3000. '** Returns:
  3001. '**     
  3002. '*************************************************************************
  3003.     DIM g_strbuf$, Length%
  3004.  
  3005.     g_strbuf$ = CreateBuffer(256)
  3006.     if FGetNextChild(g_strbuf$) = 0 then
  3007.         Lot_GetNextChild = ""     
  3008.     else
  3009.         Lot_GetNextChild = NullTrim(g_strbuf$)
  3010.      end if
  3011.  
  3012. END FUNCTION
  3013. '*************************************************************************
  3014.  
  3015. PUBLIC FUNCTION Lot_GetInfChapterSize (szChapter$)  AS LONG
  3016. '** Purpose:
  3017. '** Author:
  3018. '** Arguments:
  3019. '** Returns:
  3020. '**     
  3021. '*************************************************************************
  3022.     DIM size&
  3023.  
  3024.     size&= LcbGetInfChapterSize(szChapter$)
  3025.     if size& = -1 then
  3026.       Lot_GetInfChapterSize = -1         
  3027.     else
  3028.       Lot_GetInfChapterSize = size&
  3029.     end if
  3030.  
  3031. END FUNCTION
  3032. '*************************************************************************
  3033.  
  3034. PUBLIC SUB Lot_ToggleChapterFilesInCopyList (szChapter$)  
  3035. '** Purpose:
  3036. '** Author:
  3037. '** Arguments:
  3038. '** Returns:
  3039. '**     
  3040. '*************************************************************************
  3041.  
  3042.     If FToggleChapterFilesInCopylist(szChapter$) = 0 Then
  3043.         ERROR STFTOGGLE
  3044.     End If
  3045.  
  3046. END SUB
  3047.  
  3048.  
  3049. '*************************************************************************
  3050.  
  3051. PUBLIC FUNCTION Lot_SetChapterFilesInCopyListInOrOut (szChapter$, InOrOut%) AS INTEGER
  3052. '** Purpose: Given a chapter, This function turns the feature on or off.
  3053. '**          It is written to be especially careful that features are not
  3054. '**          turned on if they are not allowed to be. Examples are:
  3055. '**          NODE: If the feaure doesn't exist on the Server
  3056. '**          ANY TYPE: If the feature is not in the INF file
  3057. '** Author: Marcel Meth
  3058. '** Arguments: szChapter$: The chapter number, e.g. "1.2.1"
  3059. '**               InOrOut: 1 for in, 0 for Out
  3060. '** Returns: Wheter the feature is actually In (1) or Out (0)
  3061. '**          regardless of what the request was.
  3062. '**     
  3063. '*************************************************************************
  3064. DIM curinorout%, FeatureToFind$
  3065.  
  3066.     If szChapter$ = "" Then
  3067.         Lot_SetChapterFilesInCopyListInOrOut  = 0
  3068.         Exit FUNCTION
  3069.     End If
  3070.  
  3071.     curinorout% = Lot_GetChapterValInt(szChapter$, F_INOROUT)
  3072.     '** If the current setting already equals the requested setting
  3073.     If InOrOut% = curinorout% Then
  3074.         Lot_SetChapterFilesInCopyListInOrOut  = InOrOut%
  3075.         Exit FUNCTION
  3076.     End If
  3077.  
  3078.     '** If the requested setting is IN
  3079.     If  InOrOut% = 1 THEN
  3080.         Lot_SetChapterFilesInCopyListInOrOut = 1
  3081.  
  3082.         '** For a node install, make sure the server has the feature
  3083.         If GetSymbolValue("NETWORK") = gNODE Then
  3084.      FeatureToFind$ = Lot_GetChapterValStr(szChapter$, F_KEYWORD)
  3085.      If Lot_IsTheFeatureInstalled(FeatureToFind$) = FALSE Then
  3086.          Lot_SetChapterFilesInCopyListInOrOut = 0
  3087.          Exit Function
  3088.      End If
  3089.         End If
  3090.  
  3091.         If FToggleChapterFilesInCopylist(szChapter$) = 0 Then
  3092.      Lot_SetChapterFilesInCopyListInOrOut = 0
  3093.         End If
  3094.  
  3095.     '** If the requested setting is OUT
  3096.     Else
  3097.         Lot_SetChapterFilesInCopyListInOrOut = 0
  3098.         If FToggleChapterFilesInCopylist(szChapter$) = 0 Then
  3099.      Lot_SetChapterFilesInCopyListInOrOut = 1
  3100.         End If
  3101.     End If
  3102.  
  3103. END FUNCTION
  3104.  
  3105.  
  3106. '*************************************************************************
  3107.  
  3108. PUBLIC SUB Lot_InitializeCopyList (szChpt$, nField%) 
  3109. '** Purpose:
  3110. '** Author:
  3111. '** Arguments:
  3112. '** Returns:
  3113. '**     
  3114. '*************************************************************************
  3115.     if FInitializeCopyList(szChpt$, GetSymbolValue(SYM_STF_SRCDIR$), CLng(nField%)) = 0 then
  3116.         ErrorMsg 0, "Error initializing the copylist: " + szChpt$
  3117.         ERROR STFQUIT
  3118.     end if
  3119. END SUB
  3120.  
  3121. '***********************************************************************
  3122. PUBLIC SUB Lot_TurnOffAllNodeOptSections
  3123. '**
  3124. '**Turns off all node options sections in copy list
  3125. '**Normally these get turned off and on by the callback
  3126. '**But Suit needs to be able to turn them all off without
  3127. '**surfacing the dialog
  3128. '**
  3129. '**No registration functions performed, just killing 
  3130. '**the sections in the copylist
  3131. '**
  3132. DIM AllProdNum%, prodNum%, AllOptNum%, chpt$, j%, OptKeyWord$
  3133. DIM notused%
  3134.  
  3135.      'Loop through the products and find the avail node options
  3136.   AllProdNum% = 0
  3137.   AllProdNum% = Reg_GetNumberOfProducts()
  3138.   IF AllProdNum% <> 0 THEN
  3139.      'Loop through the products
  3140.      FOR prodNum%=1 TO AllProdNum%
  3141.         AllOptNum% = 0
  3142.         AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  3143.         chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(prodNum%)_
  3144.           + gTOP$)
  3145.         IF AllOptNum% <> 0 THEN
  3146.           ' Loop through the options
  3147.           FOR j% = 1 TO AllOptNum%
  3148.              OptKeyWord$ = Reg_GetNodeOptionStr(prodNum%,j%)
  3149.              chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  3150.              notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 0)
  3151.           NEXT
  3152.         END IF
  3153.      NEXT
  3154.   END IF
  3155. END SUB
  3156.  
  3157. '*************************************************************************
  3158.  
  3159. PUBLIC SUB Lot_InitializeWinWinsysSym () 
  3160. '** Purpose: Sets win and winsys symbols
  3161. '** Author:  MZ
  3162. '*************************************************************************
  3163. DIM systemDir$
  3164.  
  3165.     'Set Windows directory symbol
  3166.     systemDir$ = GetWindowsDir()
  3167.     SetSymbolValue SYM_WINDIR$, systemdir$
  3168.  
  3169.     'Get Windows System directory
  3170.     systemDir$ = GetWindowsSysDir()
  3171.  
  3172.     'Check if I can write to the window system dir. and set winsysdir symbol
  3173.     IF(IsDirWritable(systemDir$)) = 1 THEN
  3174.         SetSymbolValue SYM_WINSYSDIR$, systemDir$
  3175.     ELSE
  3176.         SetSymbolValue SYM_WINSYSDIR$, GetWindowsDir()
  3177.     END IF
  3178. END SUB
  3179.  
  3180. ''* INitialize the gEXTRA LIST to 200000 bytes for the windows drive.
  3181. PUBLIC SUB Lot_InitializeEXTRA
  3182.      DIM drv$, drvno%, i%
  3183.     '' Add extra "FUDGE" space on Windows drive to allow for activities
  3184.     '' in windows directory.
  3185.     If GetListLength(gEXTRA) = 0 Then
  3186.         drv$ = Lot_ExtractDriveLetter(GetWindowsDir())
  3187.         drvno% = ASC(drv$) - ASC("a") + 1
  3188.         FOR i% = 1 to 26
  3189.      If i% = drvno% Then
  3190.          AddlistItem gEXTRA, "200000"
  3191.      Else
  3192.          AddlistItem gEXTRA, ""
  3193.      End If
  3194.         NEXT
  3195.     End If
  3196. END SUB
  3197.  
  3198. PUBLIC SUB Lot_RefreshDestination (symbol$) 
  3199. '** Purpose:
  3200. '** Author:
  3201. '** Arguments:
  3202. '** Returns:
  3203. '**     
  3204. '*************************************************************************
  3205.     if FRefreshDestination(symbol$) = FALSE THEN
  3206.         ErrorMsg 0, "Lot_RefreshDestination error: " + symbol$
  3207.         ERROR STFQUIT
  3208.     end if
  3209. END SUB
  3210.  
  3211. '*************************************************************************
  3212. PUBLIC SUB Lot_WriteDestinationSymAndVal (IniFileName$,IniSection$) 
  3213. '** Purpose:
  3214. '** Author:
  3215. '** Arguments:
  3216. '** Returns:
  3217. '**     
  3218. '*************************************************************************
  3219.     if FWriteDestinationSymAndVal(IniFileName$,IniSection$) = FALSE THEN
  3220.         ErrorMsg 0, "Lot_WriteDestinationSymAndVal error."
  3221.         ERROR STFQUIT
  3222.     end if
  3223. END SUB
  3224. '*************************************************************************
  3225.  
  3226. PUBLIC SUB Lot_GetDriveFreeSpaceList (szSymbol$)
  3227. '** Purpose: Creates a list of available drives, with space available
  3228. '** Author:
  3229. '** Arguments: sySymbol$        Name of list
  3230. '**     
  3231. '*************************************************************************
  3232. DIM     i%, nd%, rc$
  3233.     if FGetDriveFreeSpaceList(szSymbol$) = FALSE THEN
  3234.         ErrorMsg SID_ERR_LOT_GDFSL, ""
  3235.         ERROR STFQUIT
  3236.     end if
  3237. END SUB
  3238.  
  3239. PUBLIC FUNCTION Lot_AddToDriveFreeSpaceList (szSymbol$, szNewItem$) AS LONG
  3240. '** Purpose:Add a drive to a drive free space combo control 
  3241. '** Author:GJL
  3242. '** Arguments:szSymbol$ symbol for combo control
  3243. '**             szNewItem$ drive or UNC volume to add
  3244. '** Returns:TRUE if successful 
  3245. '**     
  3246. '*************************************************************************
  3247. DIM ret&
  3248.     ret& = FAddToDriveFreeSpaceList(szSymbol$, szNewItem$)
  3249.     IF ret& = 0 THEN
  3250.     Lot_AddToDriveFreeSpaceList = FALSE
  3251.     ELSE
  3252.     Lot_AddToDriveFreeSpaceList  = TRUE
  3253.     END IF
  3254. END FUNCTION
  3255. '*************************************************************************
  3256.  
  3257.  
  3258. '**UNC stuff
  3259. PUBLIC FUNCTION Lot_IsUnvalidatedUNCPath(szPath$) AS LONG
  3260. '** Purpose:Checks for 2 leading backslashes on a path
  3261. '** Author:GJL
  3262. '** Arguments:szPath$ a path
  3263. '** Returns:
  3264. '**     
  3265. '*************************************************************************
  3266.     IF FIsUnvalidatedUNCPath(szPath$) = 1 THEN
  3267.     Lot_IsUnvalidatedUNCPath = TRUE
  3268.     ELSE   
  3269.     Lot_IsUnvalidatedUNCPath = FALSE
  3270. END IF
  3271. END FUNCTION
  3272.  
  3273. PUBLIC FUNCTION Lot_IsValidUNCPath(szPath$) AS LONG
  3274. '** Purpose:determine whether a UNC volume is valid
  3275. '** Author:GJL
  3276. '** Arguments:A UNC volume with no trailing backslash
  3277. '** Returns:
  3278. '**     
  3279. '*************************************************************************
  3280.     IF FIsValidUNCPath(szPath$) = 1 THEN
  3281.     Lot_IsValidUNCPath = TRUE
  3282.     ELSE
  3283.     Lot_IsValidUNCPath = FALSE
  3284.     END IF
  3285. END FUNCTION
  3286.  
  3287. '**end UNC stuff
  3288.  
  3289.  
  3290. PUBLIC FUNCTION PopupModelessDlg (Dlg%, HelpID&) AS STRING
  3291. '** Purpose:
  3292. '** Author:
  3293. '** Arguments:
  3294. '** Returns:
  3295. '*************************************************************************
  3296.     DIM cuidll$, szWnd$, notused$, notused1%
  3297.  
  3298.  '-   cuidll$ = GetSymbolValue(SYM_CUIDLL$)
  3299.  ' JMD
  3300.  ' SYM_CUIDLL is now a list of DLLs
  3301.  ' First one contains code (dialog procs) and common resources
  3302.  ' Others contain product specific resources
  3303.  'NOTE: common DLL MUST be listed FIRST in the INI file
  3304.  '------------------------------
  3305.     cuidll$ = GetSymbolValue(SYM_CUIDLL$)
  3306.  
  3307.     'UIStartDlg(cuidll$, Dlg&, "FNameOrgDlgProc", APPHELP, "FHelpDlgProc")
  3308.     notused$ = UIStartDlg(cuidll$, Dlg%, FNAMEORGDLGPROC$, 0, "")
  3309.  
  3310.     ''Make sure the dialog gets fully painted
  3311.     szWnd$ = GetSymbolValue(SYM_WNDHANDLE$)
  3312.     notused1% = SendMessage(VAL(szWnd$),UM_PAINTMODELESS,0,0)
  3313. END FUNCTION
  3314.  
  3315. PUBLIC FUNCTION PopupWithFunction (Dlg%, HelpID&, Func$) AS STRING
  3316. '** Purpose:   Surface modal dialog box
  3317. '** Author:
  3318. '** Arguments:  Dlg%      ID of dialog template
  3319. '**             HelpID&   ID of help topic
  3320. '**             Func$     Dialog procedure name
  3321. '** Returns:     Exit string
  3322. '*************************************************************************
  3323.      DIM cuidll$, sz$, cdir$, notused%
  3324.  
  3325.  ' JMD
  3326.  ' SYM_CUIDLL is now a list of DLLs
  3327.  ' First one contains code (dialog procs) and common resources
  3328.  ' Others contain product specific resources
  3329.  'NOTE: common DLL MUST be listed FIRST in the INI file
  3330.  '------------------------------
  3331.  
  3332.     If GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ Then EXIT FUNCTION
  3333.     
  3334.     cuidll$ = GetSymbolValue(SYM_CUIDLL$)
  3335.     DO
  3336.         sz$ = UIStartDlg(cuidll$, Dlg%, Func$, 0, "")
  3337.  
  3338.         SELECT CASE sz$
  3339.         case "IDC_EXIT"
  3340.             notused% = FRemoveSymbol("IDC_TEXT")
  3341.             QUIT
  3342.             SetListItem "__DLG_ID", 1, STR(Dlg%)
  3343.         case "IDC_CANCEL" 
  3344.             EXIT DO
  3345.         case "IDC_CONTINUE" 
  3346.             EXIT DO
  3347.         case "IDC_OK" 
  3348.             EXIT DO
  3349.         case "IDC_MENU"
  3350.             EXIT DO
  3351.         case "IDC_BACK"
  3352.             EXIT DO
  3353.         case "IDC_CITHELP"
  3354.             cdir$ = GetSymbolValue(SYM_STF_CWDDIR$) + gINSTALLHLP$
  3355.             notused% = WinHelp(HwndFrame(), cdir$+">Install", HELP_CONTEXT, HelpID&)
  3356.             SetListItem "RETFROMHELP", 1, "T"
  3357.         case "HELPKEY" 
  3358.             cdir$ = GetSymbolValue(SYM_STF_CWDDIR$) + gINSTALLHLP$
  3359.             notused% = WinHelp(HwndFrame(), cdir$+">Install", HELP_CONTEXT, HelpID&)
  3360.             SetListItem "RETFROMHELP", 1, "T"
  3361.         END SELECT
  3362.     LOOP
  3363.     PopupWithFunction = MID$(sz$,5,LEN(sz$)-4)
  3364.     UIPop 1
  3365.     notused% = WinHelp(HwndFrame(), cdir$+">Install", HELP_QUIT, HelpID&)
  3366. END FUNCTION
  3367.  
  3368. PUBLIC FUNCTION PopupModalDlg (Dlg%, HelpID&) AS STRING
  3369. '** Purpose:
  3370. '** Author:
  3371. '** Arguments:
  3372. '** Returns:
  3373. '*************************************************************************
  3374.     PopupModalDlg=PopupWithFunction(Dlg%, HelpID&, FNAMEORGDLGPROC$)
  3375. END FUNCTION
  3376.  
  3377. PUBLIC FUNCTION RegisterCallback (ModName$, FuncName$) AS INTEGER
  3378. '** Purpose:
  3379. '** Author:
  3380. '** Arguments:
  3381. '** Returns:
  3382. '*************************************************************************
  3383.   DIM rc%, automation$
  3384.  
  3385.   automation$ = GetSymbolValue(SYM_AUTOMATIONINST$)
  3386.   If  automation$ <> gTRUE$ Then
  3387.     RemoveSymbol(SYM_CALLBACK$)
  3388.     AddListItem SYM_CALLBACK$, FuncName$
  3389.     rc% = RegisterFunction(LSI_INFO(4),ModName$,FuncName$)
  3390.      If rc% = -4 Then
  3391.         ErrorMsg 0, "Maximum Number of Callbacks exceeded"
  3392.      End If
  3393.   End If
  3394. END FUNCTION
  3395.  
  3396. '*************************************************************************
  3397. '** FUNCTION SelectDriveCombo (ComboID$, path$)
  3398. '** Purpose:    Sets the ComboID dropdown to drive$
  3399. '**
  3400. '** IN SYMBOLS   Expects SYM_UPDATELIST$ to have an "ALL" entry
  3401. '**                 otherwise dropdown combo code asserts
  3402. '** OUT SYMBOLS  Adds 2 entries to the UPDATELIST 
  3403. '**     
  3404. '** Author:  Marcel Meth
  3405. '** Arguments:    ComboId$ - Id of the combo being set e.g. "IDC_COMBO1"
  3406. '**               path$ - Path that includes a drive letter or UNC vol.
  3407. '**     
  3408. '** If drive is not in combo box it will be added 
  3409. '**
  3410. '** Returns:  Index of the drive letter in the combo
  3411. '**     
  3412. '*************************************************************************
  3413. PUBLIC FUNCTION SelectDriveCombo (ComboID$, path$) AS INTEGER
  3414.     DIM n%, i%, drv$, dirpath$, position&, addRet&
  3415.     DIM FirstDriveLetter$
  3416.  
  3417.     n% = GetListLength(ComboID$)
  3418.     SelectDriveCombo = 1
  3419.     drv$ = Lot_ExtractDriveLetter(path$)
  3420. '** 
  3421. '** UNC path
  3422. '** 
  3423.     IF drv$ = "\" THEN
  3424.       Lot_SplitUNCPath path$, drv$, dirpath$
  3425.       IF Lot_IsvalidUNCPath(drv$) = FALSE THEN
  3426.          SelectDriveCombo = FALSE
  3427.          Exit FUNCTION
  3428.       END IF
  3429.       For i% = 1 to n%
  3430.          position& = InStr(LCASE$(GetListItem(ComboID$, i%)), LCASE$(drv$)) 
  3431.          If 0 < position Then
  3432.      AddListItem SYM_UPDATELIST$, ComboID$ 
  3433.      AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3434.      SelectDriveCombo = i%
  3435.      EXIT FUNCTION
  3436.          End If
  3437.       NEXT
  3438.       addRet& = Lot_AddToDriveFreeSpaceList(ComboID$, drv$)
  3439.       IF addRet&  = TRUE THEN
  3440.          i% = GetListLength(ComboID$)
  3441.          AddListItem SYM_UPDATELIST$, ComboID$ 
  3442.          AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3443.          SelectDriveCombo = i%
  3444.       ELSE 
  3445.          SelectDriveCombo = FALSE
  3446.       END IF
  3447. '** 
  3448. '** Drive letter given
  3449. '** 
  3450.     ELSE
  3451.       For i% = 1 to n%
  3452.          If drv$ = LCASE$(MID(GetListItem(ComboID$, i%), 1, 1)) Then
  3453.      AddListItem SYM_UPDATELIST$, ComboID$ 
  3454.      AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3455.      SelectDriveCombo = i% 
  3456.      EXIT FUNCTION
  3457.          End If
  3458.       Next
  3459. '** 
  3460. '** Drive not found in list
  3461. '** 
  3462.       IF Lot_AddToDriveFreeSpaceList(ComboID$, drv$)  = FALSE THEN
  3463.          SelectDriveCombo = FALSE
  3464.       ELSE
  3465.          i% = GetListLength(ComboID$)
  3466.          AddListItem SYM_UPDATELIST$, ComboID$ 
  3467.          AddListItem SYM_UPDATELIST$, ComboID$ & "," & i%
  3468.          SelectDriveCombo = i%
  3469.       END IF
  3470.     END IF
  3471.  
  3472. END FUNCTION
  3473.  
  3474. PUBLIC FUNCTION CheckForSpace(DlgId%) AS INTEGER
  3475. '** Purpose: Checks to see if there is enough space on dest directories
  3476. '**          First does a cheap check, followed, if need be by a high
  3477. '**          granularity check.
  3478. '** Author: Marcel Meth
  3479. '** Arguments:
  3480. '**     
  3481. '**     
  3482. '** Returns: SUCCESS/FAILURE
  3483. '**     
  3484. '*************************************************************************
  3485.      DIM lTicks&, lcb&, lNew&, i%, j%, lcbNeed&, dr$, s$, helpId&, rc$
  3486.      DIM notused1$, curcursor&, UNCSym$
  3487.  
  3488.     '** Try a quick check
  3489.     CheckForSpace = SUCCESS
  3490.     lTicks&       = GetTickCount()
  3491.     lcb&          = LcbGetChapterCost("", "", SYM_COST$, SYM_NEEDED$)
  3492.     IF lcb& = CLNG(0) THEN
  3493.         DO '** Keep the modeless up at least 2 seconds
  3494.      lNew& = GetTickCount()
  3495.         LOOP UNTIL (lNew& - lTicks&) > 2000
  3496.         DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  3497.         GOTO ENDCHECK
  3498.     END IF
  3499.     '** Try A High Granularity Check
  3500.     curcursor& = ShowWaitCursor()
  3501.     SetListItem "IDC_BMP", 1, STR$(IDD_MAXSCAN_BMP) '** put up the bitmap
  3502.     notused1$ = PopupModelessDlg(DB_CHECKSPACE, DB_CHECKSPACE)
  3503.     lcb& = GetCopyListCost (gEXTRA, SYM_COST$, SYM_NEEDED$)
  3504.     UIPOP 1     '** Bring down DB_CHECKSPACE
  3505.     RestoreCursor curcursor&
  3506.     IF lcb& = CLNG(0) THEN
  3507.         DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  3508.         GOTO ENDCHECK
  3509.     END IF
  3510.  
  3511.     '** If you get here then there was not enough space (Tab is CHR$(9))
  3512.     CheckForSpace = FAILURE
  3513.     RemoveSymbol "IDC_LIST1"
  3514.     FOR i% = 1 TO 26
  3515.         lcbNeed& = CLNG(GetListItem(SYM_NEEDED$, i%))
  3516.         IF  lcbNeed& > 0 THEN
  3517.      dr$ = CHR$(ASC("A")+i%-1) + ":" + CHR$(9)
  3518.      s$  = dr$ & (lcbNeed& + 4)
  3519.      AddlistItem "IDC_LIST1", s$ + gStrK$
  3520.         END IF
  3521.     NEXT
  3522.     j%=GetListLength("UNCVOLLIST")
  3523.     FOR i% = 1 to j%
  3524.         UNCSym$ = GetListItem("UNCVOLLIST",i%)
  3525.         lcbNeed& = CLNG(GetListItem(UNCSym$, 3))
  3526.         IF lcbNeed&  > 0 THEN
  3527.             IF IsDBCSFirstAtOffset(UNCSym$, 18) = 0 THEN
  3528.                 s$ = Leftbp(UNCSym$, 18)
  3529.             ELSE
  3530.                 s$ = Leftbp(UNCSym$, 17)
  3531.             END IF
  3532.             s$ = s$ & CHR$(9) & (lcbNeed& + 4)
  3533.      AddlistItem "IDC_LIST1", s$ + gStrK$
  3534.         END IF
  3535.     NEXT
  3536.  
  3537.  
  3538.     SetListItem "SETTABS1",1,"50"
  3539.     SetListItem "NORMALFONT", 1, STR$(IDC_TEXT1)
  3540.     SetListItem "NORMALFONT", 2, STR$(IDC_TEXT2)
  3541.     SetListItem "NORMALFONT", 3, STR$(IDC_TEXT3)
  3542.  
  3543.     helpId& = DlgId%
  3544.     rc$ = PopupModalDlg (DlgId%, helpId&)
  3545.  
  3546. ENDCHECK:
  3547.     RemoveSymbol(SYM_COST$)
  3548.     RemoveSymbol(SYM_NEEDED$)
  3549.  
  3550. END FUNCTION
  3551.  
  3552. '*************************************************************************
  3553. '** SUB DisplayWhenSpaceIsTight(szCost$,szNeed$)
  3554. '**
  3555. '** Purpose:    Display a warning message when disk space is tight
  3556. '**             You should only call this sub if you think there is
  3557. '**             enough disk space. This means that we will assume that
  3558. '**             szNeed$ contains only negative numbers.
  3559. '**
  3560. '**             The message will be displayed if 110% of cost will not
  3561. '**             fit on any one disk.
  3562. '**
  3563. '** Arguments:  szCost$ and szNeed$ - Symbols for cost and need
  3564. '**             Both symbol lists are expected to contain 26 numbers
  3565. '**     
  3566. '** Author:     DND
  3567. '**     
  3568. '*************************************************************************
  3569.  
  3570. PUBLIC SUB DisplayWhenSpaceIsTight(szCost$,szNeed$)
  3571.     DIM i%, lcbCost&, lcbNeed&, sz$, retcode%
  3572.     FOR i% = 1 TO 26
  3573.         lcbCost& =  (CLNG(GetListItem(szCost$, i%)) \ 1024) \ 10
  3574.         lcbNeed& = -CLNG(GetListItem(szNeed$, i%))
  3575.         IF lcbCost& > lcbNeed& THEN
  3576.      sz$ = LdString(SID_WARN_DISKSPACE1) + _
  3577.              LdString(SID_WARN_DISKSPACE2) + _
  3578.              LdString(SID_WARN_DISKSPACE3)
  3579.      'MessageBox sz$, MB_OK+MB_ICONINFORMATION, LdString(SID_TKT_STD_TITLE)
  3580.      retcode% = DoMsgBox(sz$,LdString(SID_TKT_STD_TITLE),MB_OKCANCEL _
  3581.                     +MB_ICONINFORMATION)
  3582.             if retcode% = IDCANCEL then
  3583.                 QUIT
  3584.             end if
  3585.      EXIT FOR
  3586.         END IF
  3587.     NEXT
  3588.  
  3589. END SUB
  3590.  
  3591. '******** Microsoft Functions that Lotus re-wrote **************************
  3592.  
  3593.  
  3594.  
  3595. PUBLIC SUB ReadInfFile (szFile$) 
  3596. '** Purpose:
  3597. '** Author:
  3598. '** Arguments: szFile$
  3599. '*************************************************************************
  3600. %rem
  3601. '    if FValidFATPath(szFile$) = 0 then
  3602. '        BadArgErr 1, "ReadInfFile", szFile$
  3603. '    end if
  3604. '    IF FOpenInf(szFile$, 1, 1) = 0 THEN
  3605. '        StfApiErr saeFail, "ReadInfFile", szFile$
  3606. %endrem
  3607.      IF FOpenInf(szFile$, 1, 0) = 0 THEN
  3608.     ErrorMsg SID_ERR_READINFFILE, ""
  3609.     ERROR STFQUIT
  3610.      END IF
  3611. END SUB
  3612.  
  3613. PUBLIC SUB MakeListFromSectionKeys(szSymbol$, szSect$) 
  3614. '** Purpose:
  3615. '** Author:
  3616. '** Arguments: szSymbol$, szSect$
  3617. '*************************************************************************
  3618. %rem
  3619.      if szSymbol$ = "" then
  3620.     n% = 1
  3621.      elseif FValidInfSect(szSect$) = 0 then
  3622.     n% = 2
  3623.      else
  3624.     n% = 0
  3625.      end if
  3626.      if n% > 0 then
  3627.     BadArgErr n%, "MakeListFromSectionKeys", szSymbol$+", "+szSect$
  3628.      end if
  3629. %endrem ''DEBUG
  3630.  
  3631.      IF FSetSymbolToListOfInfKeys(szSymbol$, szSect$, 1) = 0 THEN
  3632.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONKEYS, ""
  3633.     ERROR STFQUIT
  3634.      END IF
  3635. END SUB
  3636.  
  3637. PUBLIC SUB MakeListFromSectionDate (szSym$, szSect$) 
  3638. '** Purpose:
  3639. '** Author:
  3640. '** Arguments: szSym$, szSect$
  3641. '** Returns:
  3642. '**     
  3643. '*************************************************************************
  3644. %rem
  3645.      if szSym$ = "" then
  3646.     n% = 1
  3647.      elseif FValidInfSect(szSect$) = 0 then
  3648.     n% = 2
  3649.      else
  3650.     n% = 0
  3651.      end if
  3652.      if n% > 0 then
  3653.     BadArgErr n%, "MakeListFromSectionDate", szSym$+", "+szSect$
  3654.      end if
  3655. %endrem ''DEBUG
  3656.  
  3657.      IF FMakeListInfSectionField(szSym$, szSect$, 5) = 0 THEN
  3658.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONDATE, ""
  3659.     ERROR STFQUIT
  3660.      END IF
  3661. END SUB
  3662.  
  3663. PUBLIC SUB MakeListFromSectionFilename (szSym$, szSect$) 
  3664. '** Purpose:
  3665. '** Author:
  3666. '** Arguments: szSym$, szSect$
  3667. '** Returns:
  3668. '**     
  3669. '*************************************************************************
  3670. %rem
  3671.      if szSym$ = "" then
  3672.     n% = 1
  3673.      elseif FValidInfSect(szSect$) = 0 then
  3674.     n% = 2
  3675.      else
  3676.     n% = 0
  3677.      end if
  3678.      if n% > 0 then
  3679.     BadArgErr n%, "MakeListFromSectionFilename", szSym$+", "+szSect$
  3680.      end if
  3681. %endrem ''DEBUG
  3682.  
  3683.      IF FMakeListInfSectionField(szSym$, szSect$, 1) = 0 THEN
  3684.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONFILENAME, ""
  3685.     ERROR STFQUIT
  3686.      END IF
  3687. END SUB
  3688.  
  3689. PUBLIC SUB MakeListFromSectionSize (szSym$, szSect$) 
  3690. '** Purpose:
  3691. '** Author:
  3692. '** Arguments: szSym$, szSect$
  3693. '** Returns:
  3694. '**     
  3695. '*************************************************************************
  3696. %rem
  3697.      if szSym$ = "" then
  3698.     n% = 1
  3699.      elseif FValidInfSect(szSect$) = 0 then
  3700.     n% = 2
  3701.      else
  3702.     n% = 0
  3703.      end if
  3704.      if n% > 0 then
  3705.     BadArgErr n%, "MakeListFromSectionSize", szSym$+", "+szSect$
  3706.      end if
  3707. %endrem ''DEBUG
  3708.  
  3709.      IF FMakeListInfSectionField(szSym$, szSect$, 15) = 0 THEN
  3710.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONSIZE, ""
  3711.     ERROR STFQUIT
  3712.      END IF
  3713. END SUB
  3714.  
  3715. PUBLIC SUB MakeListFromSectionVersion (szSym$, szSect$) 
  3716. '** Purpose:
  3717. '** Author:
  3718. '** Arguments: szSym$, szSect$
  3719. '** Returns:
  3720. '**     
  3721. '*************************************************************************
  3722. %rem
  3723.      if szSym$ = "" then
  3724.     n% = 1
  3725.      elseif FValidInfSect(szSect$) = 0 then
  3726.     n% = 2
  3727.      else
  3728.     n% = 0
  3729.      end if
  3730.      if n% > 0 then
  3731.     BadArgErr n%, "MakeListFromSectionVersion", szSym$+", "+szSect$
  3732.      end if
  3733. %endrem ''DEBUG
  3734.  
  3735.      IF FMakeListInfSectionField(szSym$, szSect$, 19) = 0 THEN
  3736.     ErrorMsg SID_ERR_MAKELISTFROMSECTIONVERSION, ""
  3737.     ERROR STFQUIT
  3738.      END IF
  3739. END SUB
  3740.  
  3741. PUBLIC FUNCTION SetSilentMode (mode%)  AS INTEGER
  3742. '** Purpose:
  3743. '** Author:
  3744. '** Arguments: mode%
  3745. '** Returns:
  3746. '**     
  3747. '*************************************************************************
  3748.     DIM temp&
  3749.  
  3750.     temp& = CLNG ( mode% )
  3751.      SetSilentMode = FSetSilent( temp& )
  3752. END FUNCTION
  3753.  
  3754. PUBLIC FUNCTION SetBeepingMode (mode%)  AS INTEGER
  3755. '** Purpose:
  3756. '** Author:
  3757. '** Arguments: mode%
  3758. '** Returns:
  3759. '**     
  3760. '*************************************************************************
  3761.     DIM temp&
  3762.  
  3763.     temp& = CLNG ( mode% )
  3764.  
  3765.      SetBeepingMode = FSetBeepingMode( temp& )
  3766. END FUNCTION
  3767.  
  3768. PUBLIC FUNCTION GetSectionKeyDate (szSect$, szKey$)  AS STRING
  3769. '** Purpose:
  3770. '** Author:
  3771. '** Arguments: szSect$, szKey$
  3772. '** Returns:
  3773. '**     
  3774. '*************************************************************************
  3775. %rem
  3776.      if FValidInfSect(szSect$) = 0 then
  3777.     n% = 1
  3778.      elseif szKey$ = "" then
  3779.     n% = 2
  3780.      else
  3781.     n% = 0
  3782.      end if
  3783.      if n% > 0 then
  3784.     BadArgErr n%, "GetSectionKeyDate", szSect$+", "+szKey$
  3785.      end if
  3786. %endrem ''DEBUG
  3787.      DIM szBuf$, Length&
  3788.  
  3789.      szBuf$ = string$(128, 32) 
  3790.      Length& = CbGetInfSectionKeyField(szSect$, szKey$, 5, szBuf$, 128)
  3791.      IF Length& >= 128 THEN
  3792.     ErrorMsg SID_ERR_GETSECTIONKEYDATE, ""
  3793.     ERROR STFQUIT
  3794.      END IF
  3795.  
  3796.      IF Length& = -1 THEN
  3797.     ErrorMsg SID_ERR_GETSECTIONKEYDATE2, ""
  3798.     ERROR STFQUIT
  3799.      END IF
  3800.  
  3801.      GetSectionKeyDate = LEFT$ (szBuf$, CInt(Length&))
  3802.      szBuf$ = ""
  3803. END FUNCTION
  3804.  
  3805. PUBLIC FUNCTION GetSectionKeyFilename (szSect$, szKey$)  AS STRING
  3806. '** Purpose:
  3807. '** Author:
  3808. '** Arguments: szSect$, szKey$
  3809. '** Returns:
  3810. '**     
  3811. '*************************************************************************
  3812. %rem
  3813.      if FValidInfSect(szSect$) = 0 then
  3814.     n% = 1
  3815.      elseif szKey$ = "" then
  3816.     n% = 2
  3817.      else
  3818.     n% = 0
  3819.      end if
  3820.      if n% > 0 then
  3821.     BadArgErr n%, "GetSectionKeyFilename", szSect$+", "+szKey$
  3822.      end if
  3823. %endrem ''DEBUG
  3824.      DIM szBuf$, Length&
  3825.  
  3826.      szBuf$ = string$(128, 32)
  3827.      Length& = CbGetInfSectionKeyField(szSect$, szKey$, 1, szBuf$, 128)
  3828.      IF Length& >= 128 THEN
  3829.     ErrorMsg SID_ERR_GETSECTIONKEYFILENAME, ""
  3830.     ERROR STFQUIT
  3831.      END IF
  3832.  
  3833.      IF Length& = -1 THEN
  3834.     ErrorMsg SID_ERR_GETSECTIONKEYFILENAME2, ""
  3835.     ERROR STFQUIT
  3836.      END IF
  3837.  
  3838.      GetSectionKeyFilename = LEFT$ (szBuf$, CInt(Length&) )
  3839.      szBuf$ = ""
  3840. END FUNCTION
  3841.  
  3842. PUBLIC FUNCTION GetSectionKeySize (szSect$, szKey$)  AS LONG
  3843. '** Purpose:
  3844. '** Author:
  3845. '** Arguments: szSect$, szKey$
  3846. '** Returns:
  3847. '**     
  3848. '*************************************************************************
  3849. %rem
  3850.      if FValidInfSect(szSect$) = 0 then
  3851.     n% = 1
  3852.      elseif szKey$ = "" then
  3853.     n% = 2
  3854.      else
  3855.     n% = 0
  3856.      end if
  3857.      if n% > 0 then
  3858.     BadArgErr n%, "GetSectionKeySize", szSect$+", "+szKey$
  3859.      end if
  3860. %endrem ''DEBUG
  3861.      DIM szBuf$, Length&
  3862.  
  3863.      szBuf$ = string$(128, 32)
  3864.      Length& = CbGetInfSectionKeyField(szSect$, szKey$, 15, szBuf$, 128)
  3865.      IF Length& >= 128 THEN
  3866.     ErrorMsg SID_ERR_GETSECTIONKEYSIZE, ""
  3867.     ERROR STFQUIT
  3868.      END IF
  3869.  
  3870.      IF Length& = -1 THEN
  3871.     ErrorMsg SID_ERR_GETSECTIONKEYSIZE2, ""
  3872.     ERROR STFQUIT
  3873.      END IF
  3874.      
  3875.      GetSectionKeySize = VAL (LEFT$ (szBuf$, CInt(Length&)) )
  3876.      szBuf$ = ""
  3877. END FUNCTION
  3878.  
  3879. PUBLIC FUNCTION GetSectionKeyVersion (szSect$, szKey$)  AS STRING
  3880. '** Purpose:
  3881. '** Author:
  3882. '** Arguments: szSect$, szKey$
  3883. '** Returns:
  3884. '**     
  3885. '*************************************************************************
  3886. %rem
  3887.      if FValidInfSect(szSect$) = 0 then
  3888.     n% = 1
  3889.      elseif szKey$ = "" then
  3890.     n% = 2
  3891.      else
  3892.     n% = 0
  3893.      end if
  3894.      if n% > 0 then
  3895.     BadArgErr n%, "GetSectionKeyVersion", szSect$+", "+szKey$
  3896.      end if
  3897. %endrem ''DEBUG
  3898.      DIM szBuf$, Length&
  3899.  
  3900.      szBuf$ = string$(128, 32) 
  3901.      Length& = CbGetInfSectionKeyField(szSect$, szKey$, 19, szBuf$, 128)
  3902.      IF Length& >= 128 THEN
  3903.     ErrorMsg SID_ERR_GETSECTIONKEYVERSION, ""
  3904.     ERROR STFQUIT
  3905.      END IF
  3906.  
  3907.      IF Length& = -1 THEN
  3908.     ErrorMsg SID_ERR_GETSECTIONKEYVERSION2, ""
  3909.     ERROR STFQUIT
  3910.      END IF
  3911.  
  3912.      GetSectionKeyVersion = LEFT$ (szBuf$, CInt(Length&))
  3913.      szBuf$ = ""
  3914. END FUNCTION
  3915.  
  3916. PUBLIC SUB RemoveDir (szDir$, cmo%) 
  3917. '** Purpose:
  3918. '** Author:
  3919. '** Arguments: szDir$, cmo%
  3920. '*************************************************************************
  3921. %rem
  3922.      if FValidFATDir(szDir$) = 0 then
  3923.     BadArgErr 1, "RemoveDir", szDir$+", "+STR$(cmo%)
  3924.      end if
  3925. %endrem ''DEBUG
  3926.      IF FRemoveDir(szDir$) = 0 THEN
  3927.     ErrorMsg SID_ERR_REMOVEDIR, ""
  3928.     ERROR STFERR
  3929.      END IF
  3930. END SUB
  3931.  
  3932. PUBLIC SUB DumpCopyList (szFile$) 
  3933. '** Purpose:
  3934. '** Author:
  3935. '** Arguments: szFile$
  3936. '*************************************************************************
  3937. %rem
  3938.      if szFile$ = "" then
  3939.     BadArgErr 1, "DumpCopyList", szFile$
  3940.      end if
  3941. %endrem ''DEBUG
  3942.      IF FDumpCopyListToFile (szFile$) = 0 THEN
  3943.     ErrorMsg SID_ERR_DUMPCOPYLIST, ""
  3944.     ERROR STFERR
  3945.      END IF
  3946. END SUB
  3947.  
  3948. PUBLIC SUB ClearCopyList 
  3949. '** Purpose:
  3950. '** Author:
  3951. '** Arguments: None
  3952. '*************************************************************************
  3953.      ResetCopyList
  3954. END SUB
  3955.  
  3956. PUBLIC FUNCTION GetCopyListCost (szExtraList$, szCostList$, szNeedList$)  AS LONG
  3957. '** Purpose:
  3958. '** Author:
  3959. '** Arguments: szExtraList$, szCostList$, szNeedList$
  3960. '** Returns:
  3961. '**     
  3962. '*************************************************************************
  3963.      DIM lNeed&
  3964.  
  3965.      lNeed& = LcbGetCopyListCost (szExtraList$, szCostList$, szNeedList$)
  3966.      IF lNeed& < 0 THEN
  3967.     ErrorMsg SID_ERR_GETCOPYLISTCOST, ""
  3968.     ERROR STFQUIT
  3969.      END IF
  3970.      GetCopyListCost = lNeed&
  3971. END FUNCTION
  3972.  
  3973. PUBLIC SUB CopyFilesInCopyList 
  3974. '** Purpose:
  3975. '** Author:
  3976. '** Arguments:
  3977. '** Returns:
  3978. '**     
  3979. '*************************************************************************
  3980.      DIM grc&, notused%
  3981.  
  3982.      notused% = RemovePriorVersion("begin","execution")
  3983.  
  3984.      grc& = GrcCopyFilesInCopyList (HinstFrame())
  3985.  
  3986.      IF grc& = grcUserQuit THEN
  3987.     ErrorMsg SID_ERR_NOT_COMPLETE, ""
  3988.     ERROR STFQUIT
  3989.      ELSEIF grc& > 0 THEN
  3990.     ErrorMsg SID_ERR_NOT_COMPLETE, ""
  3991.     ERROR STFQUIT
  3992.      END IF
  3993. END SUB
  3994.  
  3995. PUBLIC SUB AddSectionFilesToCopyList (szSect$, szSrc$, szDest$) 
  3996. '** Purpose:
  3997. '** Author:
  3998. '** Arguments:
  3999. '** Returns:
  4000. '**     
  4001. '*************************************************************************
  4002. %rem
  4003.      if FValidInfSect(szSect$) = 0 then
  4004.     n% = 1
  4005.      elseif FValidFATDir(szSrc$) = 0 then
  4006.     n% = 2
  4007.      elseif FValidFATDir(szDest$) = 0 then
  4008.     n% = 3
  4009.      else
  4010.     n% = 0
  4011.      end if
  4012.      if n% > 0 then
  4013.     BadArgErr n%, "AddSectionFilesToCopyList", szSect$+", "+szSrc$+", "+szDest$
  4014.      end if
  4015. %endrem ''DEBUG
  4016.  
  4017.      IF FAddSectionFilesToCopyList (szSect$, szSrc$, szDest$) = 0 THEN
  4018.  
  4019.     ErrorMsg SID_ERR_ADDSECTIONFILESTOCOPYLIST, ""
  4020.     ERROR STFQUIT
  4021.      END IF
  4022. END SUB
  4023. '*************************************************************************
  4024.  
  4025. PUBLIC SUB AddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$) 
  4026. '** Purpose:
  4027. '** Author:
  4028. '** Arguments:
  4029. '** Returns:
  4030. '**     
  4031. '*************************************************************************
  4032. %rem
  4033.      if FValidInfSect(szSect$) = 0 then
  4034.     n% = 1
  4035.      elseif szKey$ = "" then
  4036.     n% = 2
  4037.      elseif FValidFATDir(szSrc$) = 0 then
  4038.     n% = 3
  4039.      elseif FValidFATDir(szDest$) = 0 then
  4040.     n% = 4
  4041.      else
  4042.     n% = 0
  4043.      end if
  4044.      if n% > 0 then
  4045.     BadArgErr n%, "AddSectionKeyFileToCopyList", szSect$+", "+szKey$+", "+szSrc$+", "+szDest$
  4046.      end if
  4047. %endrem ''DEBUG
  4048.  
  4049.      IF FAddSectionKeyFileToCopyList (szSect$, szKey$, szSrc$, szDest$) = 0 THEN
  4050.     ErrorMsg SID_ERR_ADDSECTIONKEYFILETOCOPYLIST, ""
  4051.     ERROR STFQUIT
  4052.      END IF
  4053. END SUB
  4054.  
  4055. PUBLIC SUB AddToBillboardList (szDll$, idDlg&, szProc$, lTicks&) 
  4056. '** Purpose:
  4057. '** Author:
  4058. '** Arguments:
  4059. '** Returns:
  4060. '**     
  4061. '** NOTE: Argument szProc$ not used -- retained for backward compatibility
  4062. '*************************************************************************
  4063. DIM rc&,i%, Dll$
  4064. %rem
  4065.      if szDll$ = "" then
  4066.     n% = 1
  4067.      elseif idDlg& = 0 then
  4068.     n% = 2
  4069.      elseif szProc$ = "" then
  4070.     n% = 3
  4071.      elseif lTicks& <= 0 then
  4072.     n% = 4
  4073.      else
  4074.     n% = 0
  4075.      end if
  4076.      if n% > 0 then
  4077.     BadArgErr n%, "AddToBillboardList", szDll$+", "+STR$(idDlg&)+", "+szProc$+", "+STR$(lTicks&)
  4078.      end if
  4079. %endrem ''DEBUG
  4080.     Dll$ = FindResourceinDLL (idDlg&, RT_DIALOG)
  4081.     if Dll$ <> "" then
  4082.         IF FAddToBillboardList(Dll$, idDlg&, FNAMEORGDLGPROC$, lTicks&) <> 0 THEN
  4083.               Exit Sub
  4084.         END IF
  4085.     End if
  4086. label1:
  4087.     ErrorMsg SID_ERR_ADDTOBILLBOARDLIST, ""
  4088.     ERROR STFQUIT
  4089.  
  4090. END SUB
  4091.  
  4092. PUBLIC FUNCTION FindResourceinDLL (idDlg&, ResType%) AS STRING
  4093. '** Purpose: Traverses the list of DLLs in SYM_CUIDLL$ until it finds the
  4094. '**                             one that contains the resource
  4095. '** Author:     JMDonohue
  4096. '** Arguments:  id%     Resource id number
  4097. '** Returns:    String containing the DLL name or null string if not found
  4098. '*************************************************************************
  4099.     DIM rc&,i%, Dll$, szDlls$
  4100.     i% = 1
  4101.     szDlls$ = GetSymbolValue(SYM_CUIDLL$)
  4102.     WHILE (TRUE)
  4103.         Dll$ =  Lot_GetNthFieldFromIniString (szDlls$, i%, "") 
  4104.         if Dll$ <> "" then
  4105.             rc& = GetModuleHandle(Dll$) 
  4106.             If rc& <> 0 Then
  4107.                 rc& = FindResource(rc&, idDlg&, ResType%) 
  4108.             End If
  4109.             If rc& <> 0 Then
  4110.                 FindResourceinDLL = Dll$
  4111.                 Exit Function
  4112.             End If
  4113.         else
  4114.             FindResourceinDLL = ""
  4115.             Exit Function
  4116.         end if
  4117.         i% = i% + 1
  4118.     WEND
  4119. END FUNCTION
  4120.  
  4121. PUBLIC SUB AddBlankToBillboardList (lTicks&) 
  4122. '** Purpose:
  4123. '** Author:
  4124. '** Arguments:
  4125. '** Returns:
  4126. '**     
  4127. '*************************************************************************
  4128. %rem
  4129.      if lTicks& <= 0 then
  4130.     BadArgErr 1, "AddBlankToBillboardList", STR$(lTicks&)
  4131.      end if
  4132. %endrem ''DEBUG
  4133.      IF FAddToBillboardList("", 0, "", lTicks&) = 0 THEN
  4134.      'YYYYYYIF FAddToBillboardList(NULL, 0, NULL, lTicks&) = 0 THEN
  4135.     ErrorMsg SID_ERR_ADDBLANKTOBILLBOARDLIST, ""
  4136.     ERROR STFQUIT
  4137.      END IF
  4138. END SUB
  4139.  
  4140. PUBLIC SUB ClearBillboardList 
  4141. '** Purpose:
  4142. '** Author:
  4143. '** Arguments:
  4144. '** Returns:
  4145. '**     
  4146. '*************************************************************************
  4147.      IF FClearBillboardList() = 0 THEN
  4148.     ErrorMsg SID_ERR_CLEARBILLBOARDLIST, ""
  4149.     ERROR STFQUIT
  4150.      END IF
  4151. END SUB
  4152.  
  4153. PUBLIC SUB SetCopyGaugePosition (x%, y%) 
  4154. '** Purpose:
  4155. '** Author:
  4156. '** Arguments:
  4157. '** Returns:
  4158. '**     
  4159. '*************************************************************************
  4160.     DIM xt&, yt&
  4161.  
  4162.     xt& = CLNG ( x% )
  4163.     yt& = CLNG ( y% )
  4164.      ProSetPos xt&, yt&
  4165. END SUB
  4166.  
  4167. PUBLIC SUB QUIT
  4168. '** Purpose:
  4169. '** Author:
  4170. '** Arguments:
  4171. '*************************************************************************
  4172.     DIM sz$
  4173.  
  4174.     sz$ = PopupModalDlg (DB_EXITHISTORY, DB_EXITHISTORY)
  4175.     If sz$ = "OK" Then
  4176.         UIPopAll
  4177.         gEndStatementEncountered% = TRUE      
  4178.         END
  4179.     End If
  4180. END SUB
  4181.  
  4182.  
  4183. '*************************************************************************
  4184. '** FUNCTION Lot_WriteToRiFile(ripath$) AS INTEGER
  4185. '**            
  4186. '** Purpose:   Writes user, company and serial number in 123w.ri file. 
  4187. '** Author:    JYOTI KEDIA
  4188. '** Arguments: None
  4189. '** Returns:   SUCCESS or Failure
  4190. '*************************************************************************
  4191.  
  4192. PUBLIC FUNCTION Lot_WriteToRiFile (ripath$) AS INTEGER
  4193. DIM  uname$, cname$, snum$
  4194.  
  4195.     Lot_WriteToRiFile = TRUE
  4196.  
  4197. '** Removed all checks on length of names mmeth-8/7/95
  4198. '** C Code now truncates strings if they are too long
  4199.     uname$ = GetSymbolValue("NAME")
  4200. 'print uname$,"uname$"
  4201.     cname$ = GetSymbolValue(SYM_COMPANY$)
  4202. 'print cname$,"cname$"
  4203.     snum$  = GetSymbolValue(SYM_SERIALNUM$)
  4204.  
  4205.     IF WriteUserRegistration(ripath$,uname$,cname$,snum$) <> 0 Then
  4206.         Lot_WriteToRiFile = FALSE
  4207.     End If
  4208.  
  4209. END FUNCTION
  4210.  
  4211. '*************************************************************************
  4212. '** FUNCTION Lot_ReadDefaultsfromRi(default_ripath$) AS INTEGER
  4213. '**
  4214. '** Purpose: For standard,Server and node install reads the default user,
  4215. '**          company name and serial number from 123w.ri file. For
  4216. '**            
  4217. '** Author:    JYOTI KEDIA
  4218. '** Arguments: Sets: SYM_NAME$, SYM_COMPANY$, SYM_SERIALNUM$
  4219. '** Returns:   TURE (SUCCESS)  FALSE (FAILURE)
  4220. '*************************************************************************
  4221.  
  4222. PUBLIC FUNCTION Lot_ReadDefaultsfromRi (default_ripath$) AS INTEGER
  4223. DIM rc%, lrc&, n%
  4224.  
  4225.     DIM buf1 AS STRING : buf1 = CreateBuffer(82)   '* These strings can be upto  80
  4226.     DIM buf2 AS STRING : buf2 = CreateBuffer(82)   '* bytes not including terminator.
  4227.     DIM buf3 AS STRING : buf3 = CreateBuffer(18)   '* See lcomstf\userreg.cpp &
  4228.                           '* callback.lss:WELCOMECB
  4229.  
  4230.     Lot_ReadDefaultsfromRi = FALSE
  4231.  
  4232.     lrc& = DoesFileExist(default_ripath$,femExists)
  4233.     if lrc& = 0 goto rinotfound
  4234.  
  4235.  
  4236.     lrc& = ReadUserRegistration(default_ripath$,buf1,buf2,buf3)
  4237.     If lrc& <> 0 goto rinotfound
  4238.  
  4239.     n% = LEN(buf1)
  4240.     SetSymbolValue SYM_NAME$, LEFT$(buf1, n%)
  4241.     n% = LEN(buf2)
  4242.     SetSymbolValue SYM_COMPANY$, LEFT$(buf2, n%)
  4243.     n% = LEN(buf3)
  4244.     SetSymbolValue SYM_SERIALNUM$, LEFT$(buf3, n%)
  4245.  
  4246.     Lot_ReadDefaultsfromRi = TRUE
  4247.  
  4248.     EXIT FUNCTION
  4249.  
  4250. rinotfound: 
  4251.     
  4252. END FUNCTION
  4253.  
  4254.  
  4255. PUBLIC FUNCTION Lot_GetCurrentProduct() AS INTEGER
  4256. '** Purpose:    This function will return the current product number
  4257. '** Parameters: 
  4258. '** Return:     Product number
  4259. '*************************************************************************
  4260.     Lot_GetCurrentProduct = gCurrentProduct%
  4261. END FUNCTION
  4262.  
  4263. PUBLIC SUB Lot_SetCurrentProduct(ProdNo%) 
  4264. '** Purpose:    Set the current product number
  4265. '** Parameters: ProdNo%  the product number
  4266. '*************************************************************************
  4267.     IF ProdNo% > gMaxNumOfProds% THEN
  4268. '      ERROR STFSETERROR
  4269.         ERROR STFQUIT
  4270.     END IF
  4271.     gCurrentProduct% = ProdNo%
  4272. END SUB
  4273.  
  4274. PUBLIC FUNCTION Lot_GetInstallDir() AS STRING
  4275. '** Purpose:    Return the directory where Install will be installed.
  4276. '** Parameters: 
  4277. '** Return:     Install dir
  4278. '*************************************************************************
  4279.     DIM s$, network$
  4280. '  STATIC iniDir$ 
  4281.     DIM iniDir$ 
  4282.  
  4283. 'JMD: Ref SPR: JJML38BQSW
  4284. 'NO: Save initial value since it may change over course of install
  4285. ' This was causing errors in changing from server/standard
  4286. '  IF iniDir$ = "" THEN
  4287.         s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4288.         network$ = GetSymbolValue(SYM_NETWORK$)
  4289.         IF network$ <> gNODE THEN
  4290.             IF s$ = gSMARTSUITE$ THEN
  4291.                 iniDir$ = GetSymbolValue(SYM_BASEDIR$)
  4292.             ELSE
  4293.                 s$ = Reg_GetDirSymbolList(1)     '** First product dir list
  4294.                 s$ = GetListItem(s$,1)           '** First directory symbol
  4295.                 iniDir$ = GetSymbolValue(s$)
  4296.             END IF
  4297.         ELSE
  4298.             iniDir$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4299.         END IF
  4300. '  END IF
  4301.     Lot_GetInstallDir = iniDir$
  4302.  
  4303. END FUNCTION
  4304.  
  4305. '** FUNCTION Lot_GetTheRealProdDir(prodno%) AS STRING
  4306. '**            
  4307. '** Purpose:   Retrieve the read 123 directory
  4308. '** Author:    JYOTI KEDIA
  4309. '** Arguments: None
  4310. '** Returns:   The 123 directory (with trailing backslash)
  4311. '*************************************************************************
  4312.  
  4313. PUBLIC FUNCTION Lot_GetTheRealProdDir(prodno%) AS STRING
  4314.     DIM sym$, prodsym$, progdir$, basedir$, l%, m%, disks$, dlen%
  4315.     
  4316.     If GetSymbolValue(SYM_NETWORK$) <> gNODE$ Then
  4317.         sym$ = Reg_GetDirSymbolList(prodno%)
  4318.         prodsym$ = GetListItem(sym$, 1)
  4319.         progdir$ = GetListItem(prodsym$,1)
  4320.     Else
  4321.         If GetSymbolValue (SYM_SINGLESMARTSUITE) =  gSINGLE$ Then
  4322.     disks$ = GetSymbolValue(SYM_INSTALL_SOURCE$)
  4323.     dlen% = LEN(disks$)
  4324.     If dlen% <=0 Then
  4325.         disks$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4326.         dlen% = LEN(disks$)
  4327.      End If
  4328.     If MID$(disks$,dlen%,1) <> "\" Then
  4329.         disks$ = disks$ + "\"
  4330.     End If
  4331.     progdir$ = disks$
  4332.         Else
  4333.     '** USE THE product dir symbol, to extrapolate what
  4334.     '** the directory is on the server.
  4335.  
  4336. ''**** MMETH ???  STILL NEEDS WORK!
  4337. ''**** MMETH ???  I don't think SYMBASEDIR is always correct!
  4338.  
  4339.     sym$ = Reg_GetDirSymbolList(prodno%)
  4340.     prodsym$ = GetListItem(sym$, 1)
  4341.     progdir$ = GetListItem(prodsym$,1)
  4342.     basedir$ = GetSymbolValue (SYM_BASEDIR$)
  4343.     l% = INSTR(progdir$, basedir$)
  4344.     
  4345.     l% = INSTR(l%, progdir$, "\")
  4346.     m% = INSTR(l%, progdir$, "\")
  4347.  
  4348.     progdir$ = GetSymbolValue (SYM_INSTALL_SOURCE) +_
  4349.             RIGHT$( LEFT$ (progdir$, m%), l%)
  4350.             
  4351.         End If
  4352.     End If
  4353.  
  4354.     Lot_GetTheRealProdDir = progdir$
  4355.  
  4356. END FUNCTION
  4357.  
  4358.  
  4359. '*************************************************************************
  4360. '** FUNCTION Lot_ReadSerialNumber () AS INTEGER
  4361. '**
  4362. '** Purpose:   Reads serial number from SN.DAT and sets the symbol SERIALNUM.
  4363. '** Author:    JYOTI KEDIA
  4364. '** Arguments: None
  4365. '** Returns:   SUCCESS or FAILURE
  4366. '*************************************************************************
  4367.  
  4368. PUBLIC FUNCTION Lot_ReadSerialNumber () AS INTEGER
  4369.  
  4370.     DIM buf1 AS STRING : buf1 = CreateBuffer(18)
  4371.     DIM snpath$, rc&
  4372.  
  4373.     snpath$ = GetSymbolValue(SYM_STF_CWDDIR$)
  4374.     rc& = ReadSerialNumber(snpath$,buf1$)
  4375.     If rc& = 0 Then
  4376.         SetSymbolValue SYM_SERIALNUM$, NullTrim(buf1$)
  4377.         Lot_ReadSerialNumber = SUCCESS
  4378.     Else
  4379.         ErrorMsg SID_ERR_READSERIAL, ""
  4380.         Lot_ReadSerialNumber = FAILURE
  4381.     end if 
  4382.  
  4383. END FUNCTION
  4384.  
  4385. PUBLIC FUNCTION Lot_AreShareToolsSupported () AS INTEGER
  4386. '** Purpose:    Finds if any of the registered products supports share
  4387. '** Author:     MZ
  4388. '** Arguments:  None
  4389. '** Returns:    1 if there is at least one product that supports share
  4390. '**             0 if none of the registered prods supports share or if 
  4391. '**             no products are registered
  4392. '*************************************************************************
  4393.     DIM NumberOfProducts%,count%,ShareSupport%
  4394.     DIM network$, prod$
  4395.  
  4396.     network$ = GetSymbolValue(SYM_NETWORK$)
  4397.     ShareSupport%=0
  4398.     ' Find how many products are registered
  4399.     NumberOfProducts%=Reg_GetNumberOfProducts()
  4400.     IF(NumberOfProducts%<>0) THEN
  4401.         ' Loop through the products
  4402.         FOR count%=1 TO NumberOfProducts%
  4403.      IF Reg_GetProdSupportForShare(count%)=1 THEN
  4404.                      prod$ = Reg_GetProductAcronym(count%)
  4405.                 IF network$ = gNODE$  THEN
  4406.                      If  prod$ <> "SUIT" THEN
  4407.                           prod$ = prod$ + gTOP$
  4408.                           If Lot_IsTheFeatureInstalled (prod$) = 1 Then
  4409.                       ShareSupport%=1
  4410.                          EXIT FOR
  4411.                           End If
  4412.                      End If
  4413.                 ELSE
  4414.             ShareSupport%=1
  4415.               EXIT FOR
  4416.                 END IF    
  4417.      END IF
  4418.         NEXT
  4419.     END IF
  4420.     Lot_AreShareToolsSupported=ShareSupport%
  4421. END FUNCTION
  4422.  
  4423. PUBLIC FUNCTION Lot_AreShare32ToolsSupported () AS INTEGER
  4424. '** Purpose:    Finds if any of the registered products supports share32
  4425. '** Author:     MZ
  4426. '** Arguments:  None
  4427. '** Returns:    1 if there is at least one product that supports share32
  4428. '**             0 if none of the registered prods supports share32 or if 
  4429. '**             no products are registered
  4430. '*************************************************************************
  4431.     DIM NumberOfProducts%,count%,Share32Support%
  4432.  
  4433.     Share32Support%=0
  4434.     ' Find how many products are registered
  4435.     NumberOfProducts%=Reg_GetNumberOfProducts()
  4436.     IF(NumberOfProducts%<>0) THEN
  4437.         ' Loop through the products
  4438.         FOR count%=1 TO NumberOfProducts%
  4439.      IF Reg_GetProdSupportForShare32(count%)=1 THEN
  4440.          Share32Support%=1
  4441.          EXIT FOR
  4442.      END IF
  4443.         NEXT
  4444.     END IF
  4445.     Lot_AreShare32ToolsSupported=Share32Support%
  4446. END FUNCTION
  4447.  
  4448. PUBLIC Lot_CallShareExec_RC%
  4449. PUBLIC FUNCTION Lot_CallSharedTool (func$) AS INTEGER
  4450. '** Purpose:    Simply calls a shared function through EXECUTE
  4451. '**             if share is loaded.  Using EXECUTE allows us to
  4452. '**             not load SHARE.LSS
  4453. '** Author:     MMETH
  4454. '** Arguments:  func$ the function to call.
  4455. '** Returns:    Whatever the function returns.
  4456. '**             
  4457. '*************************************************************************
  4458. DIM notused%
  4459.     Lot_CallSharedTool = 0
  4460.     IF Lot_AreShareToolsSupported () = 1 OR _
  4461.         Lot_AreShare32ToolsSupported () = 1 THEN
  4462.         'notused% = DOEXEC (("SHARE"), (prodcall$))
  4463.         gEndStatementEncountered% = FALSE
  4464.         EXECUTE(|USE "SHARE": sub initialize: Lot_CallShareExec_RC% =| & func$ & |:end sub|)
  4465.         'EXECUTE(|USE "SHARE" : Lot_CallShareExec_RC% = | & func$)
  4466.  
  4467.         '  this gEndStatementEncountered flag is necessary because the Lotus
  4468.         '  END statement, which normally exists the entire program, only
  4469.         '  exits the top-level routine running in DOEXEC.  So,
  4470.         '  check this flag here, to see if we hit an END during DOEXEC.
  4471.  
  4472.         IF gEndStatementEncountered% = TRUE THEN
  4473.      END                       ' exit the program
  4474.         END IF
  4475.  
  4476.         Lot_CallSharedTool = Lot_CallShareExec_RC%
  4477.     END IF
  4478.  
  4479. END FUNCTION
  4480.  
  4481.  
  4482. PUBLIC SUB SetRestartDir (szDir$) 
  4483. '** Purpose:
  4484. '** Author:
  4485. '** Arguments:
  4486. '** Returns:
  4487. '**     
  4488. '*************************************************************************
  4489.     ' This part doesn't really work any way.
  4490.      IF FSetRestartDir(szDir$) = FALSE THEN
  4491.     ErrorMsg SID_ERR_SETRESTARTDIR, ""
  4492.     ERROR STFQUIT
  4493.      END IF
  4494.  
  4495. END SUB
  4496.  
  4497. PUBLIC FUNCTION RestartListEmpty  AS INTEGER
  4498. '** Purpose:
  4499. '** Author:
  4500. '** Arguments:
  4501. '** Returns:
  4502. '**     
  4503. '*************************************************************************
  4504.  
  4505.      IF CInt(FRestartListEmpty()) = FALSE THEN
  4506.     RestartListEmpty = FALSE
  4507.      ELSE
  4508.     RestartListEmpty = TRUE
  4509.      END IF
  4510.  
  4511. END FUNCTION
  4512.  
  4513. PUBLIC FUNCTION ExitExecRestart  AS INTEGER
  4514. '** Purpose:
  4515. '** Author:
  4516. '** Arguments:
  4517. '** Returns:
  4518. '**     
  4519. '*************************************************************************
  4520.  
  4521.      ExitExecRestart = CInt(FExitExecRestart())
  4522.  
  4523. END FUNCTION
  4524.  
  4525.  
  4526. CONST FEATUREPREF$ = "Feature"
  4527. CONST FEATURESECTION$ = "Server Feature Installed"
  4528.  
  4529. '** FUNCTION Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  4530. '**            
  4531. '** Purpose:   THis function will return the location of the destdir
  4532. '**            for the section, if the feature is installed.
  4533. '**            This function should **NOT** be used before PostCopyConfig.
  4534. '**            In a node situation it can be used during PreCopyConfig for
  4535. '**            shared components ** only! **
  4536. '**            This function can be used for standard, node, and server. Later
  4537. '**            will provide directory suuport on CDs also. Clients should use this function
  4538. '**            heavily! Make sure to check for empty string return "".
  4539. '**
  4540. '**            This function assumes: 
  4541. '**            1. The feature you are looking for exists in the INF file
  4542. '**                 if it doesn't, then we will always report back "" since
  4543. '**                 we depend upon the inf to find the destination directory
  4544. '**            2. The location of the feature relative to the top level
  4545. '**               product directory is identical for server and node!
  4546. '**            
  4547. '**            3. all files that can be found on the server using this
  4548. '**               functions must reside somewher under the main product directory
  4549. '**
  4550. '**            If clients use this function heavily, the transition to CD's
  4551. '**            and Toolkit supported node options will be smooth.
  4552. '**
  4553. '** Author:    MARCEL METH
  4554. '**
  4555. '** Arguments:    prodno%: The product that we are looking for.
  4556. '**            FeatureId$: which is the name of the keyword ID as it appears
  4557. '**                        in the INF FILE.
  4558. '**        filetolookfor$: a file in this section that we can use to
  4559. '**                        confirm that we found the feature.
  4560. '** Returns:   returns the directory where the feature can be found or ""
  4561. '**            If it can't be found.
  4562. '*************************************************************************
  4563. PUBLIC FUNCTION Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  4564.     DIM network$, dirsym$, chpt$, destdir$,s$,subdir$,installIniFile$
  4565.     
  4566.     network$ = GetSymbolValue(SYM_NETWORK$)
  4567.     s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4568.  
  4569.     '***Processing Suit
  4570.     '******************
  4571.     IF s$ = gSMARTSUITE$ THEN
  4572.  
  4573.         '***Processing Suit Standard
  4574.         IF network$ = gSTANDARD$ THEN
  4575.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESUITCD
  4576.      '***Get the chapter
  4577.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4578.      IF chpt$ = "" GOTO NOFEATURE
  4579.      '***Get if the feature was installed
  4580. ' We want to find it even if it's been previously copied (i.e., not now in copy
  4581. ' list
  4582. '   InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4583. '   IF InorOut%=0 GOTO MAYBESUITCD
  4584.      '***Get the destination symbol
  4585.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4586.      IF dirsym$ = "" GOTO NOFEATURE
  4587.      '***Get the destination directory
  4588.      destdir$ = GetSymbolValue(dirsym$)
  4589.      IF destdir$ = "" GOTO NOFEATURE
  4590.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESUITCD
  4591.      '***Get the destination of the feature
  4592.      Lot_WhereIsFeature = destdir$
  4593.      EXIT FUNCTION
  4594.  
  4595.  
  4596.         '***Processing Suit Node
  4597.         ELSEIF network$ = gNODE$ THEN
  4598.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESUITCD
  4599.      '***Get the chapter
  4600.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4601.      '***Look on the node
  4602.      IF chpt$ <> "" THEN
  4603.          '***Get if the feature was installed
  4604. ' We want to find it even if it's been previously copied (i.e., not now in copy
  4605. ' list
  4606. '      InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4607. '      IF InorOut%=0 GOTO LOOKONSUITSRV
  4608.          '***Get the destination directory
  4609.          dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4610.          destdir$ = GetSymbolValue(dirsym$)
  4611.          IF DoesFileExist(destdir$+filetolookfor$,femExists) <> 0 THEN 
  4612.              '***Returns the destination of the feature
  4613.              Lot_WhereIsFeature = destdir$
  4614.              EXIT FUNCTION
  4615.          ELSE 
  4616.              GOTO LOOKONSUITSRV
  4617.          END IF
  4618.      ELSE 
  4619.          GOTO LOOKONSUITSRV
  4620.      END IF
  4621.  
  4622.  
  4623.         '***Processing Suit Server
  4624.         ELSEIF network$ = gSERVER$ THEN
  4625.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESUITCD
  4626.      '***Get the chapter
  4627.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4628.      IF chpt$ = "" GOTO MAYBESUITCD
  4629.      '***Get if the feature was installed
  4630. ' We want to find it even if it's been previously copied (i.e., not now in copy
  4631. ' list
  4632. '   InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4633. '   IF InorOut%=0 GOTO MAYBESUITCD
  4634.      '***Get the destination symbol
  4635.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4636.      IF dirsym$ = "" GOTO MAYBESUITCD
  4637.      '***Get the destination directory
  4638.      destdir$ = GetSymbolValue(dirsym$)
  4639.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESUITCD
  4640.      '***Get the destination of the feature
  4641.      Lot_WhereIsFeature = destdir$
  4642.      EXIT FUNCTION
  4643.  
  4644.  
  4645.         '***Processing Suit Distribution
  4646.         ELSE  
  4647.      GOTO NOFEATURE
  4648.         END IF
  4649.  
  4650.     '***Processing Single product
  4651.     '****************************
  4652.     ELSEIF s$ = gSINGLE$ THEN
  4653.  
  4654.         '***Processing Single Product Standard
  4655.         IF network$ = gSTANDARD$ THEN
  4656.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESINGLECD
  4657.      '***Get the chapter
  4658.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4659.      IF chpt$ = "" GOTO NOFEATURE
  4660.      '***Get if the feature was installed
  4661. ' We want to find it even if it's been previously copied (i.e., not now in copy
  4662. ' list
  4663. '   InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4664. '   IF InorOut%=0 GOTO MAYBESINGLECD
  4665.      '***Get the destination symbol
  4666.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4667.      IF dirsym$ = "" GOTO NOFEATURE
  4668.      '***Get the destination directory
  4669.      destdir$ = GetSymbolValue(dirsym$)
  4670.      IF destdir$ = "" GOTO NOFEATURE
  4671.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESINGLECD
  4672.      '***Get the destination of the feature
  4673.      Lot_WhereIsFeature = destdir$
  4674.      EXIT FUNCTION
  4675.  
  4676.         '***Processing Single Product Node
  4677.         ELSEIF network$ = gNODE$ THEN
  4678.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESINGLECD
  4679.      '***Get the chapter
  4680.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4681.      '***Look on the node
  4682.      IF chpt$ <> "" THEN
  4683.          '***Get if the feature was installed
  4684. ' We want to find it even if it's been previously copied (i.e., not now in copy
  4685. ' list
  4686. '      InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4687. '      IF InorOut%=0 GOTO LOOKONSINGLESRV
  4688.          '***Get the destination directory
  4689.          dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4690.          destdir$ = GetSymbolValue(dirsym$)
  4691.          IF DoesFileExist(destdir$+filetolookfor$,femExists) <> 0 THEN 
  4692.              '***Returns the destination of the feature
  4693.              Lot_WhereIsFeature = destdir$
  4694.              EXIT FUNCTION
  4695.          ELSE 
  4696.              GOTO LOOKONSINGLESRV
  4697.          END IF
  4698.      ELSE 
  4699.          GOTO LOOKONSINGLESRV
  4700.      END IF
  4701.  
  4702.          '***Processing Single Product Server
  4703.         ELSEIF network$ = gSERVER$ THEN
  4704.      IF Lot_IsTheFeatureInstalled(featureId$) = 0 GOTO MAYBESINGLECD
  4705.      '***Get the chapter
  4706.      chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4707.      IF chpt$ = "" GOTO MAYBESINGLECD
  4708.      '***Get if the feature was installed
  4709. ' We want to find it even if it's been previously copied (i.e., not now in copy
  4710. ' list
  4711. '   InorOut% = Lot_GetChapterValInt(chpt$, F_INOROUT)
  4712. '   IF InorOut%=0 GOTO MAYBESINGLECD
  4713.      '***Get the destination symbol
  4714.      dirsym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4715.      IF dirsym$ = "" GOTO MAYBESINGLECD
  4716.      '***Get the destination directory
  4717.      destdir$ = GetSymbolValue(dirsym$)
  4718.      IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO MAYBESINGLECD
  4719.      '***Get the destination of the feature
  4720.      Lot_WhereIsFeature = destdir$
  4721.      EXIT FUNCTION
  4722.  
  4723.         '***Processing Single Product Distribution
  4724.         ELSE  
  4725.      GOTO NOFEATURE
  4726.         END IF
  4727.     END IF
  4728.  
  4729.  
  4730.     Exit Function
  4731.     LOOKONSINGLESRV:
  4732.         destdir$ = GetSymbolValue(SYM_INSTALL_SOURCE$)
  4733.         IF destdir$ = ""  THEN  destdir$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4734.         IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO LOOKONNETCOMPONENT
  4735.         Lot_WhereIsFeature = destdir$
  4736.         EXIT FUNCTION
  4737.  
  4738.     LOOKONSUITSRV:
  4739.         destdir$ = GetSymbolValue(SYM_INSTALL_SOURCE$)
  4740.         IF destdir$ = ""  THEN  destdir$ = GetSymbolValue(SYM_STF_SRCDIR$)
  4741.         installIniFile$ = MakePath(destdir$,gINSTALLINI$)
  4742.         subdir$ = GetIniKeyString(installIniFile$,"Destination Directories", Reg_GetProductAcronym(prodno%))
  4743.         IF DoesFileExist(destdir$+subdir$+filetolookfor$,femExists) = 0 GOTO LOOKONNETCOMPONENT
  4744.         Lot_WhereIsFeature = destdir$+subdir$
  4745.         EXIT FUNCTION
  4746.  
  4747.     LOOKONNETCOMPONENT:
  4748.         destdir$ = GetSymbolValue(SYM_NETCOMPONENT$)
  4749.         IF DoesFileExist(destdir$+filetolookfor$,femExists) = 0 GOTO NOFEATURE
  4750.         Lot_WhereIsFeature = destdir$
  4751.         EXIT FUNCTION
  4752.  
  4753.     MAYBESINGLECD:
  4754.         ''** MMETH WORK TO DO FOR CD; have a CDROOT symbol
  4755.     MAYBESUITCD:
  4756.         ''** MMETH WORK TO DO FOR CD; have a CDROOT symbol
  4757.  
  4758.     NOFEATURE:        
  4759.         Lot_WhereIsFeature = ""
  4760.  
  4761. END FUNCTION
  4762.  
  4763.  
  4764. PUBLIC FUNCTION Lot_IsTheFeatureInstalled(FeatureToFind$) AS INTEGER
  4765. '** Purpose:   Reads the chapters installed by the network  administrator 
  4766. '**            during server install into install.ini in the section
  4767. '**            [Server Feature Installed] and if the feature 
  4768. '**            was installed  returns 1 if not returns 0
  4769. '** Author:    MZ
  4770. '** Arguments: featureToFind$
  4771. '** Returns:   1 YES
  4772. '**            0 NO
  4773. '*************************************************************************
  4774.     DIM NetworkIns$ 
  4775.  
  4776.     'Identify if I am in node or server install
  4777.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4778.  
  4779.     PopulateCINSTALLLIST
  4780.  
  4781.     IF NetworkIns$ <> gDISTRIBUTION THEN
  4782.  
  4783.         If ISELEMENT(CINSTALL(FeatureToFind$)) <> FALSE Then
  4784.      Lot_IsTheFeatureInstalled = 1
  4785.         Else
  4786.      Lot_IsTheFeatureInstalled = 0
  4787.         End If
  4788.     Else
  4789.         Lot_IsTheFeatureInstalled = 0
  4790.     End If
  4791.  END FUNCTION
  4792.  
  4793. PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstallIni() AS INTEGER
  4794. '** Purpose:   Saves the Features installed by the network  administrator 
  4795. '**            during server install into install.ini in the section
  4796. '**            [Server Feature Installed];  This is needed at Node
  4797. '**            install time
  4798. '**            MMETH added: Also save during standard so that
  4799. '**                         we have a record for standard install
  4800. '**            MZ    Added: save [Destination Directories] needed by Node
  4801. '**                         suit install
  4802. '** Author:    MZ
  4803. '** Arguments: None
  4804. '** Returns:   SUCCESS
  4805. '*************************************************************************
  4806.     DIM NetworkIns$, prodDir$, gInstallIniFile$, CurrChpt$, FeatureName$
  4807.     DIM FeatureNum%,s$,AllProdNum%,prodNum%,ProdAcronym$,BaseDir$,symList$
  4808.     DIM prodsym$,progdir$
  4809.     DIM installkind$
  4810.  
  4811.     'Identify if I am in server or standard install
  4812.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4813.     IF NetworkIns$=gSERVER$ OR NetworkIns$=gSTANDARD THEN
  4814.  
  4815.         'Built the path to install.ini
  4816.         prodDir$ = Lot_GetInstallDir()
  4817.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4818.  
  4819.         PopulateCINSTALLLIST
  4820.  
  4821.         'Loop through the chapters and log the features
  4822.       CurrChpt$ = Lot_GetFirst("", F_INOROUT) 
  4823.       WHILE (CurrChpt$ <> "")
  4824.     'Log all installed chapters
  4825.     FeatureName$ = Lot_GetChapterValStr(CurrChpt$, F_KEYWORD)
  4826.     If ISELEMENT(CINSTALL(FeatureName$)) = FALSE Then
  4827.         FeatureNum% = gNCINSTALL%    'Lot_GetLastFeatureNumber()
  4828.         CreateIniKeyValue gInstallIniFile$,  FEATURESECTION$, "Feature"+LTRIM$(STR$(FeatureNum%+1)),FeatureName$, cmoOverwrite
  4829.         CINSTALL (FeatureName$) = "1"
  4830.         gNCINSTALL% = gNCINSTALL%+1
  4831.     END IF
  4832.     CurrChpt$ = Lot_GetNext() 
  4833.       WEND       
  4834.  
  4835.     END IF
  4836.     s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4837.  
  4838.     'Identify if I am in server and suit install
  4839.     IF NetworkIns$=gSERVER$ AND s$ = gSMARTSUITE$ THEN
  4840.         'Loop through the products and log the directories
  4841.         AllProdNum% = 0
  4842.         AllProdNum% = Reg_GetNumberOfProducts()
  4843.         IF AllProdNum% <> 0 THEN
  4844.             BaseDir$= GetSymbolValue(SYM_BASEDIR$)
  4845.             FOR prodNum%=1 TO AllProdNum%
  4846.                 ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  4847.                 'Get the directory symbol
  4848.                 symList$ = Reg_GetDirSymbolList(prodNum%)
  4849.                 prodsym$ = GetListItem(symList$, 1)
  4850.                 progdir$ = GetListItem(prodsym$,1)
  4851.                 IF LEN(BaseDir$) < LEN(progdir$) THEN
  4852.                     CreateIniKeyValue gInstallIniFile$, "Destination Directories", ProdAcronym$,MID(progdir$,LEN(BaseDir$)+1), cmoOverwrite
  4853.                 END IF
  4854.             NEXT
  4855.         END IF
  4856.  
  4857.     END IF
  4858.  
  4859.     installkind$ = GetSymbolValue(SYM_INSTALLKIND$)
  4860.     'If we're a server, always write directories
  4861.     'Otherwise, write only if NOT a language install so that uninstall can work
  4862.     'correctly on the primary language
  4863.     IF NetworkIns$ = gSERVER$ OR installkind$ <> gLANGUAGEINSTALL$ THEN
  4864.     'write all destination symbols and their values
  4865.     Lot_WriteDestinationSymAndVal gInstallIniFile$, "Destination Symbols And Values" 
  4866.     Lot_WriteCriticalDirectories gInstallIniFile$
  4867.     IF GetSymbolValue(SYM_BASEDIR$) <>"" THEN
  4868.         CreateIniKeyValue gInstallIniFile$, _
  4869.             "Destination Symbols And Values", _
  4870.             "ParentDir",GetSymbolValue(SYM_BASEDIR$),_
  4871.             cmoOverwrite
  4872.     ELSE
  4873.         CreateIniKeyValue gInstallIniFile$, _
  4874.             "Destination Symbols And Values", _
  4875.             "ParentDir","", cmoOverwrite
  4876.     END IF
  4877.     END IF
  4878.  
  4879.     Lot_SaveFeaturesInstaledInInstallIni = SUCCESS
  4880. END FUNCTION
  4881.  
  4882. '*************************************************************************
  4883.  
  4884. PUBLIC FUNCTION Lot_SaveFeaturesInstaledInInstNodeIni() AS INTEGER
  4885. '** Purpose:   Saves the Features installed by the network  administrator 
  4886. '**            during server install into install.ini in the section
  4887. '**            [Server Feature Installed];  This is needed at Node
  4888. '**            install time
  4889. '**            MMETH added: Also save during standard so that
  4890. '**                         we have a record for standard install
  4891. '**            MZ    Added: save [Destination Directories] needed by Node
  4892. '**                         suit install
  4893. '** Author:    TV
  4894. '** Arguments: None
  4895. '** Returns:   SUCCESS
  4896. '*************************************************************************
  4897.     DIM NetworkIns$, prodDir$, gInstNodeIniFile$, CurrChpt$, FeatureName$
  4898.     DIM FeatureNum%,s$,AllProdNum%,prodNum%,ProdAcronym$,BaseDir$,symList$
  4899.     DIM prodsym$,progdir$, dirSym$, inidir$
  4900.  
  4901.     'Identify if I am in server or standard install
  4902.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4903.     IF NetworkIns$=gNODE THEN
  4904.         'Built the path to cinstnod.ini
  4905.     dirSym$ = Reg_GetDirSymbolList(1)       '** First product dir list
  4906.     IF GetListLength(dirSym$) >= 1 THEN
  4907.          dirSym$ = GetListItem(dirSym$, 1)    '** First directory symbol
  4908.          inidir$ = GetSymbolValue(dirSym$) 
  4909.                  gInstNodeIniFile$ = MakePath(inidir$,"cinstnod.ini")
  4910.     END IF
  4911.  
  4912.  
  4913.         PopulateCINSTNODELIST
  4914.  
  4915.         'Loop through the chapters and log the features
  4916.       CurrChpt$ = Lot_GetFirst("", F_INOROUT) 
  4917.       WHILE (CurrChpt$ <> "")
  4918.     'Log all installed chapters
  4919.     FeatureName$ = Lot_GetChapterValStr(CurrChpt$, F_KEYWORD)
  4920.     If ISELEMENT(CINSTNODE(FeatureName$)) = FALSE Then
  4921.         FeatureNum% = gNCINSTNODE%    'Lot_GetLastFeatureNumber()
  4922.         CreateIniKeyValue gInstNodeIniFile$,  FEATURESECTION$, "Feature"+LTRIM$(STR$(FeatureNum%+1)),FeatureName$, cmoOverwrite
  4923.         CINSTNODE (FeatureName$) = "1"
  4924.         gNCINSTNODE% = gNCINSTNODE%+1
  4925.     END IF
  4926.     CurrChpt$ = Lot_GetNext() 
  4927.       WEND       
  4928.  
  4929.     END IF
  4930.     's$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  4931.  
  4932.  
  4933.     'write all destination symbols and their values
  4934.     Lot_WriteDestinationSymAndVal gInstNodeIniFile$, "Destination Symbols And Values" 
  4935.     Lot_WriteCriticalDirectories gInstNodeIniFile$
  4936.     IF GetSymbolValue(SYM_BASEDIR$) <>"" THEN
  4937.         CreateIniKeyValue gInstNodeIniFile$, _
  4938.             "Destination Symbols And Values", _
  4939.             "ParentDir",GetSymbolValue(SYM_BASEDIR$),_
  4940.             cmoOverwrite
  4941.     ELSE
  4942.         CreateIniKeyValue gInstNodeIniFile$, _
  4943.             "Destination Symbols And Values", _
  4944.             "ParentDir","", cmoOverwrite
  4945.     END IF
  4946.  
  4947.     Lot_SaveFeaturesInstaledInInstNodeIni = SUCCESS
  4948. END FUNCTION
  4949.  
  4950. '*************************************************************************
  4951.  
  4952. FUNCTION Lot_GetLastFeatureNumber() AS INTEGER
  4953. '** Purpose:   Reads the features installed by the network  administrator 
  4954. '**            so far in the section [Server Feature Installed] and returns 
  4955. '**            the last number
  4956. '** Author:    MZ
  4957. '** Returns:   last number
  4958. '*************************************************************************
  4959.     DIM NetworkIns$, prodDir$, gInstallIniFile$
  4960.     DIM FeatureTag$, FeatureID$, rc%, lrc&
  4961.     STATIC FeatureNumber%
  4962.  
  4963.     'Identify if I am in node or server install
  4964.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  4965.  
  4966.     IF NetworkIns$=gSERVER$ OR NetworkIns$=gSTANDARD$ THEN
  4967.  
  4968.         'Built the path to install.ini
  4969.         prodDir$ = Lot_GetInstallDir()
  4970.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  4971.  
  4972.         FeatureNumber%=1
  4973.         FeatureTag$=FEATUREPREF$+LTRIM$(STR$(FeatureNumber%))
  4974.         FeatureID$ = GetIniKeyString(gInstallIniFile$, FEATURESECTION$, FeatureTag$)
  4975. 'print gInstallIniFile$, FEATURESECTION$, FeatureTag$, FeatureID$, "XXX"
  4976.         lrc& = DoesFileExist(gInstallIniFile$,femExists)
  4977.         IF lrc& = 1 THEN
  4978.      IF FeatureID$ = "" THEN
  4979.          Lot_GetLastFeatureNumber = 0
  4980.          EXIT FUNCTION
  4981.      ELSE   
  4982.          WHILE (FeatureID$ <> "")
  4983.              FeatureNumber% = FeatureNumber% + 1
  4984.              FeatureTag$=FEATUREPREF$+LTRIM$(STR$(FeatureNumber%))
  4985.              FeatureID$ = GetIniKeyString(gInstallIniFile$, FEATURESECTION$, FeatureTag$)
  4986. 'print "in while", FEATURESECTION$, FeatureTag$, FeatureID$, "XXX1"
  4987.          WEND
  4988.          Lot_GetLastFeatureNumber = FeatureNumber%-1
  4989. 'print"FeatureNum% in the loop for getLastFeatureNum",STR$(FeatureNumber%)
  4990.          EXIT FUNCTION
  4991.     END IF
  4992.      
  4993.       ELSE
  4994.             CinstallIniError gInstallIniFile$, 4932
  4995.       END IF
  4996.     END IF
  4997.  END FUNCTION
  4998. '*************************************************************************
  4999.  
  5000. PUBLIC FUNCTION Lot_SaveTheNodeOptionsInInstallIni() AS INTEGER
  5001. '** Purpose:   Saves the node options installed by the network  administrator 
  5002. '**            during server install into install.ini in the section
  5003. '**            [<Product acronym> Node Options];  This is needed at Node
  5004. '**            install time
  5005. '** Author:    MZ
  5006. '** Arguments: None
  5007. '** Returns:   SUCCESS
  5008. '*************************************************************************
  5009.     DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$
  5010.     DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5011.  
  5012.     'Identify if I am in server install
  5013.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5014.     IF NetworkIns$=gSERVER$ THEN
  5015.  
  5016.         'Built the path to install.ini
  5017.         prodDir$ = Lot_GetInstallDir()
  5018.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5019.  
  5020.         'Loop through the products and log the node options
  5021.         AllProdNum% = 0
  5022.         AllProdNum% = Reg_GetNumberOfProducts()
  5023.         IF AllProdNum% <> 0 THEN
  5024.      FOR prodNum%=1 TO AllProdNum%
  5025.          AllOptNum% = 0
  5026.          AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  5027.          IF AllOptNum% <> 0 THEN
  5028.              ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5029.              'Loop though options
  5030.              FOR OptNum%=1 TO AllOptNum% 
  5031.           IF Reg_IsNodeOptionSelected(prodNum%,OptNum%)=STR(1) THEN
  5032.               OptName$ = Reg_GetNodeOptionStr(prodNum%,OptNum%)
  5033.               IF OptName$ <> "" AND FIsKeywordinCopyList (OptName$) <> FALSE THEN
  5034.             OptCount% = Lot_GetLastNodeOptNumber(ProdAcronym$)
  5035.             CreateIniKeyValue gInstallIniFile$, ProdAcronym$+" Node Options", "Option"+LTRIM$(STR$(OptCount%+1)),OptName$, cmoOverwrite
  5036.               END IF
  5037.           END IF
  5038.              NEXT
  5039.          END IF
  5040.  
  5041.      NEXT
  5042.         END IF
  5043.     END IF
  5044.     Lot_SaveTheNodeOptionsInInstallIni = SUCCESS
  5045. END FUNCTION
  5046. '*************************************************************************
  5047.  
  5048. FUNCTION Lot_GetLastNodeOptNumber(ProdAcronym$) AS INTEGER
  5049. '** Purpose:   Reads the node options installed by the network  administrator 
  5050. '**            so far in the section [<ProdAcronym$>+" Node Options"] and returns 
  5051. '**            the last number
  5052. '** Author:    MZ
  5053. '** Returns:   last number
  5054. '*************************************************************************
  5055.     DIM NetworkIns$, prodDir$, gInstallIniFile$
  5056.     DIM OptTag$, OptID$, OptPref$, lrc&
  5057.     STATIC OptNumber%
  5058.  
  5059.     'Identify if I am in node or server install
  5060.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5061.  
  5062.     IF NetworkIns$=gSERVER$ THEN
  5063.  
  5064.         'Built the path to install.ini
  5065.         prodDir$ = Lot_GetInstallDir()
  5066.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5067.  
  5068.         OptPref$ = "Option"
  5069.         OptNumber%=1
  5070.         OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5071.         OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5072.         lrc& = DoesFileExist(gInstallIniFile$,femExists)
  5073.         IF lrc& = 1 THEN
  5074.      IF OptID$ = "" THEN
  5075.          Lot_GetLastNodeOptNumber = 0
  5076.          EXIT FUNCTION
  5077.      ELSE   
  5078.          WHILE (OptID$ <> "")
  5079.              OptNumber% = OptNumber% + 1
  5080.              OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5081.              OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5082.          WEND
  5083.          Lot_GetLastNodeOptNumber = OptNumber%-1
  5084.          EXIT FUNCTION
  5085.     END IF
  5086.      
  5087.       ELSE
  5088.             CinstallIniError gInstallIniFile$, 5026
  5089.       END IF
  5090.     END IF
  5091.  END FUNCTION
  5092. '*************************************************************************
  5093.  
  5094. PUBLIC FUNCTION Lot_IsTheNodeOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  5095. '** Purpose:   Checks if the node options is available to node users
  5096. '**            by reading into install.ini in the section
  5097. '**            [<Product acronym> Node Options]; 
  5098. '** Author:    MZ
  5099. '** Arguments: None
  5100. '** Returns:   1 or 0 if it is or not available
  5101. '*************************************************************************
  5102.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$
  5103.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&
  5104.  
  5105.     'Identify if I am in node install
  5106.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5107.     IF NetworkIns$=gNODE$ THEN
  5108.  
  5109.         'Built the path to install.ini
  5110.         prodDir$ = Lot_GetInstallDir()
  5111.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5112.         ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5113.         Lot_IsTheNodeOptionsAvailToNode = 0
  5114.  
  5115.         OptPref$ = "Option"
  5116.         OptNumber%=1
  5117.         OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5118.         OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5119.         lrc& = DoesFileExist(gInstallIniFile$,femExists)
  5120.         IF lrc& = 1 THEN
  5121.      IF OptID$ = OptName$ THEN
  5122.          Lot_IsTheNodeOptionsAvailToNode = 1
  5123.          EXIT FUNCTION
  5124.      ELSE   
  5125.          WHILE (OptID$ <> "")
  5126.              IF OptID$ = OptName$ THEN
  5127.           Lot_IsTheNodeOptionsAvailToNode = 1
  5128.           EXIT FUNCTION
  5129.              END IF
  5130.              OptNumber% = OptNumber% + 1
  5131.              OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5132.              OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5133.          WEND
  5134.          Lot_IsTheNodeOptionsAvailToNode = 0
  5135.          EXIT FUNCTION
  5136.     END IF
  5137.      
  5138.       ELSE
  5139.             CinstallIniError gInstallIniFile$, 5077
  5140.       END IF
  5141.     END IF
  5142.  END FUNCTION
  5143. '*************************************************************************
  5144.  
  5145. PUBLIC FUNCTION Lot_IsAnyNodeOptAvailToNode() AS INTEGER
  5146. '** Purpose:   Checks if any node options are available to node users
  5147. '**            by reading into install.ini in the section
  5148. '**            [<Product acronym> Node Options]; 
  5149. '** Author:    MZ
  5150. '** Arguments: None
  5151. '** Returns:   1 or 0 if it is or not available
  5152. '*************************************************************************
  5153.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  5154.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&, prodNum%
  5155.  
  5156.     'Identify if I am in node install
  5157.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5158.     IF NetworkIns$=gNODE$ THEN
  5159.  
  5160.         'Built the path to install.ini
  5161.         prodDir$ = Lot_GetInstallDir()
  5162.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5163.  
  5164.         'Get all the products registered
  5165.         NumOfProds% = Reg_GetNumberOfProducts()
  5166.         IF NumOfProds% = 0 THEN
  5167.      Lot_IsAnyNodeOptAvailToNode = 0
  5168.      EXIT FUNCTION
  5169.         END IF
  5170.  
  5171.         lrc& = DoesFileExist(gInstallIniFile$,femExists)
  5172.         IF lrc& = 1 THEN
  5173.      'Loop through the products
  5174.      FOR prodNum% = 1 TO NumOfProds%
  5175.          ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5176.  
  5177.          OptPref$ = "Option"
  5178.          OptNumber%=1
  5179.          OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5180.          OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5181.          IF OptID$ <> "" THEN
  5182.              Lot_IsAnyNodeOptAvailToNode = 1
  5183.              EXIT FUNCTION
  5184.         END IF
  5185.      NEXT 
  5186.      
  5187.         ELSE
  5188.             CinstallIniError gInstallIniFile$, 5126
  5189.         END IF
  5190.  
  5191.     END IF
  5192.  END FUNCTION
  5193. '*************************************************************************
  5194.  
  5195. PUBLIC FUNCTION Lot_AreNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  5196. '** Purpose:   Checks if any node options are available to node users
  5197. '**            for the prodNum%, by reading into install.ini in the section
  5198. '**            [<Product acronym> Node Options]; 
  5199. '** Author:    MZ
  5200. '** Arguments: None
  5201. '** Returns:   1 or 0 if it is or not available
  5202. '*************************************************************************
  5203.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  5204.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&
  5205.  
  5206.     'Identify if I am in node install
  5207.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5208.     IF NetworkIns$=gNODE$ THEN
  5209.  
  5210.         'Built the path to install.ini
  5211.         prodDir$ = Lot_GetInstallDir()
  5212.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5213.  
  5214.         lrc& = DoesFileExist(gInstallIniFile$,femExists)
  5215.         IF lrc& = 1 THEN
  5216.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5217.      OptPref$ = "Option"
  5218.      OptNumber%=1
  5219.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5220.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5221.      IF OptID$ <> "" THEN
  5222.          Lot_AreNodeOptAvailToNodeForProd = 1
  5223.          EXIT FUNCTION
  5224.      ELSE
  5225.          Lot_AreNodeOptAvailToNodeForProd = 0
  5226.          EXIT FUNCTION
  5227.      END IF
  5228.     
  5229.         ELSE
  5230.             CinstallIniError gInstallIniFile$, 5168
  5231.         END IF
  5232.  
  5233.     END IF
  5234.  END FUNCTION
  5235. '*************************************************************************
  5236.  
  5237. PUBLIC FUNCTION Lot_GetNumOfNodeOptAvailToNodeForProd(prodNum%) AS INTEGER
  5238. '** Purpose:   Counts the node options available to node users
  5239. '**            for the prodNum%, by reading into install.ini in the section
  5240. '**            [<Product acronym> Node Options]; 
  5241. '** Author:    MZ
  5242. '** Arguments: None
  5243. '** Returns:   0 or num of options
  5244. '*************************************************************************
  5245.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfOptions%
  5246.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%, lrc&
  5247.  
  5248.     'Identify if I am in node install
  5249.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5250.     IF NetworkIns$=gNODE$ THEN
  5251.  
  5252.         'Built the path to install.ini
  5253.         prodDir$ = Lot_GetInstallDir()
  5254.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5255.  
  5256.         lrc& = DoesFileExist(gInstallIniFile$,femExists)
  5257.         IF lrc& = 1 THEN
  5258.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5259.      OptPref$ = "Option"
  5260.      OptNumber%=1
  5261.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5262.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5263.      IF OptID$ <> "" THEN
  5264.          WHILE (OptID$ <> "")
  5265.              NumOfOptions% = OptNumber%
  5266.              OptNumber% = OptNumber% + 1
  5267.              OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5268.              OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" Node Options", OptTag$)
  5269.          WEND
  5270.       ELSE
  5271.          Lot_GetNumOfNodeOptAvailToNodeForProd = 0
  5272.          EXIT FUNCTION
  5273.      END IF
  5274.      Lot_GetNumOfNodeOptAvailToNodeForProd = NumOfOptions
  5275.      EXIT FUNCTION
  5276.     
  5277.         ELSE
  5278.             CinstallIniError gInstallIniFile$, 5216
  5279.         END IF
  5280.  
  5281.     END IF
  5282.  END FUNCTION
  5283. '*************************************************************************
  5284.  
  5285. PUBLIC FUNCTION Lot_AreAnyNodeOptAvailToSrv() AS INTEGER
  5286. '** Purpose:   Checks the registration database to find the registred 
  5287. '**            node options
  5288. '** Author:    MZ
  5289. '** Arguments: None
  5290. '** Returns:   1 if there is at least 1 option or 0 if there is none
  5291. '*************************************************************************
  5292.     DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$, j%, nodeopt_flag%
  5293.     DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5294.     DIM OptKeyword$, chpt$
  5295.  
  5296.     'Identify if I am in server install
  5297.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5298.     IF NetworkIns$=gSERVER$ THEN
  5299.  
  5300.         'Built the path to install.ini
  5301.         prodDir$ = Lot_GetInstallDir()
  5302.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5303.  
  5304.         'Loop through the products and check for node options
  5305.         AllProdNum% = 0
  5306.         nodeopt_flag% = 0
  5307.         AllProdNum% = Reg_GetNumberOfProducts()
  5308.         IF AllProdNum% <> 0 THEN
  5309.      FOR prodNum%=1 TO AllProdNum%
  5310.          AllOptNum% = 0
  5311.          AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  5312.  
  5313. '            Reg_ReSetAllNodeOptsSelToDefaults prodNum%
  5314.          OptNum%=Reg_GetNumofNodeOptions(prodNum%)
  5315.      IF OptNum% <> 0 THEN
  5316.          chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(prodNum%) + gTOP$)
  5317.         ' Loop through the options
  5318.          FOR j% = 1 TO OptNum%
  5319.         OptKeyWord$ = Reg_GetNodeOptionStr(prodNum%,j%)
  5320.         chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  5321.         IF INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1 THEN
  5322.          nodeopt_flag% = 1
  5323.         END IF
  5324.          NEXT
  5325.      END IF
  5326.      
  5327.      IF AllOptNum% <> 0 AND nodeopt_flag% <> 0 THEN
  5328.              Lot_AreAnyNodeOptAvailToSrv=1
  5329.              EXIT FUNCTION
  5330.          END IF
  5331.      NEXT
  5332.         ELSE
  5333.      Lot_AreAnyNodeOptAvailToSrv=0
  5334.      EXIT FUNCTION
  5335.         END IF
  5336.     ELSE
  5337.         Lot_AreAnyNodeOptAvailToSrv=0
  5338.         EXIT FUNCTION
  5339.     END IF
  5340.  
  5341.     Lot_AreAnyNodeOptAvailToSrv=0
  5342. END FUNCTION
  5343. '*************************************************************************
  5344.  
  5345.  
  5346.  
  5347. PUBLIC FUNCTION Lot_SaveTheCDOptionsInInstallIni() AS INTEGER
  5348. '** Purpose:   Saves the CD options installed by the network  administrator 
  5349. '**            during server install into install.ini in the section
  5350. '**            [<Product acronym> CD Options];  This is needed at CD
  5351. '**            install time
  5352. '** Author:    MZ
  5353. '** Arguments: None
  5354. '** Returns:   SUCCESS
  5355. '*************************************************************************
  5356.     DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$
  5357.     DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5358.  
  5359.     'Identify if I am in server install
  5360.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5361.     IF NetworkIns$=gSERVER$ THEN
  5362.  
  5363.         'Built the path to install.ini
  5364.         prodDir$ = Lot_GetInstallDir()
  5365.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5366.  
  5367.         'Loop through the products and log the CD options
  5368.         AllProdNum% = 0
  5369.         AllProdNum% = Reg_GetNumberOfProducts()
  5370.         IF AllProdNum% <> 0 THEN
  5371.      FOR prodNum%=1 TO AllProdNum%
  5372.          AllOptNum% = 0
  5373.          AllOptNum% = Reg_GetNumofCDOptions(prodNum%)
  5374.          IF AllOptNum% <> 0 THEN
  5375.              ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5376.              'Loop though options
  5377.              FOR OptNum%=1 TO AllOptNum% 
  5378.           IF Reg_IsCDOptionSelected(prodNum%,OptNum%)=STR(1) THEN
  5379.               OptName$ = Reg_GetCDOptionStr(prodNum%,OptNum%)
  5380.               IF OptName$ <> "" AND FIsKeywordinCopyList (OptName$) <> FALSE THEN
  5381.             OptCount% = Lot_GetLastCDOptNumber(ProdAcronym$)
  5382.             CreateIniKeyValue gInstallIniFile$, ProdAcronym$+" CD Options", "Option"+LTRIM$(STR$(OptCount%+1)),OptName$, cmoOverwrite
  5383.               END IF
  5384.           END IF
  5385.              NEXT
  5386.          END IF
  5387.  
  5388.      NEXT
  5389.         END IF
  5390.     END IF
  5391.     Lot_SaveTheCDOptionsInInstallIni = SUCCESS
  5392. END FUNCTION
  5393. '*************************************************************************
  5394.  
  5395. SUB CinstallIniError(IniFile$, lineno%)    
  5396. '** Purpose:   Reports a missing cinstall.ini file with path sought
  5397. '**            debug version shows line number of error
  5398. '** Author:    JMD
  5399. '*************************************************************************
  5400.     DIM s$ : s$ = CHR(10) + CHR(9)
  5401.     if ToolkitDebug% = TRUE then s$ = s$ + "Tag " + Str(lineno%) + " : "
  5402.     s$ = s$ + IniFile$
  5403.     FatalErrorMsg SID_ERR_INSTALLINI_MISSING, s$, STFQUIT
  5404. END SUB  
  5405.  
  5406. FUNCTION Lot_GetLastCDOptNumber(ProdAcronym$) AS INTEGER
  5407. '** Purpose:   Reads the CD options installed by the network  administrator 
  5408. '**            so far in the section [<ProdAcronym$>+" CD Options"] and returns 
  5409. '**            the last number
  5410. '** Author:    MZ
  5411. '** Returns:   last number
  5412. '*************************************************************************
  5413.     DIM NetworkIns$, prodDir$, gInstallIniFile$
  5414.     DIM OptTag$, OptID$, OptPref$, rc%
  5415.     STATIC OptNumber%
  5416.  
  5417.     'Identify if I am in CD or server install
  5418.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5419.  
  5420.     IF NetworkIns$=gSERVER$ THEN
  5421.  
  5422.         'Built the path to install.ini
  5423.         prodDir$ = Lot_GetInstallDir()
  5424.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5425.  
  5426.         OptPref$ = "Option"
  5427.         OptNumber%=1
  5428.         OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5429.         OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5430.         IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5431.      IF OptID$ = "" THEN
  5432.          Lot_GetLastCDOptNumber = 0
  5433.          EXIT FUNCTION
  5434.      ELSE   
  5435.          WHILE (OptID$ <> "")
  5436.              OptNumber% = OptNumber% + 1
  5437.              OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5438.              OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5439.          WEND
  5440.          Lot_GetLastCDOptNumber = OptNumber%-1
  5441.          EXIT FUNCTION
  5442.     END IF
  5443.      
  5444.       ELSE
  5445.             CinstallIniError gInstallIniFile$, 5402 
  5446.       END IF
  5447.     END IF
  5448.  END FUNCTION
  5449. '*************************************************************************
  5450.  
  5451. PUBLIC FUNCTION Lot_IsTheCDOptionsAvailToNode(prodNum%,OptName$) AS INTEGER
  5452. '** Purpose:   Checks if the CD options is available to node users
  5453. '**            by reading into install.ini in the section
  5454. '**            [<Product acronym> CD Options]; 
  5455. '** Author:    MZ
  5456. '** Arguments: None
  5457. '** Returns:   1 or 0 if it is or not available
  5458. '*************************************************************************
  5459.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$
  5460.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%
  5461.  
  5462.     'Identify if I am in node install
  5463.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5464.     IF NetworkIns$=gNODE$ THEN
  5465.  
  5466.         'Built the path to install.ini
  5467.         prodDir$ = Lot_GetInstallDir()
  5468.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5469.         ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5470.         Lot_IsTheCDOptionsAvailToNode = 0
  5471.  
  5472.         OptPref$ = "Option"
  5473.         OptNumber%=1
  5474.         OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5475.         OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5476.         IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5477.      IF OptID$ = OptName$ THEN
  5478.          Lot_IsTheCDOptionsAvailToNode = 1
  5479.          EXIT FUNCTION
  5480.      ELSE   
  5481.          WHILE (OptID$ <> "")
  5482.              IF OptID$ = OptName$ THEN
  5483.           Lot_IsTheCDOptionsAvailToNode = 1
  5484.           EXIT FUNCTION
  5485.              END IF
  5486.              OptNumber% = OptNumber% + 1
  5487.              OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5488.              OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5489.          WEND
  5490.          Lot_IsTheCDOptionsAvailToNode = 0
  5491.          EXIT FUNCTION
  5492.     END IF
  5493.      
  5494.       ELSE
  5495.             CinstallIniError gInstallIniFile$, 5433
  5496.       END IF
  5497.     END IF
  5498.  END FUNCTION
  5499. '*************************************************************************
  5500.  
  5501. PUBLIC FUNCTION Lot_IsAnyCDOptAvailToNode() AS INTEGER
  5502. '** Purpose:   Checks if any CD options are available to node users
  5503. '**            by reading into install.ini in the section
  5504. '**            [<Product acronym> CD Options]; 
  5505. '** Author:    MZ
  5506. '** Arguments: None
  5507. '** Returns:   1 or 0 if it is or not available
  5508. '*************************************************************************
  5509.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  5510.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%,prodNum%
  5511.  
  5512.     'Identify if I am in node install
  5513.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5514.     IF NetworkIns$=gNODE$ THEN
  5515.  
  5516.         'Built the path to install.ini
  5517.         prodDir$ = Lot_GetInstallDir()
  5518.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5519.  
  5520.         'Get all the products registered
  5521.         NumOfProds% = Reg_GetNumberOfProducts()
  5522.         IF NumOfProds% = 0 THEN
  5523.      Lot_IsAnyCDOptAvailToNode = 0
  5524.      EXIT FUNCTION
  5525.         END IF
  5526.  
  5527.         IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5528.      'Loop through the products
  5529.      FOR prodNum% = 1 TO NumOfProds%
  5530.          ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5531.  
  5532.          OptPref$ = "Option"
  5533.          OptNumber%=1
  5534.          OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5535.          OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5536.          IF OptID$ <> "" THEN
  5537.              Lot_IsAnyCDOptAvailToNode = 1
  5538.              EXIT FUNCTION
  5539.         END IF
  5540.      NEXT 
  5541.      
  5542.         ELSE
  5543.             CinstallIniError gInstallIniFile$, 5481
  5544.         END IF
  5545.  
  5546.     END IF
  5547.  END FUNCTION
  5548. '*************************************************************************
  5549.  
  5550. PUBLIC FUNCTION Lot_AreCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  5551. '** Purpose:   Checks if any CD options are available to node users
  5552. '**            for the prodNum%, by reading into install.ini in the section
  5553. '**            [<Product acronym> CD Options]; 
  5554. '** Author:    MZ
  5555. '** Arguments: None
  5556. '** Returns:   1 or 0 if it is or not available
  5557. '*************************************************************************
  5558.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfProds%
  5559.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%
  5560.  
  5561.     'Identify if I am in node install
  5562.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5563.     IF NetworkIns$=gNODE$ THEN
  5564.  
  5565.         'Built the path to install.ini
  5566.         prodDir$ = Lot_GetInstallDir()
  5567.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5568.  
  5569.         IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5570.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5571.      OptPref$ = "Option"
  5572.      OptNumber%=1
  5573.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5574.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5575.      IF OptID$ <> "" THEN
  5576.          Lot_AreCDOptAvailToNodeForProd = 1
  5577.          EXIT FUNCTION
  5578.      ELSE
  5579.          Lot_AreCDOptAvailToNodeForProd = 0
  5580.          EXIT FUNCTION
  5581.      END IF
  5582.     
  5583.         ELSE
  5584.             CinstallIniError gInstallIniFile$, 5522
  5585.         END IF
  5586.  
  5587.     END IF
  5588.  END FUNCTION
  5589. '*************************************************************************
  5590.  
  5591. PUBLIC FUNCTION Lot_GetNumOfCDOptAvailToNodeForProd(prodNum%) AS INTEGER
  5592. '** Purpose:   Counts the CD options available to node users
  5593. '**            for the prodNum%, by reading into install.ini in the section
  5594. '**            [<Product acronym> CD Options]; 
  5595. '** Author:    MZ
  5596. '** Arguments: None
  5597. '** Returns:   0 or num of options
  5598. '*************************************************************************
  5599.     DIM NetworkIns$, prodDir$, gInstallIniFile$, ProdAcronym$,NumOfOptions%
  5600.     DIM OptTag$, OptID$, OptPref$, OptNumber%, rc%
  5601.  
  5602.     'Identify if I am in node install
  5603.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5604.     IF NetworkIns$=gNODE$ THEN
  5605.  
  5606.         'Built the path to install.ini
  5607.         prodDir$ = Lot_GetInstallDir()
  5608.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5609.  
  5610.         IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  5611.      ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  5612.      OptPref$ = "Option"
  5613.      OptNumber%=1
  5614.      OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5615.      OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5616.      IF OptID$ <> "" THEN
  5617.          WHILE (OptID$ <> "")
  5618.              NumOfOptions% = OptNumber%
  5619.              OptNumber% = OptNumber% + 1
  5620.              OptTag$=OptPref$+LTRIM$(STR$(OptNumber%))
  5621.              OptID$ = GetIniKeyString(gInstallIniFile$,ProdAcronym$+" CD Options", OptTag$)
  5622.          WEND
  5623.       ELSE
  5624.          Lot_GetNumOfCDOptAvailToNodeForProd = 0
  5625.          EXIT FUNCTION
  5626.      END IF
  5627.      Lot_GetNumOfCDOptAvailToNodeForProd = NumOfOptions
  5628.      EXIT FUNCTION
  5629.     
  5630.         ELSE
  5631.             CinstallIniError gInstallIniFile$, 5569
  5632.         END IF
  5633.  
  5634.     END IF
  5635.  END FUNCTION
  5636. '*************************************************************************
  5637.  
  5638. PUBLIC FUNCTION Lot_AreAnyCDOptAvailToSrv() AS INTEGER
  5639. '** Purpose:   Checks the registration database to find the registred 
  5640. '**            CD options
  5641. '** Author:    MZ
  5642. '** Arguments: None
  5643. '** Returns:   1 if there is at least 1 option or 0 if there is none
  5644. '*************************************************************************
  5645.     DIM NetworkIns$, prodDir$, gInstallIniFile$, OptName$, j%, CDopt_flag%
  5646.     DIM OptCount%, prodNum%, AllProdNum%, ProdAcronym$, AllOptNum%, OptNum%
  5647.     DIM OptKeyword$, chpt$
  5648.  
  5649.     'Identify if I am in server install
  5650.     NetworkIns$ = GetSymbolValue(SYM_NETWORK$)
  5651.     IF NetworkIns$=gSERVER$ THEN
  5652.  
  5653.         'Built the path to install.ini
  5654.         prodDir$ = Lot_GetInstallDir()
  5655.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  5656.  
  5657.         'Loop through the products and check for CD options
  5658.         AllProdNum% = 0
  5659.         CDopt_flag% = 0
  5660.         AllProdNum% = Reg_GetNumberOfProducts()
  5661.         IF AllProdNum% <> 0 THEN
  5662.      FOR prodNum%=1 TO AllProdNum%
  5663.          AllOptNum% = 0
  5664.          AllOptNum% = Reg_GetNumofCDOptions(prodNum%)
  5665.  
  5666. '            Reg_ReSetAllCDOptsSelToDefaults prodNum%
  5667.          OptNum%=Reg_GetNumofCDOptions(prodNum%)
  5668.      IF OptNum% <> 0 THEN
  5669.          chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(prodNum%) + gTOP$)
  5670.         ' Loop through the options
  5671.          FOR j% = 1 TO OptNum%
  5672.         OptKeyWord$ = Reg_GetCDOptionStr(prodNum%,j%)
  5673.         chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  5674.         IF INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1 THEN
  5675.          CDopt_flag% = 1
  5676.         END IF
  5677.          NEXT
  5678.      END IF
  5679.      
  5680.      IF AllOptNum% <> 0 AND CDopt_flag% <> 0 THEN
  5681.              Lot_AreAnyCDOptAvailToSrv=1
  5682.              EXIT FUNCTION
  5683.          END IF
  5684.      NEXT
  5685.         ELSE
  5686.      Lot_AreAnyCDOptAvailToSrv=0
  5687.      EXIT FUNCTION
  5688.         END IF
  5689.     ELSE
  5690.         Lot_AreAnyCDOptAvailToSrv=0
  5691.         EXIT FUNCTION
  5692.     END IF
  5693.  
  5694.     Lot_AreAnyCDOptAvailToSrv=0
  5695. END FUNCTION
  5696. '*************************************************************************
  5697.  
  5698.  
  5699.  
  5700.  
  5701. '*************************************************************************
  5702. '** FUNCTION GetNotesPathfromLotusIni() AS STRING
  5703. '**
  5704. '** Purpose: Gets the notes dir path from Lotus.ini file, and searches for
  5705. '**          notes.exe in the product dir path. 
  5706. '**            
  5707. '** Author:    INSIK RHEE
  5708. '** Arguments: None
  5709. '** Returns:   if notes.exe does not exist in dir specified in lotus.ini, it
  5710. '**            returns "", otherwise returns the full path without filename.
  5711. '*************************************************************************
  5712.  
  5713.  
  5714. PUBLIC FUNCTION GetNotesPathfromLotusIni() AS STRING
  5715. DIM DestDir$, lotusinipath$, defdir$, temp%, ProdDir$, fullpath$, rv%
  5716.  
  5717.     DestDir$ = GetWindowsDir()
  5718.     lotusinipath$ = DestDir$ +"lotus.ini"
  5719.  
  5720.     if DoesFileExist(lotusinipath$,femExists) then
  5721.         defdir$ = GetIniKeyString(lotusinipath$,"Lotus Applications", "Notes")
  5722.         if defdir$ <> "" then
  5723.      temp% = INSTR(1,LCASE$(defdir$),"notes.exe")
  5724.      if temp% <> 0 then
  5725.          ProdDir$ = MID$(defdir$,1,(temp%-1))
  5726.          if ProdDir$ <> "" then
  5727.              fullpath$ = ProdDir$ + "notes.exe"
  5728.              if DoesFileExist(fullpath$, femExists) then
  5729.           GetNotesPathfromLotusIni = MID$(defdir$,1,(temp%-2))
  5730.           EXIT FUNCTION
  5731.              end if 
  5732.          end if 
  5733.      end if 
  5734.         end if 
  5735.     end if
  5736.  
  5737.     GetNotesPathfromLotusIni = ""
  5738.  
  5739. END FUNCTION
  5740.  
  5741. '*************************************************************************
  5742. '** FUNCTION IsNotesInPath AS INTEGER
  5743. '**
  5744. '** Purpose: Detects the presence of notes path in the autoexec.bat file
  5745. '**            
  5746. '** Author:    INSIK RHEE
  5747. '** Arguments: None
  5748. '** Returns:   1 if true, 0 if false.
  5749. '*************************************************************************
  5750.  
  5751. PUBLIC FUNCTION IsNotesInPath() AS INTEGER
  5752. DIM     notesdir$,autoexec$,Buffer$
  5753. DIM autofile%, FoundPath%
  5754.  
  5755.     notesdir$ = GetNotesPathfromLotusIni()
  5756.     IsNotesInPath = 0                                                                       ' default = FALSE
  5757.     if notesdir$ = "" then
  5758.         IsNotesInPath = 1
  5759.         EXIT FUNCTION
  5760.     end if
  5761.     autoexec$ = GetBootDrive() 
  5762.     IF autoexec$ <> "" THEN
  5763.         autoexec$ = autoexec$ + "autoexec.bat" 
  5764.     ELSE
  5765.         autoexec$ = "c:\" + "autoexec.bat"
  5766.     END IF
  5767.  
  5768.     autofile% = 111
  5769.     OPEN autoexec$ FOR INPUT AS autofile%
  5770.     Do Until EOF(autofile%)
  5771.         LINE INPUT #autofile%, Buffer$
  5772.         FoundPath% = INSTR(1,LCASE$(Buffer$), "path")
  5773.         if FoundPath% <> 0 Then                                                 ' path statement found.
  5774.             FoundPath% = INSTR(FoundPath%, LCASE$(Buffer$), LCASE$(notesdir$))
  5775.             if FoundPath% <> 0 Then 
  5776.                 IsNotesInPath = 1
  5777.                 CLOSE #autofile%
  5778.                 EXIT FUNCTION
  5779.             end if
  5780.         end if
  5781.     Loop
  5782.     CLOSE #autofile%
  5783.  
  5784. END FUNCTION
  5785.  
  5786. '*************************************************************************
  5787. '** FUNCTION IsShareInAUTOEXEC AS INTEGER
  5788. '**
  5789. '** Purpose: Detects the presence of SHARE.EXE in the autoexec.bat file
  5790. '**            
  5791. '** Author:    INSIK RHEE
  5792. '** Arguments: None
  5793. '** Returns:   1 if true, 0 if false.
  5794. '*************************************************************************
  5795.  
  5796. PUBLIC FUNCTION IsShareInAUTOEXEC() AS INTEGER
  5797. DIM   autoexec$,Buffer$
  5798. DIM   autofile%, FoundShare%
  5799.  
  5800.     IsShareInAUTOEXEC = 0                                                                   ' default = FALSE
  5801.     autoexec$ = GetBootDrive() 
  5802.     IF autoexec$ <> "" THEN
  5803.         autoexec$ = autoexec$ + "autoexec.bat" 
  5804.     ELSE
  5805.         autoexec$ = "c:\" + "autoexec.bat"
  5806.     END IF
  5807.  
  5808.     autofile% = 111
  5809.     OPEN autoexec$ FOR INPUT AS autofile%
  5810.     Do Until EOF(autofile%)
  5811.         LINE INPUT #autofile%, Buffer$
  5812.         FoundShare% = INSTR(1,LCASE$(Buffer$), "share")
  5813.         if FoundShare% <> 0 Then                                                        ' share statement found.
  5814.             IsShareInAUTOEXEC = 1
  5815.             CLOSE #autofile%
  5816.             EXIT FUNCTION
  5817.         end if
  5818.     Loop
  5819.     CLOSE #autofile%
  5820.  
  5821. END FUNCTION
  5822.  
  5823. '*************************************************************************
  5824. '** FUNCTION ModifyAutoexec AS STRING
  5825. '**
  5826. '** Purpose: Modifies autoexec.bat to include share and/or modify path to 
  5827. '**             include notes 
  5828. '**            
  5829. '** Author:    INSIK RHEE
  5830. '** Arguments:  modflag%        = bitwise flag on what to modify.
  5831. '**                             directmod%      = 1 to modify autoexec.bat (backing up old one)
  5832. '**                                                       0 to modify to a backup file 
  5833. '**                             backup$         = backup filename 
  5834. '** Returns:   NULL string if success.  string describing error otherwise
  5835. '**     NOTE: This function assumes that the caller has already used the 
  5836. '** IsNotesInPath and IsShareEnabled calls and will NOT check to see if 
  5837. '** the modifications are redundant.
  5838. '*************************************************************************
  5839.  
  5840.  
  5841. PUBLIC FUNCTION ModifyAutoexec(modflag%,directmod%,backup$) AS STRING
  5842. DIM     notesdir$,src$,dest$,Buffer$
  5843. DIM srcfile%,destfile%, FoundPath%, PathNext%
  5844.  
  5845.     srcfile% = 112
  5846.     destfile% = 113
  5847.     ModifyAutoexec=""                                                               ' default
  5848.     if (modflag% AND MANotes) then                          ' notes mod
  5849.         notesdir$ = GetNotesPathfromLotusIni()
  5850.     end if
  5851.     src$ = GetBootDrive() 
  5852.     IF src$ <> "" THEN
  5853.         dest$ = src$ + backup$
  5854.         src$ = src$ + "autoexec.bat"
  5855.      ELSE
  5856.         dest$ = "c:\" + backup$
  5857.         src$ = "c:\" + "autoexec.bat"
  5858.     END IF
  5859.  
  5860.     
  5861.     IF Win32CopyFile(src$, dest$, TRUE) = FALSE THEN
  5862.         ModifyAutoexec = LdString( SID_ERR_AUTOEXEC_NOT_COPIED )
  5863.         EXIT FUNCTION
  5864.     End If
  5865.  
  5866.     Win32CopyFile src$, dest$, TRUE
  5867.  
  5868.     if directmod% <> 0 then
  5869.         src$ = dest$
  5870.         dest$ = GetBootDrive()
  5871.         IF dest$ <> "" THEN
  5872.      dest$ = dest$ + "autoexec.bat" 
  5873.         ELSE
  5874.             dest$ = "c:\" + "autoexec.bat"
  5875.         END IF
  5876.     
  5877.     End If
  5878.     OPEN src$ FOR INPUT AS srcfile%
  5879.     OPEN dest$ FOR OUTPUT AS destfile%
  5880.     PathNext% = 0   ' set to 1 when path found, 2 after mod is done.
  5881.     Do Until EOF(srcfile%)
  5882.         LINE INPUT #srcfile%, Buffer$
  5883.         FoundPath% = INSTR(1,LCASE$(Buffer$), "path")
  5884.         if ((FoundPath% <> 0) AND (PathNext <> 2)) Then  ' path statement found.
  5885.             PathNext% = 1
  5886.         end if
  5887.         PRINT #destfile%, Buffer$
  5888.         if PathNext% = 1 Then
  5889.             if (modflag% AND MANotes) then
  5890.                 PRINT #destfile%, "PATH=%PATH%;"+notesdir$
  5891.             End If
  5892.             If (modflag% AND MAShare) then
  5893.                 PRINT #destfile%, "SHARE"
  5894.             End If
  5895.             PathNext% = 2
  5896.         End If
  5897.     Loop
  5898.     if PathNext% <> 2 Then                                                                  ' path statement not found?
  5899.         if (modflag% AND MANotes) then
  5900.             PRINT #destfile%, "PATH=%PATH%;"+notesdir$
  5901.         End If
  5902.         If (modflag% AND MAShare) then
  5903.             PRINT #destfile%, "SHARE"
  5904.         End If
  5905.     End If
  5906.     CLOSE #srcfile%, #destfile%
  5907. END FUNCTION
  5908.  
  5909. '*************************************************************************
  5910. '** FUNCTION GetBootDrive() AS STRING
  5911. '**
  5912. '** Purpose: Gets the boot drive letter and trailing slash (e.g. "C:\")
  5913. '**            
  5914. '** Author:    INSIK RHEE
  5915. '** Arguments: None
  5916. '** Returns:   Searches the fixed drive list for AUTOEXEC.BAT
  5917. '**                        returns null string if none found. (or READ_ONLY drive)
  5918. '*************************************************************************
  5919.  
  5920. PUBLIC FUNCTION GetBootDrive() AS STRING
  5921. DIM lDrive$, Length%, count%
  5922.     GetLocalHardDrivesList SYM_LOCALHARDDRIVES$
  5923.     Length% = GetListLength(SYM_LOCALHARDDRIVES$)
  5924.     FOR count% = 1 TO Length%
  5925.         lDrive$     = GetListItem(SYM_LOCALHARDDRIVES$, count%) + ":\"
  5926.         IF IsDirWritable(lDrive$) AND (DoesFileExist(lDrive$+"autoexec.bat",femExists)=1) THEN
  5927.         GetBootDrive$ = lDrive$
  5928.             EXIT FUNCTION
  5929.         END IF
  5930.     NEXT
  5931.     GetBootDrive$=""
  5932. END FUNCTION
  5933.  
  5934.  
  5935. PUBLIC SUB      DL_SetOraclePath
  5936. '** Purpose:   This subroutine Sets the Oracle Data Path symbol
  5937. '**            
  5938. '** Author:    JMD
  5939. '** Arguments: NONE
  5940. '*************************************************************************
  5941.     DIM TmpDDir$
  5942.      ' Should use this if NODE or STANDARD - 
  5943.      TmpDDir$ = Lot_GetORACLEHomePath() 
  5944.      IF TmpDDir$ <> "" THEN
  5945.          SetSymbolValue SYM_ORACLEHOMEDIR$, TmpDDir$
  5946.          Lot_RefreshDestination(SYM_ORACLEHOMEDIR$)
  5947.      End If
  5948. END SUB
  5949.  
  5950. PUBLIC SUB      DL_SetNotesDataPath
  5951. '** Purpose:   This subroutine Sets the DataLens specific symbols for the
  5952. '**            Notes Data Path.  This facilitates copying NSF files to the 
  5953. '**            proper DOC location
  5954. '** Author:    PJT
  5955. '** Arguments: NONE
  5956. '*************************************************************************
  5957.     DIM TmpDDir$
  5958.      ' Should use this if NODE or STANDARD - 
  5959.      TmpDDir$ = Lot_GetLotusNotesDataPath() 
  5960.      'print "Got Lotus Notes Data Directory of " & TmpDDir$
  5961.      IF TmpDDir$ <> "" THEN
  5962.          SetSymbolValue SYM_LOTUSNOTESDATADIR$, TmpDDir$
  5963.          Lot_RefreshDestination(SYM_LOTUSNOTESDATADIR$)
  5964.      End If
  5965. END SUB
  5966.  
  5967. PUBLIC FUNCTION Lot_GetLotusNotesDataPath() AS STRING
  5968. '** Purpose:         Returns the location for the Notes Data Directory
  5969. '** Author:          PTilton
  5970. '** Arguments:       None.
  5971. '** Returns:             NULL String if Notes Data Directory not found.
  5972. '**                  Otherwise, returns directory of Notes Data Directory.
  5973. '*************************************************************************
  5974.     DIM szDir$, szSearch$, szTmp$, rc%, lrc&
  5975.  
  5976.     Lot_GetLotusNotesDataPath = ""
  5977.     szTmp$ = GetIniKeyString( "Notes.ini", "Notes", "Directory")
  5978.     If szTmp$ <> "" Then
  5979.         lrc& = FDirExists ( szTmp$ )
  5980. '          print "Does Directory -" & szTmp$ & "- Exist: " & str( rc% )
  5981.         If (lrc& = 1) Then
  5982.           Lot_GetLotusNotesDataPath = szTmp$
  5983.         End If
  5984.     Else
  5985.         szTmp$ = GetIniKeyString( "Lotus.ini", "Lotus Applications", "Notes")
  5986.         szSearch$ = ucase$( szTmp$ )
  5987.         rc% = instr( szSearch$, "NOTES.EXE") 
  5988.         If rc% > 2 Then
  5989.           szDir$ = left$(szTmp$, rc% - 2 )
  5990. '                 print "Notes LOTUS.INI Data Directory: " & szDir$
  5991.           lrc& = FDirExists ( szDir$ )
  5992. '                 print "Does LOTUS.INI Directory Exist: " & str( lrc& )
  5993.           If (lrc& = 1) Then
  5994.              szTmp$ = GetIniKeyString( szDir$ & "\" & "Notes.ini", "Notes", "Directory")
  5995. '                        print "Notes Data Directory: " & szTmp$
  5996.              If szTmp$ <> "" Then
  5997.                  lrc& = FDirExists ( szTmp$ )
  5998. '                               print "Does Directory -" & szTmp$ & "- Exist: " & str( lrc& )
  5999.                 If (lrc& = 1) Then
  6000.                     Lot_GetLotusNotesDataPath = szTmp$
  6001.                 End If
  6002.           Else
  6003.             Lot_GetLotusNotesDataPath = szDir$
  6004.          End If
  6005.           End If
  6006.         End If
  6007.     End If
  6008. END FUNCTION
  6009. '*************************************************************************
  6010.  
  6011. PUBLIC FUNCTION Lot_GetLotusNotesPrgPath() AS STRING
  6012. '** Purpose:         Returns the location for the Notes Data Directory
  6013. '** Author:          PTilton
  6014. '** Arguments:       None.
  6015. '** Returns:             NULL String if Notes Data Directory not found.
  6016. '**                  Otherwise, returns directory of Notes Data Directory.
  6017. '*************************************************************************
  6018.     DIM szDir$, szSearch$, szTmp$, rc%, lrc&
  6019.     DIM szPath$, szFile$, szSect$, szKey$, szExe$
  6020.  
  6021.     szPath$ = GetSymbolValue( SYM_WINDIR$ ) & LdString( SID_DATALENS_NOTES_INI )
  6022.     szSect$ = LdString( SID_DATALENS_NOTES_SECT )
  6023.     szKey$ = LdString( SID_DATALENS_NOTES_KEY )
  6024.     szExe$ = LdString( SID_DATALENS_NOTES_EXE )
  6025.  
  6026.     Lot_GetLotusNotesPrgPath = ""
  6027.     szTmp$ = GetIniKeyString( szPath$, szSect$, szKey$ )
  6028.     szSearch$ = ucase$( szTmp$ )
  6029.     rc% = instr( szSearch$, szExe$) 
  6030.     If rc% > 2 Then
  6031.         szDir$ = left$(szTmp$, rc% - 2 )
  6032.         'print "Notes LOTUS.INI Program Directory: " & szDir$
  6033.         lrc& = FDirExists ( szDir$ )
  6034.         'print "Does LOTUS.INI Program Directory Exist: " & str( rc% )
  6035.         If (lrc& = 1) Then
  6036.      Lot_GetLotusNotesPrgPath = szDir$
  6037.         End If
  6038.     End If
  6039. END FUNCTION
  6040. '*************************************************************************
  6041.  
  6042. 'FUNCTION GetLotusNotesDataPath(szFile$, szSect$, szKey$) AS STRING
  6043. '** Purpose:         Returns the location for the Notes Data Directory
  6044. '** Author:          PTilton
  6045. '** Arguments:       None.
  6046. '** Returns:             NULL String if Notes Data Directory not found.
  6047. '**                  Otherwise, returns directory of Notes Data Directory.
  6048. '*************************************************************************
  6049. '   DIM szDir$, rc%
  6050.  
  6051. '   GetLotusNotesDataPath = ""
  6052.     
  6053. '   rc% = DoesIniSectionExist (szFile$, szSect$) 
  6054. '   print "Does Section [" & szSect$ & "] Exist in File("& szFile$ &": " & str( rc% )
  6055. '   If (rc% = 1) Then
  6056. '      rc% = DoesIniKeyExist (szFile$, szSect$, szKey$)
  6057. '      print "Does Key -" & szKey$ & "- Exist: " & str( rc% )
  6058. '      If (rc% = 1) Then
  6059. '         szDir$ = GetIniKeyString (szFile$, szSect$, szKey$)
  6060. '         print "Keyword -" & szKey$ & "- Value: " & szDir$
  6061. '         GetLotusNotesDataPath =szDir$
  6062. '      End If
  6063. '   End If
  6064. 'END FUNCTION
  6065. '*************************************************************************
  6066.  
  6067.  
  6068. PUBLIC FUNCTION Lot_GetORACLEHomePath() AS STRING
  6069. '** Purpose:         Returns the location for the ORACLE Home Directory
  6070. '** Author:          PTilton
  6071. '** Arguments:       None.
  6072. '** Returns:             NULL String if ORACLE Home Directory not found.
  6073. '**                  Otherwise, returns directory of ORACLE Home Directory.
  6074. '*************************************************************************
  6075.     DIM szPath$, szTmp$, rc%, lrc&, szFile$, szSect$, szKey$
  6076.  
  6077.     szPath$ = GetSymbolValue( SYM_WINDIR$ ) & LdString( SID_DATALENS_ORACLE_INI )
  6078.     szSect$ = LdString( SID_DATALENS_ORACLE_SECT )
  6079.     szKey$ = LdString( SID_DATALENS_ORACLE_KEY )
  6080.     Lot_GetORACLEHomePath = ""
  6081.     szTmp$ = GetIniKeyString ( szPath$, szSect$, szKey$ )
  6082.     'print "Oracle Home Directory: " & szTmp$
  6083.     If szTmp$ <> "" Then
  6084.         lrc& = FDirExists ( szTmp$ )
  6085.         'print "Does Directory -" & szTmp$ & "- Exist: " & str( lrc& )
  6086.         If (lrc& = 1) Then
  6087.           Lot_GetORACLEHomePath = szTmp$
  6088.         End If
  6089.     End If
  6090. END FUNCTION
  6091. '*************************************************************************
  6092.  
  6093. PUBLIC FUNCTION Lot_IsDestVerNewerOrEqual(DestinationPath$,sourcever1&,sourcever2&,sourcever3&,sourcever4&) AS INTEGER
  6094. '** Purpose:   This function validates the version of the file
  6095. '** Author:    MZ
  6096. '** Arguments: DestinationPath$,
  6097. '**            SourceVer1&,
  6098. '**            SourceVer2&,
  6099. '**            SourceVer3&,
  6100. '**            SourceVer4&
  6101. '** Returns:   1 if newer or equal
  6102. '**            0 if older or the file is not found or it does not have version
  6103. '*************************************************************************
  6104.     DIM DestFileVersion$
  6105.     DIM DestVer1&,DestVer2&,DestVer3&,DestVer4&, notused%
  6106.  
  6107.     'Find If the file exists
  6108.     IF DoesFileExist(DestinationPath$,femExists)=1 THEN
  6109.  
  6110.         'Find the version
  6111.         DestFileVersion$=GetVersionOfFile(DestinationPath$)
  6112.  
  6113.         'If no version found
  6114.         IF DestFileVersion$="" THEN
  6115.      Lot_IsDestVerNewerOrEqual = 0
  6116.      EXIT FUNCTION
  6117.  
  6118.         'If version found
  6119.         ELSE
  6120.      'Find the version components
  6121.      DestVer1&=GetVersionNthField(DestFileVersion$,1)
  6122.      DestVer2&=GetVersionNthField(DestFileVersion$,2)
  6123.      DestVer3&=GetVersionNthField(DestFileVersion$,3)
  6124.      DestVer4&=GetVersionNthField(DestFileVersion$,4)
  6125.  
  6126.      'Compare the version
  6127.      IF SourceVer1& > DestVer1& THEN
  6128.          Lot_IsDestVerNewerOrEqual = 0
  6129.          EXIT FUNCTION
  6130.      ELSEIF SourceVer1& = DestVer1& AND _
  6131.         SourceVer2& > DestVer2& THEN
  6132.          Lot_IsDestVerNewerOrEqual = 0
  6133.          EXIT FUNCTION
  6134.      ELSEIF SourceVer1& = DestVer1& AND _
  6135.         SourceVer2& = DestVer2& AND _
  6136.         SourceVer3& > DestVer3& THEN
  6137.          Lot_IsDestVerNewerOrEqual = 0
  6138.          EXIT FUNCTION
  6139.      ELSEIF SourceVer1& = DestVer1& AND _
  6140.         SourceVer2& = DestVer2& AND _
  6141.         SourceVer3& = DestVer3& AND _
  6142.         SourceVer4& > DestVer4& THEN
  6143.          Lot_IsDestVerNewerOrEqual = 0
  6144.          EXIT FUNCTION
  6145.      ELSEIF SourceVer1& = DestVer1& AND _
  6146.         SourceVer2& = DestVer2& AND _
  6147.         SourceVer3& = DestVer3& AND _
  6148.         SourceVer4& = DestVer4& THEN
  6149.          'Version is equal. Delete the source
  6150.          Lot_IsDestVerNewerOrEqual = 1
  6151.          EXIT FUNCTION
  6152.      ELSE
  6153.          'Dest is newer.
  6154.          Lot_IsDestVerNewerOrEqual = 1
  6155.          EXIT FUNCTION
  6156.      END IF
  6157.  
  6158.         END IF
  6159.     'file not found in the destination
  6160.     ELSE
  6161.         Lot_IsDestVerNewerOrEqual = 0
  6162.         EXIT FUNCTION
  6163.     END IF
  6164. END FUNCTION
  6165.  
  6166. CONST ObjectPrefix$="Object"
  6167. CONST gMISCINSTALLEDOBJECTS="Miscellaneous Installed Objects"
  6168.  
  6169. SUB PopulateCOBJECTLIST(iniPath$)
  6170. '*************************************************************************
  6171. '** Purpose:         Compiles a list of objects already in the cinstall or
  6172. '**                  cinstnod.ini file; populates list COBJECT
  6173. '** Author:          JMD
  6174. '** Arguments:       Full pathname of .INI file
  6175. '** Returns:             NULL String if Notes Data Directory not found.
  6176. '**                  Otherwise, returns directory of Notes Data Directory.
  6177. '*************************************************************************
  6178.     DIM Number%
  6179.     DIM Tag$, ID$, rc%
  6180.     STATIC gCOBJECTinited%  ''ASSUME gCOBJECTinited% starts as zero
  6181.  
  6182.     If  gCOBJECTinited% <> 1 THEN
  6183.         gNCOBJECT% = 0
  6184.         gCOBJECTinited% = 1
  6185.         IF DoesFileExist(iniPath$,femExists) = 1 THEN
  6186.             Erase COBJECT 
  6187.             Number%=1
  6188.             Tag$=ObjectPrefix$+LTRIM$(STR$(Number%))
  6189.             ID$ = GetIniKeyString(iniPath$, gMISCINSTALLEDOBJECTS, Tag$)
  6190.             WHILE ID$ <> ""
  6191.                 gNCOBJECT% = Number%
  6192.                 COBJECT (ID$) = gNCOBJECT%
  6193.                 Number% = Number% + 1
  6194.                 Tag$=ObjectPrefix$+LTRIM$(STR$(Number%))
  6195.                 ID$ = GetIniKeyString(iniPath$, gMISCINSTALLEDOBJECTS, Tag$)
  6196.             WEND
  6197.         END IF
  6198.     END IF
  6199.  
  6200. END SUB
  6201.  
  6202. SUB PopulateCINSTALLLIST
  6203.     DIM prodDir$, gInstallIniFile$, Featurenumber%
  6204.     DIM FeatureTag$, FeatureID$, rc%
  6205.     STATIC gCINSTALLinited%  ''ASSUME gCINSTALLinited% starts as zero
  6206.  
  6207.     If  gCINSTALLinited% = 1 Then EXIT SUB
  6208.  
  6209.     gNCINSTALL% = 0
  6210.     gCINSTALLinited% = 1
  6211.  
  6212.     'Built the path to install.ini
  6213.     prodDir$ = Lot_GetInstallDir()
  6214.     gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  6215.     If DoesFileExist(gInstallIniFile$,femExists) <> 1 Then
  6216.         CinstallIniError gInstallIniFile$, 6168
  6217.     End If
  6218.     FeatureNumber%=1
  6219.     FeatureTag$=FEATUREPREF$+LTRIM$(STR$(FeatureNumber%))
  6220.     FeatureID$ = GetIniKeyString(gInstallIniFile$, FEATURESECTION$, FeatureTag$)
  6221.     If FeatureID$ <> "" Then
  6222.         DO
  6223.             CINSTALL (FeatureID$) = "1"
  6224.             gNCINSTALL% = gNCINSTALL%+1
  6225.             FeatureNumber% = FeatureNumber% + 1
  6226.             FeatureTag$=FEATUREPREF$+LTRIM$(STR$(FeatureNumber%))
  6227.             FeatureID$ = GetIniKeyString(gInstallIniFile$, FEATURESECTION$, FeatureTag$)
  6228.         LOOP UNTIL FeatureID$ = ""
  6229.     END IF
  6230. END SUB
  6231.  
  6232.  
  6233. CONST gINSTNODINI$ = "cinstnod.ini"
  6234.  
  6235. '*************************************************************************
  6236. SUB PopulateCINSTNODELIST
  6237.     DIM prodDir$, gInstallIniFile$, Featurenumber%
  6238.     DIM FeatureTag$, FeatureID$, rc%, dirSym$, inidir$
  6239.     STATIC gCINSTNODEinited%  ''ASSUME gCINSTALLinited% starts as zero
  6240.  
  6241.     If  gCINSTNODEinited% = 1 Then EXIT SUB
  6242.         gNCINSTNODE% = 0
  6243.         gCINSTNODEinited% = 1
  6244.  
  6245.         'Built the path to cinstnod.ini
  6246.         dirSym$ = Reg_GetDirSymbolList(1)       '** First product dir list
  6247.         IF GetListLength(dirSym$) >= 1 THEN
  6248.          dirSym$ = GetListItem(dirSym$, 1)    '** First directory symbol
  6249.          inidir$ = GetSymbolValue(dirSym$) 
  6250.                  gInstallIniFile$ = MakePath(inidir$, gINSTNODINI$)
  6251.         END IF
  6252.  
  6253.         FeatureNumber%=1
  6254.         FeatureTag$=FEATUREPREF$+LTRIM$(STR$(FeatureNumber%))
  6255.         FeatureID$ = GetIniKeyString(gInstallIniFile$, FEATURESECTION$, FeatureTag$)
  6256.         IF DoesFileExist(gInstallIniFile$,femExists) = 1 THEN
  6257.     IF FeatureID$ <> "" THEN
  6258.         DO
  6259.             CINSTNODE (FeatureID$) = "1"
  6260.             gNCINSTNODE% = gNCINSTNODE%+1
  6261.             FeatureNumber% = FeatureNumber% + 1
  6262.             FeatureTag$=FEATUREPREF$+LTRIM$(STR$(FeatureNumber%))
  6263.             FeatureID$ = GetIniKeyString(gInstallIniFile$, FEATURESECTION$, FeatureTag$)
  6264.         LOOP UNTIL FeatureID$ = ""
  6265.         END IF
  6266.         ELSE
  6267.             CinstallIniError gInstallIniFile$, 6205
  6268.     END IF
  6269. END SUB
  6270.  
  6271. '*************************************************************************
  6272. '** PUBLIC FUNCTION TrimNetlotusapp (path$) AS STRING
  6273. '**
  6274. '** Purpose:   trims the net lotusapp directory to detect mapping. 
  6275. '** Author:    Thangv
  6276. '** Arguments: path$ 
  6277. '** Returns:   the modified path
  6278. '*************************************************************************
  6279.  
  6280. PUBLIC FUNCTION TrimNetlotusapp (ByVal path$) AS STRING
  6281.  
  6282.     DIM  firstslash%, newpath$, drive$
  6283.     
  6284.     TrimNetlotusapp = ""
  6285.     path$ = Lot_TrimEndSlash (path$)
  6286.     drive$ = LEFT(path$, 2)
  6287.     
  6288.     firstslash% = INSTR(1,path$,"\")
  6289.     WHILE firstslash% <> 0
  6290.         path$ = MID$(path$,firstslash%+1)
  6291.         newpath$ = drive$ + "\" + path$
  6292.         IF DoesDirExist(newpath$) = 1 THEN
  6293.      TrimNetlotusapp = newpath$ + "\"
  6294.      EXIT FUNCTION     
  6295.         ELSE 
  6296.      firstslash% = INSTR(1,path$,"\")                       
  6297.         END IF
  6298.     WEND
  6299.  
  6300. END FUNCTION
  6301.  
  6302. PUBLIC FUNCTION Lot_RegisterUninstaller(ProdRegKeyName$,ProdVer$,_
  6303.                     ProdDisplayedName$,ProdInfPath$,_
  6304.                     LogFlag%,AutoFlag%,_
  6305.                     LangID$,LogFile$,RspFile$,_
  6306.                     UserName$ ) AS INTEGER
  6307. '** Purpose:   Registers the uninstaller for a product and builds the uninstall
  6308. '**            command line. This function should be called in PostCopyConfig()
  6309. '** Author:    MZ
  6310. '** Arguments: ProdRegKeyName$     The name of the product key in the registry
  6311. '**            ProdVer$            The version of the product installed
  6312. '**            ProdDisplayedName$  The description of the product put into the registry
  6313. '**            ProdInfPath$        The path of the standalone/server INF file
  6314. '**            LogFlag%            TRUE/FALSE if you want uninstall to produce or not a log
  6315. '**            AutoFlag%           TRUE/FALSE if you want uninstall to run or not silantelly
  6316. '**            LangID$             The default language for uninstall
  6317. '**            LogFile$ (optional) The log file path to overwrite the default provided by uninstall
  6318. '**            RspFile$ (optional) The response file path to overwrite the default provided by uninstall
  6319. '**            UserName$(optional) The User Name
  6320. '** Returns:   True if worked False otherwise
  6321. '*************************************************************************
  6322. DIM gInstallIniFile$,cwd$,prodDir$,Network$,ProdNameAndVer$,CommandLine$ 
  6323. DIM Platform%, PlatformStr$, LReturn&, grouptitle$, Caption$, dirSym$, RegKey$
  6324. DIM s$, szkey$, IsRootProduct%
  6325.  
  6326.     'Validate the arguments
  6327.     IF ProdRegKeyName$ = "" OR _
  6328.         ProdVer$ = "" OR _
  6329.         ProdDisplayedName$ = "" OR _
  6330.         ProdInfPath$ = "" OR _
  6331.         LangID$ = "" THEN
  6332.         Lot_RegisterUninstaller = FALSE
  6333.     END IF
  6334.  
  6335.     IF LogFlag% <> FALSE AND LogFlag% <> TRUE THEN
  6336.         Lot_RegisterUninstaller = FALSE
  6337.     END IF
  6338.  
  6339.     IF AutoFlag% <> FALSE AND AutoFlag% <> TRUE THEN
  6340.         Lot_RegisterUninstaller = FALSE
  6341.     END IF
  6342.     
  6343.     Network$ = GetSymbolValue(SYM_NETWORK$)
  6344.  
  6345.  'TV: For server, distribution installs don't register uninstall
  6346.     IF Network$ = gSERVER$ OR Network$ = gDISTRIBUTION$ THEN EXIT FUNCTION
  6347.  
  6348.     ' The first product, either suite or this product for standalone
  6349.     ProdNameAndVer$ = MakePath(GetSymbolValue(SYM_REG_PRODUCTNAME$) , GetSymbolValue(SYM_REG_PRODUCTVER$))
  6350.     s$ = MakePath(ProdRegKeyName$, ProdVer$)
  6351.     IsRootProduct% = (ProdNameAndVer$ =  s$)
  6352. 'Only register suite uninstaller, or single product
  6353. IF IsRootProduct% THEN
  6354.     
  6355.     'Built the path to cinstall.ini
  6356.     IF Network$ = gNODE$ THEN
  6357.         'Get the target directory for the product
  6358.         dirSym$ = Reg_GetDirSymbolList(Lot_GetCurrentProduct())
  6359.         If GetListLength(dirSym$) >= 1 Then
  6360.             dirSym$ = GetListItem(dirSym$, 1)
  6361.             gInstallIniFile$ = GetSymbolValue(dirSym$)+ gINSTNODINI$
  6362.         End If
  6363.     ELSEIF Network$=gSERVER$ OR Network$=gSTANDARD THEN
  6364.         'Get the install directory
  6365.         prodDir$ = Lot_GetInstallDir()
  6366.         gInstallIniFile$ = MakePath(prodDir$,gINSTALLINI$)
  6367.     END IF
  6368.  
  6369.     'print gInstallIniFile$,"gInstallIniFile$"
  6370.     PlatformStr$ = gREGWINNAME
  6371.  
  6372.     'Write the uninstall key and registry values
  6373.     RegKey$=PlatformStr$+"\Uninstall\"+ProdRegKeyName$+" V"+ProdVer$
  6374.     LReturn& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, RegKey$)
  6375.   'print " after calling Lot_RegCreateKeyEx in share32",LReturn&
  6376.   IF LReturn& <> ERROR_SUCCESS THEN
  6377.       Lot_RegisterUninstaller = FALSE
  6378.       RegErrorMsg SID_ERR_REG_CREATE, gHLM$+"\"+RegKey$,"",""
  6379.   END IF
  6380.          
  6381.   'Write the display name key and value
  6382.   'print " before calling Lot_CreateRegKeyValueEx in share32"        
  6383.   LReturn& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, RegKey$,_
  6384.               "DisplayName",_
  6385.               REG_SZ,_
  6386.               ProdDisplayedName$, _
  6387.               LENBP(ProdDisplayedName$)+1)
  6388.   'print " after calling Lot_CreateRegKeyValueEx in share32",LReturn&
  6389.   IF LReturn& <> ERROR_SUCCESS THEN
  6390.         Lot_RegisterUninstaller = FALSE
  6391.         RegErrorMsg SID_ERR_REG_UNINST, gHLM$+RegKey$,"DisplayName",ProdDisplayedName$
  6392.   END IF
  6393.  
  6394.   'Build the command line
  6395.   CommandLine$ = | /T | & ProdRegKeyName & | /V | & ProdVer$
  6396.   IF IsNewShell() THEN
  6397.         CommandLine$ = CommandLine$ & | /I "| & ProdInfPath$ & |"|
  6398.         CommandLine$ = CommandLine$ & | /C "| & gInstallIniFile$ & |"|   
  6399.     ELSE
  6400. 'JMD:
  6401. '  NT 3.51 has a bug that truncates the command line in the program icon if
  6402. '  there are embedded quotes; therefore embedded quotes are NOT supported for
  6403. '  NT 3.51 (old Win 3.1 shell) only
  6404.         CommandLine$ = CommandLine$ & " /I " & ProdInfPath$
  6405.         CommandLine$ = CommandLine$ & " /C " & gInstallIniFile$
  6406.     END IF
  6407.   IF LogFlag% <> FALSE THEN
  6408.       CommandLine$ = CommandLine$+" /O "
  6409.   END IF
  6410.   IF LogFile$ <> "" THEN
  6411.       CommandLine$ = CommandLine$+LogFile$
  6412.   END IF
  6413.   IF AutoFlag% <> FALSE THEN
  6414.       CommandLine$ = CommandLine$+" /A "
  6415.   END IF
  6416.   IF RspFile$ <> "" THEN
  6417.       CommandLine$ = CommandLine$+RspFile$
  6418.   END IF
  6419.   CommandLine$ = CommandLine$+" /L "+LangID$
  6420.   IF UserName$ <> "" THEN
  6421.       CommandLine$ = CommandLine$+" /U "+UserName$
  6422.   END IF    
  6423.   CommandLine$ = GetWindowsDir()+gUNINSTALLEXE+CommandLine$
  6424.  
  6425.     ' Register it under the first product (suit or main product for single)
  6426.     s$ = Reg_GetProductAcronym(1) + gTOP$
  6427.   IF NOT IsNewShell() THEN
  6428.         Caption$ = ProdRegKeyName$+" V"+ProdVer$+" "+LdString(SID_SHARED_UNINSTALL)
  6429.         grouptitle$ = Reg_GetProgManagerGroupName(1)
  6430.     CreateProgmanItem grouptitle$, Caption$, CommandLine$, GetWindowsDir()+gUNINSTALLEXE, cmoOverwrite
  6431.     Lot_RegisterObject s$, UNIN_CLASS_ICON$, grouptitle$ + "\" + Caption$
  6432.   END IF
  6433.  
  6434.   'print CommandLine$,"CommandLine$"
  6435.   'Write the CommandLine
  6436.   'print " before calling Lot_CreateRegKeyValueEx in share32"        
  6437.   LReturn& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, RegKey$,_
  6438.               "UninstallString",_
  6439.               REG_SZ,_
  6440.               CommandLine$, _
  6441.               LENBP(CommandLine$)+1)
  6442.   'print " after calling Lot_CreateRegKeyValueEx in share32",LReturn&        
  6443.  
  6444.   IF LReturn& <> ERROR_SUCCESS THEN
  6445.         Lot_RegisterUninstaller = FALSE
  6446.         RegErrorMsg SID_ERR_REG_UNINST, gHLM$+RegKey$,"UninstallString",CommandLine$
  6447.   ELSE
  6448.         Lot_RegisterUninstaller = TRUE
  6449.   END IF
  6450.  
  6451. END IF   ' IF IsRootProduct% 
  6452.  
  6453.     ' Register suite products for Suite uninstall
  6454.     s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  6455.     szkey$ = gREGLOTUS + ProdNameAndVer$ + "\Products\"
  6456.     szkey$ = szkey$  + ProdRegKeyName$ + "\" +  ProdVer$
  6457.     IF s$ = gSMARTSUITE$ THEN
  6458.         IF NOT IsRootProduct% THEN
  6459.             IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$) = FALSE THEN
  6460.                 IF Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$) <> 0 THEN
  6461.                     Lot_RegisterUninstaller = FALSE
  6462.                     EXIT FUNCTION
  6463.                 END IF
  6464.             END IF
  6465.             LReturn& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$,_
  6466.               "InfFileName", REG_SZ, ProdInfPath$, LENBP(ProdInfPath$)+1)
  6467.         END IF
  6468.     ELSE
  6469.         ' Delete these entries so single prodcut uninstall can work
  6470.         IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$) = TRUE THEN _
  6471.             LReturn& = Lot_RegDelAllSubKeys(HKEY_LOCAL_MACHINE, szKey)
  6472.     END IF
  6473.     Lot_RegisterUninstaller = (LReturn& = ERROR_SUCCESS)
  6474.  
  6475. END FUNCTION
  6476.  
  6477. PUBLIC FUNCTION Lot_RegisterObject(FeatureKeyWord$, ClassOfObject$, ObjectPath$)
  6478. '** Purpose:   Registers the [Miscellaneous Installed Objects] into cinstall.ini 
  6479. '**            for standalone installs and into cinsnode.ini for node installs
  6480. '** Author:    MZ
  6481. '** Arguments: FeatureKeyWord$     The KeyWord of the section that is associate 
  6482. '**                                with this object
  6483. '**            ClassOfObject$      The classes; The predefined (in globals.lss)
  6484. '**                                classes are: 
  6485. '**                                UNIN_CLASS_PROGRAM_GROUP$
  6486. '**                                UNIN_CLASS_ICON$
  6487. '**                                UNIN_CLASS_FOLDER$
  6488. '**                                UNIN_CLASS_SHORTCUT$
  6489. '**                                UNIN_CLASS_START_MENU_ENTRY$
  6490. '**                                UNIN_CLASS_REGISTRY_KEY$
  6491. '**                                UNIN_CLASS_REGISTRY_VALUE$
  6492. '**                                UNIN_CLASS_REGISTRY_HIVE$
  6493. '**                                UNIN_CLASS_FILE$
  6494. '**                                UNIN_CLASS_FILE_GROUP$
  6495. '**                                UNIN_CLASS_DIRECTORY$
  6496. '** Returns:   True if worked False otherwise
  6497. '*************************************************************************
  6498. DIM inidir$, s$,Network$
  6499. DIM NodeInstIniFile$,ObjectNum%,lrc&, ObjectPref$
  6500. DIM ObjectTag$, ObjectID$, LastObjectNumber%, dirSym$, temp%
  6501. DIM ObjectName$
  6502. STATIC iniPath$
  6503. STATIC ThisInstallType$
  6504.  
  6505.     'Get the install type
  6506.     Network$ = GetSymbolValue(SYM_NETWORK$)
  6507.     s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  6508.  
  6509.     IF NOT IsNewShell() AND ClassOfObject$ = UNIN_CLASS_ICON$ THEN
  6510.         temp% = INSTR(ObjectPath$, "\")
  6511.         IF LEN(ObjectPath$) > temp%+40 THEN
  6512.             ObjectPath$ = LEFT$(ObjectPath$, temp%+40)
  6513.         END IF
  6514.     END IF
  6515.  
  6516.     'TV: For server and distribution installs don't register any objects
  6517.     IF Network$ = gSERVER$ OR Network$ = gDISTRIBUTION$ THEN EXIT FUNCTION 
  6518.     
  6519.     '** Initialization:
  6520.     IF ThisInstallType$ <> Network$ THEN
  6521.         ThisInstallType$ = Network$
  6522.         '** Built the path to cinstall.ini (in standalone case) 
  6523.         '** or cinstnod.ini (in NODE case)
  6524.         IF Network$ = gNODE$ AND s$ = gSMARTSUITE$ THEN
  6525.             inidir$ = GetSymbolValue(SYM_BASEDIR$)
  6526.             NodeInstIniFile$ = inidir$+ gINSTNODINI$
  6527.             iniPath$ = NodeInstIniFile$
  6528.         ELSEIF Network$ = gNODE$ AND s$ = gSINGLE$ THEN
  6529.             dirSym$ = Reg_GetDirSymbolList(1)       '** First product dir list
  6530.             IF GetListLength(dirSym$) >= 1 THEN
  6531.                 dirSym$ = GetListItem(dirSym$, 1)    '** First directory symbol
  6532.                 inidir$ = GetSymbolValue(dirSym$) 
  6533.             ELSE
  6534.                 inidir$ = GetSymbolValue(SYM_STF_CWDDIR$)
  6535.             END IF
  6536.             NodeInstIniFile$ = inidir$+ gINSTNODINI$
  6537.             iniPath$ = NodeInstIniFile$
  6538.         ELSEIF Network$=gSTANDARD THEN
  6539.             'Get the install directory
  6540.             inidir$ = Lot_GetInstallDir()
  6541.             iniPath$ = MakePath(inidir$,gMISCOBJINI$)
  6542.         END IF
  6543.         'print iniPath$,"IniPath$"
  6544.         '** Construct a list of objects already there
  6545.         PopulateCOBJECTLIST(iniPath$)
  6546.     END IF
  6547.  
  6548.     '** See if the object's already there, if not, write a new object
  6549.     '** and add to List
  6550.  
  6551.     ObjectName$ = FeatureKeyWord$+","+ClassOfObject$+","+ObjectPath$
  6552.     ObjectName$ = NullTrim (ObjectName$)
  6553.     If ISELEMENT(COBJECT(ObjectName$)) = FALSE THEN 
  6554.         gNCOBJECT% = gNCOBJECT% + 1
  6555.         CreateIniKeyValue iniPath$, gMISCINSTALLEDOBJECTS,_
  6556.                     "Object"+LTRIM$(STR$(gNCOBJECT%)), _
  6557.                     ObjectName$,  cmoOverwrite
  6558.                 COBJECT (ObjectName$) = gNCOBJECT%
  6559.     END IF
  6560.  
  6561. END FUNCTION
  6562.  
  6563. '*************************************************************************
  6564. PUBLIC FUNCTION Lot_GetDestDirValueFromInstallini(DestDirSym$) AS STRING
  6565. '**
  6566. '** Purpose:   trims the net lotusapp directory to detect mapping. 
  6567. '** Author:    Thangv, PD, JMD
  6568. '** Arguments: path$ 
  6569. '** Returns:   the modified path
  6570. '*************************************************************************
  6571. DIM DestDirSymVal$, rv%, source$
  6572. DIM gInstallIniFile$,inidir$
  6573. DIM uncvol$, dirPath$
  6574. DIM iniPath$   
  6575.  
  6576.     Lot_GetDestDirValueFromInstallini = ""
  6577.     'Get the install directory
  6578.     'Save initial value since it may change over course of install
  6579.     inidir$ = Lot_GetInstallDir()
  6580.     gInstallIniFile$ = MakePath(inidir$,gINSTALLINI$)
  6581.     iniPath$ = gInstallIniFile$
  6582.     DestDirSymVal$ = GetIniKeyString(iniPath$,_
  6583.                  "Destination Symbols And Values", _
  6584.                  DestDirSym$)
  6585.     IF  DestDirSymVal$ <> "" THEN
  6586.          rv% = DoesDirExist(DestDirSymVal$)
  6587.          IF rv% = 0 THEN
  6588.                      '** TV: shouldn't get here even if destdirSymVal is UNC
  6589.         source$ =  GetSymbolValue(SYM_STF_SRCDIR$)
  6590.                      IF NOT Lot_IsUnvalidatedUNCPath(source$) THEN
  6591.                 DestDirSymVal$ = MID$(source$,1,1)+MID$(DestDirSymVal$,2)
  6592.                      ELSE
  6593.                                 Lot_SplitUNCPath source$, uncvol$, dirPath$
  6594.                 DestDirSymVal$ = uncvol$ + MID$(DestDirSymVal$,3)
  6595.                      END IF        
  6596.         rv% = Lot_CleanPath(DestDirSymVal$)
  6597.  
  6598.             IF rv% = 0 THEN
  6599.                     ErrorMsg SID_ERR_NODENETMAP, ""
  6600.                     ERROR STFQUIT
  6601.         END IF
  6602.          END IF
  6603.     END IF
  6604.  
  6605.     Lot_GetDestDirValueFromInstallini = DestDirSymVal$
  6606. END FUNCTION
  6607.  
  6608. '*************************************************************************
  6609. PUBLIC SUB      Lot_WriteCriticalDirectories (InstallInifile$)
  6610. '**
  6611. '** Purpose:   writes out the critical directories for uninstall in 
  6612. '**            cinstall.ini, cinstnod.ini   
  6613. '** Author:    Thangv
  6614. '** Arguments: path to cinstall.ini/cinstnod.ini file 
  6615. '** Returns:   
  6616. '*************************************************************************
  6617.     DIM dirsyms%, gInstallIniFile$, prodDir$, progdir$
  6618.     DIM prodsym$, AllProdNum%, prodNum%, symList$, i%
  6619.  
  6620.         'the path to install.ini
  6621.         gInstallIniFile$ = InstallInifile$
  6622.  
  6623.     's$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  6624.  
  6625.         'Loop through the products and log the directories
  6626.         AllProdNum% = 0
  6627.         AllProdNum% = Reg_GetNumberOfProducts()
  6628.         IF AllProdNum% <> 0 THEN
  6629.      'BaseDir$= GetSymbolValue(SYM_BASEDIR$)
  6630.      FOR prodNum%=1 TO AllProdNum%
  6631.          'ProdAcronym$ = Reg_GetProductAcronym(prodNum%)
  6632.          'Get the directory symbol
  6633.          symList$ = Reg_GetDirSymbolList(prodNum%)
  6634.          dirsyms% = GetListLength(symList$)
  6635.          FOR i% = 1 TO dirsyms% 
  6636.         prodsym$ = GetListItem(symList$, i%)
  6637.         progdir$ = GetSymbolValue(prodsym$)
  6638.         CreateIniKeyValue gInstallIniFile$, "Critical Directories", prodsym$, progdir$, cmoOverWrite
  6639.          NEXT
  6640.      NEXT
  6641.         END IF
  6642. END SUB
  6643.  
  6644.  
  6645. PUBLIC FUNCTION GetLastPathComponent( ByVal szPath$) AS STRING
  6646. '**
  6647. '** Purpose:   Returns the last component of a path
  6648. '**
  6649. '** Author:    GJL
  6650. '** Arguments: path 
  6651. '** Returns: The last dir name or file name, empty string if path
  6652. '**          ends in \
  6653. '*************************************************************************
  6654.      DIM offSet&, nextOff&
  6655.  
  6656.      GetLastPathComponent$ = szPath$
  6657.      offSet& = InStr(szPath$,"\")
  6658.      nextOff& = offSet&
  6659.  
  6660.      DO WHILE nextOff& <> 0
  6661.          nextOff = InStr(Mid$(szPath$,offset),"\")
  6662.          offSet& = offSet& + nextOff& 
  6663.  
  6664.      LOOP
  6665.      IF offSet& > 0 THEN
  6666.         GetLastPathComponent$ = Mid$(szPath$,offSet&)
  6667.      END IF
  6668. END FUNCTION
  6669.  
  6670. '*************************************************************************
  6671. FUNCTION Lot_AddToNTSystemPath(RegH&, RegKey$, VarName$, ByVal AddPath$) AS INTEGER
  6672.     DIM NewPath$, notused&, PathDir$
  6673.     DIM RegValLen&, Pos%, Resave%
  6674.  
  6675.     Lot_AddToNTSystemPath = 1
  6676.  
  6677.     If Lot_DoesRegKeyExistEx(RegH&, RegKey$) = FALSE THEN
  6678.         If Lot_RegCreateKeyEx(RegH&, RegKey$) <> 0 Then
  6679.             Lot_AddToNTSystemPath = 0
  6680.             EXIT FUNCTION
  6681.         End If
  6682.         NewPath = ""
  6683.     Else
  6684.         RegValLen&=CLNG(1024)
  6685.         NewPath$=CreateBuffer(RegValLen&)
  6686.         if Lot_GetRegKeyValueEx(RegH&, RegKey$, VarName$,_
  6687.                     REG_EXPAND_SZ&,NewPath$,RegValLen&) <> 0 Then
  6688.             NewPath = ""
  6689.         End If
  6690.     End If
  6691.  
  6692.     NewPath$ = NullTrim(NewPath$)    
  6693.     Resave%=0
  6694.     Do While AddPath$ <> ""
  6695.         Pos%=InStr(AddPath$,";")
  6696.  
  6697.         If Pos=0 Then
  6698.             PathDir$ = AddPath$
  6699.             AddPath = ""
  6700.         Else
  6701.             PathDir$ = Left$(AddPath$, Pos%-1)
  6702.             If RIGHT$(PathDir$,1) = "\" Then
  6703.                 PathDir$ = LEFT$(PathDir$, LEN(PathDir$)-1)
  6704.             End If
  6705.             AddPath = Right$(AddPath$, LEN(AddPath)-Pos%)
  6706.         End If
  6707.  
  6708.         If InStr(NewPath$,PathDir$) = 0 Then
  6709.             If NewPath = "" Then
  6710.                 NewPath=PathDir$
  6711.             Else
  6712.                 NewPath=NewPath$+";"+PathDir$
  6713.             End If
  6714.             Resave%=1
  6715.         End If
  6716.     Loop
  6717.     If Resave%=1 Then
  6718.         If Lot_CreateRegKeyValueEx(RegH&, RegKey$, VarName$,_
  6719.                     REG_EXPAND_SZ&,NewPath$,LENBP(NewPath$)+1) Then '97/02/07 CAndo
  6720.             Lot_AddToNTSystemPath = 0
  6721.         End If
  6722.     End If
  6723.  
  6724. END FUNCTION
  6725.  
  6726. '*************************************************************************
  6727. PUBLIC FUNCTION Lot_RegAppPath(ProgName$, szProgPath$, ByVal szSearchPath$, ByVal fCompPath%, ByVal KeyWord$) AS INTEGER
  6728.  
  6729. '** Purpose:   Add application path to registry
  6730. '** Author:    OM
  6731. '** Arguments: 
  6732. '**      ProgName$:     Name of the program file
  6733. '**      szProgPath$:   This is the path of program named above. It
  6734. '**                     may be entered with or without the final '\'
  6735. '**      szSearchPath$: Directories separated by ';' to be added to search
  6736. '**                     path.  Directories should not have final '\'.
  6737. '**      fCompPath:     True if component path should be added to search
  6738. '**                     path.  False if not.
  6739. '**      KeyWord$:      The feature keyword associated with this object.
  6740. '**                     For example, "FLWCORE"
  6741. '**
  6742. '** Returns:   True if worked False otherwise
  6743. '*************************************************************************
  6744.     DIM RegKey$, RegH&, PathDir$, notused&, s$, network$ 
  6745.  
  6746.     szSearchPath$ = NullTrim(szSearchPath$)
  6747.     szSearchPath$ = LTrim(szSearchPath$)
  6748.     If fCompPath% Then
  6749.         network$ = GetSymbolValue(SYM_NETWORK$)
  6750.         IF network$ = gNODE$ THEN
  6751.             s$ = GetSymbolValue(SYM_NETCOMPONENT$)
  6752.         ELSE
  6753.             s$ = GetSymbolValue(SYM_COMPONENTSDIR$)
  6754.         END IF
  6755.         szSearchPath$ = szSearchPath$+";" + s$
  6756.         szSearchPath$ = NullTrim(szSearchPath$)
  6757.         szSearchPath$ = LEFT$(szSearchPath$,LEN(szSearchPath$)-1)
  6758.     End If
  6759.     
  6760.     Lot_RegAppPath = 1
  6761.  
  6762.     RegH&=HKEY_LOCAL_MACHINE&
  6763.     RegKey$=gREGWINNAME+gREGAPPPATH95+"\"+ProgName$
  6764.     If Lot_DoesRegKeyExistEx(RegH&, RegKey$) = FALSE THEN
  6765.         notused&=Lot_RegCreateKeyEx(RegH&, RegKey$)
  6766.     End If
  6767.     If NOT RIGHT$(szProgPath$,1) = "\" Then
  6768.         szProgPath$ = szProgPath$ + "\"
  6769.     End If
  6770.     PathDir$ = szProgPath+ProgName$
  6771.     if Lot_CreateRegKeyValueEx(RegH&,RegKey$,"",_
  6772.                 REG_SZ,PathDir$,LENBP(PathDir$)+1) OR _
  6773.          Lot_CreateRegKeyValueEx(RegH&,RegKey$,gREGAPPPATH95PATH,_
  6774.                 REG_SZ,szSearchPath$,LENBP(szSearchPath$)+1) Then
  6775.         Lot_RegAppPath = 0
  6776.     Else
  6777.         RegKey$ = gHLM$+"\"+RegKey$
  6778.         Lot_RegisterObject KeyWord$, UNIN_CLASS_REGISTRY_HIVE$, RegKey$
  6779.     End If      
  6780.  
  6781.     If NOT IsNewShell() Then
  6782.         If Lot_AddToNTSystemPath(HKEY_LOCAL_MACHINE&, _
  6783.             gREGAPPPATHNT1, gREGAPPPATHNTPATH, szSearchPath$) = 0 Then
  6784.             If Lot_AddToNTSystemPath(HKEY_CURRENT_USER&, _
  6785.                 gREGAPPPATHNT2, gREGAPPPATHNTPATH, szSearchPath$) = 0 Then
  6786.                 Lot_RegAppPath = 0
  6787.             Else
  6788.                 RegKey$ = gHCU$+"\"+gREGAPPPATHNTPATH
  6789. '           Lot_RegisterObject KeyWord$, UNIN_CLASS_REGISTRY_HIVE$, RegKey$
  6790.             End If
  6791.         Else
  6792.             RegKey$ = gHCU$+"\"+gREGAPPPATHNTPATH
  6793. '        Lot_RegisterObject KeyWord$, UNIN_CLASS_REGISTRY_HIVE$, RegKey$
  6794.         End If
  6795.     End If
  6796.     If Lot_RegAppPath = 0 Then
  6797.         RegErrorMsg SID_ERR_REG_APPPATH, RegKey$, gREGAPPPATH95PATH, szSearchPath$
  6798.     End If
  6799. END FUNCTION
  6800.  
  6801. DIM FixupDirectorySymbolList LIST AS STRING
  6802.  
  6803. PUBLIC SUB MarkFixupSourceDirSymbol(szSubdirSymbol$)
  6804. '*************************************************************************
  6805. '** Purpose: Adds the symbol to a list of subdirectory symbols that must
  6806. '**   be reset for a node install based on contents of cinstall.ini on the
  6807. '**   server
  6808. '**  
  6809. '** Author: JMDonohue
  6810. '** Arguments: szSubdirSymbol$   Symbol to reset
  6811. '**************************************************************************
  6812.     if (ISELEMENT(FixupDirectorySymbolList(szSubdirSymbol$)) = 0 ) then _
  6813.         FixupDirectorySymbolList(szSubdirSymbol$) = "Yes"
  6814. END SUB
  6815.  
  6816. PUBLIC SUB Lot_FixupSourceDirectories
  6817. '*************************************************************************
  6818. '** Purpose: Changes the source location for node install files based on 
  6819. '**   the location recorded in the cinstall.ini file on the server
  6820. '**  
  6821. '** Author: JMDonohue
  6822. '** Arguments: 
  6823. '**************************************************************************
  6824.     DIM ret%, s$
  6825.     DIM rc%, Src$, chapter$, Dest$, DirSym$, Sect$
  6826.  
  6827.     FORALL sym IN FixupDirectorySymbolList 
  6828.  
  6829.         chapter$ = Lot_GetFirst("", F_NOTHING)
  6830.         WHILE (chapter$ <> "")
  6831.             DirSym$ = Lot_GetChapterValStr(chapter$, F_DESTDIRSYM)
  6832.             IF DirSym$ = ListTag(sym) AND _
  6833.             INT(Lot_GetChapterValInt(chapter$,F_INOROUT)) = 1 THEN
  6834.                 Src$ = Lot_GetDestDirValueFromInstallIni(DirSym$)
  6835.                 IF Src$ <> "" THEN 
  6836.                 '' Adjust the path to account for an extra product level for the 
  6837.                 '' filename in the node .INF file
  6838.                     Src$ = OneUp(Src$)
  6839.                     IF Src$ = "" THEN GOTO SYMBOLERROR
  6840.                     s$ = GetSymbolValue(SYM_SINGLESMARTSUITE$)
  6841.                     '' For suite, need to remove two levels
  6842.                     IF s$ = gSMARTSUITE$ THEN 
  6843.                         Src$ = OneUp(Src$)
  6844.                         IF Src$ = "" THEN GOTO SYMBOLERROR
  6845.                     END IF
  6846.                     Dest$ = GetSymbolValue(DirSym$)
  6847.                     Sect$ = Lot_GetChapterValStr(chapter$, F_NOTHING)
  6848.                     IF Dest$ <> "" and Sect$ <> "" THEN _
  6849.                         AddSectionFilesToCopyList Sect$, Src$, Dest$
  6850.                 END IF   
  6851.             END IF
  6852.             chapter$ = Lot_GetNext()
  6853.         WEND
  6854.     END FORALL
  6855.     ERASE FixupDirectorySymbolList 
  6856.     EXIT SUB
  6857.  
  6858. SYMBOLERROR:
  6859.     ErrorMsg 0, "Lot_FixupSourceDirectories: invalid symbol: "+DirSym$
  6860. '  ERROR STFQUIT
  6861.  
  6862. END SUB
  6863.  
  6864. PUBLIC FUNCTION Lot_RegIni(RegFileName$) AS INTEGER
  6865. '*************************************************************************
  6866. '** Purpose: Calls SDK program regini.exe to generate registry entries 
  6867. '**   described in script file
  6868. '** NOTE:   Entries in script file have the following format:
  6869. '**   KeyName
  6870. '**   ValueName = value
  6871. '**   e.g.,
  6872. '** \registry\machine\system\currentcontrolset\services\lanmanserver\parameters
  6873. '**    DiskSpaceThreshhold = REG_DWORD 0x00000000 
  6874. '**  
  6875. '** Author: JMDonohue
  6876. '** Arguments: 
  6877. '** RegFileName$  Name of script file for registry creation
  6878. '**************************************************************************
  6879.     Lot_RegIni = Lot_CreateConsoleProcess("regini.exe", RegFileName$)
  6880.     IF Lot_RegIni <> TRUE THEN _
  6881.         ErrorMsg 0, "Error calling Lot_CreateConsoleProcess for regini.exe"
  6882. END FUNCTION
  6883.  
  6884. '*************************************************************************
  6885. PUBLIC SUB ComboSelChanged(BoxNo&, Inst%)
  6886. '** Purpose:   Handles change in combo box selection
  6887. '** Author:    GL
  6888. '** Arguments: 
  6889. '**      BoxNo%   combo/edit set. IDC_COMBO1 = 1
  6890. '**      Inst%    combo box item
  6891. '**
  6892. '*************************************************************************
  6893.     DIM    uncPath$, fullPath$, dirPath$
  6894.     DIM    curCombo$, uncOff&, unusedPath$
  6895.     DIM    comboBox$, editBox$
  6896.  
  6897.     comboBox = "IDC_COMBO"+Right$(Str$(BoxNo&),1)
  6898.     editBox = "IDC_EDIT"+Right$(Str$(BoxNo&),1)
  6899.  
  6900.     curCombo$ = GetListItem(comboBox, Inst%)
  6901.     fullPath$ = GetListItem("IDC_EDIT",CINT(BoxNo&))
  6902.     Lot_SplitUNCPath fullPath$, uncPath$, dirPath$
  6903.     uncOff& = INSTR(1, curCombo$, "\\") 
  6904.     IF uncOff > 0 THEN
  6905.         Lot_SplitUNCPath MID$(curCombo$, uncOff&), uncPath$, unusedPath$
  6906.     ELSE
  6907.       uncPath$ = ""
  6908.     END IF
  6909.     SetListItem "IDC_EDIT", CINT(BoxNo&), uncPath$ + dirPath$
  6910.     AddListItem SYM_UPDATELIST$, editBox
  6911.     EXIT SUB
  6912. END SUB
  6913.  
  6914. '*************************************************************************
  6915. PUBLIC FUNCTION GetPathFromComboEdit(hDlg&, BoxNo%) AS STRING
  6916. '** Purpose:   Builds path from combo/edit box
  6917. '** Author:    GL
  6918. '** Arguments: 
  6919. '**      hDlg&:   dialog handle
  6920. '**      BoxNo%   combo/edit set. IDC_COMBO1 = 1
  6921. '**
  6922. '** Returns:   Fully qualified path. Empty string on failure
  6923. '*************************************************************************
  6924.     DIM drvSel%, drvPath$, uncPath$, dirPath$, comboBox$
  6925.  
  6926.     comboBox = "IDC_COMBO"+Right$(Str$(BoxNo%),1)
  6927.     drvSel% = ValidateEditBox(hDlg&, BoxNo%)
  6928.   IF drvSel% = 0 THEN
  6929.         GetPathFromComboEdit = ""
  6930.         EXIT FUNCTION
  6931.     END IF
  6932.     Lot_SplitUNCPath GetListItem("IDC_EDIT", BoxNo%), uncPath$, dirPath$
  6933.     IF uncPath$ = "" THEN
  6934.         drvPath = LEFT$(GetListItem(comboBox, drvSel%), 2)
  6935.     ELSE
  6936.         drvPath = ""
  6937.     END IF
  6938.          GetPathFromComboEdit= drvPath$ + uncPath$ + dirPath$
  6939. END FUNCTION
  6940.  
  6941. PUBLIC SUB Lot_RegisterFonts()
  6942. '*************************************************************************
  6943. '** Purpose: Traverses the copy list looking for sections whose destination
  6944. '** directory symbol is "LOTUSFONTSDIR"; for each section, registers all 
  6945. '** font filenames with Windows, using the description corresponding to the
  6946. '** font name in 'shared.ini'
  6947. '** NOTE:   Entries in 'shared.ini' file have the following format:
  6948. '**   FontFileName = Description
  6949. '**   e.g.,
  6950. '**    ngoi____.ttf=News Gothic Italic (TrueType)
  6951. '** NOTE: This function should not be used by clients -- called as part of
  6952. '**   toolkit processing  
  6953. '**  
  6954. '** Author: JMDonohue
  6955. '**************************************************************************
  6956.     DIM s$, szSym$, szSect$, i%, j%, n%, chapter$, DirSym$, gSharedIniFile$ 
  6957.     DIM FontDescList LIST AS STRING
  6958.     DIM FontFile$, FontDesc$, winkey$, FontPath$, ret%, Size%, regStatus&, Key$ 
  6959.  
  6960.     szSym$ = "SECTIONFONTS"
  6961.     gSharedIniFile$ = MakePath(GetSymbolValue(SYM_STF_CWDDIR$), gSHAREDINI$)
  6962.     IF WhatPlatform() = PLATFORM_WIN95 THEN
  6963.         winkey$ = "Windows"
  6964.     ELSE
  6965.         winkey = "Windows NT"
  6966.     END IF
  6967.     Key$ = "SOFTWARE\Microsoft\" + WinKey$ + "\CurrentVersion\Fonts"
  6968.  
  6969.     chapter$ = Lot_GetFirst("", F_INOROUT)
  6970.     WHILE (chapter$ <> "")
  6971.         DirSym$ = Lot_GetChapterValStr(chapter$, F_DESTDIRSYM)
  6972.         IF DirSym$ = SYM_LOTUSFONTSDIR$ THEN 
  6973.             szSect$ = Lot_GetChapterValStr(chapter$, F_NOTHING)
  6974.             n% = FGetSectionFileList (szSym$, szSect$, 1)
  6975.             n% = GetListLength(szSym$)
  6976.             '' For each font in section, strip off path components
  6977.             '' and create list of filenames and descriptions      
  6978.             FOR i% = 1 TO n%
  6979.                 s$ = GetListItem(szSym$, i%) 
  6980.                 IF ISELEMENT(FontDescList(s$)) = FALSE THEN _
  6981.                     FontDescList(s$) = GetIniKeyString(gSharedIniFile$, "Fonts", s$)
  6982.             NEXT
  6983.             RemoveSymbol szSym$
  6984.         END IF
  6985.         chapter$ = Lot_GetNext()
  6986.     WEND
  6987. ' Traverse list, register all font files  
  6988. ' If font name not in database, use font name for description
  6989.     FORALL sym IN FontDescList
  6990.         FontFile$ = ListTag(sym)
  6991.         FontDesc$ = FontDescList(ListTag(sym))
  6992.         IF FontDesc$ = "" THEN FontDesc$ = FontFile$
  6993.         FontPath$ = GetSymbolValue(SYM_LOTUSFONTSDIR$) + FontFile$
  6994.         ret% = AddFontResource(FontPath$)
  6995.         Size% = lenbp(FontPath$) + 1 '97/02/07 CAndo
  6996.         regStatus& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, _
  6997.             Key$, FontDesc$, REG_SZ, FontPath$, Size%)
  6998.     END FORALL
  6999.     
  7000. END SUB
  7001.  
  7002. PUBLIC CONST LIBFLAG_FRESTRICTED = 1 
  7003. PUBLIC CONST LIBFLAG_FCONTROL = 2 
  7004. PUBLIC CONST LIBFLAG_FHIDDEN = 4 
  7005.  
  7006. Declare Function ltyplib Lib "OLEAUT32" Alias "LoadTypeLib" (Byval t As  Unicode String,  j As Long ) As Long
  7007. Declare Function rtyplib Lib "OLEAUT32" Alias "RegisterTypeLib" (Byval a As Long, Byval b As Unicode String, Byval c As Unicode String) As Long
  7008.  
  7009. PUBLIC FUNCTION New_RegisterTypeLib( typelibname as string, helpdir as string ) as long
  7010. ' Does registration for a type library, returns zero if successful
  7011. ' Originally by Scott Matsimoto
  7012.     Dim typlib As Long
  7013.     Dim hresult As Long
  7014.     typlib = 0
  7015.     
  7016.     hresult = ltyplib( typelibname, typlib)
  7017.     if hresult = 0 then
  7018.         hresult = rtyplib( typlib, typelibname, helpdir)
  7019.     end if
  7020.  
  7021.     New_RegisterTypeLib = hresult
  7022.     
  7023. END FUNCTION
  7024.  
  7025. PUBLIC FUNCTION Lot_RegisterTypeLib(ID$, Version$, Description$, helppath$, filename$, flags%) AS INTEGER
  7026. '*************************************************************************
  7027. '** Purpose: Creates necessary registry entries for Type Libraries
  7028. '**  
  7029. '** Arguments: 
  7030. '**      ID$            ID, "29130064-2EED-1069-BF5D-00DD011186B7", e.g. 
  7031. '**      Version$       Version
  7032. '**      Description$   Description
  7033. '**      helppath$      Pathname of directory containing help files
  7034. '**      filename$      Fully qualified name of file
  7035. '**      flags%         See below(default is 0):
  7036. '**  
  7037. '**  Flag Value         Description
  7038. '**  LIBFLAG_FCONTROL   The type library describes controls and should not be 
  7039. '**                     displayed in type browsers intended for nonvisual objects.
  7040. '**  LIBFLAG_FRESTRICTED   The type library is restricted and should not
  7041. '**                     be displayed to users.
  7042. '**  LIBFLAG_FHIDDEN    The type library should not be displayed to users, 
  7043. '**                     although its use is not restricted. To be used by
  7044. '**                     controls; hosts should create a new type library that
  7045. '**                     wraps the control with extended properties.
  7046. '**
  7047. '** Returns:   TRUE if successful, FALSE otherwise
  7048. '**  
  7049. '** Author: JMDonohue
  7050. '**************************************************************************
  7051.     DIM key$, s$, flagstr$
  7052.     DIM LReturn& 
  7053.     
  7054.     key$ = "Typelib\" + ID$ + "\" + Version$
  7055.     LReturn& = Lot_CreateRegKeyValueEx(HKEY_CLASSES_ROOT, key$,_
  7056.             "", REG_SZ, Description$,  LENBP(Description$)+1)
  7057.     IF LReturn& <> ERROR_SUCCESS THEN GOTO FAILED
  7058.     s$ = key$ + "\" + "0\win32"
  7059.     LReturn& = Lot_CreateRegKeyValueEx(HKEY_CLASSES_ROOT, s$,_
  7060.             "", REG_SZ, filename$,  LENBP(filename$)+1)
  7061.     IF LReturn& <> ERROR_SUCCESS THEN GOTO FAILED
  7062.     s$ = key$ + "\" + "HELPDIR"
  7063.     LReturn& = Lot_CreateRegKeyValueEx(HKEY_CLASSES_ROOT, s$,_
  7064.             "", REG_SZ, helppath$,  LENBP(helppath$)+1)
  7065.     IF LReturn& <> ERROR_SUCCESS THEN GOTO FAILED
  7066.     s$ = key$ + "\" + "FLAGS"
  7067.     flagstr$ = CStr(flags%)
  7068.     LReturn& = Lot_CreateRegKeyValueEx(HKEY_CLASSES_ROOT, s$,_
  7069.             "", REG_SZ, flagstr$,  LENBP(flagstr$)+1)
  7070.     IF LReturn& <> ERROR_SUCCESS THEN GOTO FAILED
  7071.     Lot_RegisterTypeLib = TRUE
  7072.     EXIT FUNCTION
  7073.  
  7074. FAILED:
  7075.     Lot_RegisterTypeLib = FALSE
  7076. END FUNCTION   
  7077.  
  7078. PUBLIC FUNCTION OneUp(s$) AS STRING
  7079. '*************************************************************************
  7080. '**   Purpose: Removes the last element of a filename
  7081. '**    e.g. d:\lotus\compnent ==> d:\lotus\
  7082. '**            
  7083. '** Author:    JMDonohue
  7084. '** Arguments: s$ string to strip
  7085. '** Returns: stripped string or null string if invalid
  7086. '**     
  7087. '*************************************************************************
  7088. DIM i%
  7089.     i% = Len(s$) - 1  'Assume last character is \
  7090.     DO 
  7091.         i% = i% - 1
  7092.         IF i% = 0 THEN
  7093.             ErrorMsg 0, "Toolkit:OneUp: String does not contain \: "+s$
  7094.             OneUp = ""
  7095.             EXIT FUNCTION
  7096.         END IF
  7097.     LOOP  UNTIL Mid(s$, i%, 1) = "\"
  7098.     OneUp =  Mid(s$, 1, i%)
  7099. END FUNCTION   
  7100.  
  7101.  
  7102. PUBLIC FUNCTION Lot_AreAnyNodeOptionsAvail() AS INTEGER
  7103. '*************************************************************************
  7104. '**Purpose:Determine whether any node options are available
  7105. '**for the products selected.
  7106. '**
  7107. '**Returns:TRUE if any options are available
  7108. '**        FALSE if none
  7109. '**
  7110. '**Autor:GLutz
  7111. '*************************************************************************
  7112. DIM AllProdNum%,AllOptNum%,prodNum%,chpt$
  7113.  
  7114.   Lot_AreAnyNodeOptionsAvail = FALSE
  7115.  
  7116.   'Loop through the products and find the avail node options
  7117.   AllProdNum% = 0
  7118.   AllProdNum% = Reg_GetNumberOfProducts()
  7119.   IF AllProdNum% <> 0 THEN
  7120.      'Loop through the products
  7121.      FOR prodNum%=1 TO AllProdNum%
  7122.         AllOptNum% = 0      
  7123.         AllOptNum% = Lot_GetNumOfNodeOptAvailToNodeForProd(prodNum%)
  7124.         IF AllOptNum% <> 0 THEN
  7125.           chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(prodNum%)_
  7126.                      + gTOP$)
  7127.           IF (INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1) THEN
  7128.              Lot_AreAnyNodeOptionsAvail = TRUE
  7129.              EXIT FUNCTION
  7130.           END IF
  7131.         END IF
  7132.      NEXT
  7133.   END IF
  7134. END FUNCTION
  7135.  
  7136.  
  7137.  
  7138. '--------------------------------------------------------------------
  7139. '                                                                                          -
  7140. ' Function: RemovePriorVersion ( string$, string$ ) As Integer      -
  7141. '                                                                                          -
  7142. ' Purpose:  removes previous installations of 32 bit products          -
  7143. '                                                                                          -
  7144. ' Params:   ProdRegKeyName$ : Product's registry name (WordPro)      -
  7145. '           ProdVer$        : Version to be remove    (96.0)          -
  7146. '                                                                                          -
  7147. '--------------------------------------------------------------------
  7148.  
  7149. Public Function RemovePriorVersion(ProdRegKeyName$,ProdVer$) As Integer
  7150.  
  7151.   Dim prodCount%, i%, status&, RegKey$, PlatformStr$
  7152.   Dim cmdLine$, dwStatus&, cbBuf&, exeName$, newCmdLine$
  7153.   STATIC cmdBuf(10) AS STRING, cmdCount%
  7154.  
  7155.   If ProdRegKeyName$ = "begin" AND ProdVer$ = "execution" Then
  7156.  
  7157.      '-- case one: execute all uninstall calls in buffer --'
  7158.  
  7159.      For i% = 0 To cmdCount%
  7160.  
  7161.         '-- this call launches uninstall; dwStatus should be STILL_ACTIVE(259) --'
  7162.  
  7163.         dwStatus& = Lot_ExecUninstall(cmdBuf(i%))
  7164.  
  7165.         WHILE dwStatus& = STILL_ACTIVE
  7166.           dwStatus& = Lot_ExecUninstall("")
  7167.         WEND
  7168.  
  7169.      Next
  7170.  
  7171.   ELSEIF ProdRegKeyName$ = "reset" AND ProdVer$ = "buffer" Then
  7172.  
  7173.      '-- case two: reset buffer --'
  7174.  
  7175.      cmdCount% = 0
  7176.  
  7177.   ELSE
  7178.  
  7179.      '-- case three: get prod. uninstall str. from Registry --'
  7180.  
  7181.      PlatformStr$ = gREGWINNAME
  7182.  
  7183.      RegKey$      = PlatformStr$+"\Uninstall\"+ProdRegKeyName$+" V"+ProdVer$
  7184.  
  7185.      status& = Lot_GetRegKeyValueEx( HKEY_LOCAL_MACHINE, _
  7186.                                     RegKey$,            _
  7187.                                         "UninstallString",  _
  7188.                                     dwStatus&,          _
  7189.                                     cmdLine$,           _
  7190.                                     cbBuf&              )
  7191.  
  7192.  
  7193.         If status& = ERROR_SUCCESS Then
  7194.  
  7195.  
  7196.          '-- replace old uninstall with newest uninstall (in lotustmp.000) --'
  7197.  
  7198.             Dim j         As Integer 
  7199.             Dim nPos      As Long 
  7200.             Dim nSize     As Long 
  7201.             Dim nTotalLen As Long 
  7202.             Dim TmpPath   As String 
  7203.             Dim tmpLine   As String 
  7204.             Dim tmpLine2  As String 
  7205.  
  7206.             tmpLine$   = NullTrim(cmdLine$)
  7207.          nTotalLen& = len(tmpLine$)
  7208.             nPos&      = InStr(1, tmpLine$, "/T")    
  7209.          nSize&     = nTotalLen& - nPos&
  7210.          tmpLine2$  = Right(tmpLine$, nSize&)        
  7211.          TmpPath$ = GetSymbolValue(SYM_STF_CWDDIR$) + "lunin11.exe /"
  7212.     
  7213.          cmdLine$ = TmpPath$ + tmpLine2$
  7214.  
  7215.             '-- for dev purposes don't use automated uninstall --'
  7216.  
  7217.             cmdBuf(cmdCount%) = cmdLine$ + " /A upgrade.rsp /S"
  7218.  
  7219.             cmdCount% = cmdCount% + 1
  7220.  
  7221.  
  7222.  
  7223.         ELSE
  7224.  
  7225.              '-- case four: no prod. uninstall str., build one up from Registry --'
  7226.  
  7227.              Dim szPath      As String
  7228.              Dim szInfPath   As String
  7229.              Dim szKeyVal    As String
  7230.              Dim szFirst     As String
  7231.              Dim szSuiteName As String
  7232.             
  7233.              '-- get SmartSuite's uninstall string --'
  7234.  
  7235.              RegKey$ = PlatformStr$ + "\Uninstall\" + "SmartSuite" + " V" + ProdVer$
  7236.  
  7237.              status& = Lot_GetRegKeyValueEx( HKEY_LOCAL_MACHINE, _
  7238.                                                         RegKey$,            _
  7239.                                                         "UninstallString",  _
  7240.                                                         dwStatus&,          _
  7241.                                                         cmdLine$,           _
  7242.                                                         cbBuf&              )
  7243.  
  7244.  
  7245.          '-- adjust for SmartSuite or 123Suite --'
  7246.  
  7247.             If status& = ERROR_SUCCESS Then
  7248.  
  7249.                 szSuiteName$ = "SmartSuite"
  7250.  
  7251.             Else    
  7252.  
  7253.  
  7254.                 RegKey$ = PlatformStr$ + "\Uninstall\" + "123Suite" + " V" + ProdVer$
  7255.  
  7256.                 status& = Lot_GetRegKeyValueEx( HKEY_LOCAL_MACHINE, _
  7257.                                             RegKey$,            _
  7258.                                             "UninstallString",  _
  7259.                                             dwStatus&,          _
  7260.                                             cmdLine$,           _
  7261.                                             cbBuf&              )
  7262.  
  7263.  
  7264.                 If status& = ERROR_SUCCESS Then
  7265.                     szSuiteName$ = "123Suite"
  7266.                 Else
  7267.                     EXIT FUNCTION
  7268.                 End If
  7269.             End If    
  7270.  
  7271.             '-- use first piece of SmartSuite's string --'
  7272.  
  7273.             szFirst$ = Left(cmdline$, InStr(cmdline$, szSuiteName$) - 1)
  7274.  
  7275.  
  7276.             '-- get path of Lotus ini file --'
  7277.  
  7278.             szKeyVal$ = "SOFTWARE\Lotus\" + szSuiteName$ + "\" + ProdVer$ 
  7279.  
  7280.             status& = Lot_GetRegKeyValueEx( HKEY_LOCAL_MACHINE, _
  7281.                                                       szKeyVal$,          _
  7282.                                                       "Path",             _
  7283.                                                       dwStatus&,          _
  7284.                                                       szPath$,            _
  7285.                                                       cbBuf&              )
  7286.  
  7287.             szPath$ = NullTrim(szPath$)
  7288.  
  7289.  
  7290.  
  7291.          '-- check for existing Node --'
  7292.  
  7293.          Dim nInstallType As Long
  7294.             nInstallType& = 0
  7295.          status& = Lot_GetRegKeyValueEx ( HKEY_LOCAL_MACHINE, _
  7296.                                           szKeyVal$,          _ 
  7297.                                           "InstallType",          _
  7298.                                           REG_DWORD,              _
  7299.                                           nInstallType&,      _
  7300.                                           cbBuf&              )
  7301.  
  7302.  
  7303.          If (nInstallType& = 1) Then
  7304.  
  7305.               szPath$ = szPath$ + "cinstnod.ini"
  7306.  
  7307.          ELSE
  7308.  
  7309.            szPath$ = szPath$ + "cinstall.ini"
  7310.  
  7311.          End If
  7312.  
  7313.             szPath$ = NullTrim(szPath$)
  7314.  
  7315.             '-- get path of prod. inf file --'
  7316.  
  7317.             szKeyVal$ = "SOFTWARE\Lotus\" + szSuiteName$ + "\" + ProdVer$ + "\Products\"  
  7318.             szKeyVal$ = szKeyVal$ + ProdRegKeyName$ + "\" + ProdVer$  
  7319.  
  7320.             status& = Lot_GetRegKeyValueEx( HKEY_LOCAL_MACHINE, _
  7321.                                                       szKeyVal$,          _
  7322.                                                       "InfFileName",      _
  7323.                                                       dwStatus&,          _
  7324.                                                       szInfPath$,         _
  7325.                                                       cbBuf&              )
  7326.  
  7327.  
  7328.             szInfPath$ = NullTrim(szInfPath$)
  7329.  
  7330.             '-- build command line, store it in buffer --'
  7331.  
  7332.             Dim q       As String
  7333.             Dim szTwo   As String
  7334.             Dim szThree As String
  7335.  
  7336.             q$ = """"
  7337.  
  7338.          '-- we are replacing the exe with the newest one in the lotus tmp dir 4/30: J.Pappas --'   
  7339.  
  7340.          szFirst$ = GetSymbolValue(SYM_STF_CWDDIR$) + "lunin11.exe /T "
  7341.  
  7342.             cmdLine$ = szFirst$ + ProdRegKeyName$ + " /V " + ProdVer$ + " /I "
  7343.  
  7344.             szTwo$   = q$ + szInfPath$ + q$ + " /C "
  7345.  
  7346.             szThree$ = q$ + szPath$ + q$ + " /O /L EN"
  7347.  
  7348.             cmdLine$ = cmdLine$ + szTwo$ + szThree$
  7349.  
  7350.             cmdBuf(cmdCount%) = cmdLine$ + " /A upgrade.rsp /S"
  7351.  
  7352.             cmdCount% = cmdCount% + 1
  7353.  
  7354.         End If
  7355.     
  7356.     End If
  7357.  
  7358. END FUNCTION '-- RemovePriorVersion --'
  7359.  
  7360.  
  7361.  
  7362. CONST sharedDLLkey$ = "SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs"
  7363. CONST nsize& = 4
  7364.  
  7365. PUBLIC SUB IncrementSharedDLLCount(s$)
  7366. '****************************************************************************
  7367. '** Purpose: Increments the shared dll count in registry.
  7368. '**
  7369. '** Author:  JGHAZAL, JMD
  7370. '** Arguments: s$    shared file fully qualified pathname
  7371. '**
  7372. '****************************************************************************
  7373. DIM regStatus&, Descnum as variant, Descnum2&
  7374.  
  7375.     IF Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, sharedDLLkey$, s$, REG_DWORD, Descnum, nsize&) = 0 THEN
  7376.         Descnum2& = val(Descnum) + 1
  7377.     ELSE
  7378.           Descnum2& = 1
  7379.     END IF
  7380.     regStatus& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, sharedDLLkey$, s$, REG_DWORD, Descnum2&, nsize&)
  7381.  
  7382. END SUB
  7383.  
  7384. PUBLIC SUB FixupSharedDLLCount(s$)
  7385. '****************************************************************************
  7386. '** Purpose: If a shared DLL already exists and does not have a shared count
  7387. '** it creates one, per Microsoft recommendation to avoid stepping on other's
  7388. '** who didn't do the count properly
  7389. '**
  7390. '** Author:  JMD
  7391. '** Arguments: s$    shared file fully qualified pathname
  7392. '**
  7393. '****************************************************************************
  7394. DIM regStatus&, Descnum as variant, Descnum2&
  7395.  
  7396.     IF DoesFileExist(s$, femExists) AND _
  7397.     Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, sharedDLLkey$, s$, REG_DWORD, _
  7398.             Descnum, nsize&) <> 0 THEN
  7399.         Descnum2& = 1
  7400.         regStatus& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, sharedDLLkey$, _
  7401.             s$, REG_DWORD, Descnum2&, nsize&)
  7402.     END IF
  7403.  
  7404. END SUB
  7405.  
  7406. PUBLIC FUNCTION Lot_RegisterOCX (OCXpath$) AS LONG
  7407. '*************************************************************************
  7408. '** Purpose:   This function is provided for backward compatibility with 
  7409. '**   previous versions; it calls Lot_RegisterOCX2 with the root section of
  7410. '**   the current product.  Note that this will cause deregistration when the
  7411. '**   product is removed, as opposed to associating it with a particular
  7412. '**   feature.  Clients should call Lot_RegisterOCX2 directly if greater
  7413. '**   control is desired.
  7414. '**
  7415. '** Author:    JMDonohue
  7416. '**
  7417. '** Arguments:
  7418. '**   OCXpath$    Fully qualified pathname of the OCX file on the server
  7419. '**
  7420. '** Returns:   NOT FALSE if successful
  7421. '**
  7422. '*************************************************************************
  7423.     DIM prodno%
  7424.     DIM FeatureKW$ 
  7425.     Lot_RegisterOCX = FLot_RegisterOCX (OCXpath$)
  7426.     prodno%    = Lot_GetCurrentProduct()
  7427.     FeatureKW$ = Reg_GetProductAcronym(prodno%) + gTOP$
  7428.     Lot_RegisterOCX = Lot_RegisterOCX2 (FeatureKW$, OCXpath$)
  7429. END FUNCTION
  7430.  
  7431. PUBLIC FUNCTION Lot_RegisterOCX2 (FeatureKW$, OCXpath$) AS LONG
  7432. '*************************************************************************
  7433. '** Purpose:   Registers OCX's by calling the DllRegisterServer function in
  7434. '**   the OCX, and writes a miscellaneous object to tell uninstall to unregister
  7435. '**
  7436. '** Author:    JMDonohue
  7437. '**
  7438. '** Arguments:
  7439. '**   FeatureKW$  Feature keyword associated with the OCX
  7440. '**   OCXpath$    Fully qualified pathname of the OCX file on the server
  7441. '**
  7442. '** Returns:   NOT FALSE if successful
  7443. '**
  7444. '*************************************************************************
  7445.     Lot_RegisterObject FeatureKW$, UNIN_CLASS_OCXFILE$, OCXpath$
  7446.     Lot_RegisterOCX2 = FLot_RegisterOCX (OCXpath$)
  7447. END FUNCTION
  7448.  
  7449. PUBLIC FUNCTION Lot_RegisterREGTemplate(Keyword$, InFile$, OutFile$) AS INTEGER
  7450. '*************************************************************************
  7451. '** Purpose:   Translate destination symbol macros in 'infile' to 'outfile'
  7452. '**   executes the resulting .REG file with regedit, and writes an uninstall
  7453. '**   object to allow uninstall to undo the .REG file registry entries
  7454. '**
  7455. '** Author:    JMDonohue
  7456. '**
  7457. '** Arguments:
  7458. '**   Keyword$    Section keyword
  7459. '**   InFile$     Fully qualified pathname of the template file 
  7460. '**   OutFile$    Fully qualified pathname of the output .REG file
  7461. '**
  7462. '** Returns:   TRUE if registration successful
  7463. '**
  7464. '*************************************************************************
  7465.     DIM s$, path$, ret%
  7466.     DIM inpath$, outpath$
  7467.     If OutFile$ = "" OR OutFile$ = InFile$ Then
  7468.         print "Input and output filenames cannot be the same"
  7469.         ERROR STFQUIT
  7470.     End If
  7471.     s$ = Lot_GetChapterFromKeyword(Keyword$)
  7472.     s$ = Lot_GetChapterValStr(s$, F_DESTDIRSYM)
  7473.     path$ = GetSymbolValue(s$)
  7474.     inpath$ = path$ + InFile$
  7475.     outpath$ = path$ + OutFile$
  7476.  
  7477.     If Lot_TranslateREGTemplate(inpath$, outpath$) Then
  7478.         DIM CommandLine$
  7479.         CommandLine$ =    "regedit /s " +  """" + outpath$ + """"
  7480.         WinExec CommandLine$, SW_HIDE
  7481.         ret% = WinExec (CommandLine$, SW_HIDE)
  7482.         ' TRUE indicates success
  7483.         Lot_RegisterREGTemplate = ret% > 31
  7484.         if ret% > 31 then _
  7485.             ret% = Lot_RegisterObject(Keyword$, UNIN_CLASS_REGISTRY_FILE$, outpath$)
  7486.     End If
  7487.  
  7488. END FUNCTION
  7489.  
  7490. FUNCTION Lot_TranslateREGTemplate(InFile$, OutFile$) AS INTEGER
  7491. '*************************************************************************
  7492. '** Purpose:   Wrapper for FRegisterREGTemplate, which translates %..%
  7493. '**   delimited macros in template file into standard .REG file format 
  7494. '**
  7495. '** Author:    SPeront
  7496. '**
  7497. '** Arguments:
  7498. '**   InFile$     Fully qualified pathname of the template file 
  7499. '**   OutFile$    Fully qualified pathname of the output .REG file
  7500. '**
  7501. '**   Outfile can be blank, and InFile$ will be overwritten
  7502. '**
  7503. '** Returns:   TRUE if successful
  7504. '**
  7505. '*************************************************************************
  7506.     DIM i%, s$
  7507.     i% = FRegisterREGTemplate(InFile$, OutFile$)
  7508.     If i% <> 0 then
  7509.         s$ =  "Error processing registry template file " + InFile$
  7510.         DoMsgBox s$, LdString(SID_TKT_STD_TITLE), MB_OK
  7511.         Lot_TranslateREGTemplate = FALSE
  7512.     Else  
  7513.         Lot_TranslateREGTemplate = TRUE
  7514.     End If
  7515. END FUNCTION   
  7516.  
  7517.  
  7518.  
  7519.