home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 16 / 16.iso / w / w058 / 1.img / NETSETUP.MS_ / NETSETUP.bin
Encoding:
Text File  |  1993-09-15  |  50.6 KB  |  1,503 lines

  1. '**************************************************************************
  2. '*                       Frame Setup Script
  3. '**************************************************************************
  4.  
  5. '$INCLUDE 'setupapi.inc'
  6. '$INCLUDE 'msdetect.inc'
  7. '$INCLUDE 'msregdb.inc'
  8. '$INCLUDE 'fmapi.inc'
  9.  
  10. ''Dialog ID's
  11. CONST ASKEXIT      = 200
  12. CONST DESTPATH     = 300
  13. CONST EXITFAILURE  = 400
  14. CONST EXITQUIT     = 600
  15. CONST EXITSUCCESS  = 700
  16. CONST MAKER30      = 800
  17. CONST PATHHELP     = 900
  18. CONST OPTREGISTER  = 1200
  19. CONST REGHELP      = 1300
  20. CONST CUSTHELP     = 1400
  21. CONST FILTERS      = 5200
  22. CONST CUSTINST     = 6200
  23. CONST CUSTINSTNOPATH = 1900
  24. CONST TOOBIG       = 6300
  25. CONST BADPATH      = 6400
  26. CONST BADREGNUM    = 7100
  27. CONST CDGETNAMEORG = 7500
  28. CONST REGALERT     = 7700
  29. CONST NAMEALERT    = 1500
  30. CONST BADNETPATH   = 1100
  31. CONST PCNAMEALERT  = 1800
  32. CONST BLDEXITSUCCESS = 1000
  33.  
  34. ''Splash screen dialogs
  35. CONST SCREEN1       = 2300
  36. CONST SCREEN2       = 2400
  37. CONST SCREEN3       = 2500
  38. CONST SCREEN4       = 2600
  39. CONST SCREEN5       = 2700
  40. CONST SCREEN6       = 2800
  41. CONST SCREEN7       = 2900
  42. CONST SCREEN8       = 3000
  43.  
  44. ''Boolean constants
  45. CONST FMTRUE  = -1
  46. CONST FMFALSE =  0
  47.  
  48. ''File Types
  49. CONST BINFILES      = 1
  50. CONST INITFILES     = 2
  51. CONST DICTFILES     = 3
  52. CONST FILTERFILES   = 4
  53. CONST HELPFILES        = 5
  54. CONST SAMPLEFILES   = 6
  55. CONST CLIPARTFILES  = 7
  56. CONST TRAINFILES    = 8
  57. CONST TEMPLFILES    = 9
  58. CONST REQFILES        = 10    ''These files have to reside on local disk
  59.                             ''(maker.ini and fmres.dll), so copy automatically
  60.  
  61. CONST WS_VISIBLE = &H10000000
  62. CONST WS_BORDER = &H00800000
  63. CONST WS_CLIPCHILDREN = &H02000000
  64. CONST GWL_STYLE = -16
  65. CONST SW_SHOWMAXIMIZED = 3
  66.  
  67. CONST NUMOPTIONS = 9 ''Number of options
  68. CONST FM30 = 3        ''FrameMaker 3.0
  69. CONST FM40 = 4        ''FrameMaker 4.0
  70. CONST NUMENTRIES = 39 ''Max number of filters
  71.  
  72. GLOBAL DEST$        ''Default destination directory.
  73. GLOBAL WINDRIVE$    ''Windows drive letter.
  74. GLOBAL NETPATH$        ''network path
  75. GLOBAL NETINI$        ''netsetup.ini file
  76.  
  77. GLOBAL DEMO&        ''Demo version?
  78. GLOBAL LANGUIOPT$    ''Language interface, USEng=1, UKEng=2
  79. GLOBAL PRODUCT$        ''FrameMaker=1, Builder=2
  80. GLOBAL BOTHPROD&    ''Both products exist in FMHOME
  81. GLOBAL NOPATHOPT&    ''User does not have option to set local path
  82. GLOBAL USERNAME$    ''User name
  83. GLOBAL PCNAME$        ''PC name
  84. GLOBAL COMPANY$     ''Company
  85. GLOBAL REGNUM$      ''Registration number
  86. GLOBAL NUMTRY%        ''Number of times user enters invalid regnum.
  87.                     ''Give them 3 chances.
  88.  
  89. GLOBAL NUMFILTERS%  ''Number of filters
  90.  
  91. ''CustInst list symbol names
  92. GLOBAL BINNEEDS$    ''Option list costs per drive
  93. GLOBAL INITNEEDS$
  94. GLOBAL DICTNEEDS$
  95. GLOBAL FILTERNEEDS$
  96. GLOBAL HELPNEEDS$
  97. GLOBAL SAMPLENEEDS$
  98. GLOBAL CLIPARTNEEDS$
  99. GLOBAL TRAINNEEDS$
  100. GLOBAL TEMPLNEEDS$
  101. GLOBAL REQNEEDS$
  102. GLOBAL LOGNEED&        ''max size of install.log file - 39430 bytes
  103. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  104. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  105.  
  106. ''Dialog list symbol names
  107. GLOBAL DEMOCHKSTATE$
  108. GLOBAL CHECKSTATES$
  109. GLOBAL STATUSTEXT$
  110. GLOBAL DRIVETEXT$
  111. GLOBAL OPTGREY$
  112. GLOBAL FILTLISTIN$
  113.  
  114. GLOBAL INCRINSTALL&        ''Incremental install
  115. GLOBAL NETINCINSTALL&    ''Incremental network install
  116. GLOBAL MAKER_30&        ''Installing over FM 3.0
  117. GLOBAL FMRESPATH$       ''fmres.dll
  118. GLOBAL MAKERINI$        ''maker.ini file
  119.  
  120. GLOBAL CHANGEDPATH&    'Brought up SET PATH dialog
  121. GLOBAL DISPLAYMSG&    'Display installing over 3.0 warning message
  122. GLOBAL DISPLAYED&    'Warning message already displayed for path
  123.  
  124. GLOBAL MAPTABLE(NUMENTRIES) AS STRING    'mapping for filters
  125. TYPE FILTREC
  126.     id AS STRING*3
  127.     entry AS STRING*59
  128. END TYPE
  129. GLOBAL FILTTABLE(NUMENTRIES) AS FILTREC
  130.  
  131. '** Pass arguments as fixed strings to FMGetFields
  132. DIM tmpUser AS STRING *30
  133. DIM tmpOrg AS STRING *30
  134. DIM tmpReg AS STRING *30
  135.  
  136. GLOBAL INISTRINGS(42) AS STRING
  137. DIM Setting1$  'Yes/No field in Netsetup.ini
  138. DIM Setting2$  'Enable/Disable field in Netsetup.ini
  139.  
  140.  
  141. DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%, iShow%) AS INTEGER
  142. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  143. DECLARE FUNCTION GetDialogBaseUnits LIB "user.exe" AS LONG
  144.  
  145. DECLARE SUB AddOptFilesToCopyList (ftype%)
  146. DECLARE SUB RecalcOptFiles (ftype%)
  147. DECLARE SUB RecalcPath
  148. DECLARE SUB SetDriveStatus
  149. DECLARE SUB UpdateMakerIni
  150. DECLARE SUB ModifyMakerIni
  151. DECLARE SUB UpdateNetIni
  152. DECLARE FUNCTION ValidNetPath () AS INTEGER
  153. DECLARE FUNCTION FMInstalled (makerDir$, version%) AS INTEGER
  154. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  155.  
  156.  
  157.  
  158. INIT:
  159.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  160.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  161.     LOGFILE$ = "install.log"        ''Installation log file
  162.     LOGNEED& = 39430
  163.  
  164.     hWnd% = HwndFrame()
  165.     k& = SetWindowLong(hWnd%, GWL_STYLE, WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  166.     j% = ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  167.  
  168.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  169.     print "srcinfpath = ";szInf$
  170.     IF szInf$ = "" THEN
  171.         szInf$ = GetSymbolValue("STF_CWDDIR") + INFFILE$ 
  172.     print "cwddir+inf = ";szInf$
  173.     END IF
  174.     ReadInfFile szInf$
  175.  
  176. 'Get network path from netsetup.ini and check if it is a valid
  177. 'FrameMaker or FrameBuilder path. If not, then get the directory
  178. 'from which they're running netsetup (minus \netsetup) and if not
  179. 'the same path as in netsetup.ini, then check if valid.
  180.  
  181.     PRODUCT = "1"
  182.     BOTHPROD = FMFALSE
  183.  
  184.     NETINI = GetSymbolValue("STF_SRCDIR") + "netsetup.ini"
  185.     NETPATH = GetIniKeyString(NETINI$, "FMNetPath", "NetPath")
  186.  
  187.     IF (ValidNetPath() = 0) THEN
  188.         tmppath$ = GetSymbolValue("STF_CWDDIR")
  189.         pos% = INSTR("\netsetup", tmppath)
  190.         cwd$ = MID$(tmppath, 1, (pos-1))
  191.         IF (NETPATH$ = cwd$) THEN
  192.             GOTO BADNPATH
  193.         ELSE
  194.             NETPATH$ = cwd$
  195.             IF (ValidNetPath() = 0) THEN
  196.                 GOTO BADNPATH
  197.             END IF
  198.             NETINI = MakePath(NETPATH, "netsetup.ini")
  199.         END IF
  200.     END IF
  201.         
  202. 'Get language interface
  203.     IF (GetIniKeyString(MakePath(NETPATH,"maker.ini"),"Frame","Language") = "UKEnglish") THEN
  204.         LANGUIOPT = "2"
  205.     ELSE
  206.         LANGUIOPT = "1"
  207.     END IF
  208.  
  209.     CHANGEDPATH = FMFALSE
  210.     DISPLAYMSG = FMFALSE
  211.     DISPLAYED = FMFALSE
  212.     MAKER_30 = FMFALSE
  213.     NOPATHOPT = FMFALSE
  214.     
  215.     USERNAME$ = ""
  216.     PCNAME$ = ""
  217.     COMPANY$ = ""
  218.     REGNUM$ = ""
  219.     NUMTRY% = 0
  220.  
  221.     ''CustInst list symbols
  222.     DEMOCHKSTATE$ = "DemoCheckState"
  223.     CHECKSTATES$ = "CheckItemsState"
  224.     STATUSTEXT$  = "StatusItemsText"
  225.     DRIVETEXT$   = "DriveStatusText"
  226.     CONFIRMTEXT$ = "ConfirmTextIn"
  227.     FILTLISTIN$  = "ListItemsIn"
  228.     OPTGREY$ = "OptionsGreyed"
  229.  
  230.     AddListItem DEMOCHKSTATE, "OFF"
  231.     FOR i% = 1 TO NUMOPTIONS STEP 1
  232.         AddListItem STATUSTEXT$, ""
  233.     NEXT i%
  234.     FOR i% = 1 TO 7 STEP 1
  235.         AddListItem DRIVETEXT$, ""
  236.     NEXT i%
  237.  
  238.     MakeListFromSectionKeys FILTLISTIN$, "filters"
  239.     NUMFILTERS = GetListLength(FILTLISTIN)
  240.  
  241. ''Initialize filter maptable
  242.     MAPTABLE(0) = "w4w33f.dll"        ''Ami Professional
  243.     MAPTABLE(1) = "imcgm9.flt"        ''CGM
  244.     MAPTABLE(2) = "imcdr9.flt"         ''CorelDraw
  245.     MAPTABLE(3) = "w4w15f.dll"        ''DCA/RFT
  246.     MAPTABLE(4) = "w4w15f.dll"        ''DCA/RFT - DisplayWrite 5
  247.     MAPTABLE(5) = "frame.exe"        ''DIB
  248.     MAPTABLE(6) = "w4w15f.dll"        ''DisplayWrite 2,3,4
  249.     MAPTABLE(7) = "w4w15f.dll"        ''DisplayWrite 5
  250.     MAPTABLE(8) = "imdxf9.flt"        ''DXF
  251.     MAPTABLE(9) = "frame.exe"        ''EPS(F)
  252.     MAPTABLE(10) = "imgem9.flt"        ''GEM
  253.     MAPTABLE(11) = "grphfilt.dll"    ''GIF
  254.     MAPTABLE(12) = "imhgl9.flt"        ''HPGL
  255.     MAPTABLE(13) = "g4g607f.dll"    ''IGES
  256.     MAPTABLE(14) = "macpaint.dll"    ''MacPaint
  257.     MAPTABLE(15) = "imdrw9.flt"        ''Micrografx Drawing Format
  258.     MAPTABLE(16) = "frame.exe"        ''MIF
  259.     MAPTABLE(17) = "frame.exe"        ''MML
  260.     MAPTABLE(18) = "w4w05f.dll"        ''Microsoft Word 3.0, 3.1
  261.     MAPTABLE(19) = "w4w05f.dll"        ''Microsoft Word 4.0
  262.     MAPTABLE(20) = "w4w05f.dll"        ''Microsoft Word 5.0, 5.5
  263.     MAPTABLE(21) = "w4w44f.dll"        ''MS Word for Windows 1.x
  264.     MAPTABLE(22) = "w4w44f.dll"        ''MS Word for Windows 2.0
  265.     MAPTABLE(23) = "w4w54f.dll"        ''MS Word for Mac 4.0
  266.     MAPTABLE(24) = "w4w42t.dll"        ''MSI
  267.     MAPTABLE(25) = "grphfilt.dll"    ''PCX
  268.     MAPTABLE(26) = "impct9.flt"        ''QuickDraw PICT
  269.     MAPTABLE(27) = "w4w19f.dll"        ''RTF
  270.     MAPTABLE(28) = "frame.exe"        ''SunRF
  271.     MAPTABLE(29) = "frame.exe"        ''Text
  272.     MAPTABLE(30) = "grphfilt.dll"    ''TIFF
  273.     MAPTABLE(31) = "vp2mif.dll"        ''Ventura Publisher 1.0-4.0
  274.     MAPTABLE(32) = "frame.exe"        ''WMF
  275.     MAPTABLE(33) = "w4w07f.dll"        ''WordPerfect 5.0 
  276.     MAPTABLE(34) = "w4w07f.dll"        ''WordPerfect 5.1 
  277.     MAPTABLE(35) = "w4w59f.dll"        ''WordPerfect Mac 1.0 
  278.     MAPTABLE(36) = "w4w60f.dll"        ''WordPerfect Mac 2.0 
  279.     MAPTABLE(37) = "imwpg9.flt"        ''WordPerfect Graphics
  280.     MAPTABLE(38) = "grphfilt.dll"    ''XWD
  281.  
  282. ''Initialize filter entries for maker.ini
  283.     FILTTABLE(0).id = "100"
  284.     FILTTABLE(0).entry = """Ami Professional"" ""MSI"" DOCUMENT W4W33F.DLL ^.SAM"
  285.     FILTTABLE(1).id = "120"
  286.     FILTTABLE(1).entry = """CGM"" ""WMF"" OBJECT FRME_INT.DLL ^.CGM"
  287.     FILTTABLE(2).id = "125"
  288.     FILTTABLE(2).entry = """CorelDRAW"" ""WMF"" OBJECT FRME_INT.DLL ^.CDR"
  289.     FILTTABLE(3).id = "130"
  290.     FILTTABLE(3).entry = """DCA/RFT"" ""MSI"" DOCUMENT W4W15F.DLL"
  291.     FILTTABLE(4).id = "131"
  292.     FILTTABLE(4).entry = """DCA/RFT - DisplayWrite 5"" ""MSI"" DOCUMENT W4W15F.DLL"
  293.     FILTTABLE(5).id = "132"
  294.     FILTTABLE(5).entry = """DIB"" ""DIB"" OBJECT frame.exe ^.BMP"
  295.     FILTTABLE(6).id = "133"
  296.     FILTTABLE(6).entry = """DisplayWrite 2,3,4"" ""MSI"" DOCUMENT W4W15F.DLL"
  297.     FILTTABLE(7).id = "134"
  298.     FILTTABLE(7).entry = """DisplayWrite 5"" ""MSI"" DOCUMENT W4W15F.DLL"
  299.     FILTTABLE(8).id = "136"
  300.     FILTTABLE(8).entry = """DXF"" ""WMF"" OBJECT FRME_INT.DLL ^.DXF"
  301.     FILTTABLE(9).id = "140"
  302.     FILTTABLE(9).entry = """EPS(F)"" ""DIB"" OBJECT frame.exe ^.EPS"
  303.     FILTTABLE(10).id = "150"
  304.     FILTTABLE(10).entry = """GEM"" ""WMF"" OBJECT FRME_INT.DLL ^.GEM"
  305.     FILTTABLE(11).id = "160"
  306.     FILTTABLE(11).entry = """GIF"" ""DIB"" OBJECT grphfilt.dll ^.GIF"
  307.     FILTTABLE(12).id = "170"
  308.     FILTTABLE(12).entry = """HPGL"" ""WMF"" OBJECT FRME_INT.DLL ^.HGL"
  309.     FILTTABLE(13).id = "180"
  310.     FILTTABLE(13).entry = """IGES"" ""WMF"" OBJECT G4G607F.DLL ^.IGS"
  311.     FILTTABLE(14).id = "220"
  312.     FILTTABLE(14).entry = """MacPaint"" ""DIB"" OBJECT macpaint.dll ^.MPT"
  313.     FILTTABLE(15).id = "221"
  314.     FILTTABLE(15).entry = """Micrografx Drawing Format"" ""WMF"" OBJECT FRME_INT.DLL ^.DRW"
  315.     FILTTABLE(16).id = "222"
  316.     FILTTABLE(16).entry = """MIF"" ""MKR"" DOCUMENT frame.exe ^.MIF"
  317.     FILTTABLE(17).id = "223"
  318.     FILTTABLE(17).entry = """MML"" ""MIF"" DOCUMENT frame.exe ^.MML"
  319.     FILTTABLE(18).id = "224"
  320.     FILTTABLE(18).entry = """Microsoft Word 3.0, 3.1"" ""MSI"" DOCUMENT W4W05F.DLL"
  321.     FILTTABLE(19).id = "225"
  322.     FILTTABLE(19).entry = """Microsoft Word 4.0"" ""MSI"" DOCUMENT W4W05F.DLL"
  323.     FILTTABLE(20).id = "226"
  324.     FILTTABLE(20).entry = """Microsoft Word 5.0, 5.5"" ""MSI"" DOCUMENT W4W05F.DLL"
  325.     FILTTABLE(21).id = "227"
  326.     FILTTABLE(21).entry = """MS Word for Windows 1.x"" ""MSI"" DOCUMENT W4W44F.DLL"
  327.     FILTTABLE(22).id = "228"
  328.     FILTTABLE(22).entry = """MS Word for Windows 2.0"" ""MSI"" DOCUMENT W4W44F.DLL"
  329.     FILTTABLE(23).id = "229"
  330.     FILTTABLE(23).entry = """MS Word Mac 4.0"" ""MSI"" DOCUMENT W4W54F.DLL"
  331.     FILTTABLE(24).id = "230"
  332.     FILTTABLE(24).entry = """MSI"" ""MIF"" DOCUMENT W4W42T.DLL ^.MSI"
  333.     FILTTABLE(25).id = "250"
  334.     FILTTABLE(25).entry = """PCX"" ""DIB"" OBJECT grphfilt.dll ^.PCX"
  335.     FILTTABLE(26).id = "251"
  336.     FILTTABLE(26).entry = """QuickDraw PICT"" ""WMF"" OBJECT FRME_INT.DLL ^.PCT"
  337.     FILTTABLE(27).id = "270"
  338.     FILTTABLE(27).entry = """RTF"" ""MSI"" DOCUMENT W4W19F.DLL ^.RTF"
  339.     FILTTABLE(28).id = "280"
  340.     FILTTABLE(28).entry = """SunRF"" ""DIB"" OBJECT frame.exe ^.RF"
  341.     FILTTABLE(29).id = "290"
  342.     FILTTABLE(29).entry = """Text"" ""MKR"" DOCUMENT frame.exe ^.TXT"
  343.     FILTTABLE(30).id = "291"
  344.     FILTTABLE(30).entry = """TIFF"" ""DIB"" OBJECT grphfilt.dll ^.TIF"
  345.     FILTTABLE(31).id = "300"
  346.     FILTTABLE(31).entry = """Ventura Publisher 1.0-4.0"" ""MIF"" DOCUMENT VP2MIF.DLL ^.CHP"
  347.     FILTTABLE(32).id = "310"
  348.     FILTTABLE(32).entry = """WMF"" ""WMF"" OBJECT frame.exe ^.WMF"
  349.     FILTTABLE(33).id = "313"
  350.     FILTTABLE(33).entry = """WordPerfect 5.0"" ""MSI"" DOCUMENT W4W07F.DLL"
  351.     FILTTABLE(34).id = "314"
  352.     FILTTABLE(34).entry = """WordPerfect 5.1"" ""MSI"" DOCUMENT W4W07F.DLL"
  353.     FILTTABLE(35).id = "315"
  354.     FILTTABLE(35).entry = """WordPerfect Mac 1.0"" ""MSI"" DOCUMENT W4W59F.DLL"
  355.     FILTTABLE(36).id = "316"
  356.     FILTTABLE(36).entry = """WordPerfect Mac 2.0"" ""MSI"" DOCUMENT W4W60F.DLL"
  357.     FILTTABLE(37).id = "317"
  358.     FILTTABLE(37).entry = """WordPerfect Graphics"" ""WMF"" OBJECT FRME_INT.DLL ^.WPG"
  359.     FILTTABLE(38).id = "330"
  360.     FILTTABLE(38).entry = """XWD"" ""DIB"" OBJECT grphfilt.dll ^.XWD"
  361.  
  362.  
  363.     ''Disk cost list symbols
  364.     BINNEEDS$ = "BinNeeds"
  365.     INITNEEDS$ = "InitNeeds"
  366.     SAMPLENEEDS$  = "SampleNeeds"
  367.     HELPNEEDS$ = "HelpNeeds"
  368.     TRAINNEEDS$ = "TrainNeeds"
  369.     CLIPARTNEEDS$  = "ClipArtNeeds"
  370.     DICTNEEDS$ = "DictNeeds"
  371.     FILTERNEEDS$ = "FilterNeeds"
  372.     TEMPLNEEDS$ = "TemplNeeds"
  373.     REQNEEDS$ = "ReqNeeds"
  374.     EXTRACOSTS$ = "ExtraCosts"
  375.     BIGLIST$    = "BigList"
  376.     FOR i% = 1 TO (NUMOPTIONS+1) STEP 1
  377.         AddListItem BIGLIST$, ""
  378.     NEXT i%
  379.     FOR i% = 1 TO 26 STEP 1
  380.         AddListItem EXTRACOSTS$, "0"
  381.     NEXT i%
  382.  
  383.     INISTRINGS(1) = "FrameExe"
  384.     INISTRINGS(2) = "FMInitFiles"
  385.     INISTRINGS(3) = "Dictionaries"
  386.     INISTRINGS(4) = "Filters"
  387.     INISTRINGS(5) = "Help"
  388.     INISTRINGS(6) = "Samples"
  389.     INISTRINGS(7) = "ClipArt"
  390.     INISTRINGS(8) = "Training"
  391.     INISTRINGS(9) = "Templates"
  392.     INISTRINGS(10)= "DestLocalPath"
  393.  
  394. '$IFDEF DEBUG
  395.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  396. '$ENDIF ''DEBUG
  397.  
  398.  
  399. PREREG:
  400.     IF (INCRINSTALL) THEN
  401.     FMRESPATH$ = MakePath(DEST$,"fminit\fmres.dll")
  402.     IF (FMGetFields(tmpUser,tmpOrg,tmpReg,FMRESPATH) <> 1) THEN
  403.         USERNAME = ""
  404.         COMPANY = ""
  405.         REGNUM = ""
  406.     END IF
  407.     USERNAME = tmpUser
  408.     COMPANY = tmpOrg
  409.       REGNUM = tmpReg
  410.     PCNAME = GetIniKeyString(MakePath(DEST$,"maker.ini"),"Frame","PCName")
  411.     SetSymbolValue "NameIn", USERNAME
  412.     SetSymbolValue "OrgIn", COMPANY
  413.     SetSymbolValue "RegIn", REGNUM
  414.     SetSymbolValue "PCIn", PCNAME
  415.     END IF
  416.  
  417. REGISTRATION:
  418.     IF (BOTHPROD) THEN
  419.         sz$ = UIStartDlg(CUIDLL$, OPTREGISTER , "FOptNameOrgDlgProc", REGHELP, HELPPROC$)
  420.         PRODUCT$ = GetSymbolValue("ButtonChecked")
  421.     ELSE
  422.         sz$ = UIStartDlg(CUIDLL$, CDGETNAMEORG, "FNameOrgDlgProc", REGHELP, HELPPROC$)
  423.     END IF
  424.     USERNAME$ = GetSymbolValue("NameOut")
  425.     PCNAME$ = GetSymbolValue("PCOut")
  426.     COMPANY$ = GetSymbolValue("OrgOut")
  427.     REGNUM$ = GetSymbolValue("RegOut")
  428.  
  429.     IF sz$ = "CONTINUE" THEN
  430.         IF (GetListItem(DEMOCHKSTATE$, 1) = "ON") THEN
  431.             DEMO& = FMTRUE
  432.         ELSE
  433.             DEMO& = FMFALSE
  434.         END IF
  435.  
  436.         IF (USERNAME$ = "") THEN
  437.             GOSUB NONAME
  438.             GOTO REGISTRATION
  439.         END IF
  440.         IF (PCNAME$ = "") THEN
  441.             GOSUB NOPCNAME
  442.             GOTO REGISTRATION
  443.         END IF
  444.  
  445.         IF (NOT DEMO) THEN
  446.             IF REGNUM$ = "" THEN
  447.                 GOSUB NOREG
  448.                 GOTO REGISTRATION
  449.             END IF
  450.             IF (FMValidateRegNo(REGNUM$) <> 1) THEN
  451.                 NUMTRY% = NUMTRY% + 1
  452.                 IF (NUMTRY% > 3) THEN
  453.                     dlg% = EXITFAILURE
  454.                     UIPop 1
  455.                     GOTO QUITL1
  456.                 END IF
  457.                 GOSUB BADREG
  458.                 GOTO REGISTRATION
  459.             END IF
  460.         END IF
  461.         CursorSave% = ShowWaitCursor
  462.  
  463.     ELSEIF sz$ = "CHKDEMO" THEN
  464.         GOTO REGISTRATION
  465.     ELSE        ''User chose EXIT option
  466.         GOSUB ASKQUIT
  467.         GOTO REGISTRATION
  468.     END IF
  469.  
  470.  
  471.  
  472. DEFPATH:
  473. 'Set default destination
  474.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  475.  
  476.     IF (PRODUCT = "1") THEN
  477.     'Is maker already installed?
  478.         IF (DoesIniSectionExist("WIN.INI", "FrameMaker4") = 1) THEN
  479.             DEST$ = GetIniKeyString("WIN.INI", "FrameMaker4", "FMHome")
  480.             IF ((DoesFileExist(MakePath(DEST$, "fmres.dll"), femExists) = 1) AND (DoesFileExist(MakePath(DEST$,"maker.ini"),femExists) = 1)) THEN
  481.                 INCRINSTALL& = FMTRUE
  482.             ELSE
  483.                 INCRINSTALL& = FMFALSE
  484.                 inistring$ = GetIniKeyString(NETINI,"FMOptions","DestLocalPath")
  485.                 DEST$ = GetNthFieldFromIniString(inistring$,1)
  486.             END IF     'incremental install
  487.         ELSE
  488.             INCRINSTALL = FMFALSE
  489.             inistring$ = GetIniKeyString(NETINI,"FMOptions","DestLocalPath")
  490.             DEST$ = GetNthFieldFromIniString(inistring$,1)
  491.         END IF
  492.  
  493.     ELSE      ''Product is builder
  494.  
  495.         IF (DoesIniSectionExist("WIN.INI", "FrameBuilder") = 1) THEN
  496.             DEST$ = GetIniKeyString("WIN.INI", "FrameBuilder", "FMHome")
  497.             IF ((DoesFileExist(MakePath(DEST$,"fmres.dll"),femExists) = 1) AND (DoesFileExist(MakePath(DEST$,"builder.ini"),femExists) = 1)) THEN
  498.                 INCRINSTALL& = FMTRUE
  499.             ELSE
  500.                 INCRINSTALL& = FMFALSE
  501.                 inistring$ = GetIniKeyString(NETINI,"FMOptions","DestLocalPath")
  502.                 DEST$ = GetNthFieldFromIniString(inistring$,1)
  503.             END IF
  504.         ELSE
  505.             INCRINSTALL& = FMFALSE
  506.             inistring$ = GetIniKeyString(NETINI,"FMOptions","DestLocalPath")
  507.             DEST$ = GetNthFieldFromIniString(inistring$,1)
  508.         END IF
  509.     END IF
  510.  
  511.     ReplaceListItem DRIVETEXT$, 7, DEST$
  512.  
  513. '*** Get settings from netsetup.ini and set options accordingly.
  514. '*** Calculate space needed based on default settings for initial
  515. '*** display of options dialog.
  516.  
  517.     FOR i% = 1 TO (NUMOPTIONS+1) STEP 1
  518.         IniLine$ = GetIniKeyString(NETINI, "FMOptions", INISTRINGS(i))
  519.         Setting2 = GetNthFieldFromIniString(IniLine, 2)
  520.         IF (i = 10) THEN
  521.             IF (Setting2 = "Disable") THEN
  522.                 NOPATHOPT = FMTRUE
  523.             END IF
  524.         ELSE
  525.             IF (Setting2 = "Disable") THEN
  526.                 num$ = STR$(i)
  527.                 index$ = LTRIM$(num$)
  528.                 AddListItem OPTGREY, index 
  529.                 AddListItem CHECKSTATES, "OFF"
  530.             ELSE
  531.                 Setting1 = GetNthFieldFromIniString(IniLine, 1)
  532.                 IF (Setting1 = "Yes") THEN
  533.                     AddListItem CHECKSTATES, "ON"
  534.                 ELSE
  535.                     AddListItem CHECKSTATES, "OFF"
  536.                 END IF
  537.             END IF
  538.         END IF
  539.     NEXT i
  540.     
  541.     RestoreCursor CursorSave%
  542.     RecalcPath
  543.     SetDriveStatus
  544.     UIPop 1
  545.  
  546.     IF ((GetListLength(OPTGREY) = 9) AND NOPATHOPT) THEN
  547.     ''Do not display options dialog. Automatically install
  548.     ''required files.
  549.     ''Warn user about installing over 3.0
  550.         IF (NOT DISPLAYED) AND (NOT CHANGEDPATH) AND (FMInstalled(DEST$,FM30) = 1) THEN
  551.             DISPLAYMSG = FMTRUE
  552.             DISPLAYED = FMTRUE
  553.         END IF
  554.         IF (DISPLAYMSG) THEN
  555.             GOSUB WARNING
  556.             DISPLAYMSG = FMFALSE
  557.         END IF
  558.      
  559.         ''Install only if it will fit.
  560.         FOR i% = 1 TO NUMOPTIONS STEP 1
  561.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  562.                 GOSUB TOOBIG
  563.                 ERROR STFQUIT
  564.             END IF
  565.         NEXT i%
  566.         GOTO INSTALL
  567.     END IF
  568.  
  569.         
  570. CUSTINST:
  571.     IF NOPATHOPT THEN
  572.         sz$ = UIStartDlg(CUIDLL$, CUSTINSTNOPATH, "FCustInstDlgProc", CUSTHELP, HELPPROC$)
  573.     ELSE
  574.         sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", CUSTHELP, HELPPROC$)
  575.     END IF
  576.  
  577.     IF sz$ = "CONTINUE" THEN
  578.     ''Warn user about installing over 3.0
  579.         IF (NOT DISPLAYED) AND (NOT CHANGEDPATH) AND (FMInstalled(DEST$,FM30) = 1) THEN
  580.             DISPLAYMSG = FMTRUE
  581.             DISPLAYED = FMTRUE
  582.         END IF
  583.         IF (DISPLAYMSG) THEN
  584.             GOSUB WARNING
  585.             DISPLAYMSG = FMFALSE
  586.             GOTO CUSTINST
  587.         END IF
  588.      
  589.         ''Install only if it will fit.
  590.         FOR i% = 1 TO NUMOPTIONS STEP 1
  591.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  592.                 GOSUB TOOBIG
  593.                 GOTO CUSTINST
  594.             END IF
  595.         NEXT i%
  596.         UIPop 1
  597.         GOTO INSTALL
  598.     ELSEIF sz$ = "PATH" THEN
  599.         GOTO GETPATH
  600.     ELSEIF sz$ = "CHK1" THEN
  601.         RecalcOptFiles BINFILES
  602.         SetDriveStatus
  603.         GOTO CUSTINST
  604.     ELSEIF sz$ = "CHK2" THEN
  605.         RecalcOptFiles INITFILES
  606.         SetDriveStatus
  607.         GOTO CUSTINST
  608.     ELSEIF sz$ = "CHK3" THEN
  609.         RecalcOptFiles DICTFILES
  610.         SetDriveStatus
  611.         GOTO CUSTINST
  612.     ELSEIF sz$ = "CHK4" THEN
  613.         RecalcOptFiles FILTERFILES
  614.         SetDriveStatus
  615.         GOTO CUSTINST
  616.     ELSEIF sz$ = "CHK5" THEN
  617.         RecalcOptFiles HELPFILES
  618.         SetDriveStatus
  619.         GOTO CUSTINST
  620.     ELSEIF sz$ = "CHK6" THEN
  621.         RecalcOptFiles SAMPLEFILES
  622.         SetDriveStatus
  623.         GOTO CUSTINST
  624.     ELSEIF sz$ = "CHK7" THEN
  625.         RecalcOptFiles CLIPARTFILES
  626.         SetDriveStatus
  627.         GOTO CUSTINST
  628.     ELSEIF sz$ = "CHK8" THEN
  629.         RecalcOptFiles TRAINFILES
  630.         SetDriveStatus
  631.         GOTO CUSTINST
  632.     ELSEIF sz$ = "CHK9" THEN
  633.         RecalcOptFiles TEMPLFILES
  634.         SetDriveStatus
  635.         GOTO CUSTINST
  636.     ELSEIF sz$ = "REACTIVATE" THEN
  637.         RecalcPath
  638.         SetDriveStatus
  639.         GOTO CUSTINST
  640.     ELSE
  641.         GOSUB ASKQUIT
  642.         GOTO CUSTINST
  643.     END IF
  644.  
  645.  
  646.  
  647. INSTALL:
  648.     ClearCopyList
  649.     CreateDir DEST$, cmoNone
  650.     OpenLogFile MakePath(DEST$, LOGFILE$), 0   ''open install.log for writing
  651.  
  652.     AddOptFilesToCopyList REQFILES
  653.     AddOptFilesToCopyList BINFILES
  654.     AddOptFilesToCopyList INITFILES
  655.     AddOptFilesToCopyList DICTFILES
  656.     AddOptFilesToCopyList FILTERFILES
  657.     AddOptFilesToCopyList HELPFILES
  658.     AddOptFilesToCopyList SAMPLEFILES
  659.     AddOptFilesToCopyList CLIPARTFILES
  660.     AddOptFilesToCopyList TRAINFILES
  661.     AddOptFilesToCopyList TEMPLFILES
  662.  
  663. '$IFDEF DEBUG
  664.     i% = SetCopyMode(0)
  665.     DumpCopyList "e:\tmp\install.lst"
  666. '$ENDIF
  667.  
  668.     IF (FMInstalled(DEST$, 3) = 1) THEN
  669.         MAKER_30 = FMTRUE
  670.     ENDIF 
  671.  
  672. '*** Add splash screens to billboard list
  673.     ClearBillboardList
  674.     AddToBillboardList CUIDLL$, SCREEN1, "FModelessDlgProc", 2
  675.     AddToBillboardList CUIDLL$, SCREEN2, "FModelessDlgProc", 2
  676.     AddToBillboardList CUIDLL$, SCREEN3, "FModelessDlgProc", 1
  677.     AddToBillboardList CUIDLL$, SCREEN4, "FModelessDlgProc", 2
  678.     AddToBillboardList CUIDLL$, SCREEN5, "FModelessDlgProc", 2
  679.     AddToBillboardList CUIDLL$, SCREEN6, "FModelessDlgProc", 1
  680.     AddToBillboardList CUIDLL$, SCREEN7, "FModelessDlgProc", 1
  681.     AddToBillboardList CUIDLL$, SCREEN8, "FModelessDlgProc", 1
  682.  
  683. ''Calculate where to place copy gauge so that it is below the
  684. ''splash screens and centered regardless of display. Don't need
  685. ''to calculate width, because a -1 automatically centers gauge
  686. ''horizontally.
  687. ''(look at GetDialogBaseUnits for formula)
  688.     ht% = GetScreenHeight()
  689.     htunit% = ((GetDialogBaseUnits() AND &HFFFF0000))/&HFFFF
  690.     SetCopyGaugePosition -1, (8*((ht*3)/4))/htunit
  691.  
  692.     CopyFilesInCopyList
  693.  
  694. '*** Update registration database for drag and drop
  695. '***
  696. '$IFDEF REG_DB_ENABLED
  697.     CreateRegKeyValue "Frame", "Frame"
  698.     CreateRegKeyValue "Frame\shell\print\ddeexec", "[FileOpen(%1)][FilePrint()]"
  699.     CreateRegKeyValue "Frame\shell\print\ddeexec\topic", "system"
  700.     CreateRegKeyValue "Frame\shell\print\ddeexec\application", "Frame"
  701.     IF (GetListItem(CHECKSTATES$, BINFILES) = "ON") THEN
  702.         CreateRegKeyValue "Frame\shell\print\command", MakePath(DEST$,"frame.exe")
  703.         CreateRegKeyValue "Frame\shell\open\command", MakePath(DEST$,"frame.exe")
  704.     ELSE
  705.         CreateRegKeyValue "Frame\shell\print\command", MakePath(NETPATH$,"frame.exe")
  706.         CreateRegKeyValue "Frame\shell\open\command", MakePath(NETPATH$,"frame.exe")
  707.     END IF
  708.     CreateRegKeyValue "Frame\shell\open\ddeexec", "[FileOpen(%1)]"
  709.     CreateRegKeyValue "Frame\shell\open\ddeexec\topic", "system"
  710.     CreateRegKeyValue "Frame\shell\open\ddeexec\application", "Frame"
  711.  
  712.     IF (DoesRegKeyExist(".DOC") = 0) THEN
  713.         CreateRegKeyValue ".DOC", "Frame"
  714.     END IF
  715.     IF (DoesRegKeyExist(".FRM") = 0) THEN
  716.         CreateRegKeyValue ".FRM", "Frame"
  717.     END IF
  718.     IF (DoesRegKeyExist(".BK") = 0) THEN
  719.         CreateRegKeyValue ".BK", "Frame"
  720.     END IF
  721. '$ENDIF
  722.  
  723.  
  724. '**** Put username and registration number in fmres.dll. Also whether or
  725. '**** not if demomaker.
  726.  
  727.     FMRESPATH$ = MakePath(DEST$,"fminit\fmres.dll")
  728.     IF (DEMO) THEN
  729.         stat% = FMUpdateRes((FMRESPATH$),(USERNAME$),(COMPANY$),(REGNUM$),1)
  730.     ELSE
  731.         stat% = FMUpdateRes((FMRESPATH$),(USERNAME$),(COMPANY$),(REGNUM$),0)
  732.     END IF
  733.     IF (stat% <> 0) THEN
  734.         ERROR STFQUIT
  735.     END IF
  736.  
  737. '**** Create Program Group and update WIN.INI.
  738. '**** If user did not install binaries, then use network path for path
  739. '**** for executable file for program item.
  740. '**** If user installed initialization files, then FMHome should be set
  741. '**** to local path, else set to network path.
  742.  
  743.     IF (PRODUCT$ = "1") THEN
  744.         IF (NOT INCRINSTALL) THEN
  745.             CreateProgmanGroup PROGGROUP$, "", cmoNone
  746.         END IF
  747.         IF (GetListItem(CHECKSTATES$, BINFILES) = "ON") THEN
  748.             CreateProgmanItem PROGGROUP$, MAKERITEM$, MakePath(DEST$,"frame.exe -maker"), "", cmoOverwrite
  749. 'gpk - changed maker.exe with frame.exe -maker.
  750.             whichpath$ = DEST$
  751.         ELSE
  752.             CreateProgmanItem PROGGROUP$, MAKERITEM$, MakePath(NETPATH$,"frame.exe -maker"), "", cmoOverwrite
  753. 'gpk
  754.             whichpath$ = NETPATH$
  755.         END IF
  756.         IF (GetListItem(CHECKSTATES$, INITFILES) = "ON") THEN
  757.             CreateIniKeyValue "WIN.INI", "FrameMaker4", "FMHome", DEST$, cmoAll
  758.         ELSE
  759.             CreateIniKeyValue "WIN.INI", "FrameMaker4", "FMHome", NETPATH$, cmoAll
  760.         END IF
  761.         CreateIniKeyValue "WIN.INI", "FrameMaker4", "IniFile", "maker.ini", cmoAll
  762.         ShowProgmanGroup  PROGGROUP$, 1, cmoNone
  763.  
  764.     ELSE    'Builder
  765.         IF (NOT INCRINSTALL) THEN
  766.             CreateProgmanGroup PROGGROUP$, "", cmoNone
  767.         END IF
  768.         IF (GetListItem(CHECKSTATES$, BINFILES) = "ON") THEN
  769.             CreateProgmanItem PROGGROUP$, BUILDERITEM$, MakePath(DEST$,"frame.exe -builder"), "", cmoOverwrite
  770. 'gpk -changed builder.exe with frame.exe -builder.
  771.             whichpath$ = DEST$
  772.         ELSE
  773.             CreateProgmanItem PROGGROUP$, BUILDERITEM$, MakePath(NETPATH$,"frame.exe -builder"), "", cmoOverwrite
  774. 'gpk -changed builder.exe with frame.exe -builder.
  775.             whichpath$ = NETPATH$
  776.         END IF
  777.         IF (GetListItem(CHECKSTATES$, INITFILES) = "ON") THEN
  778.             CreateIniKeyValue "WIN.INI", "FrameBuilder", "FMHome", DEST$, cmoOverwrite
  779.         ELSE
  780.             CreateIniKeyValue "WIN.INI", "FrameBuilder", "FMHome", NETPATH$, cmoOverwrite
  781.         END IF
  782.         CreateIniKeyValue "WIN.INI", "FrameBuilder", "IniFile", "builder.ini", cmoAll
  783.         ShowProgmanGroup  PROGGROUP$, 1, cmoNone
  784.     END IF    'Maker or Builder
  785.  
  786. ''**** Add extensions to win.ini
  787.     keystring$ = MakePath(whichpath$,"frame.exe") + " ^.doc"
  788.     IF (DoesIniKeyExist("WIN.INI", "Extensions", "doc") = 1) THEN
  789.         pos1% = INSTR(GetIniKeyString("WIN.INI", "Extensions", "doc"), "maker.exe")
  790.         pos2% = INSTR(GetIniKeyString("WIN.INI", "Extensions", "doc"), "frame.exe")
  791.         IF ((pos1% > 1) OR (pos2% > 1)) THEN
  792.             CreateIniKeyValue "WIN.INI", "Extensions", "doc", keystring$, cmoOverwrite
  793.         END IF
  794.     ELSE 
  795.         CreateIniKeyValue "WIN.INI", "Extensions", "doc", keystring$, cmoOverwrite
  796.     END IF
  797.     keystring$ = MakePath(whichpath$,"frame.exe") + " ^.bk"
  798.     IF (DoesIniKeyExist("WIN.INI", "Extensions", "bk") = 1) THEN
  799.         pos1% = INSTR(GetIniKeyString("WIN.INI", "Extensions", "bk"), "maker.exe")
  800.         pos2% = INSTR(GetIniKeyString("WIN.INI", "Extensions", "bk"), "frame.exe")
  801.         IF ((pos1% > 1) OR (pos2% > 1)) THEN
  802.             CreateIniKeyValue "WIN.INI", "Extensions", "bk", keystring$, cmoOverwrite
  803.         END IF
  804.     ELSE 
  805.         CreateIniKeyValue "WIN.INI", "Extensions", "bk", keystring$, cmoOverwrite
  806.     END IF
  807.     keystring$ = MakePath(whichpath$,"frame.exe") + " ^.frm"
  808.     IF (DoesIniKeyExist("WIN.INI", "Extensions", "frm") = 1) THEN
  809.         pos1% = INSTR(GetIniKeyString("WIN.INI", "Extensions", "frm"), "maker.exe")
  810.         pos2% = INSTR(GetIniKeyString("WIN.INI", "Extensions", "frm"), "frame.exe")
  811.         IF ((pos1% > 1) OR (pos2% > 1)) THEN
  812.             CreateIniKeyValue "WIN.INI", "Extensions", "frm", keystring$, cmoOverwrite
  813.         END IF
  814.     ELSE 
  815.         CreateIniKeyValue "WIN.INI", "Extensions", "frm", keystring$, cmoOverwrite
  816.     END IF
  817.  
  818. '** Copy fminit\fmfont.ttf to windows system directory
  819. '** Copy fmdbms.dll and fmheap.dll to windows system directory -gpk 
  820.     winsysdir$ = GetWindowsSysDir()
  821.     CopyFile MakePath(NETPATH$,"fminit\fmfont.ttf"),MakePath(winsysdir,"fmfont.ttf"),cmoOverwrite,0
  822.     CopyFile MakePath(NETPATH$,"fmdbms.dll"),MakePath(winsysdir,"fmdbms.dll"),cmoOverwrite,0
  823.     CopyFile MakePath(NETPATH$,"fmheap.dll"),MakePath(winsysdir,"fmheap.dll"),cmoOverwrite,0
  824.  
  825. '*** Update maker.ini
  826. '***
  827.     UpdateMakerIni
  828.  
  829.  
  830.  
  831.  
  832. '*** Update [Filters] section with the filters installed on network or
  833. '*** locally.
  834.         MAKERINI = MakePath(DEST$, "maker.ini")
  835.         IF (GetListItem(CHECKSTATES$, FILTERFILES) = "ON") THEN
  836.             filterpath$ = MakePath(DEST, "filters")
  837.         ELSE
  838.             filterpath$ = MakePath(NETPATH,"filters")
  839.         END IF
  840.         IF (DoesIniSectionExist(MAKERINI, "Filters") = 1) THEN
  841.             RemoveIniSection MAKERINI, "Filters", cmoNone
  842.         END IF
  843.         FOR i% = 0 TO (NUMENTRIES-1) STEP 1
  844.             IF (MAPTABLE(i) = "frame.exe") THEN
  845.                 tmpfile$ = MakePath(NETPATH, "frame.exe")
  846.             ELSE
  847.                 tmpfile$ = MakePath(filterpath, MAPTABLE(i))
  848.             END IF
  849.             IF (DoesFileExist(tmpfile, femExists) = 1) THEN
  850.                 CreateIniKeyValue MAKERINI, "Filters", FILTTABLE(i).id, FILTTABLE(i).entry, cmoVital 
  851.             END IF
  852.         NEXT i
  853.  
  854.  
  855. 'Copy over some user set preferences from the old maker.ini to the
  856. 'new maker.ini
  857.     IF (MAKER_30) THEN
  858.         ModifyMakerIni
  859.     END IF
  860.  
  861.     CloseLogFile
  862.  
  863. QUIT:
  864.     ON ERROR GOTO ERRQUIT
  865.  
  866.     IF ERR = 0 THEN
  867.         IF (PRODUCT = "2") THEN
  868.             dlg% = BLDEXITSUCCESS
  869.         ELSE
  870.             dlg% = EXITSUCCESS
  871.         END IF
  872.         ''Remove log file if installation was successful.
  873.         RemoveFile MakePath(DEST$,LOGFILE$), cmoNone
  874.  
  875.     ELSEIF ERR = STFQUIT THEN
  876.         dlg% = EXITQUIT
  877.     ELSE
  878.         dlg% = EXITFAILURE
  879.     END IF
  880. QUITL1:
  881.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  882.     IF sz$ = "REACTIVATE" THEN
  883.         GOTO QUITL1
  884.     END IF
  885.     UIPop 1
  886.  
  887.     END
  888.  
  889. ERRQUIT:
  890.     i% = DoMsgBox(ERRMSG$, ERRTITLE$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  891.     END
  892.  
  893.  
  894. GETPATH:
  895.     SetSymbolValue "EditTextIn", DEST$
  896.     SetSymbolValue "EditFocus", "END"
  897. GETPATHL1:
  898.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", PATHHELP, HELPPROC$)
  899.  
  900.     IF sz$ = "CONTINUE" THEN
  901.         CHANGEDPATH = FMTRUE
  902.         olddest$ = DEST$
  903.         DEST$ = GetSymbolValue("EditTextOut")
  904.  
  905.     ''Validate new path.
  906.         IF IsDirWritable(DEST$) = 0 THEN
  907.             GOSUB BADPATH
  908.             GOTO GETPATHL1
  909.         END IF
  910.         UIPop 1
  911.  
  912.     ''Truncate display if too long
  913.         IF LEN(DEST$) > 32 THEN
  914.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  915.         ELSE
  916.             ReplaceListItem DRIVETEXT$, 7, DEST$
  917.         END IF
  918.  
  919.     ''Recalc if path changed.
  920.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  921.         ''Installing over FM 3.0?
  922.             IF (FMInstalled(DEST$, FM30) = 1) THEN
  923.                 DISPLAYMSG = FMTRUE
  924.             ELSEIF (FMInstalled(DEST$, FM40) = 0) AND (INCRINSTALL) THEN
  925.                 INCRINSTALL = FMFALSE
  926.                 FOR i% = 1 TO NUMOPTIONS STEP 1
  927.                     ReplaceListItem CHECKSTATES$, i%, "ON"
  928.                 NEXT i%
  929.             END IF
  930.             RecalcPath
  931.             SetDriveStatus
  932.         ELSE
  933.             IF (FMInstalled(DEST$, FM30) = 2) THEN
  934.                 DISPLAYMSG = FMFALSE
  935.             END IF
  936.         END IF
  937.  
  938.         olddest$ = ""
  939.         GOTO CUSTINST
  940.     ELSEIF sz$ = "REACTIVATE" THEN
  941.         RecalcPath
  942.         SetDriveStatus
  943.         GOTO GETPATHL1
  944.     ELSEIF sz$ = "EXIT" THEN
  945.         GOSUB ASKQUIT
  946.         GOTO GETPATHL1
  947.     ELSE
  948.         UIPop 1
  949.         GOTO CUSTINST
  950.     END IF
  951.  
  952.  
  953.  
  954. TOOBIG:
  955.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  956.     IF sz$ = "REACTIVATE" THEN
  957.         RecalcPath
  958.         SetDriveStatus
  959.         GOTO TOOBIG
  960.     END IF
  961.     UIPop 1
  962.     RETURN
  963.  
  964.  
  965.  
  966. BADPATH:
  967.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  968.     IF sz$ = "REACTIVATE" THEN
  969.         RecalcPath
  970.         SetDriveStatus
  971.         GOTO BADPATH
  972.     END IF
  973.     UIPop 1
  974.     RETURN
  975.  
  976.  
  977. WARNING:
  978.     sz$ = UIStartDlg(CUIDLL$, MAKER30, "FInfo0DlgProc", 0, "")
  979.     IF sz$ = "REACTIVATE" THEN
  980.     RecalcPath
  981.     SetDriveStatus
  982.     GOTO WARNING
  983.     END IF
  984.     UIPop 1
  985.     RETURN
  986.  
  987.  
  988. ASKQUIT:
  989.     sz$ = UIStartDlg(CUIDLL$, ASKEXIT, "FQuitDlgProc", 0, "")
  990.  
  991.     IF sz$ = "EXIT" THEN
  992.         UIPopAll
  993.         ERROR STFQUIT
  994.     ELSEIF sz$ = "REACTIVATE" THEN
  995.         GOTO ASKQUIT
  996.     ELSE
  997.         UIPop 1
  998.     END IF
  999.     RETURN
  1000.  
  1001.  
  1002. NONAME:
  1003.     sz$ = UIStartDlg(CUIDLL$, NAMEALERT, "FInfo0DlgProc", 0, "")
  1004.     IF sz$ = "REACTIVATE" THEN
  1005.         GOTO NONAME
  1006.     END IF
  1007.     UIPop 1
  1008.     RETURN
  1009.  
  1010. NOPCNAME:
  1011.     sz$ = UIStartDlg(CUIDLL$, PCNAMEALERT, "FInfo0DlgProc", 0, "")
  1012.     IF sz$ = "REACTIVATE" THEN
  1013.         GOTO NOPCNAME
  1014.     END IF
  1015.     UIPop 1
  1016.     RETURN
  1017.  
  1018. NOREG:
  1019.     sz$ = UIStartDlg(CUIDLL$, REGALERT, "FInfo0DlgProc", 0, "")
  1020.     IF sz$ = "REACTIVATE" THEN
  1021.         GOTO NOREG
  1022.     END IF
  1023.     UIPop 1
  1024.     RETURN
  1025.  
  1026. BADREG:
  1027.     sz$ = UIStartDlg(CUIDLL$, BADREGNUM, "FInfo0DlgProc", 0, "")
  1028.     IF sz$ = "REACTIVATE" THEN
  1029.         GOTO BADREG
  1030.     ENDIF
  1031.     UIPop 1
  1032.     RETURN
  1033.  
  1034. BADNPATH:
  1035.     sz$ = UIStartDlg(CUIDLL$, BADNETPATH, "FBadNetDlgProc", 0, "")
  1036.     IF sz$ = "REACTIVATE" THEN
  1037.         GOTO BADNPATH
  1038.     END IF
  1039.     ERROR STFQUIT
  1040.  
  1041. '**
  1042. '** Purpose:
  1043. '**     Adds the specified option files to the copy list.
  1044. '** Arguments:
  1045. '**     ftype%  - type of files to add, one of the following:
  1046. '**             BINFILES, INITFILES, DICTFILES, FILTERFILES,
  1047. '**                HELPFILES, SAMPLEFILES, CLIPARTFILES, TRAINFILES,
  1048. '**             TEMPLFILES, REQFILES
  1049. '** Returns:
  1050. '**     none.
  1051. '*************************************************************************
  1052. SUB AddOptFilesToCopyList (ftype%) STATIC
  1053.  
  1054.     IF ftype% = REQFILES THEN
  1055.         SrcDir$ = NETPATH$
  1056.         AddSectionFilesToCopyList "base", SrcDir$, DEST$
  1057.         SrcDir$ = ""
  1058.     ELSE
  1059.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  1060.         SrcDir$ = NETPATH$
  1061.         IF ftype% = BINFILES THEN
  1062.             IF (PRODUCT = "1") THEN
  1063.                 AddSectionFilesToCopyList "makerbin", SrcDir$, DEST$
  1064.             ELSE
  1065.                 AddSectionFilesToCopyList "builderbin", SrcDir$, DEST$
  1066.             END IF
  1067.         ELSEIF ftype% = INITFILES THEN
  1068.             AddSectionFilesToCopyList "init", SrcDir$, DEST$
  1069.             IF (LANGUIOPT = "2") THEN
  1070.                 AddSectionFilesToCopyList "ukcustom", SrcDir$, DEST$
  1071.             ELSE
  1072.                 AddSectionFilesToCopyList "uscustom", SrcDir$, DEST$
  1073.             END IF
  1074.         ELSEIF ftype% = DICTFILES THEN
  1075.             AddSectionFilesToCopyList "dictionaries", SrcDir$, DEST$
  1076.         ELSEIF ftype% = FILTERFILES THEN
  1077.             filterini% = 0
  1078.             FOR i% = 1 TO NUMFILTERS STEP 1
  1079.                 Filter$ = GetListItem(FILTLISTIN, i)
  1080.                 IF (GetIniKeyString(NETINI, "Filters", Filter$) = "Yes") THEN
  1081.                     AddSectionKeyFileToCopyList "filters", Filter$, SrcDir$, DEST$
  1082.                     IF (filterini = 0) THEN
  1083.                         AddSectionFilesToCopyList "filtini", SrcDir$, DEST$
  1084.                         filterini = 1
  1085.                     END IF
  1086.                 END IF
  1087.             NEXT i%
  1088.             IF (GetIniKeyString(NETINI,"Filters","BaseFilters") = "Yes") THEN
  1089.                 AddSectionFilesToCopyList "basefilters", SrcDir$, DEST$
  1090.             END IF
  1091.  
  1092.         ELSEIF ftype% = HELPFILES THEN
  1093.             AddSectionFilesToCopyList "help", SrcDir$, DEST$
  1094.         ELSEIF ftype% = SAMPLEFILES THEN
  1095.             IF (LANGUIOPT = "2") THEN
  1096.                 AddSectionFilesToCopyList "uksamples", SrcDir$, DEST$
  1097.             ELSE
  1098.                 AddSectionFilesToCopyList "ussamples", SrcDir$, DEST$
  1099.             END IF
  1100.         ELSEIF ftype% = CLIPARTFILES THEN
  1101.             AddSectionFilesToCopyList "clipart", SrcDir$, DEST$
  1102.         ELSEIF ftype% = TRAINFILES THEN
  1103.             IF (LANGUIOPT = "2") THEN
  1104.                 AddSectionFilesToCopyList "uktraining", SrcDir$, DEST$
  1105.             ELSE
  1106.                 AddSectionFilesToCopyList "ustraining", SrcDir$, DEST$
  1107.             END IF
  1108.         ELSEIF ftype% = TEMPLFILES THEN
  1109.             IF (LANGUIOPT = "2") THEN
  1110.                 AddSectionFilesToCopyList "uktemplates", SrcDir$, DEST$
  1111.             ELSE
  1112.                 AddSectionFilesToCopyList "ustemplates", SrcDir$, DEST$
  1113.             END IF
  1114.         END IF
  1115.         SrcDir$ = ""
  1116.     END IF
  1117.     END IF 'not reqfiles
  1118. END SUB
  1119.  
  1120.  
  1121. '**
  1122. '** Purpose:
  1123. '**     Recalculates disk space for the given option files and sets
  1124. '**     the status info symbol "StatusItemsText".
  1125. '** Arguments:
  1126. '**     ftype% - type of files to add, one of the following:
  1127. '**         BASEFILES, SAMPLEFILES, CLIPARTFILES, HELPFILES,
  1128. '**         TRAINFILES, DICTFILES, FILTERFILES, NETFILES
  1129. '** Returns:
  1130. '**     none.
  1131. '*************************************************************************
  1132. SUB RecalcOptFiles (ftype%) STATIC
  1133.     CursorSave% = ShowWaitCursor()
  1134.     ClearCopyList
  1135.     AddOptFilesToCopyList ftype%
  1136.  
  1137.     fExtra% = 0
  1138.     IF ftype% = REQFILES THEN
  1139.         ListSym$ = REQNEEDS$
  1140. '        IF GetListItem(CHECKSTATES$, BASEFILES) = "ON" THEN
  1141.             ''Add extra cost to Windows drive for ini/progman, etc.
  1142.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1143.             ReplaceListItem EXTRACOSTS$, ndrive%, "6144"
  1144.             fExtra% = 1
  1145. '        END IF
  1146.     ELSEIF ftype% = BINFILES THEN
  1147.         ListSym$ = BINNEEDS$
  1148.     ELSEIF ftype% = INITFILES THEN
  1149.         ListSym$ = INITNEEDS$
  1150.     ELSEIF ftype% = DICTFILES THEN
  1151.         ListSym$ = DICTNEEDS
  1152.     ELSEIF ftype% = FILTERFILES THEN
  1153.         ListSym$ = FILTERNEEDS$
  1154.     ELSEIF ftype% = HELPFILES THEN
  1155.         ListSym$ = HELPNEEDS$
  1156.     ELSEIF ftype% = SAMPLEFILES THEN
  1157.         ListSym$ = SAMPLENEEDS$
  1158.     ELSEIF ftype% = CLIPARTFILES THEN
  1159.         ListSym$ = CLIPARTNEEDS
  1160.     ELSEIF ftype% = TRAINFILES THEN
  1161.         ListSym$ = TRAINNEEDS$
  1162.     ELSEIF ftype% = TEMPLFILES THEN
  1163.         ListSym$ = TEMPLNEEDS$
  1164.     END IF
  1165.  
  1166.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  1167.  
  1168.     cost& = 0
  1169.     FOR i% = 1 TO 26 STEP 1
  1170.         cost& = cost& + VAL(GetListItem(ListSym$, i%))
  1171.     NEXT i%
  1172.  
  1173.     IF (ftype <> REQFILES) THEN
  1174.         ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  1175.     END IF
  1176.  
  1177.     IF StillNeed& > 0 THEN
  1178.         ReplaceListItem BIGLIST$, ftype%, "YES"
  1179.     ELSE
  1180.         ReplaceListItem BIGLIST$, ftype%, ""
  1181.     END IF
  1182.  
  1183.     IF fExtra% THEN
  1184.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  1185.     END IF
  1186.     RestoreCursor CursorSave%
  1187.     ListSym$ = ""
  1188. END SUB
  1189.  
  1190.  
  1191. '**
  1192. '** Purpose:
  1193. '**     Recalculates disk space and sets option status info according
  1194. '**     to the current destination path.
  1195. '** Arguments:
  1196. '**     none.
  1197. '** Returns:
  1198. '**     none.
  1199. '*************************************************************************
  1200. SUB RecalcPath STATIC
  1201.  
  1202.     CursorSave% = ShowWaitCursor()
  1203.     RecalcOptFiles REQFILES
  1204.     RecalcOptFiles BINFILES
  1205.     RecalcOptFiles INITFILES
  1206.     RecalcOptFiles DICTFILES
  1207.     RecalcOptFiles FILTERFILES
  1208.     RecalcOptFiles HELPFILES
  1209.     RecalcOptFiles SAMPLEFILES
  1210.     RecalcOptFiles CLIPARTFILES
  1211.     RecalcOptFiles TRAINFILES
  1212.     RecalcOptFiles TEMPLFILES
  1213.  
  1214.     RestoreCursor CursorSave%
  1215. END SUB
  1216.  
  1217.  
  1218. '**
  1219. '** Purpose:
  1220. '**     Sets drive status info according to latest disk space calcs.
  1221. '** Arguments:
  1222. '**     none.
  1223. '** Returns:
  1224. '**     none.
  1225. '*************************************************************************
  1226. SUB SetDriveStatus STATIC
  1227.  
  1228.     drive$ = MID$(DEST$, 1, 1)
  1229.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  1230.  
  1231. 'Have to split up to halfcost and totalcost, because cannot
  1232. 'have more than 256 chars on one line.
  1233.  
  1234.     halfcost& = VAL(GetListItem(REQNEEDS$, ndrive%)) + VAL(GetListItem(BINNEEDS$, ndrive%)) + VAL(GetListItem(INITNEEDS$, ndrive%)) + VAL(GetListItem(DICTNEEDS$, ndrive%)) + VAL(GetListItem(FILTERNEEDS$, ndrive%))
  1235.  
  1236.     othercost& = VAL(GetListItem(HELPNEEDS$, ndrive%)) + VAL(GetListItem(SAMPLENEEDS$, ndrive%)) + VAL(GetListItem(CLIPARTNEEDS$, ndrive%)) + VAL(GetListItem(TRAINNEEDS$, ndrive%)) + VAL(GetListItem(TEMPLNEEDS$, ndrive%))
  1237.  
  1238.     totalcost& = halfcost& + othercost& + LOGNEED
  1239.  
  1240.     free& = GetFreeSpaceForDrive(drive$)
  1241.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  1242.     ReplaceListItem DRIVETEXT$, 2, STR$(totalcost& / 1024) + " K"
  1243.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  1244.  
  1245.     IF drive$ = WINDRIVE$ THEN
  1246.         ReplaceListItem DRIVETEXT$, 4, ""
  1247.         ReplaceListItem DRIVETEXT$, 5, ""
  1248.         ReplaceListItem DRIVETEXT$, 6, ""
  1249.     ELSE
  1250.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  1251.  
  1252.         halfcost& = VAL(GetListItem(REQNEEDS$, ndrive%)) + VAL(GetListItem(BINNEEDS$, ndrive%)) + VAL(GetListItem(INITNEEDS$, ndrive%)) + VAL(GetListItem(DICTNEEDS$, ndrive%)) + VAL(GetListItem(FILTERNEEDS$, ndrive%))
  1253.  
  1254.         totalcost& = halfcost& + VAL(GetListItem(HELPNEEDS$, ndrive%)) + VAL(GetListItem(SAMPLENEEDS$, ndrive%)) + VAL(GetListItem(CLIPARTNEEDS$, ndrive%)) + VAL(GetListItem(TRAINNEEDS$, ndrive%)) + VAL(GetListItem(TEMPLNEEDS$, ndrive%))
  1255.  
  1256.         IF totalcost& = 0 THEN
  1257.             ReplaceListItem DRIVETEXT$, 4, ""
  1258.             ReplaceListItem DRIVETEXT$, 5, ""
  1259.             ReplaceListItem DRIVETEXT$, 6, ""
  1260.         ELSE
  1261.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  1262.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  1263.             ReplaceListItem DRIVETEXT$, 5, STR$(totalcost& / 1024) + " K"
  1264.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  1265.         END IF
  1266.     END IF
  1267. END SUB
  1268.  
  1269.  
  1270. '**
  1271. '** Purpose:
  1272. '**        Modifies the paths in maker.ini depending on what FMHome
  1273. '**        directory is set to and what options the user installed.
  1274. '** Arguments:
  1275. '**        none.
  1276. '** Returns:
  1277. '**        none.
  1278. '******************************************************************
  1279. SUB UpdateMakerIni STATIC
  1280.     IF (PRODUCT = "1") THEN
  1281.         inifile$ = MakePath(DEST$, "maker.ini")
  1282.         helppath$ = "\help\maker"
  1283.     ELSE
  1284.         inifile$ = MakePath(DEST$, "builder.ini")
  1285.         helppath$ = "\help\builder"
  1286.     END IF
  1287.     CreateIniKeyValue inifile$,"Frame","PCName",PCNAME,cmoOverwrite
  1288.     CreateIniKeyValue inifile$,"Directories","ReleaseNotes",NETPATH$,cmoOverwrite
  1289.     CreateIniKeyValue inifile$,"RecentlyVisitedFiles","0",NETPATH$+"\relnotes",cmoOverwrite
  1290.     IF (GetListItem(CHECKSTATES$, INITFILES) = "ON") THEN
  1291.         IF (GetListItem(CHECKSTATES$, HELPFILES) = "OFF") THEN
  1292.             CreateIniKeyValue inifile$,"Directories","HelpDir",NETPATH$+helppath$,cmoOverwrite
  1293.             CreateIniKeyValue inifile$,"Directories","OnlineManuals",NETPATH$+"\manuals",cmoOverwrite
  1294.             CreateIniKeyValue inifile$,"Files","FirstRunOpenDoc",NETPATH$+"\manuals\welcome",cmoOverwrite
  1295.             CreateIniKeyValue inifile$,"RecentlyVisitedFiles","1",NETPATH$+"\manuals\welcome",cmoOverwrite
  1296.         END IF
  1297.         IF (GetListItem(CHECKSTATES$, DICTFILES) = "OFF") THEN
  1298.             CreateIniKeyValue inifile$,"Directories","LanguageDir",NETPATH$+"\dict",cmoOverwrite
  1299.         END IF
  1300.         IF (GetListItem(CHECKSTATES$, TEMPLFILES) = "OFF") THEN
  1301.             CreateIniKeyValue inifile$,"Directories","TemplateDir",NETPATH$+"\template",cmoOverwrite
  1302.             CreateIniKeyValue inifile$,"Directories","Templates",NETPATH$+"\template",cmoOverwrite
  1303.         END IF
  1304.         IF (GetListItem(CHECKSTATES$, FILTERFILES) = "OFF") THEN
  1305.             CreateIniKeyValue inifile$,"Directories","FilterDllDir",NETPATH$+"\filters",cmoOverwrite
  1306.         END IF
  1307.         IF (GetListItem(CHECKSTATES$, SAMPLEFILES) = "OFF") THEN
  1308.             CreateIniKeyValue inifile$,"Directories","Samples",NETPATH$+"\samples",cmoOverwrite
  1309.             CreateIniKeyValue inifile$,"RecentlyVisitedFiles","2",NETPATH$+"\samples\demodoc",cmoOverwrite
  1310.         END IF
  1311.         IF (GetListItem(CHECKSTATES$, CLIPARTFILES) = "OFF") THEN
  1312.             CreateIniKeyValue inifile$,"Directories","Clipart",NETPATH$+"\clipart",cmoOverwrite
  1313.         END IF
  1314.     
  1315.     ELSE    ''FMHome is network dir
  1316.  
  1317.         CreateIniKeyValue inifile$,"Files","Resources",DEST$+"\fminit\fmres.dll",cmoOverwrite
  1318.         IF (GetListItem(CHECKSTATES$, HELPFILES) = "ON") THEN
  1319.             CreateIniKeyValue inifile$,"Directories","HelpDir",DEST$+helppath$,cmoOverwrite
  1320.             CreateIniKeyValue inifile$,"Directories","OnlineManuals",DEST$+"\manuals",cmoOverwrite
  1321.             CreateIniKeyValue inifile$,"Files","FirstRunOpenDoc",DEST$+"\manuals\welcome",cmoOverwrite
  1322.             CreateIniKeyValue inifile$,"RecentlyVisitedFiles","1",DEST$+"\manuals\welcome",cmoOverwrite
  1323.         END IF
  1324.         IF (GetListItem(CHECKSTATES$, DICTFILES) = "ON") THEN
  1325.             CreateIniKeyValue inifile$,"Directories","LanguageDir",DEST$+"\dict",cmoOverwrite
  1326.         END IF
  1327.         IF (GetListItem(CHECKSTATES$, TEMPLFILES) = "ON") THEN
  1328.             CreateIniKeyValue inifile$,"Directories","TemplateDir",DEST$+"\template",cmoOverwrite
  1329.             CreateIniKeyValue inifile$,"Directories","Templates",DEST$+"\template",cmoOverwrite
  1330.         END IF
  1331.         IF (GetListItem(CHECKSTATES$, FILTERFILES) = "ON") THEN
  1332.             CreateIniKeyValue inifile$,"Directories","FilterDllDir",DEST$+"\filters",cmoOverwrite
  1333.         END IF
  1334.         IF (GetListItem(CHECKSTATES$, SAMPLEFILES) = "ON") THEN
  1335.             CreateIniKeyValue inifile$,"Directories","Samples",DEST$+"\samples",cmoOverwrite
  1336.             CreateIniKeyValue inifile$,"RecentlyVisitedFiles","2",DEST$+"\samples\demodoc",cmoOverwrite
  1337.         END IF
  1338.         IF (GetListItem(CHECKSTATES$, CLIPARTFILES) = "ON") THEN
  1339.             CreateIniKeyValue inifile$,"Directories","Clipart",DEST$+"\clipart",cmoOverwrite
  1340.         END IF
  1341.     END IF
  1342. END SUB
  1343.  
  1344.         
  1345.  
  1346. '**
  1347. '** Purpose:
  1348. '**    Copies some user set preferences in 3.0 maker.ini
  1349. '**    to 4.0 maker.ini.
  1350. '** Arguments:
  1351. '**    none.
  1352. '** Returns:
  1353. '**    none.
  1354. '******************************************************************
  1355. SUB ModifyMakerIni STATIC
  1356.  
  1357.     Maker30Ini$ = MakePath(DEST$, "makerini.bak")
  1358.     CreateIniKeyValue MAKERINI,"Frame","PCName",GetIniKeyString(Maker30Ini$,"Frame","PCName"),cmoOverwrite
  1359.     CreateIniKeyValue MAKERINI,"Preferences","BackupOnSave",GetIniKeyString(Maker30Ini$,"Preferences","BackupOnSave"),cmoOverwrite
  1360.     CreateIniKeyValue MAKERINI,"Preferences","AutoSave",GetIniKeyString(Maker30Ini$,"Preferences","AutoSave"),cmoOverwrite
  1361.     CreateIniKeyValue MAKERINI,"Preferences","ShowErrors",GetIniKeyString(Maker30Ini$,"Preferences","ShowErrors"),cmoOverwrite
  1362.     CreateIniKeyValue MAKERINI,"Preferences","GreekSize",GetIniKeyString(Maker30Ini$,"Preferences","GreekSize"),cmoOverwrite
  1363.     CreateIniKeyValue MAKERINI,"Preferences","FMImage",GetIniKeyString(Maker30Ini$,"Preferences","FMImage"),cmoOverwrite
  1364.     CreateIniKeyValue MAKERINI,"Preferences","NetworkLock",GetIniKeyString(Maker30Ini$,"Preferences","NetworkLock"),cmoOverwrite
  1365.     CreateIniKeyValue MAKERINI,"Preferences","Zoom",GetIniKeyString(Maker30Ini$,"Preferences","Zoom"),cmoOverwrite
  1366.     CreateIniKeyValue MAKERINI,"Preferences","PenWidths",GetIniKeyString(Maker30Ini$,"Preferences","PenWidths"),cmoOverwrite
  1367.     CreateIniKeyValue MAKERINI,"Preferences","ClipboardFormatsPriorities",GetIniKeyString(Maker30Ini$,"Preferences","ClipboardFormatsPriorities"),cmoOverwrite
  1368.     CreateIniKeyValue MAKERINI,"Preferences","MonitorSize",GetIniKeyString(Maker30Ini$,"Preferences","MonitorSize"),cmoOverwrite
  1369.     CreateIniKeyValue MAKERINI,"Fonts","Sizes",GetIniKeyString(Maker30Ini$,"Fonts","Sizes"),cmoOverwrite
  1370.     CreateIniKeyValue MAKERINI,"Fonts","Angles",GetIniKeyString(Maker30Ini$,"Fonts","Angles"),cmoOverwrite
  1371.     CreateIniKeyValue MAKERINI,"Fonts","Variations",GetIniKeyString(Maker30Ini$,"Fonts","Variations"),cmoOverwrite
  1372.     CreateIniKeyValue MAKERINI,"Fonts","Weights",GetIniKeyString(Maker30Ini$,"Fonts","Weights"),cmoOverwrite
  1373.     CreateIniKeyValue MAKERINI,"Fonts","DefaultSize",GetIniKeyString(Maker30Ini$,"Fonts","DefaultSize"),cmoOverwrite
  1374.     CreateIniKeyValue MAKERINI,"Fonts","DefaultFamily",GetIniKeyString(Maker30Ini$,"Fonts","DefaultFamily"),cmoOverwrite
  1375.     CreateIniKeyValue MAKERINI,"Fonts","DefaultAngle",GetIniKeyString(Maker30Ini$,"Fonts","DefaultAngle"),cmoOverwrite
  1376.     CreateIniKeyValue MAKERINI,"Fonts","DefaultVariation",GetIniKeyString(Maker30Ini$,"Fonts","DefaultVariation"),cmoOverwrite
  1377.     CreateIniKeyValue MAKERINI,"Fonts","DefaultWeight",GetIniKeyString(Maker30Ini$,"Fonts","DefaultWeight"),cmoOverwrite
  1378.     CreateIniKeyValue MAKERINI,"Fonts","MathFamily",GetIniKeyString(Maker30Ini$,"Fonts","MathFamily"),cmoOverwrite
  1379.     CreateIniKeyValue MAKERINI,"Fonts","NonTextFamilies",GetIniKeyString(Maker30Ini$,"Fonts","NonTextFamilies"),cmoOverwrite
  1380.     CreateIniKeyValue MAKERINI,"Files","UserDictionary",GetIniKeyString(Maker30Ini$,"Files","UserDictionary"),cmoOverwrite
  1381.     CreateIniKeyValue MAKERINI,"Files","SiteDictionary",GetIniKeyString(Maker30Ini$,"Files","SiteDictionary"),cmoOverwrite
  1382. END SUB
  1383.  
  1384.  
  1385. '**
  1386. '** Purpose:
  1387. '**        Checks if path is a valid maker or builder network path. Valid
  1388. '**        if maker.ini and maker.exe exists or builder.ini and builder.exe
  1389. '**        exists. Uses path in the global variable NETPATH$.
  1390. '**        Sets the following global variables:
  1391. '**        PRODUCT$ = Set to "1" if only maker fmhome. Set to "2" if
  1392. '**                   only builder fmhome.
  1393. '**        BOTHPROD&= Set to true if both maker and builder exist in fmhome.
  1394. '** Arguments:
  1395. '**    none.
  1396. '** Returns:
  1397. '**        1 = path is valid
  1398. '**        0 = path is not valid
  1399. '******************************************************************
  1400. FUNCTION ValidNetPath() STATIC AS INTEGER
  1401.     makerexists& = FMFALSE
  1402.     builderexists& = FMFALSE
  1403.     IF ((DoesFileExist(MakePath(NETPATH,"maker.ini"), femExists) = 1) AND (DoesFileExist(MakePath(NETPATH,"frame.exe"),femExists) = 1)) THEN
  1404. ' gpk - changed maker.exe to frame.exe
  1405.     makerexists& = FMTRUE
  1406.     END IF
  1407.     IF ((DoesFileExist(MakePath(NETPATH,"builder.ini"),femExists) = 1) AND (DoesFileExist(MakePath(NETPATH,"frame.exe"),femExists) = 1)) THEN
  1408. ' gpk - changed builder.exe to frame.exe
  1409.     builderexists& = FMTRUE
  1410.     END IF
  1411.     IF (makerexists AND builderexists) THEN
  1412.     BOTHPROD = FMTRUE
  1413.     ValidNetPath = 1
  1414.     ELSEIF (makerexists) THEN 
  1415.     PRODUCT = "1"
  1416.     ValidNetPath = 1
  1417.     ELSEIF (builderexists) THEN 
  1418.     PRODUCT = "2"
  1419.     ValidNetPath = 1
  1420.     ELSE
  1421.     ValidNetPath = 0
  1422.     END IF
  1423. END FUNCTION
  1424.  
  1425.  
  1426.  
  1427.  
  1428. '**
  1429. '** Purpose:
  1430. '**     Checks if FrameMaker is already installed in the
  1431. '**    specified directory. For our purposes, FrameMaker is
  1432. '**    considered installed if:
  1433. '**        a) maker.exe exists in the directory.
  1434. '**        b) The FMHome field in WIN.INI is that directory.
  1435. '** Arguments:
  1436. '**    makerDir$ - directory name
  1437. '**    version% - FrameMaker version to check for (3 or 4)
  1438. '** Return Value:
  1439. '**    Return 1 if FrameMaker is already installed.
  1440. '**    Otherwise return 0.
  1441. '******************************************************************
  1442. FUNCTION FMInstalled (makerDir$, version%) STATIC AS INTEGER
  1443.     IniStat& = FMFALSE
  1444.     IF (version% = 3)  THEN
  1445.      section$ = "FrameMaker3.00"
  1446.     IF (DoesFileExist(MakePath(makerDir$,"maker.ini"), femExists) = 1) THEN
  1447.         tmp$ = GetIniKeyString(MakePath(makerDir$,"maker.ini"),"FrameMaker","Version")
  1448.         print "version = ";tmp$
  1449.         IF (GetIniKeyString(MakePath(makerDir$,"maker.ini"),"FrameMaker","Version") = "3.00") OR (GetIniKeyString(MakePath(makerDir$,"maker.ini"),"FrameMaker","Version") = "3.01") THEN
  1450.         IniStat& = FMTRUE
  1451.         END IF
  1452.     END IF
  1453.     ELSE
  1454.     section$ = "FrameMaker4"
  1455.     IF (DoesFileExist(MakePath(makerDir$,"maker.ini"), femExists) = 1) THEN
  1456.         IF (GetIniKeyString(MakePath(makerDir$,"maker.ini"),"FrameMaker","Version") = "4.0B1c") THEN
  1457.         IniStat& = FMTRUE
  1458.         END IF
  1459.     END IF
  1460.     END IF
  1461.     IF (DoesFileExist(MakePath(makerDir$,"frame.exe"), femExists) = 1) AND (IniStat) THEN
  1462. 'gpk - changed maker.exe to frame.exe
  1463.     IF (DoesIniSectionExist("WIN.INI", section$) = 1) THEN    
  1464.         fmhome$ = GetIniKeyString("WIN.INI", section$, "FMHome")
  1465.          ufmhome$ = UCASE$(fmhome$)
  1466.         IF (ufmhome$ = makerDir$) THEN
  1467.         FMInstalled = 1
  1468.         ELSE
  1469.         FMInstalled = 0
  1470.         END IF
  1471.     ELSE
  1472.         FMInstalled = 0
  1473.     END IF
  1474.     ELSE
  1475.     FMInstalled = 0
  1476.     END IF
  1477. END FUNCTION
  1478.  
  1479.  
  1480. '**
  1481. '** Purpose:
  1482. '**     Appends a file name to the end of a directory path,
  1483. '**     inserting a backslash character as needed.
  1484. '** Arguments:
  1485. '**     szDir$  - full directory path (with optional ending "\")
  1486. '**     szFile$ - filename to append to directory
  1487. '** Returns:
  1488. '**     Resulting fully qualified path name.
  1489. '*************************************************************************
  1490. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1491.     IF szDir$ = "" THEN
  1492.         MakePath = szFile$
  1493.     ELSEIF szFile$ = "" THEN
  1494.         MakePath = szDir$
  1495.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1496.         MakePath = szDir$ + szFile$
  1497.     ELSE
  1498.         MakePath = szDir$ + "\" + szFile$
  1499.     END IF
  1500. END FUNCTION
  1501.  
  1502.  
  1503.