home *** CD-ROM | disk | FTP | other *** search
/ Club KidSoft Volume 3 #1 / ClubKidsoft.iso / demos / dk / twtw / dksetup / dksetup.mst < prev    next >
Text File  |  1994-08-30  |  8KB  |  275 lines

  1.  
  2. '**************************************************************************
  3. '*                       Sampler Setup
  4. '**************************************************************************
  5.  
  6. '$INCLUDE 'setupapi.inc'
  7. '$INCLUDE 'msdetect.inc'
  8. '' '$INCLUDE 'msshared.inc'
  9.  
  10. 'OPTION EXPLICIT
  11.  
  12. DECLARE FUNCTION FIsVGA LIB "mscuistf.dll" AS INTEGER
  13. DECLARE FUNCTION FIs256Colour LIB "mscuistf.dll" AS INTEGER
  14.  
  15.  
  16.  
  17. ''Dialog ID's
  18. CONST WELCOME       = 100
  19. CONST CUSTOMHELP    = 106
  20. CONST SPEED         = 111
  21. CONST BILLBOARD     = 113
  22. CONST ASKQUIT       = 200
  23. CONST DESTPATH      = 300
  24. CONST EXITFAILURE   = 400
  25. CONST EXITQUIT      = 600
  26. CONST EXITSUCCESS   = 700
  27. CONST OPTIONS       = 800
  28. CONST APPHELP       = 900
  29. CONST DONENEWSYSSOFT    = 1100
  30. CONST MAILMAN           = 1500
  31. CONST DONENOSYSSOFT     = 1800
  32. CONST NEWSYSTEMSOFTWARE = 2300
  33. CONST NEWADPCM          = 2600
  34. CONST WARNNOSYSSOFT     = 3100
  35. CONST PROGMANGRP        = 3742
  36. CONST CUSTOM        = 6200
  37. CONST NOSPACE       = 6300
  38. CONST BADPATH       = 6400
  39. CONST NEED31        = 6401
  40. CONST NOMOUSE       = 6402
  41. CONST BADVGA        = 6403
  42. CONST NOT256        = 6404
  43. CONST POORMACHINE   = 6405
  44. CONST AWFULMACHINE  = 6406
  45. CONST PATHHELP      = 6407
  46. CONST WHIZZHELP     = 6408
  47. CONST URKADPCM      = 6409
  48. CONST ADPCMHELP     = 6410
  49.  
  50. ''Bitmap ID
  51. CONST LOGO = 1
  52.  
  53. GLOBAL CURSOR%      '' Old mouse cursor state
  54. GLOBAL DEST$        '' Default destination directory.
  55. GLOBAL ProdSrc$, dirCode$, dirSetup$
  56. GLOBAL SysSrc$
  57. GLOBAL SRCDIR$      '' Source Drive
  58. GLOBAL FussyUser$   '' "1" for express installation, "2" for custom.
  59. GLOBAL MINIMAL$     '' "ON" for minimal installation, "OFF" for normal
  60. GLOBAL PROGMAN$     '' "ON" for invoke program manager, "OFF" otherwise
  61. GLOBAL CUSTCHECK$   '' the state of all Custom dialogue check boxes
  62. GLOBAL PROGGRP$     '' Name of Program Manager Group
  63. GLOBAL PRODNAME$    '' Product Name
  64. GLOBAL COMPNAME$    '' Company Name
  65. GLOBAL WINSYSDIR$   '' Windows System Driver
  66. GLOBAL DESTDRIVE$   '' Destination drive
  67. GLOBAL WINDRIVE$    '' Windows drive (system directory)
  68. GLOBAL WinDir$      '' Windows directory
  69. GLOBAL DD%          '' Integer DESTDRIVE$
  70. GLOBAL WD%          '' Integer WINDRIVE$
  71. GLOBAL SizeReq&     '' Total installation size?
  72. GLOBAL IcoFile$
  73. GLOBAL CrapLng%
  74. GLOBAL Junk&
  75. GLOBAL CUIDLL$
  76. GLOBAL HELPPROC$
  77. GLOBAL SZINF$
  78. GLOBAL OPTCUR$
  79. GLOBAL I%
  80. GLOBAL SZ$, Key$, SrcDrive$, SrcPengeDir$
  81. GLOBAL VerNew$
  82. GLOBAL VerOld$
  83. GLOBAL dlg%
  84. GLOBAL INI$
  85. GLOBAL INSTRINI$
  86. GLOBAL Count%, RebootMsg%, uLen%
  87. GLOBAL OLDNTH&, NEWNTH&
  88. GLOBAL OldYear%, NewYear%, OldMonth%, NewMonth%, OldDay%, NewDay%
  89. GLOBAL ExeFile$, PengeFile$, IniFile$, Section$, Moi$
  90.  
  91. DECLARE SUB Install
  92. DECLARE FUNCTION IsVersionLater (VersionOld$, VersionNew$) AS INTEGER
  93. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  94. DECLARE FUNCTION IsDateLater (DateOld$, DateNew$) AS INTEGER
  95.  
  96. '******************************************************************
  97. '** Declare the funcitons in USER.EXE we need to register a
  98. '** unique message identifier and needed to post that message
  99. '** to the NSETUP.EXE program.  See the Windows api documentation
  100. '** for additional information on these functions.
  101. '******************************************************************
  102. DECLARE FUNCTION PostMessage LIB "user" (hwnd%, msg%, wparam%, lparam&) AS INTEGER
  103.  
  104.  
  105.  
  106. INIT:
  107.     Cursor% = ShowWaitCursor ()
  108.     dirCode$ = ""
  109.     dirSetup$ = "DKSETUP"
  110.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  111.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  112.     PRODNAME$ = "The Way Things Work"
  113.     COMPNAME$ = "DK Multimedia"
  114.     PROGGRP$=COMPNAME$+" Samples"
  115.     ExeFile$ = "twtw.exe"
  116.     IcoFile$ = "twtw.ico"
  117.     PengeFile$ = ""
  118.     IniFile$ = ""
  119.     Section$ = "Sampler"
  120.     Moi$ = ProdName$ + " Setup"
  121.     WinSysDir$ = GetWindowsSysDir ()
  122.     WinDir$ = GetWindowsDir ()
  123.     WINDRIVE$ = MID$ (GetWindowsSysDir (), 1, 1)
  124.     INSTRINI$ = MakePath(GetWindowsDir(),IniFile$)
  125.  
  126.     SrcDir$ = GetSymbolValue ("STF_SRCDIR")
  127.     uLen% = Len (SrcDir$) - Len (dirSetup$)
  128.     ProdSrc$ = Mid$ (SrcDir$, 1, uLen% - 1) + dirCode$
  129.     SysSrc$ = SrcDir$
  130.  
  131.     SetAbout PRODNAME$, "⌐ 1994 " + COMPNAME$
  132.     CrapLng% = SetBeepingMode (1)
  133.     SetBitmap CUIDLL$, LOGO
  134.     SetTitle PRODNAME$ + " Setup"
  135.     CrapLng% = SetDecompMode (1)
  136.  
  137.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  138.  
  139.     IF szInf$ = "" THEN
  140.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  141.     END IF
  142.  
  143.     ReadInfFile szInf$
  144.  
  145.     OPTCUR$ = "1"
  146.     DEST$ = "C:\"
  147.     MINIMAL$ = "OFF"
  148.     PROGMAN$ = "ON"
  149.  
  150. '***************************************************************
  151. '**  Here we go registering the message so we can communicate
  152. '**  with NSETUP.EXE.
  153. '***************************************************************
  154.  
  155.  
  156. WELCOME:
  157.     RestoreCursor (Cursor%)
  158.     sz$="Welcome to the Dorling Kindersley CD-ROM Demonstration Setup program. This program updates Program Manager "
  159.     sz$=sz$+"by adding icons to the "+PROGGRP$+" group for the demonstrations on the CD-ROM. Please ensure "
  160.     sz$=sz$+"Program Manager is running. Do you wish to continue?"
  161.     i% = DoMsgBox (sz$,Moi$,MB_ICONQUESTION+MB_YESNO)
  162.  
  163.     if i% = IDNO then
  164.        end
  165.     end if
  166.  
  167. TEST31:
  168.     Cursor% = ShowWaitCursor ()
  169.  
  170.     IF GetWindowsMajorVersion () > 3 THEN
  171.         GOTO TESTVGA
  172.     END IF
  173.  
  174.     IF GetWindowsMajorVersion () < 3 THEN
  175.         GOTO GORDONBENNETT
  176.     END IF
  177.  
  178.     IF GetWindowsMinorVersion () >= 10 THEN
  179.         GOTO TESTVGA
  180.     END IF
  181.  
  182. GORDONBENNETT:
  183.     RestoreCursor (Cursor%)
  184.     sz$="This demonstration requires Windows version 3.1 or later."
  185.     i% = DoMsgBox (sz$,Moi$,MB_ICONSTOP+MB_OK)
  186.     End
  187.  
  188.  
  189. TESTVGA:
  190.     IF GetScreenHeight () >= 480 AND GetScreenWidth () >= 640 THEN
  191.         GOTO TESTMOUSE
  192.     ELSE
  193.         RestoreCursor (Cursor%)
  194.         sz$="This demonstration requires a screen with a resolution of at least 640x480. Please install appropriate "
  195.         sz$=sz$+"screen drivers."
  196.         i% = DoMsgBox (sz$,Moi$,MB_ICONSTOP+MB_OK)
  197.         End
  198.     END IF
  199.  
  200. TESTMOUSE:
  201.     IF HasMouseInstalled() > 0 THEN
  202.         GOTO TESTCOLOUR
  203.     ELSE
  204.         RestoreCursor (Cursor%)
  205.         sz$="This demonstration requires a mouse or alternative pointing device."
  206.         i% = DoMsgBox (sz$,Moi$,MB_ICONSTOP+MB_OK)
  207.         End
  208.     END IF
  209.  
  210. TESTCOLOUR:
  211.     IF FIs256Colour() > 0 THEN
  212.         GOTO WHIZZO
  213.     ELSE
  214.         RestoreCursor (Cursor%)
  215.         sz$="This demonstration is designed for a system with at least 256 colors. If you wish to "
  216.         sz$=sz$+"appreciate it fully, install appropriate screen drivers. Do you wish to continue?"
  217.         i% = DoMsgBox (sz$,Moi$,MB_ICONQUESTION+MB_YESNO)
  218.  
  219.         if i%=IDNO then
  220.             End
  221.         end if
  222.  
  223.     END IF
  224.  
  225. WHIZZO:
  226.     CreateProgmanGroup PROGGRP$, "", cmoNone
  227.     ShowProgmanGroup   PROGGRP$, 1, cmoNone
  228.  
  229.     sz$ = MakePath(ProdSrc$,IcoFile$) + ",,,,"+ProdSrc$
  230.     szInf$ = MakePath (ProdSrc$,ExeFile$)
  231.     CreateProgmanItem PROGGRP$, PRODNAME$, szInf$, sz$, cmoOverwrite
  232.  
  233.     sz$="Setup has added an icon to Program Manager. To run the sample, just double click on the appropriate icon "
  234.     sz$=sz$+"in Program Manager. When the program is running, click on Start to see the demonstration. Please disable "
  235.     sz$=sz$+"all screen savers before running the demonstration."
  236.     i% = DoMsgBox (sz$,Moi$,MB_OK)
  237.  
  238. QUIT:
  239.     End
  240.  
  241. ERRQUIT:
  242.     i% = DoMsgBox("The setup sources were corrupted. You may be able to correct the problem by using SCANDISK to fix your hard disk.", Moi$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  243.     END
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252. '**
  253. '** Purpose:
  254. '**     Appends a file name to the end of a directory path,
  255. '**     inserting a backslash character as needed.
  256. '** Arguments:
  257. '**     szDir$  - full directory path (with optional ending "\")
  258. '**     szFile$ - filename to append to directory
  259. '** Returns:
  260. '**     Resulting fully qualified path name.
  261. '*************************************************************************
  262. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  263.     IF szDir$ = "" THEN
  264.         MakePath = szFile$
  265.     ELSEIF szFile$ = "" THEN
  266.         MakePath = szDir$
  267.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  268.         MakePath = szDir$ + szFile$
  269.     ELSE
  270.         MakePath = szDir$ + "\" + szFile$
  271.     END IF
  272. END FUNCTION
  273.  
  274.  
  275.