home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Bonus / lotus123rel9 / install.dsk / AUTOMATE.LSS < prev    next >
Encoding:
Text File  |  1997-10-02  |  44.2 KB  |  1,410 lines

  1. ''/*********************************************************************
  2. ''
  3. ''   Module Name:   automate.lss
  4. ''
  5. ''   Module Code:   TOOLKIT
  6. ''
  7. ''   Author:  Thangaraj Veerappan
  8. ''
  9. ''   Creation Date:  Aug 31, 1994
  10. ''
  11. ''   Copyright Lotus Development Corporation, (c) 1991
  12. ''
  13. ''
  14. ''   Description: 
  15. ''
  16. ''   Additional authors:  
  17. ''                       
  18. ''
  19. ''   Change History:
  20. ''   $Log:   //SS_DEV/INSTLOG/CI/cominst/toolkit/automate.lss  $
  21. '' 
  22. ''    Rev 1.29   02 Oct 1997 11:52:38   jdonohue
  23. '' Ref. SPR:  PMYS3MEMXS
  24. '' Removed commented Japanese characters causing script interpreter to choke
  25. '' 
  26. ''    Rev 1.28   02 Oct 1997 11:17:54   jdonohue
  27. '' Ref. SPR:  PMYS3MEMXS
  28. '' Removed spurious end of file (ASCII 26) character in comment
  29. '' 
  30. ''    Rev 1.27   23 May 1996 12:21:00   jdonohue
  31. '' Replaced LEFTBP calls with LEFT
  32. '' 
  33. ''    Rev 1.26   07 May 1996 12:55:04   glutz
  34. '' In Lot_AutoGetProgramGroupOrFolder changed WhatPlatform calls to 
  35. '' IsNewShell. SPR#CDWT34LJLA
  36. '' 
  37. ''    Rev 1.25   07 May 1996 10:16:24   glutz
  38. '' fixed up logic for node options handling SPR#CDWT353MX9.
  39. '' 
  40. ''    Rev 1.24   04 Mar 1996 08:31:08   jdonohue
  41. '' Remove 16 bit shared component support -- pass 1 : eliminate LOTUSAPP
  42. '' 
  43. ''    Rev 1.23   01 Mar 1996 10:57:18   glutz
  44. '' The Lot_AutoProcessNodeOptions uses the CustomizeNodeOptions ACRONYM keyword
  45. '' for setting node options
  46. '' 
  47. ''    Rev 1.22   28 Feb 1996 15:07:32   glutz
  48. '' Lot_AutoProcessNodeOptions now processes available options individually.
  49. '' 
  50. ''    Rev 1.21   28 Feb 1996 14:50:34   cmoy
  51. '' added header
  52. ''
  53. ''*********************************************************************/
  54.  
  55.  
  56. USE "TOOLKIT"
  57. OPTION DECLARE
  58.  
  59.  
  60.  
  61. '*****
  62. 'AUTOMATION
  63. PUBLIC gAutoFile$
  64. PUBLIC gLogFile$
  65. DECLARE PUBLIC FUNCTION Lot_AutoGetProductDestDirSymbol () AS INTEGER
  66. DECLARE PUBLIC FUNCTION Lot_AutoGetBaseDirSymbol () AS STRING
  67. DECLARE PUBLIC FUNCTION Lot_GetKeyValFromResponseFile (Section$, Key$) AS STRING
  68. DECLARE PUBLIC FUNCTION Lot_AutoGetInstallType () AS STRING
  69. DECLARE PUBLIC FUNCTION Lot_AutoGetProgramGroupOrFolder () AS INTEGER
  70. DECLARE PUBLIC FUNCTION Lot_AutoGetSizeOfInstall () AS INTEGER
  71. DECLARE PUBLIC FUNCTION AutoCheckForSpace () AS INTEGER
  72. DECLARE PUBLIC FUNCTION Lot_AutoGetUserInfo () AS INTEGER
  73. DECLARE PUBLIC FUNCTION Lot_AutoConfigureAutoexec () AS INTEGER
  74. DECLARE PUBLIC SUB AutoInstallReboot () 
  75. DECLARE PUBLIC FUNCTION Lot_AutoWriteOutDebugFile () AS INTEGER
  76. DECLARE PUBLIC FUNCTION Lot_AutoIsThisNetLotusApp (LotusIniPath$, ExistingCommDir$) AS INTEGER
  77. DECLARE PUBLIC FUNCTION Lot_AutoConsolidateMoveCopy () AS INTEGER
  78. DECLARE PUBLIC FUNCTION Lot_AutoConsolidateLotusAppDir (gConsolidateSize&) AS INTEGER
  79. DECLARE PUBLIC FUNCTION Lot_AutoChangeLotusAppDir () AS INTEGER
  80. DECLARE PUBLIC FUNCTION Lot_AutoSuiteAppSelect () AS INTEGER
  81. DECLARE PUBLIC FUNCTION Lot_AutoProcessNodeOptions () AS INTEGER
  82. DECLARE PUBLIC FUNCTION Lot_AutoGetSetLicenserInfo () AS INTEGER
  83. DECLARE PUBLIC FUNCTION Lot_AutoInstallCustomize () AS INTEGER
  84. DECLARE PUBLIC FUNCTION Lot_AutoCustomizeShare () AS INTEGER
  85. DECLARE PUBLIC FUNCTION Lot_AutoInstallSuiteCustomize () AS INTEGER
  86. DECLARE PUBLIC FUNCTION Lot_AutoSetSrvNodeOptions () AS INTEGER
  87. DECLARE PUBLIC FUNCTION Lot_AutoAddiconOptions () AS INTEGER
  88. DECLARE PUBLIC SUB AutoSetParentDir 
  89.  
  90. DECLARE FUNCTION Lot_AutoCheckRSPPath (rsppath$) AS STRING
  91.  
  92.  
  93. '*************************************************************************
  94. '**                             AUTOMATION
  95. '*************************************************************************
  96. '** PUBLIC FUNCTION Lot_GetKeyValFromResponseFile (Section$, Key$) AS STRING
  97. '**
  98. '** Purpose:   reads in values from the response file. 
  99. '** Author:    Thangv
  100. '** Arguments:  section and key 
  101. '** Returns:   the key value
  102. '*************************************************************************
  103. PUBLIC FUNCTION Lot_GetKeyValFromResponseFile (Section$, Key$) AS STRING
  104.    
  105.    DIM Platform%
  106.    '** Automation Intialization: needs to be moved else where.
  107.    IF gAutoFile$ = "" THEN
  108.     gAutoFile$ = GetSymbolValue(SYM_RSPPATH$)
  109.  
  110.     '** For win95 the FFileExists(init.c)function seems to return true if
  111.     '** the file is in the CWD or at the root.
  112.     '** if in the cwd build the path to rsp file for Getinikey to work.
  113.     Platform% = WhatPlatForm()
  114.     IF (PlatForm% = PLATFORM_WIN95 OR PlatForm% = PLATFORM_WINNT) _
  115.         AND INSTR(gAutoFile$,"\") = 0 THEN 
  116.        gAutoFile$ = GetSymbolValue(SYM_STF_SRCDIR$)+ gAutoFile$ 
  117.     END IF
  118.  
  119.        'DEBUGGING INFO -- PLEASE RETAIN
  120.        'gAutoFile$ = GetSymbolValue(SYM_STF_CWDDIR$)+"auto.rsp"
  121.        'gAutoFile$ = GetSymbolValue(SYM_STF_CWDDIR$)+"autosuit.rsp"
  122.  
  123.     IF DoesFileExist (gAutoFile$,femExists) = 0 THEN
  124.            ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_NORSP)
  125.            ERROR STFQUIT
  126.     END IF
  127.    END IF
  128.    
  129.    Lot_GetKeyValFromResponseFile = GetIniKeyString(gAutoFile$,Section$,Key$)
  130.  
  131. END FUNCTION
  132.  
  133. '*************************************************************************
  134. PUBLIC FUNCTION Lot_AutoGetProductDestDirSymbol () AS INTEGER
  135. '** Purpose:    Get the destination directory symbols
  136. '**             from the RSP file -- used in AUTOMATION             
  137. '**             
  138. '** Author:     Jill Salter Plump     
  139. '** Arguments:  
  140. '** Returns:    TRUE if successful    
  141. '**             
  142. '*************************************************************************
  143. DIM notused%, prodno%, lname$, n%, i%, d%, DirSymbol1$, DirListSymbol$
  144. DIM proddirectory$, errText$, rc$
  145. DIM saveproddirectory$
  146.  
  147. Lot_AutoGetProductDestDirSymbol = FALSE
  148.  n% = Reg_GetNumberOfProducts()
  149.  
  150. ' IF GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ THEN
  151.     For prodno% = 1 to n%
  152.         lname$ = Reg_GetProductAcronym(prodno%)
  153.         IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" AND lname$ <> "SUIT" Then
  154.             DirListSymbol$ = Reg_GetDirSymbolList(prodno%)  
  155.             d% = Reg_GetNumOfDirectories(prodno%)
  156.             'd% = GetListLength(DirListSymbol$)
  157.             For i% = 1 to d%
  158.                 DirSymbol1$ = GetListItem(DirListSymbol$, i%)
  159.                 ' Save the original value in case if fails
  160.                 saveproddirectory$ = GetSymbolValue (DirSymbol1$)
  161.                 proddirectory$ = Lot_GetKeyValFromResponseFile (lname$,DirSymbol1$)
  162.                 
  163.                 proddirectory$ = Lot_AutoCheckRSPPath(proddirectory$)
  164.  
  165.                 IF LEN(proddirectory$)  > 0 THEN
  166.                     SetSymbolValue DirSymbol1$, proddirectory$
  167.  
  168.                    rc$ = Lot_CallOneProductFunction(prodno%, "PathChange",gNEXT$, _
  169.                          FALSE, |"| + DirSymbol1$ + |",TRUE|)
  170.                     IF rc$ = gBACK THEN
  171.                         SetSymbolValue DirSymbol1$, saveproddirectory$
  172.                         ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_PRODDIR) + "  " + lname$
  173.                         ERROR STFQUIT
  174.                     END IF
  175.  
  176.                 ELSE
  177.                     ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_PRODDIR) + "  " + lname$
  178.                     ERROR STFQUIT
  179.                 END IF
  180.             Next
  181.         END IF
  182.     Next
  183. ' END IF
  184. Lot_AutoGetProductDestDirSymbol = TRUE
  185. END FUNCTION
  186. '*************************************************************************
  187. FUNCTION Lot_AutoCheckRSPPath (rsppath$) AS STRING
  188. '** Purpose:    To validate paths from RSP file
  189. '**                          
  190. '**             
  191. '** Author:     Jill Salter Plump     
  192. '** Arguments:  The path from the RSP file
  193. '** Returns:    Valid path input -- path with "\" on the end        
  194. '**             Invalid path input (includes bad path, non-existent path
  195. '**                      and empty path) -- empty string
  196. '**
  197. '**             IMPORTANT!!! -- calling functions should check path length
  198. '**                             upon return for LEN > 0 before proceeding.
  199. '**                             If LEN (path$) < 1, caller should singal
  200. '**                             error in RSP file path and quit if default
  201. '**                             path not available.
  202. '*************************************************************************
  203.  
  204. Lot_AutoCheckRSPPATH = ""
  205.  
  206. IF LEN(rsppath$) > 0 THEN
  207.  
  208.     IF RIGHT$(rsppath$, 1) <> "\" THEN
  209.         rsppath$ = rsppath$+ "\"
  210.     END IF
  211.  
  212.     IF ValidatePath(rsppath$) <> FALSE THEN
  213.         Lot_AutoCheckRSPPATH = rsppath$
  214.     END IF
  215.     
  216. END IF
  217.  
  218. END FUNCTION
  219. '*************************************************************************
  220. PUBLIC FUNCTION Lot_AutoGetBaseDirSymbol () AS STRING
  221. '** Purpose:    Get the BASEDIR symbol (for Suite)
  222. '**             from the RSP file -- used in AUTOMATION             
  223. '**             
  224. '** Author:     Jill Salter Plump     
  225. '** Arguments:  
  226. '** Returns:    TRUE if successful    
  227. '**                         
  228. '*************************************************************************
  229. DIM notused%, lname$
  230. DIM proddirectory$
  231.  
  232. Lot_AutoGetBaseDirSymbol = ""
  233.  
  234. lname$ = "SUIT"
  235. proddirectory$ = Lot_GetKeyValFromResponseFile (lname$,SYM_BASEDIR$)
  236.  
  237.  
  238. proddirectory$ = Lot_AutoCheckRSPPath(proddirectory$)
  239.  
  240. IF LEN(proddirectory$)  < 1 THEN
  241.     ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_BASEDIR) + "  " + lname$
  242.     ERROR STFQUIT
  243. END IF
  244.  
  245. Lot_AutoGetBaseDirSymbol = proddirectory$
  246.  
  247. END FUNCTION
  248.  
  249. '*************************************************************************
  250. '** PUBLIC FUNCTION Lot_AutoGetInstallType () AS STRING
  251. '**
  252. '** Purpose:   reads in values from the response file. 
  253. '** Author:    Thangv
  254. '** Arguments:  section and key 
  255. '** Returns:   the key value
  256. '*************************************************************************
  257. PUBLIC FUNCTION Lot_AutoGetInstallType () AS STRING
  258.  
  259.     DIM installtype$
  260.     DIM lname$ 
  261.  
  262.     lname$ = "General Information"
  263.  
  264.     installtype$ = Lot_GetKeyValFromResponseFile(lname$,"InstallType")
  265.  
  266.     SELECT CASE installtype$
  267.       case "1"
  268.      Lot_AutoGetInstallType = gSTANDARD$
  269.       case "2"
  270.      Lot_AutoGetInstallType = gSERVER$
  271.       case "3"
  272.      Lot_AutoGetInstallType = gDISTRIBUTION$
  273.       case "4"
  274.      IF GetSymbolValue (SYM_NETWORK$) <> gNODE$ THEN
  275.         ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_NODE)
  276.         ERROR STFQUIT
  277.      END IF        
  278.       case else
  279.      ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_INSTALLTYPE)+ "  " + lname$
  280.      ERROR STFQUIT
  281.     'Log Error: Invalid entry
  282.      Lot_AutoGetInstallType = ""    
  283.     END SELECT
  284.  
  285. END FUNCTION
  286.  
  287.  
  288. '*************************************************************************
  289. '** PUBLIC FUNCTION Lot_AutoGetProgramGroupOrFolder () AS INTEGER
  290. '**
  291. '** Purpose:   Reads in values from the response file for Program Group
  292. '**            or start menu folder, to be created under programs in Win95.
  293. '**            Checks value for validity, uses the Default Group for the
  294. '**            first registered product or "Lotus Applications" if the
  295. '**            user's value is invalid. 
  296. '** Author:    Jill Salter Plump, Thangaraj Veerappan
  297. '** Arguments: 
  298. '** Returns:   
  299. '** Replaces:   PROGMANGROUPCB
  300. '*************************************************************************
  301. PUBLIC FUNCTION Lot_AutoGetProgramGroupOrFolder () AS INTEGER
  302. DIM proggroup$, DefaultGroup$, CheckName$, failed%, count%, errText$
  303. DIM lname$, newShell%
  304. DIM InvChar LIST AS STRING
  305.    
  306.    InvChar("*") = "1"
  307.    InvChar("+") = "1"
  308.    InvChar("|") = "1"
  309.    InvChar(":") = "1"
  310.    InvChar(|"|) = "1"
  311.    InvChar("<") = "1"
  312.    InvChar(">") = "1"
  313.    InvChar("?") = "1"
  314.    InvChar("=") = "1"
  315.    InvChar("[") = "1"
  316.    InvChar("]") = "1"
  317.    InvChar("\") = "1"
  318.    InvChar(";") = "1"
  319.    InvChar(",") = "1"
  320.    InvChar("/") = "1"
  321.    InvChar(")") = "1"
  322.    InvChar("(") = "1"
  323.    InvChar(".") = "1"  '* MMETH; I believe that this is a valid character
  324.  
  325.    'TV: These are also invalid characters.
  326.    InvChar("'") = "1" 
  327.    InvChar("@") = "1" 
  328.    InvChar("{") = "1" 
  329.    InvChar("}") = "1" 
  330.    InvChar("#") = "1" 
  331.    InvChar("%") = "1" 
  332.    InvChar("!") = "1" 
  333.    InvChar("`") = "1" 
  334.    InvChar("$") = "1" 
  335.    InvChar("^") = "1" 
  336.    InvChar("~") = "1" 
  337.    InvChar("-") = "1" 
  338.    InvChar("_") = "1" 
  339.    InvChar("&") = "1" 
  340.  
  341. DefaultGroup$=Reg_GetProgManagerGroupName(1)
  342. IF DefaultGroup$="" THEN
  343.    DefaultGroup$="Lotus Application"
  344. END IF
  345.  
  346. lname$ = "General Information"
  347. newShell% = IsNewShell()
  348. IF newShell% <> FALSE  THEN
  349.     '** Win95 and NT 4.x
  350.     proggroup$ = Lot_GetKeyValFromResponseFile(lname$,"StartmenuFolder")
  351.  
  352. ELSE
  353.     '** WinNT 3.x and Win3.x                                                                
  354.      proggroup$ = Lot_GetKeyValFromResponseFile(lname$,"ProgramGroup")
  355. END IF
  356.     
  357. IF proggroup$ = "" THEN
  358.     proggroup$=DefaultGroup$
  359. END IF
  360.  
  361. ' Validate the name if it is a new one
  362. ' The ilegal characters in the name are:
  363. ' * + | : " < > ? + { } \ ; ,  /  MMETH removed the period
  364. ' if the path consists only of " then the group name will be )]
  365. ' if the path consists only of ) or ] or , the group is not created
  366. failed% = 1
  367.  
  368. '** TV: Reject only if the group name consists entirely of Invalid 
  369. '**characters
  370. CheckName$ = proggroup$  
  371. FOR count% = 1 TO LEN(proggroup$)
  372.    IF ISELEMENT(InvChar(LEFT$(CheckName$,1))) = FALSE THEN
  373.       failed% = 0
  374.       EXIT FOR
  375.    END IF 
  376.    CheckName$ = RIGHT$(Checkname$,LEN(CheckName$)-1)
  377. NEXT
  378.  
  379. '*** TV: The " character cannot be permitted.
  380. '** This breaks the script execution later!!
  381. IF INSTR(1,proggroup$,|"|) <> 0 THEN
  382.       failed% = 1
  383. END IF 
  384.  
  385. IF failed% <> 0 THEN
  386.     ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_PROGGROUP) + "  " + lname$
  387.     ERROR STFQUIT
  388. END IF
  389.  
  390. IF newShell% <> FALSE THEN
  391.      '** Win95: SelectedFolder has complete path 
  392.      proggroup$ = Reg_GetRootFolder() + "\" + proggroup$
  393.      Reg_SetSelectedFolder  1,proggroup$
  394. ELSE
  395.      Reg_SetProgManagerGroup 1,proggroup$
  396. END IF
  397.  
  398. END FUNCTION
  399.  
  400. '*************************************************************************
  401. '** PUBLIC FUNCTION Lot_AutoGetSizeOfInstall () AS STRING
  402. '**
  403. '** Purpose:   reads in values from the response file. 
  404. '** Author:    Jill Salter Plump
  405. '** Arguments: 
  406. '** Returns:   
  407. '** Replaces:   
  408. '*************************************************************************
  409. PUBLIC FUNCTION Lot_AutoGetSizeOfInstall () AS INTEGER
  410.     DIM size$, lname$, i%, nProds%
  411.  
  412.    Lot_AutoGetSizeOfInstall = FALSE
  413.  
  414.    '**** TV: we don't need this check for now
  415.    '** If GetSymbolValue(SYM_SINGLESMARTSUITE$)= gSINGLE$ Then
  416.         lname$ = Reg_GetProductAcronym(1)
  417.         size$ = Lot_GetKeyValFromResponseFile(lname$,"SizeOfInstall")
  418.    '** Else
  419.     'SMARTSUITE: Full & Min for all products. Custom : Set Size of install
  420.     'for each product
  421.    '** End IF
  422.  
  423.    SELECT CASE size$
  424.       case "1"
  425.      size$ = gCOMPLETE$
  426.       case "2"
  427.      size$ = gLAPTOP$
  428.       case "3"
  429.      size$ = gCUSTOM$
  430.       case else
  431.      ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_SIZEOFINSTALL)+ "  " + lname$
  432.      ERROR STFQUIT
  433.     'Log Error: Invalid entry
  434.    END SELECT
  435.  
  436.    SetSymbolValue SYM_SIZEOFINSTALL$, size$
  437.  
  438.    '** Reset all the sizes
  439.    size$ = GetSymbolValue(SYM_SIZEOFINSTALL$)
  440.    nProds% = Reg_GetNumberOfProducts()
  441.    FOR i% = 1 to nProds%
  442.       Reg_SetSelectedInstallType i%, size$
  443.    NEXT
  444.    
  445.    Lot_AutoGetSizeOfInstall = TRUE
  446.  
  447. END FUNCTION
  448. '*************************************************************************
  449.  
  450. PUBLIC FUNCTION AutoCheckForSpace() AS INTEGER
  451. '** Purpose: Checks to see if there is enough space on dest directories
  452. '**          First does a cheap check, followed, if need be by a high
  453. '**          granularity check.
  454. '** Author: Thangaraj Veerappan
  455. '** Arguments:
  456. '**     
  457. '**     
  458. '** Returns: SUCCESS/FAILURE
  459. '**     
  460. '*************************************************************************
  461.     DIM lTicks&, lcb&, lNew&, i%, lcbNeed&, dr$, s$, helpId&, rc$
  462.     DIM notused1$, curcursor&, j%, UNCSym$
  463.  
  464.    '** Try a quick check
  465.    AutoCheckForSpace = SUCCESS
  466.    lcb&          = LcbGetChapterCost("", "", SYM_COST$, SYM_NEEDED$)
  467.    IF lcb& = CLNG(0) THEN
  468.       DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  469.       GOTO ENDCHECK
  470.    END IF
  471.    '** Try A High Granularity Check
  472.    curcursor& = ShowWaitCursor()
  473.    SetListItem "IDC_BMP", 1, STR$(IDD_MAXSCAN_BMP) '** put up the bitmap
  474.    notused1$ = PopupModelessDlg(DB_CHECKSPACE, DB_CHECKSPACE)
  475.    lcb& = GetCopyListCost (gEXTRA, SYM_COST$, SYM_NEEDED$)
  476.    UIPOP 1     '** Bring down DB_CHECKSPACE
  477.    RestoreCursor curcursor&
  478.    IF lcb& = CLNG(0) THEN
  479.       DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  480.       GOTO ENDCHECK
  481.    END IF
  482.  
  483.    '** If you get here then there was not enough space (Tab is CHR$(9))
  484.    FOR i% = 1 TO 26
  485.       lcbNeed& = CLNG(GetListItem(SYM_NEEDED$, i%))
  486.       IF  lcbNeed& > 0 THEN
  487.      dr$ = CHR$(ASC("A")+i%-1) + ": " 
  488.      s$  = dr$ & (lcbNeed& + 4)
  489.       END IF
  490.    NEXT
  491.  
  492.    '** unc stuff 
  493.    j%=GetListLength("UNCVOLLIST")
  494.    FOR i% = 1 to j%
  495.       UNCSym$ = GetListItem("UNCVOLLIST",i%)
  496.       lcbNeed& = CLNG(GetListItem(UNCSym$, 3))
  497.       IF lcbNeed&  > 0 THEN
  498.          IF IsDBCSFirstAtOffset(UNCSym$, 18) = 0 THEN
  499.             s$ = Left(UNCSym$, 18)
  500.          ELSE
  501.             s$ = Left(UNCSym$, 17)
  502.          END IF
  503.          s$ = s$ & CHR$(9) & (lcbNeed& + 4)
  504.      AddlistItem "IDC_LIST1", s$ + gStrK$
  505.       END IF
  506.    NEXT
  507.  
  508.     ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_DRV_INSUFSPACE)+ s$ + LdString(SID_KBYTE_CHAR)
  509.     ERROR STFQUIT                           
  510.    'Log space needed and drive information: s$
  511.    AutoCheckForSpace = FAILURE
  512.  
  513. ENDCHECK:
  514.  
  515.    RemoveSymbol(SYM_COST$)
  516.    RemoveSymbol(SYM_NEEDED$)
  517.  
  518. END FUNCTION
  519.  
  520. '*************************************************************************
  521. '** PUBLIC FUNCTION Lot_AutoGetUserInfo () AS INTEGER
  522. '**
  523. '** Purpose:   Reads in values from the response file for User Name and
  524. '**            Company Name
  525. '**            
  526. '**            
  527. '** Author:    Jill Salter Plump
  528. '** Arguments: 
  529. '** Returns:   
  530. '** Replaces:   WELCOMECB
  531. '*************************************************************************
  532. PUBLIC FUNCTION Lot_AutoGetUserInfo () AS INTEGER
  533. DIM uname$, company$, defname$, defcompany$
  534. DIM lname$
  535.  
  536. Lot_AutoGetUserInfo = FALSE
  537.  
  538. 'Get Defaults
  539. defname$   = GetSymbolValue(SYM_NAME$)
  540. defcompany$ = GetSymbolValue(SYM_COMPANY$)
  541.  
  542. 'Get User Name from Command Line
  543. uname$ = GetSymbolValue(SYM_USERNAME$)
  544.  
  545. lname$ = "User Registration"
  546.  
  547. IF LEN (uname$) < 1 THEN
  548.     uname$ = Lot_GetKeyValFromResponseFile(lname$,"UserName")
  549.     IF LEN (uname$) < 1 THEN
  550.         IF LEN (defname$) < 1 THEN
  551.               uname$ = GetSymbolValue(SYM_NAME$)
  552.               IF LEN (uname$) < 1 THEN
  553.             uname$ = "Unknown User"
  554.             'ADD ERROR
  555.             'print "Warning:  Unknown User"                                             
  556.               END IF      
  557.         ELSE
  558.              uname$ = defname$
  559.         END IF                
  560.     END IF        
  561. END IF
  562.     SetSymbolValue SYM_NAME$, uname$
  563.  
  564. company$ = Lot_GetKeyValFromResponseFile(lname$,"CompanyName")
  565. IF LEN (company$) < 1 THEN
  566.     IF LEN (defcompany$) < 1 THEN
  567.           company$ = GetSymbolValue(SYM_COMPANY$)
  568.           IF LEN (company$) < 1  THEN
  569.         company$ = "Unknown Company"
  570.         'ADD ERROR
  571.           END IF      
  572.     ELSE
  573.          company$ = defcompany$
  574.     END IF                
  575. END IF        
  576.  
  577.     SetSymbolValue SYM_COMPANY$, company$
  578.  
  579.     Lot_AutoGetUserInfo = TRUE
  580.  
  581. END FUNCTION
  582.  
  583. '*************************************************************************
  584. '** PUBLIC FUNCTION Lot_AutoConfigureAutoexec () AS INTEGER
  585. '**
  586. '** Purpose:  Determines if the autoexec needs to be configured and the
  587. '**           system rebooted. 
  588. '** Author:    Thangv
  589. '** Arguments:   
  590. '** Returns:   TRUE or FALSE
  591. '*************************************************************************
  592. PUBLIC FUNCTION Lot_AutoConfigureAutoexec () AS INTEGER
  593. DIM modflag%, notused1$, reboot$, lname$
  594.  
  595.  Lot_AutoConfigureAutoexec = FALSE
  596.     lname$ = "General Information"
  597.     reboot$ = Lot_GetKeyValFromResponseFile(lname$, "Autoexec")
  598.  
  599.    SELECT CASE reboot$
  600.  
  601.       CASE "1"            ''** Yes button:IDC_OK
  602.      modflag% = 0
  603.      IF GetSymbolValue(SYM_NEEDNOTES$) <> gFALSE$ THEN
  604.         modflag% = 1            '** autoexec needs notes
  605.      END IF
  606.      IF GetSymbolValue(SYM_NEEDSHARE$) <> gFALSE$ THEN
  607.         modflag% = modflag% + 2 '** autoexec needs share
  608.      END IF
  609.      IF modflag% <> FALSE THEN
  610.         notused1$=ModifyAutoexec(modflag%, 1, "AUTOEXEC.LTS")
  611.      END IF
  612.      SetSymbolValue SYM_AUTOEXEC_CHOICE$, gAUTO$
  613.  
  614.       CASE "2"                      '** Make Copy button **
  615.      modflag% = 0               '** test flag situation
  616.      IF GetSymbolValue(SYM_NEEDNOTES$) <> gFALSE$ THEN
  617.         modflag% = 1            '** autoexec needs notes
  618.      END IF
  619.      IF GetSymbolValue(SYM_NEEDSHARE$) <> gFALSE$ THEN
  620.         modflag% = modflag% + 2 '** autoexec needs share
  621.      END IF
  622.      IF modflag% <> FALSE THEN
  623.         notused1$=ModifyAutoexec(modflag%, 0, "AUTOEXEC.LTS")
  624.      END IF
  625.      SetSymbolValue SYM_AUTOEXEC_CHOICE$, gAUTOCOPY$
  626.  
  627.       CASE "3"                  '** No button
  628.      SetSymbolValue SYM_AUTOEXEC_CHOICE$, gMAN$
  629.  
  630.       CASE ELSE
  631.      ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_REBOOT) + "  " + lname$
  632.      ERROR STFQUIT
  633.     'Log Error: Invalid entry
  634.    END SELECT
  635.  
  636.     SELECT CASE GetSymbolValue(SYM_AUTOEXEC_CHOICE$)
  637.  
  638.     CASE "AUTO"
  639.              'Log appropriate message
  640.     CASE "AUTOCOPY"   
  641.              'Log appropriate message
  642.  
  643.     CASE "MAN"
  644.              'Log appropriate message
  645.  
  646.     END SELECT
  647.  
  648.  Lot_AutoConfigureAutoexec = TRUE
  649.  
  650.  
  651.      
  652.  
  653. END FUNCTION
  654.  
  655. '*************************************************************************
  656. '** PUBLIC SUB AutoInstallReboot () 
  657. '**
  658. '** Purpose:  reboots the system. 
  659. '** Author:    Thangv
  660. '** Arguments:   
  661. '** Returns:   TRUE or FALSE
  662. '*************************************************************************
  663. PUBLIC SUB AutoInstallReboot () 
  664.    DIM notused1$, hwnd&, lr&
  665.       'notused1$ = Lot_CallProductFunctions("PostSuccessReg", gNext, FALSE, gALLPRODUCTS,"")
  666.       hwnd&=FindWindow("LInstallWClass",LdString(SID_INST_WINDOW_TITLE))
  667.       lr&=SendMessage(hwnd&, WM_COMMAND, UM_REBOOTFLAG, 0)
  668.  
  669. END SUB
  670.  
  671. '*************************************************************************
  672. '** PUBLIC FUNCTION Lot_AutoWriteOutDebugFile () AS INTEGER
  673. '**
  674. '** Purpose:   
  675. '**            
  676. '**            
  677. '**            
  678. '** Author:    Jill Salter Plump
  679. '** Arguments: 
  680. '** Returns:   
  681. '*************************************************************************
  682. PUBLIC FUNCTION Lot_AutoWriteOutDebugFile () AS INTEGER
  683. DIM notused%, mybuffer$, symbolbuff$, uname$
  684. DIM FileExist&, TBD$, spacer$
  685. DIM rc%, lrc&, SectionName$, SectionPref$, SectionNumber%, SectionTag$
  686. DIM KeywordName$, KeywordPref$, KeywordNumber%, KeywordTag$, KeywordValue$
  687. DIM DebugLog$, DebugIni$, AutoRsp$
  688. DIM sname$, scompany$, stype$, sproggroup$, slotusappdir$, ssize$
  689. DIM i%, n%, licensedprod%
  690.  
  691. Lot_AutoWriteOutDebugFile = 0
  692.  
  693. IF GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ THEN
  694.  
  695.   IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
  696.     DebugLog$ = GetWindowsDir() + "autosuit.out"
  697.     DebugIni$ = GetWindowsDir() + "autosuit.ini"
  698.   ELSE
  699.     DebugLog$ = GetWindowsDir() + "auto.out"
  700.     DebugIni$ = GetWindowsDir() + "auto.ini"
  701.   END IF        
  702.  
  703. FileExist&=DoesFileExist(DebugIni$, femExists)
  704.  
  705. IF FileExist& <> 1 THEN
  706.     GOTO NODEBUGLOG
  707. END IF
  708.  
  709. TBD$ = "NOT YET IMPLEMENTED!!!"
  710. spacer$ = ""
  711.  
  712. FileExist&=DoesFileExist(DebugLog$, femExists)
  713.  
  714. IF FileExist&=1 THEN
  715.      RemoveFile DebugLog$, cmoNone
  716. END IF 
  717.  
  718.  
  719.  
  720. 'Initialize the loop
  721. SectionPref$="section"
  722. SectionNumber%=1
  723. SectionTag$=SectionPref$+LTRIM$(STR(SectionNumber%))
  724. SectionName$ = GetIniKeyString(DebugIni$,"Sections", SectionTag$)
  725.  
  726. 'Using auto.ini as a data driver I find all the section entries and
  727. 'log them to the debugging file
  728.  
  729. DO
  730.  
  731. mybuffer$ = spacer$
  732. 'WriteToFile DebugLog$, mybuffer$
  733.  
  734. lrc& = DoesIniSectionExist (gAutoFile$, SectionName$) 
  735.  
  736. mybuffer$ = "[" + SectionName$ + "]"
  737.  
  738. IF lrc& = 1 THEN
  739. '        WriteToFile DebugLog$, mybuffer$
  740.     KeywordPref$="option"
  741.     KeywordNumber%=1
  742.     KeywordTag$=KeywordPref$+LTRIM$(STR(KeywordNumber%))
  743.     'DoMsgBox("KeywordTag$",KeywordTag$ ,MB_OK)
  744.     'DoMsgBox("gSharedIniFile$ where used",gSharedIniFile$ ,MB_OK)
  745.     KeywordName$ = GetIniKeyString(DebugIni$,SectionName$, KeywordTag$)
  746.  
  747.     DO
  748.     SELECT CASE KeywordName$
  749.  
  750.       case "UserName"
  751.         KeywordValue$ = GetSymbolValue(SYM_NAME$)
  752.         sname$ = "UserName: " + KeywordValue$
  753.  
  754.         uname$ = GetSymbolValue(SYM_USERNAME$)
  755.  
  756.         IF LEN (uname$) >= 1 THEN
  757.             IF KeywordValue$ <> uname$ THEN
  758.             KeywordValue$ = "Mismatch:" + uname$ + "from command" + KeywordValue$ + "used"
  759.             ELSE
  760.             KeywordValue$ = KeyWordValue$ + "     <----   From Command Line"
  761.             END IF
  762.         END IF
  763.  
  764.       case "CompanyName"
  765.         KeywordValue$ = GetSymbolValue(SYM_COMPANY$)
  766.         scompany$ = "CompanyName:" + KeywordValue$ 
  767.  
  768.       case "InstallType"
  769.         KeywordValue$ = GetSymbolValue(SYM_NETWORK$)
  770.         SELECT CASE KeywordValue$                
  771.               case gSTANDARD$
  772.              KeywordValue$ = "1 (Standard)" 
  773.               case gSERVER$
  774.              KeywordValue$ = "2 (Server)"
  775.               case gDISTRIBUTION$
  776.              KeywordValue$ = "3 (Distribution)"
  777.         END SELECT
  778.         stype$ = "InstallType:" + KeywordValue$
  779.  
  780.       case "Autoexec"
  781.         KeywordValue$ = GetSymbolValue(SYM_AUTOEXEC_CHOICE$)
  782.         SELECT CASE KeywordValue$
  783.             case gAUTO$
  784.                KeywordValue$ = "1 (Auto)"         
  785.             case gAUTOCOPY$                
  786.                KeywordValue$ = "2 (AutoCopy)"
  787.             case gMAN$
  788.                KeywordValue$ = "0 (Manual)"
  789.         END SELECT
  790.  
  791.       case "ProgramGroup"
  792.         KeywordValue$ = Reg_GetProgManagerGroupName(1)
  793.         sproggroup$ = "ProgramGroup:" + KeywordValue$
  794.  
  795.       case "Licenser"
  796.         KeywordValue$ = "NOT IMPLEMENTED YET!!!" 
  797.     
  798.       case "LICDIR"
  799.         KeywordValue$ = GetSymbolValue(SYM_LICDIR$)
  800.  
  801.       case "LICCOUNTDIR"
  802.         n% = Reg_GetNumberOfProducts()
  803.         FOR i% = 1 to n%
  804.           IF Reg_GetProdSupportForLicense (i%) <> FALSE THEN
  805.             licensedprod% = i%
  806.             KeywordValue$ = Reg_GetCountDirectory(licensedprod%)
  807.             EXIT FOR
  808.           ELSE
  809.             KeywordValue$ = "Licenser not supported"    
  810.           END IF
  811.         NEXT
  812.  
  813.       case "NodeOptions"
  814.         KeywordValue$ = TBD$
  815.  
  816.       case "Consolidation"
  817.         KeywordValue$ = TBD$
  818.  
  819.       case "SQLServerName"
  820.         KeywordValue$ = TBD$
  821.  
  822.       case "PARADOXNetInfo"
  823.         KeywordValue$ = TBD$
  824.  
  825.       case "BASEDIR"
  826.         KeywordValue$ =GetSymbolValue(SYM_BASEDIR$) 
  827.  
  828.       case "SizeofInstall"
  829.         KeywordValue$ = GetSymbolValue(SYM_SIZEOFINSTALL$)
  830.  
  831.         SELECT CASE KeywordValue$
  832.             case gCOMPLETE$
  833.                KeywordValue$ = "1 (Complete)"         
  834.             case gLAPTOP$                
  835.                KeywordValue$ = "2 (Laptop)"
  836.             case gCUSTOM$
  837.                KeywordValue$ = "3 (Custom)"
  838.         END SELECT
  839.         ssize$ = "SizeofInstall" + KeywordValue$        
  840.     
  841.       case "123"
  842.         KeywordValue$ = TBD$
  843.  
  844.       case "AMI"
  845.         KeywordValue$ = TBD$
  846.  
  847.       case "ORG"
  848.         KeywordValue$ = TBD$
  849.  
  850.       case "APR"
  851.         KeywordValue$ = TBD$
  852.  
  853.       case "123DIR"
  854.         KeywordValue$ = GetSymbolValue(KeywordName$)
  855.  
  856.       case "123WORKDIR"
  857.  
  858.         IF GetSymbolValue(SYM_NETWORK$) = gSTANDARD$  OR _
  859.            GetSymbolValue(SYM_NETWORK$) = gNODE$ THEN
  860.             KeywordValue$ = GetSymbolValue(KeywordName$) 
  861.         ELSE
  862.         KeywordValue$ = "Only supported in Standalone or Node"
  863.         END IF
  864.  
  865.       case "Customize123"
  866.         KeywordValue$ = TBD$
  867.  
  868.       case "AMIDIR"
  869.         KeywordValue$ = GetListItem("AMIDIRS", 1) 
  870.  
  871.       case "ORGDIR"
  872.         KeywordValue$ = GetListItem("ORGDIRS", 1) 
  873.        
  874.  
  875.     END SELECT 
  876.  
  877.     mybuffer$ = KeywordName$ + "="+ KeywordValue$
  878. '        notused% = WriteToFile(DebugLog$, mybuffer$)
  879.  
  880.     KeywordNumber% = KeywordNumber% + 1
  881.     KeywordTag$=KeywordPref$+LTRIM$(STR(KeywordNumber%))
  882.     KeywordName$ = GetIniKeyString(DebugIni$,SectionName$, KeywordTag$)
  883.     LOOP UNTIL KeywordName$ = ""
  884.  
  885. ELSE
  886.     mybuffer$ = mybuffer$ + " missing from RSP"        
  887. '        notused% = WriteToFile(DebugLog$, mybuffer$)
  888. END IF
  889.  
  890.  
  891. SectionNumber% = SectionNumber% + 1
  892. SectionTag$=SectionPref$+LTRIM$(STR(SectionNumber%))
  893. 'DoMsgBox("SectionTag$",SectionTag$ ,MB_OK)
  894. 'DoMsgBox("gSharedIniFile$ where used",gSharedIniFile$ ,MB_OK)
  895. SectionName$ = GetIniKeyString(DebugIni$,"Sections", SectionTag$)
  896. 'DoMsgBox("SectionName$",SectionName$ ,MB_OK)
  897. LOOP UNTIL SectionName$ = ""
  898.  
  899. Lot_AutoWriteOutDebugFile = 1
  900.  
  901. 'print sname$,,scompany$,, stype$,, sproggroup$,, slotusappdir$,, ssize$
  902.  
  903. NODEBUGLOG:
  904.  
  905. ELSE
  906.  
  907. END IF
  908.  
  909.  
  910. END FUNCTION
  911.  
  912. '*************************************************************************
  913. '** PUBLIC FUNCTION Lot_AutoConsolidateMoveCopy () AS INTEGER
  914. '**
  915. '** Purpose:   Assums that at the prompt DBM_CONSOLIDATE_MOVECOPY the user
  916. '**            selected copy
  917. '**            
  918. '** Author:    MZ
  919. '** Arguments: NONE
  920. '** Returns:   TRUE
  921. '** Replaces:  CONSOLIDATEMOVECOPY
  922. '*************************************************************************
  923. PUBLIC FUNCTION Lot_AutoConsolidateMoveCopy () AS INTEGER
  924.    ' Is a copy
  925.    'print "copy"     
  926.    SetSymbolValue "SYM_MOVE", "0"
  927.    SetSymbolValue "SYM_COPY", "1"
  928.    Lot_AutoConsolidateMoveCopy = TRUE
  929. END FUNCTION
  930.  
  931. '*************************************************************************
  932. '** PUBLIC FUNCTION Lot_AutoSuiteAppSelect () AS INTEGER
  933. '**
  934. '** Purpose:   reads in values from the response file for suite app.selection. 
  935. '** Author:    Thangaraj Veerappan
  936. '** Arguments: 
  937. '** Returns:   TRUE or FALSE
  938. '** Replaces:   
  939. '*************************************************************************
  940. PUBLIC FUNCTION Lot_AutoSuiteAppSelect () AS INTEGER
  941.     DIM Selection%, lname$, prodno%, nProds%
  942.     DIM sname$, rspval$    
  943.  
  944.    Lot_AutoSuiteAppSelect = FALSE
  945.  
  946.    
  947.    If GetSymbolValue(SYM_SINGLESMARTSUITE$)= gSMARTSUITE$ Then
  948.  
  949.    sname$ = "Select Applications"     
  950.    nProds% = Reg_GetNumberOfProducts()
  951.      For prodno% = 2 to nProds%
  952.         lname$ = Reg_GetProductAcronym(prodno%)
  953.         IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" Then
  954.             rspval$ = Lot_GetKeyValFromResponseFile(sname$, lname$)
  955.             IF rspval$ <> "" THEN
  956.                 Selection% = CINT(rspval$)
  957.             ELSE
  958.                 Selection% = -1
  959.             END IF  
  960.             IF Selection% <> 0 AND Selection% <> 1 THEN
  961.             '** Error in response file
  962.                 ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_SELECTAPPS)
  963.                 ERROR STFQUIT
  964.             ELSE
  965.                 Reg_SetUIInOrOut prodno%, Selection%
  966.             END IF
  967.                 
  968.             ' Find out if product actually exists on the server
  969.             ' Set if off if not
  970.             IF GetSymbolValue(SYM_NETWORK$) = gNODE$ THEN 
  971.                 lname$ = Reg_GetProductAcronym(prodno%)
  972.                 IF Lot_IsTheFeatureInstalled(lname$ + "TOP") = 0 THEN
  973.                     Reg_SetUIInOrOut prodno%, 0
  974.                 END IF
  975.             END IF        
  976.         END IF        
  977.     Next
  978.  
  979.    End IF
  980.  
  981.    Lot_AutoSuiteAppSelect = TRUE
  982.  
  983. END FUNCTION
  984.  
  985. '*************************************************************************
  986. '** PUBLIC FUNCTION Lot_AutoProcessNodeOptions () AS INTEGER
  987. '**
  988. '** Purpose:   reads in values from the response file for node options and does
  989. '**            the processing. 
  990. '** Author:    Thangaraj Veerappan
  991. '** Arguments: 
  992. '** Returns:   TRUE or FALSE
  993. '** Replaces:   
  994. '*************************************************************************
  995. PUBLIC FUNCTION Lot_AutoProcessNodeOptions () AS INTEGER
  996.  
  997. DIM AllProdNum%,prodNum%,AllOptNum%,OptName$,OptNum%,notused%
  998. DIM nodeoption%, Chapter$, lname$, rspval$
  999.  
  1000.    Lot_AutoProcessNodeOptions = TRUE
  1001.    'Loop through the products and turn the options on
  1002.    AllProdNum% = 0
  1003.    AllProdNum% = Reg_GetNumberOfProducts()
  1004.    IF AllProdNum% <> 0 THEN
  1005.      FOR prodNum%=1 TO AllProdNum%
  1006.        AllOptNum% = 0
  1007.        AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  1008.        IF AllOptNum% <> 0 THEN
  1009.          lname$ = "CustomizeNodeOptions" + Reg_GetProductAcronym(prodNum%)
  1010.          'Loop though registered options and toggle them according
  1011.          'to response file.  If they are not avail turn them off
  1012.          FOR OptNum%=1 TO AllOptNum% 
  1013.            OptName$ = Reg_GetNodeOptionStr(prodNum%,OptNum%)
  1014.            nodeoption% = 0
  1015.            Chapter$ = Lot_GetChapterFromKeyword(OptName$)
  1016.            IF Lot_IsTheNodeOptionsAvailToNode(prodNum%,OptName$) = 1 THEN
  1017.              rspval$ = Lot_GetKeyValFromResponseFile(lname$, OptName$)
  1018.              IF rspval$ = "1" THEN
  1019.                nodeoption% = 1
  1020.              END IF                
  1021.            END IF
  1022.            notused% = Lot_SetChapterFilesInCopyListInOrOut(Chapter$, _
  1023.                         nodeoption%)
  1024.          NEXT
  1025.        END IF
  1026.      NEXT
  1027.    END IF
  1028. END FUNCTION
  1029.  
  1030. '*************************************************************************
  1031. PUBLIC FUNCTION Lot_AutoGetSetLicenserInfo () AS INTEGER
  1032. '** Purpose:    Get the destination directory symbols
  1033. '**             from the RSP file -- used in AUTOMATION             
  1034. '**             
  1035. '** Author:     Jill Salter Plump     
  1036. '** Arguments:  
  1037. '** Returns:    TRUE if successful    
  1038. '**             
  1039. '*************************************************************************
  1040. STATIC licselected%, licensedprod% 
  1041. DIM i%, n%, dirtochange$, lname$
  1042. DIM chpt$, notused%, countdir$
  1043. DIM firstslash%, lastslash%, fullpath$
  1044. DIM countbasedir$, counttaildir$, rspval$
  1045.  
  1046.    Lot_AutoGetSetLicenserInfo = FALSE
  1047.  
  1048.    lname$ = "Server Install"
  1049.  
  1050.    licensedprod% = 0
  1051.    licselected% = 0
  1052.    n% = Reg_GetNumberOfProducts()
  1053.  
  1054.    '** FIND THE FIRST LICENSED PRODUCT. ONLY WORKS FOR SINGLE PRODUCT!
  1055.    FOR i% = 1 to n%
  1056.       IF Reg_GetProdSupportForLicense (i%) <> FALSE THEN
  1057.      licensedprod% = i%
  1058.      EXIT FOR
  1059.       END IF
  1060.    NEXT
  1061.  
  1062.    IF licensedprod% <> 0 THEN
  1063.  
  1064.       rspval$ = Lot_GetKeyValFromResponseFile (lname$, "Licenser")
  1065.  
  1066.       IF rspval$ <> "" THEN
  1067.      licselected% = CINT(rspval$)
  1068.       ELSE
  1069.      ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICENSER) + "  " + lname$
  1070.      ERROR STFQUIT        
  1071.       END IF                
  1072.  
  1073.    END IF
  1074.  
  1075.    IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
  1076.     '** For suite propagate the lic. selection to all products
  1077.     '** that are selected and support lic.
  1078.     FOR i% = 1 to n%
  1079.      IF Reg_GetProdSupportForLicense (i%) <> FALSE AND _
  1080.         Reg_GetUIInOrOut(i%) <> FALSE  THEN
  1081.           Reg_SetLicenseSelected i%, licselected%
  1082.      END IF
  1083.     NEXT
  1084.       ELSE      
  1085.      Reg_SetLicenseSelected licensedprod%, licselected%
  1086.       END IF
  1087.  
  1088. IF licselected% = 1 THEN
  1089.       '** CONFIGURE COPYLIST TO ACCOUNT FOR LICENSER FILES
  1090.       IF Reg_IsLicenseSelected(licensedprod%) <> FALSE Then
  1091.      chpt$ = Lot_GetChapterFromKeyword("LIC" + gTOP$)
  1092.      notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 1)    
  1093.       ELSE
  1094.      chpt$ = Lot_GetChapterFromKeyword("LIC" + gTOP$)
  1095.      notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 0)
  1096.       END IF
  1097.  
  1098.       IF Reg_IsLicenseSelected(licensedprod%) <> FALSE Then
  1099.      '** ACCOUNT FOR LOTUS LICENSER DIRECTORY CHANGE
  1100.      dirtochange$ = Lot_GetKeyValFromResponseFile ("Server Install", "LICDIR")  
  1101.      IF Lot_AutoCheckRSPPath(dirtochange$) <> "" THEN
  1102.          SetSymbolValue SYM_LICDIR$, dirtochange$
  1103.          Lot_RefreshDestination(SYM_LICDIR$)
  1104.       ELSE
  1105.          ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICDIR) + "  " + lname$
  1106.          ERROR STFQUIT
  1107.       END IF
  1108.  
  1109.        '** ACCOUNT FOR LOTUS COUNT DIRECTORY CHANGE
  1110.        dirtochange$ = Lot_GetKeyValFromResponseFile (lname$, "LICCOUNTDIR")   
  1111.        IF Lot_AutoCheckRSPPath(dirtochange$) = "" THEN
  1112.          ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICDIR) + "  " + lname$
  1113.          ERROR STFQUIT
  1114.        END IF
  1115.         licensedprod% = 0
  1116.         FOR i% = 1 to Reg_GetNumberofProducts()
  1117.             IF Reg_GetProdSupportForLicense(i%) <> FALSE THEN
  1118.                 licensedprod% = i%
  1119.                 countdir$ = Lot_TrimEndSlash(Reg_GetCountDirectory(licensedprod%))
  1120.                 firstslash% = INSTR(countdir$, "\") : lastslash% = firstslash%
  1121.                 WHILE firstslash% <> 0
  1122.                     lastslash% = firstslash% : firstslash% = INSTR(firstslash%+1, countdir$, "\")
  1123.                 WEND
  1124.                 countdir$ = countdir$ + "\"
  1125.                 counttaildir$ = RIGHT$(countdir$, LEN(countdir$) - lastslash%)
  1126.                 fullpath$ = MakePath(dirtochange$, counttaildir$)
  1127.                 IF ValidatePath(fullpath$) <> FALSE THEN
  1128.                     Reg_SetCountDirectory licensedprod%, fullpath$
  1129.                 ELSE
  1130.                     ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICCOUNTDIR) + "  " + lname$
  1131.                     ERROR STFQUIT
  1132.                 END IF
  1133.             END IF
  1134.         NEXT
  1135.       END IF
  1136.  
  1137. END IF                  'licselected = TRUE
  1138.  
  1139.  
  1140.  
  1141. Lot_AutoGetSetLicenserInfo = TRUE
  1142.  
  1143. END FUNCTION
  1144.  
  1145.  
  1146. '*************************************************************************
  1147. '** PUBLIC FUNCTION Lot_AutoInstallCustomize () AS INTEGER
  1148. '**
  1149. '** Purpose:   reads in values from the response file. 
  1150. '** Author:    Thangv
  1151. '** Arguments:   
  1152. '** Returns:   TRUE if successful
  1153. '*************************************************************************
  1154. PUBLIC FUNCTION Lot_AutoInstallCustomize () AS INTEGER
  1155. DIM tabchpt$, prodfeaturechpt$, RspInOrOut%, Rspval$
  1156. DIM lname$, rc%, prodno%, n%, chpt$, tab_name$, prodfeature$ 
  1157.  
  1158.     Lot_AutoInstallCustomize = FALSE
  1159.  
  1160.     n% = Reg_GetNumberOfProducts()
  1161.     For prodno% = 1 to n%
  1162.       lname$ = Reg_GetProductAcronym(prodno%)
  1163.       IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" AND _
  1164.      lname$ <> "SUIT"  Then
  1165.     IF Reg_GetUIInOrOut (prodno%) = 1 AND _
  1166.        Reg_GetProdSelectedInstallType (prodno%) = gCUSTOM$ THEN
  1167.         chpt$ = Lot_GetChapterFromKeyword(lname$ + gTOP$)
  1168.         '** DND: If no first chapter then we need to do somthing
  1169.         prodfeaturechpt$  = Lot_GetFirst(chpt$, F_DISPLAY + F_CUSTOM)
  1170.         WHILE (prodfeaturechpt$ <> "")
  1171.            prodfeature$ = Lot_GetChapterValStr (prodfeaturechpt$, F_KEYWORD)
  1172.            Rspval$ = Lot_GetKeyValFromResponseFile("Customize"+lname$,prodfeature$)
  1173.            '** script bug work around: generates Type mismatch and crashes
  1174.            IF Rspval$ <> "" THEN
  1175.          RspInOrOut% = CINT(Rspval$)
  1176.  
  1177.          IF RspInOrOut% <> 0 AND RspInOrOut% <> 1 THEN
  1178.            ErrorMsg SID_ERR_AUTO_INSTALL, "Feature selection entry in response file invalid: " + prodfeature$
  1179.            ERROR STFQUIT
  1180.          END IF
  1181.          rc% = Lot_SetChapterFilesInCopyListInOrOut(prodfeaturechpt$,RspInOrOut%)
  1182.            END IF
  1183.            '*** Goto next sibbling feature chpt$
  1184.            prodfeaturechpt$ = Lot_GetNext()  
  1185.         WEND
  1186.  
  1187.     END IF
  1188.       END IF
  1189.     Next
  1190.  
  1191. Lot_AutoInstallCustomize = TRUE
  1192.  
  1193. END FUNCTION
  1194.  
  1195. '*************************************************************************
  1196. '** PUBLIC FUNCTION Lot_AutoCustomizeShare () AS INTEGER
  1197. '**
  1198. '** Purpose:   reads in values from the response file. 
  1199. '** Author:    Thangv
  1200. '** Arguments:   
  1201. '** Returns:   TRUE if successful
  1202. '*************************************************************************
  1203. PUBLIC FUNCTION Lot_AutoCustomizeShare () AS INTEGER
  1204. DIM sharechpt$, RspInOrOut%, Rspval$, prodchpt$
  1205. DIM lname$, rc%, n%, chpt$, sharefeature$,prodkeyword$
  1206.  
  1207.     Lot_AutoCustomizeShare = FALSE
  1208.  
  1209.     lname$ = Reg_GetProductAcronym(1)
  1210.     sharechpt$ = Lot_GetFirst("", F_DISPLAY + F_CUSTOM + F_SHARE)
  1211.               
  1212.     '** DND: If no first chapter then we need to do somthing
  1213.         
  1214.     WHILE (sharechpt$ <> "")
  1215.  
  1216.       '** for the shared chpt check if the product it belongs to
  1217.       '** is in the copylist. 
  1218.       '** Only the shared chpt$ of a product being installed
  1219.       '** is processed. This works as long as the same shared keywords are
  1220.       '** listed in all the products for a specific shared feature.
  1221.  
  1222.       prodchpt$ = LEFT$(sharechpt$,1)
  1223.       prodkeyword$ = Lot_GetChapterValStr (prodchpt$, F_KEYWORD)
  1224.       IF FIsKeywordinCopyList (prodkeyword$) <> FALSE THEN
  1225.      sharefeature$ = Lot_GetChapterValStr (sharechpt$, F_KEYWORD)
  1226.      IF LEFT$(sharefeature$,5) = "WIN32" THEN
  1227.         '** 32 bit shared component
  1228.         Rspval$ = Lot_GetKeyValFromResponseFile("Shared Components", sharefeature$)
  1229.      ELSE
  1230.         '** 16 bit lotusapp component               
  1231.         Rspval$ = Lot_GetKeyValFromResponseFile("Lotusapp",sharefeature$)
  1232.      END IF
  1233.     '** script bug work around: generates Type mismatch and crashes
  1234.     IF Rspval$ <> "" THEN
  1235.        RspInOrOut% = CINT(Rspval$)
  1236.        IF RspInOrOut% <> 0 AND RspInOrOut% <> 1 THEN
  1237.            ErrorMsg SID_ERR_AUTO_INSTALL, LdString (SID_ERR_AUTO_SHRCOMPNENT) + sharefeature$
  1238.            ERROR STFQUIT
  1239.        END IF
  1240.        rc% = Lot_SetChapterFilesInCopyListInOrOut(sharechpt$,RspInOrOut%)
  1241.     ELSE
  1242.       '*** Log error: feature missing from the response file        
  1243.     END IF
  1244.       END IF
  1245.       '*** Goto next shared feature chpt$
  1246.       sharechpt$ = Lot_GetNext()  
  1247.     WEND
  1248.  
  1249. Lot_AutoCustomizeShare = TRUE
  1250.  
  1251. END FUNCTION
  1252.  
  1253. '*************************************************************************
  1254. '** PUBLIC FUNCTION Lot_AutoInstallSuiteCustomize () AS INTEGER
  1255. '**
  1256. '** Purpose:   reads in values from the response file. 
  1257. '** Author:    Thangv
  1258. '** Arguments:   
  1259. '** Returns:   TRUE if successful
  1260. '*************************************************************************
  1261. PUBLIC FUNCTION Lot_AutoInstallSuiteCustomize () AS INTEGER
  1262.  
  1263.     Lot_AutoInstallSuiteCustomize = FALSE
  1264.  
  1265.     DIM sizetype$, direction$ 
  1266.     DIM lname$, rc%, prodno%, n%  
  1267.     n% = Reg_GetNumberOfProducts()
  1268.     For prodno% = 1 to n%
  1269.       lname$ = Reg_GetProductAcronym(prodno%)
  1270.       IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" AND _
  1271.      lname$ <> "SUIT"  Then
  1272.        IF Reg_GetUIInOrOut(prodno%) = 1 THEN
  1273.          sizetype$ = Lot_GetKeyValFromResponseFile(lname$,"SizeOfInstall")
  1274.      IF sizetype$ = "" THEN
  1275.         ErrorMsg SID_ERR_AUTO_INSTALL, "SizeOfInstall entry missing from section: " + lname$
  1276.         ERROR STFQUIT
  1277.      END IF
  1278.         If sizetype$ = "1" Then         '*** gCOMPLETE$ 
  1279.         Reg_SetSelectedInstallType prodno%, gCOMPLETE$
  1280.         direction$ = Lot_CallOneProductFunction(prodno%, "InitCopyList", gNEXT, TRUE, "")
  1281.         ElseIf sizetype$ = "2" Then      '*** gLAPTOP$
  1282.         Reg_SetSelectedInstallType prodno%, gLAPTOP$
  1283.         direction$ = Lot_CallOneProductFunction(prodno%, "InitCopyList", gNEXT, TRUE, "")
  1284.         End If
  1285.        END IF
  1286.       END IF
  1287.     Next
  1288. Lot_AutoInstallSuiteCustomize = TRUE
  1289.  
  1290. END FUNCTION
  1291.  
  1292. '*************************************************************************
  1293. PUBLIC SUB AutoSetParentDir 
  1294. '** Purpose:    Get the BASEDIR symbol (for Single product),
  1295. '**             from the RSP file -- used in AUTOMATION             
  1296. '**             
  1297. '** Author:     TV     
  1298. '** Arguments:  
  1299. '** Returns:        
  1300. '**                         
  1301. '*************************************************************************
  1302. DIM notused%, lname$
  1303. DIM parentdirectory$
  1304.  
  1305.     '*** single product no is always 1 *****
  1306.     lname$ = Reg_GetProductAcronym(1)
  1307.     parentdirectory$ = Lot_GetKeyValFromResponseFile (lname$,SYM_BASEDIR$)
  1308.  
  1309.     parentdirectory$ = Lot_AutoCheckRSPPath(parentdirectory$)
  1310.  
  1311.     IF LEN(parentdirectory$)  < 1 THEN
  1312.        ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_BASEDIR) + "  " + lname$
  1313.        ERROR STFQUIT
  1314.     END IF
  1315.     
  1316.     SetSymbolValue SYM_BASEDIR$, parentdirectory$ 
  1317.  
  1318. END SUB
  1319.  
  1320. '*************************************************************************
  1321. '** PUBLIC FUNCTION Lot_AutoSetSrvNodeOptions () AS INTEGER
  1322. '**
  1323. '** Purpose:   reads in values from the response file. 
  1324. '** Author:    Thangv
  1325. '** Arguments:   
  1326. '** Returns:   TRUE if successful
  1327. '*************************************************************************
  1328. PUBLIC FUNCTION Lot_AutoSetSrvNodeOptions () AS INTEGER
  1329.  
  1330.    DIM chpt$, nodesel%, nodeoptsel$
  1331.    DIM NumOfProds%, OptNum%, OptName$, ProdNum%, prodno$
  1332.    DIM i%, j%,k%, notused%, OptKeyWord$
  1333.    DIM lname$   
  1334.    
  1335.    ' If no products are registered exit
  1336.    NumOfProds% = Reg_GetNumberOfProducts()
  1337.    IF NumOfProds%=0 THEN
  1338.       Lot_AutoSetSrvNodeOptions = TRUE
  1339.       EXIT FUNCTION
  1340.    END IF
  1341.    
  1342.    Lot_AutoSetSrvNodeOptions = FALSE
  1343.  
  1344.       ' Loop through products
  1345.      FOR i% = 1 TO NumOfProds%
  1346.      lname$ = "CustomizeNodeOptions" + Reg_GetProductAcronym(i%)
  1347.      Reg_ReSetAllNodeOptsSelToDefaults i%
  1348.      OptNum%=Reg_GetNumofNodeOptions(i%)
  1349.      IF OptNum% <> 0 THEN
  1350.     chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(i%) + gTOP$)
  1351.  
  1352.        ' Loop through the options
  1353.        FOR j% = 1 TO OptNum%
  1354.     ' Indent the option name under the product
  1355.     OptKeyWord$ = Reg_GetNodeOptionStr(i%,j%)
  1356.     chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  1357.     IF INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1 THEN
  1358.           nodeoptsel$ = Lot_GetKeyValFromResponseFile(lname$, OptKeyWord$) 
  1359.           'IF nodeoptsel$ <> "0" AND nodeoptsel$ <> "1" THEN
  1360.           '  ErrorMsg SID_ERR_AUTO_INSTALL, "Auto install error"
  1361.           ' ERROR STFQUIT
  1362.           'END IF
  1363.           IF nodeoptsel$ = "0" OR nodeoptsel$ = "1" THEN
  1364.         nodesel% = CINT (nodeoptsel$)   
  1365.         Reg_ReSetNodeOptionSelected i%,j%,nodesel%
  1366.           END IF
  1367.  
  1368.     END IF
  1369.        NEXT
  1370.  
  1371.      END IF
  1372.      NEXT
  1373.  
  1374. Lot_AutoSetSrvNodeOptions = TRUE
  1375.  
  1376. END FUNCTION
  1377.  
  1378. '*************************************************************************
  1379. '** PUBLIC FUNCTION Lot_AutoAddiconOptions () AS INTEGER
  1380. '**
  1381. '** Purpose:   reads AddiconOption values from the response file. 
  1382. '** Author:    Shu Chen
  1383. '** Arguments:   
  1384. '** Returns:   TRUE if successful
  1385. '*************************************************************************
  1386.  
  1387. PUBLIC FUNCTION Lot_AutoAddiconOptions () AS INTEGER
  1388.  
  1389.     DIM AddOption$
  1390.     DIM lname$ 
  1391.  
  1392.     Lot_AutoAddiconOptions = TRUE
  1393.  
  1394.     lname$ = "General Information"
  1395.  
  1396.     AddOption$ = Lot_GetKeyValFromResponseFile(lname$,"AddiconOption")
  1397.  
  1398.     SELECT CASE AddOption$
  1399.       case "1"
  1400.          Lot_AutoAddiconOptions = TRUE
  1401.       case "0"
  1402.          Lot_AutoAddiconOptions = FALSE
  1403.       case else
  1404.           Lot_AutoAddiconOptions = TRUE
  1405.  
  1406.     END SELECT
  1407.  
  1408. END FUNCTION
  1409.  
  1410.