home *** CD-ROM | disk | FTP | other *** search
/ Anne Hooper's Ultimate Sex Guide / DKMMTUSG.iso / dksetup / dksetup.mst < prev    next >
Text File  |  1995-09-04  |  21KB  |  581 lines

  1. ''$DEFINE DEBUG
  2. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3. '   TUSG (UK)
  4. '
  5. '   uses VforW & Wing
  6.  
  7. '
  8. '   18/08/95    rc and this have no min install. Changed dlg boxes custom,
  9. '                custom help and speed
  10. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  11.  
  12. '18/08/95 Register notes most recent lang used
  13. '11/08/95 Register created using inf file
  14. '26/07/95 Uninstall code added
  15. '07/07/95 Correct dkgen.inc so unregisters use of ctl3d
  16. '04/07/95 Make sure files in bin section of inf file 'always' overwrite
  17. '28/07/95 Ini file not created for minimum install, uses file provided in dkcode
  18. '27/06/95 Test for directory names max 8 chars
  19. '26/06/95 For minimum install, ini file is now not installed
  20. '19/06/95 Moved test for cirrus drivers to mst file as only applies to sampler
  21. '05/06/95 Fonts installed on users machine
  22. '01/06/95 No choice about adding icon to prog man, altered dkgen.inc & rc file
  23. '            (custom, customhelp & speed dlg boxes need changing)
  24. '22/05/95 Code for bundling with sampler
  25. '22/05/95 Large readme need Write (will need to change dlg box in rc file)
  26. '15/05/95 No warning that directory does not exist
  27. '03/05/95 Ini file put in executable directory rather than Windows dir to stop
  28. '            clash with foreign products with same name files
  29.  
  30.  
  31. '$INCLUDE 'dkgen.inc'
  32.  
  33.  
  34. 'IF WITH SAMPLER ( add to .inf & dkcode ) + see add to prog man below
  35. 'CONST SAMPLER_PATH = "SAMPLER"
  36. 'CONST APPLICATION_MENU_FILE = "custmenu.exe"
  37. 'CONST APPLICATION_EXE2_FILE = "dksd2pc.exe"
  38. 'DECLARE FUNCTION TestForCirrus LIB "dkutils.dll" () As INTEGER
  39.  
  40.  
  41. 'IF USING SPECIFIC FONTS
  42. 'DECLARE FUNCTION InstallFont LIB "dkutils.dll" (szFont$) AS INTEGER
  43. 'DECLARE SUB UpdateFonts()
  44.  
  45. ' Uninstall icon
  46. CONST STR_UNINSTALL = "DKMM Uninstall"
  47. CONST LANG_DLL = "Unlang.eng"     'will use as default if can't find dll to match window lang
  48.  
  49. ' Paths and INI stuff
  50. CONST APPLICATION_INI_FILE = "tusg.ini"
  51. CONST APPLICATION_EXE_FILE = "tusg.exe"
  52. CONST APPLICATION_PENGE_FILE = "tusg.png"
  53.  
  54. CONST INI_FILE_SOURCE = "AppPath" ' OR  "WinPath"
  55. CONST EDITOR_EXE =  "write.exe " 'OR "notepad.exe "
  56.  
  57. ' Language dependant strings
  58. CONST APPLICATION_README_FILE = "readme.wri"
  59. CONST STR_README = "Anne Hooper's Ultimate Sex Guide Read Me"
  60. CONST ORDER_FILE = "order.wri"
  61. CONST STR_ORDER = "Ordering Information"
  62. CONST STR_MSGCAPTION = "Anne Hooper's Ultimate Sex Guide Setup"
  63. CONST STR_PRODUCTNAME = "Anne Hooper's Ultimate Sex Guide"
  64. CONST DEFAULT_INSTALL_PATH = "\DKMM\TUSG"
  65.  
  66.  
  67. DECLARE SUB CreateReg()
  68. DECLARE SUB Install()
  69. DECLARE SUB AddFilesToCopyList(szInstallType$)
  70. DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
  71. DECLARE FUNCTION DeleteFiles LIB "dkutils.dll" (szDiffPath$, szProdName$, szDKREgIni$) AS INTEGER
  72. DECLARE FUNCTION DeleteDir LIB "dkutils.dll" (szDiffPath$) AS INTEGER
  73. DECLARE FUNCTION DeleteSection LIB "dkutils.dll" (szProdName$, szDKREgIni$) AS INTEGER
  74.  
  75.  
  76. Init:
  77.    Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
  78.  
  79.  
  80. WelcomeDlg:
  81.     if Welcome() = NAV_BACK then
  82.         ' Don nothing - cant go back
  83.     end if
  84.  
  85.  
  86.     if TestSystem() = NAV_BACK then
  87.         goto WelcomeDlg
  88.     end if
  89.  
  90. '    dButton = DoMsgBox( "Minimum install disabled", STR_MSGCAPTION, MB_OK)
  91.  
  92. 'IF WITH SAMPLER
  93. 'TestCirrus:
  94. '    if TestForCirrus() = 1 then
  95. '        dButton = DoMsgBox(STR_CIRRUS, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  96. '    end if
  97.  
  98. 'IF EARLIER PRODS WITH NO SAMPLER
  99. '    UpdateADPCMDrivers
  100.  
  101.  
  102. ExpressCustomDlg:
  103.     ' defaults to Express
  104.     'if szExpressCustomChoice = "EXPRESS" then
  105.     '    SetSymbolValue "RadioDefault", "1"
  106.     'else
  107.     '    SetSymbolValue "RadioDefault", "1"
  108.     'end if
  109.  
  110. ECDlgLoop:
  111.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_SPEED, "FRadioDlgProc", IDD_WHIZZHELP, PROC_HELP)
  112.  
  113.     select case szButton
  114.     case "REACTIVATE"
  115.         goto ECDlgLoop
  116.     case "BACK"
  117.         UIPop 1
  118.         goto WelcomeDlg
  119.     case "CONTINUE" ' Install
  120.         UIPop 1
  121.         if GetSymbolValue("ButtonChecked") = "1" then
  122.             szExpressCustomChoice = "EXPRESS"
  123.             goto ExpressInstallLoop
  124.         else
  125.             szExpressCustomChoice = "CUSTOM"
  126.             goto CustomInstallLoop
  127.         end if
  128.     case "EXIT"
  129.         AskQuit
  130.         goto ECDlgLoop
  131.     end select
  132.  
  133.  
  134. CustomInstallLoop:
  135. GetPathDlg:
  136.     SetSymbolValue "EditTextIn", szDestPath
  137.     szOldDestPath = szDestPath
  138.     SetSymbolValue "EditFocus", "ALL"
  139.  
  140. GetPathDlgLoop:
  141.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_DESTPATH, "FEditDlgProc", IDD_PATHHELP, PROC_HELP)
  142.  
  143.     select case szButton
  144.     case "REACTIVATE"
  145.         goto GetPathDlgLoop
  146.  
  147.     case "BACK"
  148.         UIPop 1
  149.         szDestPath = szOldDestPath
  150.         goto ECDlgLoop
  151.  
  152.     case "CONTINUE"
  153.         UIPop 1
  154.         szDestPath = GetSymbolValue("EditTextOut")
  155.  
  156.         if mid$(szDestPath, 2, 1) = ":" and mid$(szDestPath, 3, 1) <> "\" then
  157.             szTemp$ = mid$(szDestPath, 1, 2) + "\" + mid$(szDestPath, 3, len(szDestPath)-2)
  158.             szDestPath = szTemp
  159.         end if
  160.  
  161.         if mid$(szDestPath, 2, 1) <> ":" then
  162.             if mid$(szDestPath, 1,1) <> "\" then
  163.                 szDestPath = mid$(szWinPath, 1,1) + ":\" + szDestPath
  164.             else
  165.                 szDestPath = mid$(szWinPath, 1,1) + ":" + szDestPath
  166.             end if
  167.         elseif IsDriveValid(mid$(szDestPath, 1,1)) = 0 then
  168.             szDestPath = szOldDestPath
  169.             UIPop 1
  170.             BadPath
  171.             goto GetPathDlg
  172.         end if
  173.  
  174.         ' check for "foreign" chars in path
  175.         slength% = len(szDestPath)
  176.         found% = 0
  177.         for i% = 1 to slength%
  178.             if asc(mid$(szDestPath, i%, 1)) > 126 then
  179.                 found% = 1
  180.             end if
  181.         next i%
  182.         if found% = 1 then
  183.             szDestPath = szOldDestPath
  184.             UIPop 1
  185.             BadPath
  186.             goto GetPathDlg
  187.         end if
  188.  
  189.         wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
  190.         if IsCDROMDrive(wDrive%) > 0 then
  191.             szDestPath = szOldDestPath
  192.             UIPop 1
  193.             BadPath
  194.             goto GetPathDlg
  195.         end if
  196.  
  197.         if IsDriveNetwork(mid$(szDestPath,1,1)) = 1 then
  198.             szDestPath = szOldDestPath
  199.             UIPop 1
  200.             NetworkDrive
  201.             goto GetPathDlg
  202.         end if
  203.  
  204.         if IsDirWritable(szDestPath) = 0 then
  205.             szDestPath = szOldDestPath
  206.             UIPop 1
  207.             BadPath
  208.             goto GetPathDlg
  209.         end if
  210.  
  211.         'check dir names not > 8 chars
  212.         dirlength% = 0
  213.         i% = 3
  214.         while i% <> slength%
  215.             i% =i%+1
  216.             dirlength% = dirlength% +1
  217.             if mid$(szDestPath, i%, 1)="\" then
  218.                 if dirlength% > 9 then
  219.                     szDestPath = szOldDestPath
  220.                     dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  221.                     goto GetPathDlg
  222.                  else
  223.                     dirlength% = 0
  224.                 endif
  225.             end if
  226.  
  227.         wend
  228.         if dirlength% > 8 then
  229.             szDestPath = szOldDestPath
  230.             dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  231.             goto GetPathDlg
  232.         endif
  233.  
  234.  
  235.  
  236.   '      if DoesDirExist(szDestPath) = 0 then
  237.   '          dButton = DoMsgBox( STR_DIRNOTEXIST, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  238.   '          if dButton = 7 then
  239.   '              goto GetPathDlg
  240.   '          end if
  241.   '      end if
  242.  
  243.         UIPop 1
  244.  
  245.  
  246.     case "EXIT"
  247.         AskQuit
  248.         goto GetPathDlg
  249.     end select
  250.  
  251. GetCustomChoicesDlg:
  252.     SetSymbolValue "CheckItemsState", ""
  253. '    AddListItem "CheckItemsState", szMinimalInstall
  254. '    AddListItem "CheckItemsState", szAddPMItem
  255. GetCustomChoicesLoop:
  256.  
  257.     ClearCopyList
  258. '    if szMinimalInstall = "OFF" then
  259.         AddFilesToCopyList "FULL"
  260. '    else
  261. '        AddFilesToCopyList "MINIMAL"
  262. '    end if
  263.  
  264.     dDestDrive = asc(mid$(szDestPath, 1,1))