home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Bonus / lotus123rel9 / install.dsk / INST.LSS < prev    next >
Text File  |  1998-04-30  |  54KB  |  1,315 lines

  1. ''/*********************************************************************
  2. ''
  3. ''   Module Name:   INST.lss
  4. ''
  5. ''   Module Code:   COMINST
  6. ''
  7. ''   Author:              
  8. ''
  9. ''   Creation Date:       Jan 26, 1994
  10. ''
  11. ''   Copyright Lotus Development Corporation, (c) 1994
  12. ''
  13. ''
  14. ''  
  15. ''   Description: 
  16. ''  
  17. ''
  18. ''   Additional authors:
  19. ''
  20. ''   Change History:
  21. ''   $Log:   //frontline/INSTLOG/CI/cominst/toolkit/inst.lss  $
  22. '' 
  23. ''    Rev 1.67   30 Apr 1998 18:11:48   jpappas
  24. '' Corrected REBOOTLATER flag for Pipeline 
  25. '' 
  26. ''    Rev 1.66   02 Jul 1997 11:16:22   jdonohue
  27. '' Ando (Japan) changes:
  28. '' Added space before product name
  29. '' 
  30. ''    Rev 1.65   03 Jul 1996 12:21:02   jdonohue
  31. '' Only record the language of install for server install in PostSuccessRegINST
  32. '' 
  33. ''    Rev 1.64   14 Jun 1996 16:42:32   jdonohue
  34. '' Ref SPR:     RBAN364Q7G
  35. '' Added pipeline RunOnce registry entry if reboot needed and requested
  36. '' 
  37. ''    Rev 1.63   17 May 1996 10:09:58   jdonohue
  38. '' Added SYM_LOTUSUSERDIR to symbol list for install for cinstall.ini
  39. '' 
  40. ''    Rev 1.62   30 Apr 1996 09:58:48   jdonohue
  41. '' Ref SPR:    AGAO357QH7
  42. '' Changed logic in SetUserHomeDirectory so that LOTUSUSERDIR set to
  43. '' COMPONENTSDIR for standard and server, to local user directory for node, and
  44. '' to nothing for distribution
  45. '' 
  46. ''    Rev 1.61   29 Apr 1996 16:23:30   jdonohue
  47. '' Only refresh SYM_LOTUSUSERDIR Destination if symbol not empty string 
  48. '' 
  49. ''    Rev 1.60   22 Apr 1996 14:17:08   jdonohue
  50. '' Ref SPR:  RMOO345M3L
  51. '' Fixed error in setting value of LOTUSUSERDIR
  52. '' 
  53. ''    Rev 1.59   04 Apr 1996 16:27:48   jdonohue
  54. '' Moved IncrementSharedDLLCount and Lot_DoSharedDLLs from inst.lss to main.lss
  55. '' since inst PostConfig processing not done for node since install not copied
  56. '' 
  57. ''    Rev 1.58   02 Apr 1996 11:48:06   jdonohue
  58. '' Call MarkLanguageSubdir for INSTDIR only in node install
  59. '' 
  60. ''    Rev 1.57   01 Apr 1996 08:54:44   jdonohue
  61. '' Register "INSTDIR" with MarkLanguageSubdir since the destination of secondary
  62. '' language files to the server is subdirectory of main product directory
  63. '' 
  64. ''    Rev 1.56   27 Mar 1996 13:15:22   jdonohue
  65. '' Changed LOTUSFONTSDIR handling to mimic WIN/WINSYS fonts go to win directory
  66. '' on server
  67. '' 
  68. ''    Rev 1.55   18 Mar 1996 13:14:18   jdonohue
  69. '' Ref SPR:LSCR32TQHP
  70. '' Use IsNewShell instead of WhatPlatform for determination of LOTUSFONTS directory
  71. '' 
  72. ''    Rev 1.54   12 Mar 1996 15:37:36   jdonohue
  73. '' Moved call to FixupSourceDirSymbol for SYM_LOTUSFONTSDIR$ to InitINST
  74. '' 
  75. ''    Rev 1.53   04 Mar 1996 15:47:06   jdonohue
  76. '' Only call Lot_RegisterFonts for standard and node install
  77. '' 
  78. ''    Rev 1.52   04 Mar 1996 14:23:14   jdonohue
  79. '' Only call Lot_DoSharedDLLs for standard and node
  80. '' 
  81. ''    Rev 1.51   04 Mar 1996 08:31:46   jdonohue
  82. '' Remove 16 bit shared component support -- pass 1 : eliminate LOTUSAPP
  83. '' 
  84. ''    Rev 1.50   28 Feb 1996 15:01:02   jdonohue
  85. '' Added subs IncrementSharedDLLCount and Lot_DoSharedDLLs to increment shared DLL
  86. '' reference count in PostCopyConfigINST
  87. '' 
  88. ''    Rev 1.49   02 Feb 1996 14:42:10   jdonohue
  89. '' Fixed bug with symbol list name not getting set for node in InitInst
  90. '' 
  91. ''    Rev 1.48   29 Jan 1996 16:43:14   jdonohue
  92. '' Fixed error in adding SYM_LOTUSFONTSDIR to list
  93. '' 
  94. ''    Rev 1.47   25 Jan 1996 16:18:40   jdonohue
  95. '' Add SYM_LOTUSFONTSDIR$ to the Directory symbol table list for INST to make
  96. '' sure it gets into the cinstall.ini file
  97. '' 
  98. ''    Rev 1.46   24 Jan 1996 16:08:48   jdonohue
  99. '' Ref SPR:    JHOH327JVA
  100. '' Fixed logic error in setting LOTUSUSERDIR
  101. '' 
  102. ''    Rev 1.45   18 Jan 1996 13:38:16   jdonohue
  103. '' Register all the Windows system fonts installed with call to Lot_RegisterFonts
  104. '' 
  105. ''    Rev 1.44   17 Jan 1996 11:43:54   jdonohue
  106. '' Fixed bug setting SYM_LOTUSUSERDIR$ - append \ where not needed
  107. '' 
  108. ''    Rev 1.43   10 Jan 1996 16:51:18   jdonohue
  109. '' Changed SetUserHomeDirectory to locate the user component files in a
  110. '' subdirectory of the node root, or the original install location for that user
  111. '' if there is one in the registry
  112. '' 
  113. ''    Rev 1.42   09 Jan 1996 14:25:34   jdonohue
  114. '' Reset the source for node install for LOTUSFONTSDIR sections in PreCopyConfig
  115. '' 
  116. ''    Rev 1.41   02 Jan 1996 16:19:58   jdonohue
  117. '' Reset destination of all files that have destination directory symbol
  118. '' LOTUSFONTSDIR
  119. '' 
  120. ''    Rev 1.40   02 Jan 1996 15:58:04   jdonohue
  121. '' Determine the location of the Windows fonts directory and set symbol
  122. '' SYM_LOTUSFONTSDIR$ in InitInst.
  123. '' 
  124. ''    Rev 1.39   28 Dec 1995 10:54:36   jdonohue
  125. '' Added sub SetUserHomeDirectory for multi-user configuration
  126. '' 
  127. ''    Rev 1.38   22 Dec 1995 14:27:08   jdonohue
  128. '' Use the language acronym instead of the language for the install node icons
  129. '' 
  130. ''    Rev 1.37   22 Dec 1995 10:13:18   jdonohue
  131. '' Removed all references to SYM_PARENTDIR$ -- is now SYM_BASEDIR$ for all
  132. '' 
  133. ''    Rev 1.36   26 Oct 1995 15:25:16   tveerapp
  134. '' FIxed IF END IF for SYM_LOTUSUSERDIR processing in PrecopyConfigINST.
  135. '' 
  136. ''    Rev 1.35   Oct 24 1995 16:55:46   cmoy
  137. '' removed eof char
  138. '' 
  139. ''    Rev 1.34   24 Oct 1995 15:42:38   jdonohue
  140. '' Fixed syntax error
  141. '' 
  142. ''    Rev 1.33   24 Oct 1995 15:25:04   jdonohue
  143. '' Make sure SYM_LOTUSUSERDIR$ not blank before refresh
  144. '' 
  145. ''    Rev 1.32   24 Oct 1995 11:49:42   jdonohue
  146. '' Added dummy call to InitLanguages
  147. '' 
  148. ''    Rev 1.31   19 Oct 1995 14:57:16   jdonohue
  149. '' Refresh "LOTUSUSERDIR" destination in PreCopyConfig
  150. '' 
  151. ''    Rev 1.30   11 Oct 1995 15:57:22   glutz
  152. '' AddIconINST sets working directory.
  153. '' 
  154. ''    Rev 1.29   26 Sep 1995 09:01:30   jdonohue
  155. '' Fixed preventing overwrite of cinstall.ini, .inf for language install
  156. '' 
  157. ''    Rev 1.28   25 Sep 1995 12:51:28   jdonohue
  158. '' Added placeholder function InitLanguageINST
  159. '' 
  160. ''    Rev 1.27   Sep 25 1995 09:52:24   cmoy
  161. '' Prevent overwrite of cinstall.ini, xxx.lss by supressing INSTTOP section inst
  162. '' ead of INSTFILES section
  163. '' 
  164. ''    Rev 1.26   07 Sep 1995 14:55:18   tveerapp
  165. '' Moved the setting of INSTDIR during a language server install from
  166. '' main.lss to fix spr# WED2SVNRDZ
  167. '' 
  168. ''    Rev 1.25   01 Sep 1995 09:35:18   jdonohue
  169. '' Turn off INSTLANG?? section for language install
  170. '' 
  171. ''    Rev 1.24   18 Aug 1995 16:43:12   glutz
  172. '' INITInst sets InitDir to SYM_PARENTDIR$.
  173. '' 
  174. ''    Rev 1.23   14 Aug 1995 13:41:46   jdonohue
  175. '' Added code to add language qualifier to node icon in AddIconsINST
  176. '' 
  177. ''    Rev 1.22   14 Aug 1995 09:09:26   jdonohue
  178. '' Added code to handle language install to server
  179. '' 
  180. ''    Rev 1.21   02 Aug 1995 14:56:28   amontalv
  181. '' Added name of product to node install shortcut.
  182. '' 
  183. ''    Rev 1.20   17 Jul 1995 15:53:58   amontalv
  184. '' Added code to put install in program folder for server install.
  185. '' 
  186. ''    Rev 1.19   03 May 1995 18:14:14   mzgripce
  187. '' replace #else with 'else
  188. '' 
  189. ''    Rev 1.18   02 May 1995 12:52:42   cmoy
  190. '' Merged c2 into cf build
  191. '' 
  192. ''    Rev 1.18   10 Apr 1995 18:09:14   amontalv
  193. '' Changed comments to reflect change of function reference.
  194. '' 
  195. ''    Rev 1.17   02 Feb 1995 14:27:06   cmoy
  196. '' 
  197. '' Thangaraj added fixes for Pipeline Problem
  198. '' 
  199. ''    Rev 1.16   13 Jan 1995 17:17:58   tveerapp
  200. '' 
  201. '' Removed redundant code
  202. '' 
  203. ''    Rev 1.15   12 Jan 1995 15:30:42   tveerapp
  204. '' 
  205. '' 1. changed cmoVital to cmoOverwrite for making the LAUNCHEXE entry in cinstall.ini
  206. '' 2. Removed MakePath.It cannot handle file names with paths in it. e.g. reg\foo.exe
  207. '' 
  208. ''    Rev 1.14   11 Jan 1995 15:32:08   tveerapp
  209. '' 
  210. '' Fixed spr# TVEN28TJK:
  211. '' The cinstall.ini in the temporary directory is used to determine if the product
  212. '' being installed supports pipeline(based on the existence of the LAUNCHEXE entry)
  213. '' If it does, a global flag is set to indicate this and an enrty is made in the
  214. '' cinstall.ini that is installed on the machine.
  215. '' If the flag is set and the execuatble exists, it is launched.
  216. '' 
  217. ''    Rev 1.13   29 Dec 1994 12:23:14   tveerapp
  218. '' 
  219. '' Fixed AND _.
  220. '' 
  221. ''    Rev 1.12   29 Dec 1994 12:15:28   tveerapp
  222. '' 
  223. '' Added a check for pipeline processing to be launched only for a non-automated 
  224. '' install.
  225. '' 
  226. ''    Rev 1.11   28 Dec 1994 16:13:50   tveerapp
  227. '' 
  228. '' Added pipeline processing (electronic registration). Functions PostCopyConfig
  229. '' and PostSuccessReg have these changes. Removed the callback for the elrctronic
  230. '' registration dialog.
  231. '' 
  232. ''    Rev 1.10   12 May 1994 11:20:52   mmeth
  233. '' Adding Icons for Lic and Install and using DoMsgBox instead of MessageBox
  234. '' 
  235. ''    Rev 1.9   02 May 1994 18:34:02   mzgripce
  236. '' 
  237. '' add AddIconsINST()
  238. '' 
  239. ''    Rev 1.8   04 Apr 1994 18:10:44   mmeth
  240. '' Now can ignore share.lss & shared.ini
  241. '' 
  242. ''    Rev 1.7   22 Mar 1994 12:34:16   mmeth
  243. '' added licdir & instdir to toolkit registration
  244. '' 
  245. ''    Rev 1.6   28 Feb 1994 14:27:42   mmeth
  246. '' Incorrectly reseting INSTDIR in PrecopyCOnfigINST
  247. '' 
  248. ''    Rev 1.5   18 Feb 1994 13:29:42   mmeth
  249. '' 
  250. '' Now check for Listlength of Reg_GetDirSymbolList
  251. '' 
  252. ''    Rev 1.4   17 Feb 1994 10:23:06   mmeth
  253. '' Added Reg_SetAllowUserToChoseInSMartSUite
  254. '' 
  255. ''    Rev 1.3   16 Feb 1994 11:00:22   mmeth
  256. '' Added error message if INSTTOP sec is
  257. '' 
  258. ''    Rev 1.2   15 Feb 1994 15:33:58   mmeth
  259. '' took out a print
  260. '' 
  261. ''    Rev 1.1   15 Feb 1994 14:48:30   mmeth
  262. '' fixed BASEDIR & Reg_GetDirSymbolLIst(1)
  263. '' 
  264. ''    Rev 1.0   11 Feb 1994 10:56:44   jbrodeur
  265. '' Initial Revision
  266. ''----------------------------------------------------------------------
  267. ''   Date     Vers. Pgmr  SPR#  Change
  268. ''----------------------------------------------------------------------
  269. ''  2-08-94   0004  MMETH       moved checking first prod for change to Initcopylist
  270. ''  2-04-94   0003  MMETH       changed PreCopyConfig to work for SmartSuite
  271. ''  2-03-94   0002  MMETH       corrected 1 prod vs smartsuite
  272. ''  2-02-94   0001  MMETH       cinstall.ini install for standard and server
  273. ''  1-25-94   0000              Initial Check-In
  274. '' !
  275. ''
  276. ''----------------------------------------------------------------------
  277. ''
  278. ''*********************************************************************/
  279.  
  280. USE "TOOLKIT"
  281. USE "LANGUAGE"
  282. OPTION DECLARE
  283.  
  284.  
  285. '** These Are the Required Functions that Products must provide
  286. '***************************************************************
  287. DECLARE PUBLIC FUNCTION ProductRegINST (prodno%, network$, direction$) AS STRING
  288. DECLARE PUBLIC FUNCTION DefaultUserRegINST (prodno%, network$, direction$) AS STRING
  289. DECLARE PUBLIC FUNCTION InitINST (prodno%, network$, direction$, basedir$) AS STRING
  290. DECLARE PUBLIC FUNCTION PathChangeINST (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
  291. DECLARE PUBLIC FUNCTION InitCopyListINST (prodno%, network$, direction$) AS STRING
  292. DECLARE PUBLIC FUNCTION PreCopyConfigINST (prodno%, network$, direction$, lic%) AS STRING
  293. DECLARE PUBLIC FUNCTION AddTheBillBoardsINST (prodno%, network$, direction$, nbytes&) AS STRING
  294. DECLARE PUBLIC FUNCTION PostCopyConfigINST (prodno%, network$, direction$, programgroup$) AS STRING
  295. DECLARE PUBLIC FUNCTION AddIconsINST (prodno%, network$, direction$, programgroup$) AS STRING
  296. DECLARE PUBLIC FUNCTION UIINST (prodno%, network$, direction$) AS STRING
  297. DECLARE PUBLIC FUNCTION PostSuccessRegINST (prodno%, network$, direction$) AS STRING
  298. DECLARE PUBLIC FUNCTION InitLanguageINST (prodno%, network$, direction$) AS STRING
  299.  
  300. '** Product specific functions
  301. '*****************************
  302. DECLARE FUNCTION GetINSTPathfromLotusIni() AS STRING
  303. DECLARE SUB SetUserHomeDirectory() 
  304.  
  305. ' ** Global flag for launching pipeline exe
  306. PUBLIC gProdsupport%
  307.  
  308. '*************************************************************************
  309. '**************************** Required Functions *************************
  310. '*************************************************************************
  311.  
  312. '*************************************************************************
  313. '** SUB Initialize
  314. '**
  315. '** Purpose: Initialize the INST product scripts. There is only one purpose
  316. '**          of this routine, it is to register **your product**. Without
  317. '**          this function, your product will not install.  All you
  318. '**          you need to do in this subroutine is:
  319. '**                   modify INST -> your acronmy.
  320. '**          NOTE: so as not to clutter up the INSTCUI.RC file,
  321. '**                we always use SID_INST.  You of course can be more
  322. '**                creative!
  323. '**
  324. '**          ASSUMPTIONS: Many things in the toolkit key off of your
  325. '**                       Acronym. These are the constraints:
  326. '**                     1. your top level chapther in the INF must
  327. '**                        have a KEYWORD of your Acronym +"TOP"
  328. '**                           e.g. INSTTOP
  329. '** Author:  Marcel Meth  
  330. '** Arguments: None
  331. '** Returns:   NONE
  332. '*************************************************************************
  333. SUB Initialize
  334.    Reg_RegisterProductNames "INST", LdString(SID_BLANKTEXT) 
  335. END SUB
  336.  
  337. '*************************************************************************
  338. '** FUNCTION ProductRegINST (prodno%, network$, direction$) AS INTEGER
  339. '**
  340. '** Purpose: This function allows your product to register itself
  341. '**          in the Install Product Registry.  The toolkit squirrles
  342. '**          the information provided and will provide you with
  343. '**          various features accordingly.  For example, if you support
  344. '**          shared files, the toolkit will do most of the work
  345. '**          for the COMPENT directory.
  346. '**
  347. '**          For the most part you should use only Reg_Set... Functions.
  348. '**          
  349. '**
  350. '**          If you turn on ATM, LICENSING, or and SHARED tools, then
  351. '**          you must be sure to add the appropriate lines and files
  352. '**          in you INST.SCR and INST.LYT, respectively. See Cook book.
  353. '**
  354. '**          If you support server, you will have to make sure that
  355. '**          you have the correct entire for the install files in your
  356. '**          INST.SCR and INST.LYT
  357. '**
  358. '** Arguments:  All paremeters are **read only**. 
  359. '**          prodno%: This is your prodno%.  It is assigned to you by the
  360. '**                   toolkit in the order in which you were  registered.
  361. '**                   When your product is oart of Smart Suite, Smart Suite
  362. '**                   will always be product #1. (prodno% >=1)
  363. '**          network$: UNINITIALIZED
  364. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  365. '**                      then step backwards, i.e start at your last dialog
  366. '**                      first.
  367. '**     
  368. '** Errors:    No return code for errors, you must Raise them
  369. '** Author:    MMeth
  370. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  371. '**                             allow the user to step backwards.)
  372. '*************************************************************************
  373.  
  374. PUBLIC FUNCTION ProductRegINST (prodno%, network$, direction$) AS STRING
  375.    ProductRegINST = gNEXT
  376.  
  377.    Reg_SetSupportedInstallTypes prodno%, 1, 1, 1
  378.    'Reg_SetSelectedInstallType ProdNo%,TypeSelected$  
  379.    Reg_SetProdSizes prodno%, 524288, 524288 ' .5 meg.
  380.    Reg_SetUIInOrOut prodno%, 1  
  381.    Reg_SetShareFlags prodno%, 0, 0, 0, 0 
  382.  
  383.    Reg_SetAllowUserToPickInSuite prodno%, 0
  384.  
  385.    'NO NEED TO SET SINCE THER IS NO CD SUPPORT.
  386.    'Reg_SetCDOption prodno%,Inst%,CDOptStr$ 
  387.    'Reg_SetCDOptionSelected ProdNo%,Inst%,Selection% 
  388.  
  389.    'DEAL WITH LATER
  390.    'Reg_SetNodeOption ProdNo%,Inst%,NodeOptStr$  
  391.    'Reg_SetNodeOptionSelected ProdNo%,Inst%,Selection% 
  392.    Reg_SetSrvSupport prodno%, 1
  393.    Reg_SetLicenseSupport prodno%, 0
  394.    Reg_SetATMSupport prodno%, 0
  395.  
  396.    'Reg_SetProgManagerGroup prodno%, LdString(SID_INST)
  397.  
  398.  
  399. END FUNCTION
  400.  
  401. '*************************************************************************
  402. '** FUNCTION DefaultUserRegINST (prodno%, network$, direction$) AS STRING
  403. '**
  404. '** Purpose: **Only** the first registered product gets called.
  405. '**          For SMartSUite, this will be Smart Suite.
  406. '**          This functions allows you to set the default user reg.
  407. '**          information that the user will be shown. The toolkit
  408. '**          will provide default values from MS-Windows. If you disagree
  409. '**          with them you should modify them in this function using:
  410. '**          SetSymbolValue on SYM_NAME, SYM_COMPANY & SYM_SERIALNUM$
  411. '**          
  412. '**          It is upto you how you store registration information.
  413. '**          it will not be stored until later in PostCopyConfigINST.
  414. '**          The CIT provides functions that allow you to access .ri 
  415. '**          files: Lot_ReadDefaultsfromRi(ripath$).
  416. '**
  417. '**          If you need to write back to the floppy, do it here.
  418. '**          Most Lotus products will no longer write back to the floppy.
  419. '**          Remeber, you can't write back to a CD or network!
  420. '**
  421. '** In Symbols : SYM_NAME$, SYM_COMPANY$
  422. '** Out Symbols: SYM_NAME$, SYM_COMPANY$, SYM_SERIALNUM$
  423. '**            
  424. '** Arguments:  All paremeters are **read only**. 
  425. '**          prodno%: This is your prodno%.  It is assigned to you by the
  426. '**                   toolkit in the order in which you were  registered.
  427. '**                   When your product is oart of Smart Suite, Smart Suite
  428. '**                   will always be product #1. (prodno% >=1)
  429. '**          network$: UNINITIALIZED
  430. '**          network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  431. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  432. '**                      then step backwards
  433. '**     
  434. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  435. '**                      then step backwards, i.e start at your last dialog
  436. '**                      first.
  437. '**     
  438. '** Errors:    No return code for errors, you must Raise them
  439. '** Author:    MMeth
  440. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  441. '**                             allow the user to step backwards.)
  442. '*************************************************************************
  443.  
  444. PUBLIC FUNCTION DefaultUserRegINST (prodno%, network$, direction$) AS STRING
  445.  
  446.    DefaultUserRegINST = gNEXT
  447.  
  448. END FUNCTION
  449.  
  450.  
  451. '*************************************************************************
  452. '** FUNCTION InitINST (prodno%, network$, direction$, basedir$) AS STRING
  453. '**
  454. '** Purpose: This is the first time you will be called when
  455. '**          the server parmater us valid.  You need to use this
  456. '**          function to intialize certain things. (See the MUST DO
  457. '**          below).
  458. '**          
  459. '**          This is a good place to put up a dialog warning the user
  460. '**          of a prrevious version of your product. If there is a previous
  461. '**          version you might want to steer them twords or away from it.
  462. '**          
  463. '**
  464. '** Must Do: You **MUST** set inital values for all of the destination
  465. '** =======  directories that you refer to in your INF file.  If you do not,
  466. '**          then InitCopylist will fail!  e.g. SetSymbolValue "INSTDIR", basedir$
  467. '**          Of course you may be more intelligent.  You should preface your
  468. '**          directory with basedir$.  The toolkit is finding a good drive
  469. '**          letter and basedirectory.  Also, remeber all paths end in a
  470. '**          \ and are lower case.
  471. '**
  472. '**          You should **NOT** define LOTUSFONTSDIR, LOTUSUSERDIR, WINDIR, &
  473. '**          WINSYSDIR. The toolkit does this for you.
  474. '**
  475. '**          Once you have defined destdir symbols, you need to register
  476. '**          them with the toolkit. (See the code below)
  477. '**
  478. '** In Symbols : 
  479. '** Out Symbols: 
  480. '**            
  481. '** Arguments:  All paremeters are **read only**. 
  482. '**          prodno%: This is your prodno%.  It is assigned to you by the
  483. '**                   toolkit in the order in which you were  registered.
  484. '**                   When your product is oart of Smart Suite, Smart Suite
  485. '**                   will always be product #1. (prodno% >=1)
  486. '**          network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  487. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  488. '**                      then step backwards
  489. '**     
  490. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  491. '**                      then step backwards, i.e start at your last dialog
  492. '**                      first.
  493. '**
  494. '**          basedir$:   The toolkit has found a good base. for your directory.
  495. '**                      This is it.  You should use it.  This will make Smart
  496. '**                      Suite work, and will pick a good drive letter for you.
  497. '**     
  498. '** Errors:    No return code for errors, you must Raise them
  499. '** Author:    MMeth
  500. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  501. '**                             allow the user to step backwards.)
  502. '**
  503. '*************************************************************************
  504.  
  505. PUBLIC FUNCTION InitINST (prodno%, network$, direction$, basedir$) AS STRING
  506. DIM dirSym$, sym$, symname$, i%
  507.  
  508.    InitINST = direction$
  509.    '' In the backwards case, keep backing up
  510.    If direction$ = gBACK Then
  511.       EXIT FUNCTION
  512.    End If
  513.  
  514.     i% = 1
  515.     sym$ = Reg_GetDirSymbolList(prodno%)
  516.     symname$ = sym$ + gNAME
  517.         
  518.    If network$ <> gSERVER AND network$ <> gSTANDARD AND network$ <> gDISTRIBUTION$ Then
  519.          Reg_SetUIInOrOut prodno%, FALSE
  520.    Else
  521.       '** Figure out where the first product is., put install there!
  522.       IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSINGLE$ THEN
  523.          SetSymbolValue "INSTDIR", GetSymbolValue(SYM_BASEDIR$)
  524.       Else
  525.          SetSymbolValue "INSTDIR", basedir$
  526.       End If
  527.  
  528.       SetSymbolValue "INSTDIRNAME", " "
  529.  
  530.       SetListItem sym$, 1, "INSTDIR"
  531.       SetListItem symname$, 1, "INSTDIR" + gNAME$
  532.         i% = i% + 1
  533.  
  534.    End If
  535. '**
  536. '**    Determine the location of the Windows fonts directory and set symbol
  537. '**    SYM_LOTUSFONTSDIR$
  538.    If network$ = gNODE OR network$ = gSTANDARD THEN 
  539.         IF IsNewShell() THEN
  540.             SetSymbolValue SYM_LOTUSFONTSDIR$, GetSymbolValue(SYM_WINDIR$) _
  541.                 + LdString(SID_FONTS95_DIR) + "\"
  542.         ELSE
  543.             SetSymbolValue SYM_LOTUSFONTSDIR$, GetSymbolValue(SYM_WINSYSDIR$)
  544.         END IF
  545.     END IF
  546.  
  547.     ' Initialize SYM_LOTUSUSERDIR$ symbol
  548.     SetUserHomeDirectory
  549.  
  550.     ' The destination of secondary language files to the server is subdirectory
  551.     ' of main product directory
  552.    If network$ = gNODE THEN _
  553.         MarkLanguageSubdir("INSTDIR")
  554.         
  555.     ' Make sure special CIT symbols get into Cinstall.ini
  556.     dirSym$ = SYM_LOTUSFONTSDIR$ 
  557.     SetListItem sym$, i%, dirSym$
  558.     SetListItem symname$, i%, dirSym$ + gNAME$
  559.     i% = i% + 1
  560.     dirSym$ = SYM_LOTUSUSERDIR$ 
  561.     SetListItem sym$, i%, dirSym$
  562.     SetListItem symname$, i%, dirSym$ + gNAME$
  563.     i% = i% + 1
  564.     
  565. END FUNCTION
  566.  
  567.  
  568. '*************************************************************************
  569. '** FUNCTION PathChangeINST (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
  570. '**
  571. '** Purpose: This function is called whenever the user proposes changes
  572. '**          to a path for your product.  by the time this function calls
  573. '**          you, the paths have already been checked syntactically, and
  574. '**          the directory has been checked to see that it is in fact writeable.
  575. '**          Your obligation is to verify that the proposed new path is okay with
  576. '**          you.  If, not, put up a dialog telling the user and return
  577. '**          gBACK.
  578. '**          
  579. '** In Symbols : 
  580. '** Out Symbols: 
  581. '**            
  582. '** Arguments:  All paremeters are **read only**. 
  583. '**          prodno%: This is your prodno%.  It is assigned to you by the
  584. '**                   toolkit in the order in which you were  registered.
  585. '**                   When your product is oart of Smart Suite, Smart Suite
  586. '**                   will always be product #1. (prodno% >=1)
  587. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  588. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  589. '**                      then step backwards
  590. '**      destdirsym$: The destdir symbol that has changed. e.g. "INSTDIR"
  591. '**   mainprodsonly%: (TRUE | FALSE) , when TRUE this means that only
  592. '**                   your top level product directory should change,
  593. '**                   probably "INSTDIR"
  594. '**     
  595. '** Errors:    No return code for errors, you must Raise them
  596. '** Author:    MMeth
  597. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  598. '**                             allow the user to step backwards.)
  599. '**
  600. '*************************************************************************
  601.  
  602. PUBLIC FUNCTION PathChangeINST (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
  603. DIM path$
  604.  
  605.    PathChangeINST = gNEXT
  606.  
  607.    path$ = GetSymbolValue (destdirsym$)
  608.    '' The following is a psudocode example
  609.    ''''''rc$ = DetectVersionPriorToDarwin(path$)
  610.    ''''''If rc$ = "BEAGLE" then
  611.    ''''''   ShowPathError SID_BEAGLE_FOUND, SID_ERR_EXISTBEAGLE, path$
  612.    ''''''   PathChangeINST = gBACK
  613.    ''''''end if   
  614.  
  615. END FUNCTION
  616.  
  617.  
  618. '*************************************************************************
  619. '** FUNCTION InitCopyListINST (prodno%, network$, direction$) AS STRING
  620. '**
  621. '** Purpose:  Product must Initialize the copylist
  622. '**          
  623. '** Must Do: You must initialize the copy list.  However,
  624. '** =======  if you leve the code totally untouched as is,
  625. '**          it will probably work for you.
  626. '**
  627. '** In Symbols : 
  628. '** Out Symbols: 
  629. '**            
  630. '** Arguments:  All paremeters are **read only**. 
  631. '**          prodno%: This is your prodno%.  It is assigned to you by the
  632. '**                   toolkit in the order in which you were  registered.
  633. '**                   When your product is oart of Smart Suite, Smart Suite
  634. '**                   will always be product #1. (prodno% >=1)
  635. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  636. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  637. '**                      then step backwards
  638. '**     
  639. '** Errors:    No return code for errors, you must Raise them
  640. '** Author:    MMeth
  641. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  642. '**                             allow the user to step backwards.)
  643. '**
  644. '*************************************************************************
  645.  
  646. PUBLIC FUNCTION InitCopyListINST (prodno%, network$, direction$) AS STRING
  647. DIM i%, sym$, chpt$
  648.  
  649.    InitCopyListINST = direction$
  650.    '' In the backwards case, keep backing up
  651.    If direction$ = gBACK Then
  652.       EXIT FUNCTION
  653.    End If
  654.  
  655.    sym$ = Reg_GetProductAcronym(prodno%) + gTOP$
  656.    chpt$ = Lot_GetChapterFromKeyWord(sym$)
  657.  
  658.    if chpt$ = "" then   
  659.       ErrorMsg 0, "Developers: You need to have install section with INSTTOP in INF file"
  660.       ERROR STFQUIT
  661.    end if
  662.  
  663.    SELECT CASE Reg_GetProdSelectedInstallType(prodno%)
  664.  
  665.    CASE gCOMPLETE$
  666.       i% = F_COMPLETE
  667.    CASE gLAPTOP$
  668.       i% = F_LAPTOP
  669.    CASE gCUSTOM$
  670.       i% = F_CUSTOM
  671.    END SELECT
  672.  
  673.    Lot_InitializeCopyList chpt$, i%
  674.  
  675.    '** FOR STANDARD we only want to install the cinstall.ini file
  676.    If network$ <> gSERVER$ Then
  677.       If FIsKeywordinCopyList ("INSTFILES") <> FALSE Then
  678.          chpt$ =  Lot_GetChapterFromKeyword("INSTFILES")
  679.          Lot_ToggleChapterFilesInCopyList chpt$              
  680.       End If
  681.    End If
  682.         
  683.     'For a language install, we don't overwrite the cinstall.ini and .INF files
  684.     'by turning off the INSTTOP section
  685.    IF network$ <> gSERVER$ THEN
  686.    IF GetSymbolValue(SYM_INSTALLKIND$) = gLANGUAGEINSTALL$ THEN
  687.         chpt$ =  Lot_GetChapterFromKeyword("INSTTOP")
  688.         Lot_SetChapterFilesInCopyListInOrOut chpt$, 0 
  689.     END IF
  690.    END iF
  691.     
  692. END FUNCTION
  693.  
  694. '*************************************************************************
  695. '** FUNCTION UIINST (prodno%, network$, direction$) AS STRING
  696. '**
  697. '** Purpose: This is your chance to put up any User Interface
  698. '**          that you want.  remeber, try to keep it short.
  699. '**          In Smart Suite, if every product puts up to extra
  700. '**          dialogs, then the Smart SUite will consist of 16 dialogs!
  701. '**          
  702. '**          Pay attention to the value of direction, if you are putting
  703. '**          up more than one dialog.
  704. '**
  705. '**          The toolkit will do an acurate space computation later,
  706. '**          so you can tamper with the copy list. But you shouldn't
  707. '**          write out anything to the disk until PostCopyCofig!
  708. '**   
  709. '** In Symbols : 
  710. '** Out Symbols: 
  711. '**            
  712. '** Arguments:  All paremeters are **read only**. 
  713. '**          prodno%: This is your prodno%.  It is assigned to you by the
  714. '**                   toolkit in the order in which you were  registered.
  715. '**                   When your product is oart of Smart Suite, Smart Suite
  716. '**                   will always be product #1. (prodno% >=1)
  717. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  718. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  719. '**                      then step backwards
  720. '**     
  721. '** Errors:    No return code for errors, you must Raise them
  722. '** Author:    MMeth
  723. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  724. '**                             allow the user to step backwards.)
  725. '**
  726. '*************************************************************************
  727.  
  728. PUBLIC FUNCTION UIINST (prodno%, network$, direction$) AS STRING
  729.    UIINST = direction$
  730.    '' In the backwards case, keep backing up
  731.    If direction$ = gBACK Then
  732.       EXIT FUNCTION
  733.    End If
  734.  
  735. END FUNCTION
  736.  
  737.  
  738. '*************************************************************************
  739. '** FUNCTION PreCopyConfigINST (prodno%, network$, direction$, lic%) AS STRING
  740. '**
  741. '** Purpose: This is the very last function called before the space is
  742. '**          acurately computed (to the last byte) and files are copied
  743. '**          by the toolkit.  If you have any last minute changes to
  744. '**          do, this is the time to do them.  example:
  745. '**          Test for monitor resolution, and turn on the chapter
  746. '**          in the copy list with the appropriate resoltuion.
  747. '**          
  748. '** In Symbols : 
  749. '** Out Symbols: 
  750. '**            
  751. '** Arguments:  All paremeters are **read only**. 
  752. '**          prodno%: This is your prodno%.  It is assigned to you by the
  753. '**                   toolkit in the order in which you were  registered.
  754. '**                   When your product is oart of Smart Suite, Smart Suite
  755. '**                   will always be product #1. (prodno% >=1)
  756. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  757. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  758. '**                      then step backwards
  759. '**             lic%: TRUE | FALSE; TRUE licensing is turned on else it is off
  760. '**     
  761. '** Errors:    No return code for errors, you must Raise them
  762. '** Author:    MMeth
  763. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  764. '**                             allow the user to step backwards.)
  765. '**
  766. '*************************************************************************
  767.  
  768. PUBLIC FUNCTION PreCopyConfigINST (prodno%, network$, direction$, lic%) AS STRING
  769. DIM dirSym$
  770.  
  771.    PreCopyConfigINST = gNEXT
  772.  
  773.    '* Just in case product 1 changed.
  774.    If GetSymbolValue (SYM_SINGLESMARTSUITE) =  gSINGLE$ Then
  775.       dirSym$ = Reg_GetDirSymbolList(1)
  776.       If GetListLength(dirSym$) >= 1 Then
  777.          dirSym$ = GetListItem(dirSym$, 1)
  778.       End If
  779.       SetSymbolValue "INSTDIR", GetSymbolValue(dirSym$)
  780.    Else
  781.       SetSymbolValue "INSTDIR", GetSymbolValue (SYM_BASEDIR$)
  782.    End If
  783.  
  784.    '** TV: We have to reset this symbol for language/server install 
  785.    IF GetSymbolValue(SYM_INSTALLKIND$) = gLANGUAGEINSTALL$  AND _
  786.       GetSymbolValue(SYM_NETWORK$) =gSERVER$ THEN 
  787.       SetLanguageSubdir  "INSTDIR", "INSTDIR"  
  788.    END IF
  789.  
  790.    Lot_RefreshDestination ("INSTDIR") 
  791.  
  792.     'Set LOTUSUSERDIR for user files on node
  793.     'may have been changed if BASEDIR changes through UI
  794.     SetUserHomeDirectory
  795.    IF GetSymbolValue(SYM_LOTUSUSERDIR$) <> "" THEN _
  796.         Lot_RefreshDestination (SYM_LOTUSUSERDIR$) 
  797.  
  798. END FUNCTION
  799.  
  800.  
  801. '*************************************************************************
  802. '** FUNCTION  AddTheBillBoardsINST (prodno%, network$, direction$, nbytes&)
  803. '**
  804. '** Purpose: This is where to add the billboards using the function:
  805. '**          AddToBillboardList. Use nbytes& as the last parameter to
  806. '**          the MS-SETUP function AddToBillboardList
  807. '**
  808. '** In Symbols : 
  809. '** Out Symbols: 
  810. '**            
  811. '** Arguments:  All paremeters are **read only**. 
  812. '**          prodno%: This is your prodno%.  It is assigned to you by the
  813. '**                   toolkit in the order in which you were  registered.
  814. '**                   When your product is oart of Smart Suite, Smart Suite
  815. '**                   will always be product #1. (prodno% >=1)
  816. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  817. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  818. '**                      then step backwards
  819. '**           nbytes: Determines the duration of billboard timing.
  820. '**     
  821. '** Errors:    No return code for errors, you must Raise them
  822. '** Author:    MMeth
  823. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  824. '**                             allow the user to step backwards.)
  825. '**
  826. '*************************************************************************
  827.  
  828. PUBLIC FUNCTION AddTheBillBoardsINST (prodno%, network$, direction$, nbytes&) AS STRING
  829.    AddTheBillBoardsINST = direction$
  830.    '' In the backwards case, keep backing up
  831.    If direction$ = gBACK Then
  832.       EXIT FUNCTION
  833.    End If
  834.  
  835.    'psudo code follows as an example
  836.    ''''If network$ <> gNODE$ Then
  837.    ''''   SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD1_BMP)
  838.    ''''   AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD1, "_FNameOrgDlgProc@16", nbytes& 
  839. '      else
  840.    ''''   AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD1, "FNameOrgDlgProc", nbytes& 
  841.    ''''End If
  842.  
  843. END FUNCTION
  844.  
  845. '*************************************************************************
  846. '** FUNCTION PostCopyConfigINST (prodno%, network$, direction$, programgroup$) AS STRING
  847. '**
  848. '** Purpose: This is called just after file copy has completed.
  849. '**          This is your opportunity to do all the configuaration
  850. '**          you need.  This includes:
  851. '**          
  852. '**          1. Writing to all your ini files
  853. '**          2. Writeing to OLE Reg database
  854. '**          3. Writing to any other confi files you may support
  855. '**          4. Writing out user registration information
  856. '**          5. Add program manager icons of those features
  857. '**             thatwere installed.
  858. '**          6. Create any working directories.
  859. '**             A working directory is one that does not contain any
  860. '**             files, thus the toolkit did not create it for you.
  861. '**
  862. '**          NOTE: THERE are many subtlties in here if you are
  863. '**                dealing with node and CD installs.  In particular,
  864. '**                you must be ***very*** careful to understand where the
  865. '**                things are that you are pointing to.  They could
  866. '**                be on the node, server, or CD!  This, in combination
  867. '**                with the INF file for Server/Node is probably the trickiest
  868. '**                part of writing a quality install.  When configuring,
  869. '**                you must be careful to consider what happens if there is
  870. '**                a preexisting product on the machine, in the same location or
  871. '**                another one!  This is very very tricky.  What happens
  872. '**                if you had a full installation previously in location C:\FOO
  873. '**                and now the user is installing a minimum installation in loaction
  874. '**                D:\FOO. 
  875. '**
  876. '**                Each and every thing you do for configuartion needs very
  877. '**                careful thought.
  878. '**
  879. '**                WE support a function Lot_WhereIsFeature("FeatureID")
  880. '**                This currrently tells you the location of a feature
  881. '**                If the feature appears both in the SERVER.INF and the
  882. '**                NODE.INF referred to by the same Keyword ID.
  883. '**                We do not support CDs with this command yet, but we will at some
  884. '**                time.
  885. '**
  886. '**                Also look out for writing to a file when the directory
  887. '**                doesn't exist.  If the user deselected one of your
  888. '**                you options, your install may still be running,
  889. '**                but since there were no files to copy into the directory
  890. '**                 it wasn't created by the toolkit!
  891. '**
  892. '**                Finally, remember that configuration files generally
  893. '**                hold the state that the user has customized earlier.
  894. '**                Sometimes you don't want to overwrite these!
  895. '**                You will primarily use three MS-SETUP functions
  896. '**                in here: 
  897. '**                  1. CreateIniKeyValue  (writing to ini files)
  898. '**                  2. SetRegKeyValue     (writing to OLE reg DB)
  899. '**                  3. CreateProgmanItem  (writing to progman) 
  900. '**
  901. '**                CreateProgmanGroup &  ShowProgmanGroup are
  902. '**                done for you by the time you reach this
  903. '**                function.
  904. '**
  905. '**                You will not have to do any configuration of LOTUS SHARED
  906. '**                tools.  The toolkit will do this for you.
  907. '** In Symbols : 
  908. '** Out Symbols: 
  909. '**            
  910. '** Arguments:  All paremeters are **read only**. 
  911. '**          prodno%: This is your prodno%.  It is assigned to you by the
  912. '**                   toolkit in the order in which you were  registered.
  913. '**                   When your product is oart of Smart Suite, Smart Suite
  914. '**                   will always be product #1. (prodno% >=1)
  915. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  916. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  917. '**                      then step backwards
  918. '**    programgroup$: The name of the program group the user chose to
  919. '**                   install the program manager icons     
  920. '**
  921. '** Errors:    No return code for errors, you must Raise them
  922. '** Author:    MMeth
  923. '** Returns:   return: gNEXT 
  924. '**
  925. '*************************************************************************
  926.  
  927. PUBLIC FUNCTION PostCopyConfigINST (prodno%, network$, direction$, programgroup$) AS STRING
  928.    PostCopyConfigINST = direction$
  929.    '' In the backwards case, keep backing up
  930.    If direction$ = gBACK Then
  931.       EXIT FUNCTION
  932.    End If
  933.    
  934. SKIPCONFIG:
  935.  
  936. END FUNCTION
  937.  
  938. '** PUBLIC FUNCTION AddIconsINST (prodno%, network$, direction$, programgroup$) AS STRING
  939. '** Purpose: This is called just after file copy has completed.
  940. '**          1. Add program manager icons of those features
  941. '**             thatwere installed.
  942. '**
  943. '**          NOTE: THERE are many subtlties in here if you are
  944. '**                dealing with node and CD installs.  In particular,
  945. '**                you must be ***very*** careful to understand where the
  946. '**                things are that you are pointing to.  They could
  947. '**                be on the node, server, or CD!  This, in combination
  948. '**                with the INF file for Server/Node is probably the trickiest
  949. '**                part of writing a quality install.  When configuring,
  950. '**                you must be careful to consider what happens if there is
  951. '**                a preexisting product on the machine, in the same location or
  952. '**                another one!  This is very very tricky.  What happens
  953. '**                if you had a full installation previously in location C:\FOO
  954. '**                and now the user is installing a minimum installation in loaction
  955. '**                D:\FOO. 
  956. '**
  957. '**                Each and every thing you do for configuartion needs very
  958. '**                careful thought.
  959. '**
  960. '**                WE support a function Lot_WhereIsFeature("FeatureID")
  961. '**                This currrently tells you the location of a feature
  962. '**                If the feature appears both in the SERVER.INF and the
  963. '**                NODE.INF referred to by the same Keyword ID.
  964. '**                We do not support CDs with this command yet, but we will at some
  965. '**                time.
  966. '**
  967. '**                Also look out for writing to a file when the directory
  968. '**                doesn't exist.  If the user deselected one of your
  969. '**                you options, your install may still be running,
  970. '**                but since there were no files to copy into the directory
  971. '**                 it wasn't created by the toolkit!
  972. '**
  973. '**                Finally, remember that configuration files generally
  974. '**                hold the state that the user has customized earlier.
  975. '**                Sometimes you don't want to overwrite these!
  976. '**                You will primarily use three MS-SETUP functions
  977. '**                in here: 
  978. '**                  1. CreateProgmanItem  (writing to progman) 
  979. '**
  980. '**                CreateProgmanGroup &  ShowProgmanGroup are
  981. '**                done for you by the time you reach this
  982. '**                function.
  983. '**
  984. '**                You will not have to do any configuration of LOTUS SHARED
  985. '**                tools.  The toolkit will do this for you.
  986. '**            
  987. '** Arguments:  All paremeters are **read only**. 
  988. '**          prodno%: This is your prodno%.  It is assigned to you by the
  989. '**                   toolkit in the order in which you were  registered.
  990. '**                   When your product is oart of Smart Suite, Smart Suite
  991. '**                   will always be product #1. (prodno% >=1)
  992. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  993. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  994. '**                      then step backwards
  995. '**    programgroup$: The name of the program group the user chose to
  996. '**                   install the program manager icons     
  997. '**
  998. '** Errors:    No return code for errors, you must Raise them
  999. '** Author:    MZ
  1000. '** Returns:   return: gNEXT 
  1001. '**
  1002. '*************************************************************************
  1003.  
  1004. PUBLIC FUNCTION AddIconsINST (prodno%, network$, direction$, programgroup$) AS STRING
  1005. DIM instdir$, notused%, Caption$
  1006. DIM LanguageQualifier$, LanguageAcronym$
  1007.    AddIconsINST = direction$
  1008.    '' In the backwards case, keep backing up
  1009.    If direction$ = gBACK Then
  1010.       EXIT FUNCTION
  1011.    End If
  1012.  
  1013.    If network$ = gSERVER Then
  1014.       instdir$ = Lot_WhereIsFeature(prodno%, "INSTFILES", "install.exe")
  1015.         Caption$ = LdString(SID_INST_VIEWSTRING)+ " " + Reg_GetProductName(1)    'Cando
  1016.         'Add language qualifier for secondary languages
  1017.         IF GetSymbolValue(SYM_INSTALLKIND$) = gLANGUAGEINSTALL$ THEN 
  1018.             LanguageAcronym$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$) 
  1019.             LanguageQualifier$ = LanguageAcronym$  
  1020.             Caption$ = Caption$ + " " + LanguageQualifier$  
  1021.         END IF
  1022.       ASSERT instdir$ <> "", ""
  1023.        If IsNewShell() THEN
  1024.             notused%=Lot_AddLinkToFolder(prodno%, instdir$ + "install.exe", _
  1025.                                     Caption$+".lnk", _
  1026.                                     Caption$, "", instdir$)
  1027.             Lot_RegisterObject "INSTFILES",UNIN_CLASS_SHORTCUT$, Lot_GetProgFolder(prodno%) + Caption$+".lnk"
  1028.         Else    
  1029.           CreateProgmanItem  programgroup$, Caption$, _
  1030.                   instdir$ + "install.exe", ",,,," + instdir$, cmoOverwrite
  1031.            Lot_RegisterObject "INSTFILES", UNIN_CLASS_ICON$, programgroup$ + "\" + Caption$
  1032.         End If
  1033.    End If
  1034.  
  1035.     ' Register all the Windows system fonts installed
  1036.    IF network$ = gNODE OR network$ = gSTANDARD THEN _
  1037.         Lot_RegisterFonts
  1038.  
  1039. END FUNCTION
  1040.  
  1041.  
  1042.  
  1043. '*************************************************************************
  1044. '** FUNCTION PostSuccessRegINST (prodno%, network$, direction$) AS STRING
  1045. '**
  1046. '** Purpose: If you need to launch something after install runs
  1047. '** In Symbols : 
  1048. '** Out Symbols: 
  1049. '**            
  1050. '** Arguments:  All paremeters are **read only**. 
  1051. '**          prodno%: This is your prodno%.  It is assigned to you by the
  1052. '**                   toolkit in the order in which you were  registered.
  1053. '**                   When your product is oart of Smart Suite, Smart Suite
  1054. '**                   will always be product #1. (prodno% >=1)
  1055. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  1056. '**       direction$: gNEXT 
  1057. '**
  1058. '** Errors:    No return code for errors, you must Raise them
  1059. '** Author:    MMeth
  1060. '** Returns:   return: gNEXT 
  1061. '**
  1062. '*************************************************************************
  1063.  
  1064. PUBLIC FUNCTION PostSuccessRegINST (prodno%, network$, direction$) AS STRING
  1065.  
  1066. DIM rc$, ExecError%, notused%, executable$, gInstallIniFile$, prodbaseDir$
  1067. DIM distribution$, automation$
  1068. DIM cwd$, TmpInstallIni$
  1069.  
  1070.    PostSuccessRegINST = direction$
  1071.    '' In the backwards case, keep backing up
  1072.    'If direction$ = gBACK Then
  1073.    '   EXIT FUNCTION
  1074.    'End If
  1075.  
  1076.     'Build the path to the installed cinstall.ini
  1077.     prodbaseDir$ = Lot_GetInstallDir()
  1078.    gInstallIniFile$ = MakePath(prodbaseDir$,gINSTALLINI$)
  1079.  
  1080.    '** the following is to identify if the product currently being installed supports
  1081.    '** the electronic registration. It sets up a global flag to indicate this
  1082.    '** and makes the LAUNCHEXE entry to the installed cinstall.ini
  1083.  
  1084.    cwd$ = GetSymbolValue(SYM_STF_CWDDIR$)
  1085.    TmpInstallIni$ = MakePath(cwd$,gINSTALLINI$)
  1086.    executable$ = GetIniKeyString(TmpInstallIni$, "TOOLKIT","LAUNCHEXE")    
  1087.  
  1088.    IF executable$ <> "" THEN
  1089.       gProdsupport% = 1
  1090.       '** make the exe entry
  1091.       CreateIniKeyValue gInstallIniFile$, "TOOLKIT", "LAUNCHEXE", executable$, cmoOverwrite    
  1092.    ELSE
  1093.       '** The current product that is being installed does not support pipeline
  1094.       gProdsupport% = 0        
  1095.    END IF
  1096.  
  1097.    '** The following is to identify subsequent installs from a distribution install
  1098.    '** to avoid launching the electronic registration. It makes an entry for
  1099.    '** a distribution install
  1100.  
  1101.    network$ = GetSymbolValue(SYM_NETWORK$)
  1102.    automation$ = GetSymbolValue(SYM_AUTOMATIONINST$)
  1103.    distribution$ = GetIniKeyString(gInstallIniFile$, "TOOLKIT", "DISTRIBUTION")
  1104.    IF network$ <> gNODE$ AND distribution$ = "" AND automation$ <> gTRUE$ THEN
  1105.           executable$ = GetIniKeyString(gInstallIniFile$, "TOOLKIT","LAUNCHEXE")    
  1106.         IF executable$ <> "" THEN
  1107.      '*** The check below is because MakePath only works with
  1108.      '** a file name of 12 characters .e.g. foo.exe  and not reg\foo.exe
  1109.             IF RIGHT$(prodbaseDir$, 1) <> "\" THEN _
  1110.                 prodbaseDir$ = prodbaseDir$ + "\"
  1111.             executable$ = prodbaseDir$ + executable$
  1112.  
  1113.             IF DoesFileExist(executable$,femExists) <> 0 AND gProdsupport% = 1 THEN
  1114.                 '' Don't launch pipeline if restart flag on 
  1115.  
  1116.            If (network$ <> gDISTRIBUTION$) Then
  1117.  
  1118.              If (RebootLater% = 1) THEN
  1119.  
  1120.                ExecError% = WinExec(executable$,SW_SHOWNORMAL)
  1121.                IF ExecError% < 32 THEN _
  1122.                  ErrorMsg SID_ERR_EXECPIPELINE, executable$
  1123.              ELSE
  1124.                '' Put pipeline in the start once category on reboot
  1125.  
  1126.                DIM RegKey$
  1127.                DIM LReturn& : LReturn& = ERROR_SUCCESS 
  1128.                DIM CommandLine$ : CommandLine$ = executable$
  1129.                DIM value$ : value$  = "Lotus Pipeline"
  1130.                RegKey$= "Software\Microsoft\Windows\CurrentVersion\RunOnce"
  1131.                IF Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, RegKey$) = FALSE THEN _
  1132.                  LReturn& = Lot_RegCreateKeyEx(HKEY_CURRENT_USER, RegKey$)
  1133.                  IF LReturn& <> ERROR_SUCCESS THEN
  1134.                    RegErrorMsg SID_ERR_REG_CREATE, gHLM$+"\"+RegKey$,"",""
  1135.                  ELSE      
  1136.                    LReturn& = Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, RegKey$,_
  1137.                        value$, REG_SZ, CommandLine$, LENBP(CommandLine$)+1)
  1138.                  END IF
  1139.  
  1140.                  IF LReturn& <> ERROR_SUCCESS THEN _
  1141.                    RegErrorMsg SID_ERR_REG_CREATE, gHLM$+"\"+RegKey$,"",""
  1142.                  END IF
  1143.  
  1144.                END IF
  1145.  
  1146.              END IF
  1147.  
  1148.            END IF
  1149.  
  1150.          END IF
  1151.  
  1152.     '** Record the language of install -- but only for server
  1153.    IF network$ = gSERVER$ THEN _
  1154.          CreateIniKeyValue gInstallIniFile$, "TOOLKIT", "LANGUAGE",_
  1155.              GetSymbolValue(SYM_INSTALL_LANGUAGE$), cmoOverwrite
  1156.      
  1157.    IF network$ = gDISTRIBUTION$ THEN
  1158.      CreateIniKeyValue gInstallIniFile$, "TOOLKIT", "DISTRIBUTION", "YES", cmoVital    
  1159.    END IF
  1160.         
  1161. END FUNCTION
  1162.  
  1163.  
  1164. '********************************
  1165. '********************************
  1166. '** Product Specific Functions **
  1167. '********************************
  1168. '********************************
  1169.  
  1170. '*************************************************************************
  1171. '** FUNCTION GetINSTPathfromLotusIni() AS STRING
  1172. '**
  1173. '** Purpose: Gets the product dir path from Lotus.ini file, and searches for
  1174. '**          inst.exe in the dir. 
  1175. '**            
  1176. '** Author:    JYOTI KEDIA
  1177. '** Arguments: None
  1178. '** Returns:   if inst.exe does not exist in dir specified in lotus.ini, it
  1179. '**            returns "", otherwise returns the full path to the product.
  1180. '*************************************************************************
  1181.  
  1182. FUNCTION GetINSTPathfromLotusIni() AS STRING
  1183. DIM DestDir$, lotusinipath$, defdir$, temp%, ProdDir$, fullpath$, rv%
  1184.  
  1185.    DestDir$ = GetWindowsDir()
  1186.    lotusinipath$ = DestDir$ +"lotus.ini"
  1187.  
  1188.    if DoesFileExist(lotusinipath$,femExists) then
  1189.       defdir$ = GetIniKeyString(lotusinipath$,"Lotus Applications", "inst")
  1190.       if defdir$ <> "" then
  1191.          temp% = INSTR(1,LCASE$(defdir$),"inst.exe")
  1192.          if temp% <> 0 then
  1193.             ProdDir$ = MID$(defdir$,1,(temp%-1))
  1194.             if ProdDir$ <> "" then
  1195.                fullpath$ = ProdDir$ + "inst.exe"
  1196.                if DoesFileExist(fullpath$, femExists) then
  1197.                   rv% = Lot_CleanPath(fullpath$)
  1198.                   GetINSTPathfromLotusIni = fullpath$
  1199.                   EXIT FUNCTION
  1200.                end if 
  1201.             end if 
  1202.          end if 
  1203.       end if 
  1204.    end if
  1205.  
  1206.    GetINSTPathfromLotusIni = ""
  1207.  
  1208. END FUNCTION
  1209.  
  1210. '*************************************************************************
  1211. '** PUBLIC FUNCTION InitLanguageINST (prodno%, network$, direction$)
  1212. '** Purpose: Placeholder, since all products must provide a function of this
  1213. '** name, does nothing.
  1214. '*************************************************************************
  1215. PUBLIC FUNCTION InitLanguageINST (prodno%, network$, direction$) AS STRING
  1216.    InitLanguages "", "", prodno%    
  1217.     InitLanguageINST  = ""
  1218. END FUNCTION
  1219.  
  1220. CONST UserPathRegValue$ = "User Path"
  1221.  
  1222. SUB SetUserHomeDirectory() 
  1223. '*************************************************************************
  1224. '** Purpose: Sets the value of the special destination directory symbol
  1225. '**    SYM_LOTUSUSERDIR$ for user specific files on node
  1226. '** For standard or server, set value to SYM_COMPONENTSDIR$           
  1227. '**            
  1228. '** Author:    JMDonohue
  1229. '*************************************************************************
  1230. DIM Key$, rc&, user$, drive$, s$, Size&, Path$, i%, network$ 
  1231.  
  1232.    network$ = GetSymbolValue(SYM_NETWORK$)
  1233.     Key$ =  gREGLOTUSCOMP
  1234.    SELECT CASE network$
  1235.     CASE gSTANDARD$
  1236.         SetSymbolValue SYM_LOTUSUSERDIR$, GetSymbolValue(SYM_COMPONENTSDIR$)
  1237.     CASE gSERVER$
  1238.         SetSymbolValue SYM_LOTUSUSERDIR$, GetSymbolValue(SYM_COMPONENTSDIR$)
  1239.     CASE gNODE$
  1240.         ' Use the local path for the user if it exists
  1241.         Path$ = ""
  1242.         IF     Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, Key$) THEN
  1243.             s$=CreateBuffer(256)
  1244.             Size& = 256
  1245.             IF Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, Key$, UserPathRegValue$, 0, _
  1246.                     s$, Size&) = ERROR_SUCCESS THEN Path$=NullTrim(s$) 
  1247.         END IF
  1248.         IF Path$ = "" THEN
  1249.             s$ = GetSymbolValue(SYM_BASEDIR$)
  1250.             Path$ = MakePath(s$,gCOMPONENTS$) + "\"
  1251.         END IF
  1252.         SetSymbolValue SYM_LOTUSUSERDIR$, Path$
  1253.     CASE gDISTRIBUTION$
  1254.         SetSymbolValue SYM_LOTUSUSERDIR$, ""
  1255.    END SELECT
  1256.  
  1257. END SUB
  1258.  
  1259. %rem
  1260.  
  1261. ****NOTE:
  1262. ****This is not used in CIT 2.1
  1263. ****Kept around for sentimental reasons
  1264.  
  1265. CONST UserDirRegKey$ = _
  1266. "SOFTWARE\Microsoft\Windows\CurrentVersion\ProfileList"
  1267. CONST UserDirRegValue$ = "ProfileImagePath"
  1268.  
  1269. SUB SetUserHomeDirectory() 
  1270. '*************************************************************************
  1271. '** Purpose: Retrieves the value of the system supplied user home directory
  1272. '**    and sets the value of the special destination directory symbol
  1273. '**    SYM_LOTUSUSERDIR$
  1274. '**            
  1275. '** Author:    JMDonohue
  1276. '*************************************************************************
  1277. DIM Key$, rc&, user$, drive$, s$, Size&, Path$, i%
  1278.  
  1279. IF WhatPlatform() = PLATFORM_WIN95 THEN
  1280.     Key$ =  UserDirRegKey$
  1281.     IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, Key$) THEN
  1282.         user$=CreateBuffer(128)
  1283.         Size&=128
  1284.         i%=GetUserName(user$, Size&)
  1285.         user$=NullTrim(user$)
  1286.         Key$ = UserDirRegKey$ + "\" + user$
  1287.         IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, Key$) = FALSE THEN 
  1288.             ErrorMsg 0, "Registry key "+Key$+" Does not Exist"
  1289.             ERROR STFQUIT
  1290.         END IF
  1291.         s$=CreateBuffer(256)
  1292.         Size& = 256
  1293.         rc& = Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, Key$, UserDirRegValue$, 0, _
  1294.                 s$, Size&) 
  1295.         Path$=NullTrim(s$) + "\Lotus\"
  1296.     ELSE
  1297.         'For a single user, put it in desktop for want of a better place
  1298.         Path = GetWindowsDir() + "Desktop\Lotus\"
  1299.     END IF
  1300.  
  1301. ELSEIF WhatPlatform() = PLATFORM_WINNT THEN
  1302.     drive$ = GetEnvVariableValue ("HOMEDRIVE")
  1303.     s$ = GetEnvVariableValue ("HOMEPATH")
  1304.     Path$ = drive$ + s$ + "\Lotus\"
  1305. ELSE
  1306.     ErrorMsg 0, "Unsupported platform"
  1307.     ERROR STFQUIT
  1308. END IF
  1309.  
  1310. SetSymbolValue SYM_LOTUSUSERDIR$, Path$
  1311.  
  1312. END SUB
  1313.  
  1314. %endrem
  1315.