home *** CD-ROM | disk | FTP | other *** search
/ 100 Smash Win 95 Games / 100SMASH.iso.7z / 100SMASH.iso / smash100.mst < prev    next >
Text File  |  1997-08-12  |  6KB  |  227 lines

  1. '**************************************************************************
  2. '*                     Softkey Installation Script
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. ''Dialog ID's
  11. CONST WELCOME       = 100
  12. CONST ASKQUIT       = 200
  13. CONST DESTPATH      = 300
  14. CONST EXITFAILURE   = 400
  15. CONST EXITQUIT      = 600
  16. CONST EXITSUCCESS   = 700
  17. CONST OPTIONS       = 800
  18. CONST APPHELP       = 900
  19. CONST BADPATH       = 6400
  20.  
  21. ''Bitmap ID
  22. CONST LOGO = 1
  23.  
  24. GLOBAL DEST$        ''Default destination directory.
  25. GLOBAL OPTCUR$      ''Option selection from option dialog.
  26.  
  27. DECLARE SUB Install
  28. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  29. Declare Function ShowWindow Lib "User" (hWnd%, nCmdShow%) As Integer
  30.  
  31.  
  32.  
  33. INIT:
  34.      i% = ShowWindow(HwndFrame(), 3)
  35.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  36.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  37.  
  38.     ''SetBitmap CUIDLL$, LOGO
  39.     SetTitle "Softkey"
  40.  
  41.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  42.     IF szInf$ = "" THEN
  43.     szInf$ = GetSymbolValue("STF_CWDDIR") + "smash100.INF"
  44.     END IF
  45.     ReadInfFile szInf$
  46.  
  47.     OPTCUR$ = "1"
  48.     DEST$ = "C:\smash100"
  49.  
  50. '$IFDEF DEBUG
  51.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  52.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  53.     IF IsDriveValid(WinDrive$) = 0 THEN
  54.     i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  55.     GOTO QUIT
  56.     END IF
  57. '$ENDIF ''DEBUG
  58.  
  59. i% = ShowWindow(HwndFrame(), 3)
  60.  
  61. WELCOME:
  62.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  63.     IF sz$ = "CONTINUE" THEN
  64.     UIPop 1
  65.     ELSE
  66.     GOSUB ASKQUIT
  67.     GOTO WELCOME
  68.     END IF
  69.  
  70.  
  71.  
  72. GETPATH:
  73.     SetSymbolValue "EditTextIn", DEST$
  74.     SetSymbolValue "EditFocus", "END"
  75. GETPATHL1:
  76.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  77.     DEST$ = GetSymbolValue("EditTextOut")
  78.  
  79.     IF sz$ = "CONTINUE" THEN
  80.     IF IsDirWritable(DEST$) = 0 THEN
  81.         GOSUB BADPATH
  82.         GOTO GETPATHL1
  83.     END IF
  84.     UIPop 1
  85.     ELSEIF sz$ = "REACTIVATE" THEN
  86.     GOTO GETPATHL1
  87.     ELSEIF sz$ = "BACK" THEN
  88.     UIPop 1
  89.     GOTO WELCOME
  90.     ELSE
  91.     GOSUB ASKQUIT
  92.     GOTO GETPATH
  93.     END IF
  94.  
  95.                    
  96.     Install
  97.  
  98. QUIT:
  99.     ON ERROR GOTO ERRQUIT
  100.  
  101.     IF ERR = 0 THEN
  102.     dlg% = EXITSUCCESS
  103.     ELSEIF ERR = STFQUIT THEN
  104.     dlg% = EXITQUIT
  105.     ELSE
  106.     dlg% = EXITFAILURE
  107.     END IF
  108. QUITL1:
  109.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  110.     IF sz$ = "REACTIVATE" THEN
  111.     GOTO QUITL1
  112.     END IF
  113.     UIPop 1
  114.  
  115.     END
  116.  
  117. ERRQUIT:
  118.     i% = DoMsgBox("CD-ROM disc is damaged please call Support Solutions technical support at (900) 555-7827!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  119.     END
  120.  
  121.  
  122.  
  123. BADPATH:
  124.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  125.     IF sz$ = "REACTIVATE" THEN
  126.     GOTO BADPATH
  127.     END IF
  128.     UIPop 1
  129.     RETURN
  130.  
  131.  
  132.  
  133. ASKQUIT:
  134.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  135.  
  136.     IF sz$ = "EXIT" THEN
  137.     UIPopAll
  138.     ERROR STFQUIT
  139.     ELSEIF sz$ = "REACTIVATE" THEN
  140.     GOTO ASKQUIT
  141.     ELSE
  142.     UIPop 1
  143.     END IF
  144.     RETURN
  145.  
  146.  
  147.  
  148. '**
  149. '** Purpose:
  150. '**     Builds the copy list and performs all installation operations.
  151. '** Arguments:
  152. '**     none.
  153. '** Returns:
  154. '**     none.
  155. '*************************************************************************
  156. SUB Install STATIC
  157.  
  158.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  159.     CreateDir DEST$, cmoNone
  160.  
  161.     OpenLogFile MakePath(DEST$, "SETUP.TXT"), 0
  162.     WriteToLogFile ""
  163.     WriteToLogFile "  User chose as destination directory: '" + DEST$ + "'"
  164.     WriteToLogFile ""
  165.     WriteToLogFile "May have had to create the directory: " + DEST$
  166.     WriteToLogFile ""
  167.     SetRestartDir DEST$
  168.     AddSectionFilesToCopyList "Files", SrcDir$, DEST$
  169.     AddSectionFilesToCopyList "Windows Files",SrcDir$, GetWindowsDir()
  170.     AddSectionFilesToCopyList "Problem System DLLs",SrcDir$, GetWindowsSysDir()
  171.     AddSectionFilesToCopyList "Problem System VBXs",SrcDir$, GetWindowsSysDir()
  172.     AddSectionFilesToCopyList "Vital System Files",SrcDir$, GetWindowsSysDir()
  173.         if DoesFileExist(MakePath(GetWindowsDir, "vbrun300.dll"),0) then
  174.         AddSectionFilesToCopyList "Problem System DLLs",SrcDir$, GetWindowsDir()
  175.     Endif 
  176.     if DoesFileExist(MakePath(GetWindowsDir, "threed.vbx"),0) then
  177.         AddSectionFilesToCopyList "Problem System VBXs",SrcDir$, GetWindowsDir()
  178.     Endif 
  179. AddSectionFilesToCopyList "Content System Files",MakePath(SrcDir$, "System"),GetWindowsSysDir()
  180.  
  181.     CopyFilesInCopyList
  182.  
  183.     ini$ = MakePath(GetWindowsDir, "smash100.INI")
  184.     CreateIniKeyValue ini$, "Content", "File", MakePath(DEST$,"smash100.lst") , cmoNone
  185.     CreateIniKeyValue ini$, "Machine",  "Home", DEST$  , cmoNone
  186.     CreateIniKeyValue ini$, "Content",  "path", SrcDir$ , cmoNone
  187.  
  188.     CreateProgmanGroup "Smash 100", "", cmoNone
  189.     ShowProgmanGroup  "Smash 100", 1, cmoNone
  190.     CreateProgmanItem "Smash 100", "Softkey 100 Smash Windows Games", MakePath(DEST$,"smash100.exe"), "", cmoOverwrite
  191.     CreateProgmanItem "Smash 100", "README", "notepad.exe "+MakePath(DEST$,"readme.txt"), "", cmoOverwrite
  192.     CreateProgmanItem "Smash 100", "Softkey 100 Smash Windows Games Help", "winhelp.exe "+MakePath(DEST$,"smash100"), "", cmoOverwrite
  193.  
  194.     CloseLogFile
  195.  
  196.  
  197.     IF RestartListEmpty() = 0 THEN
  198.     dlg% = DoMsgBox("System files in use.  Setup must exist Windows, copy these files, and restart Windows.","Problem",0)
  199.     dlg% = ExitExecRestart
  200.     ENDIF    
  201. END SUB
  202.  
  203.  
  204.  
  205. '**
  206. '** Purpose:
  207. '**     Appends a file name to the end of a directory path,
  208. '**     inserting a backslash character as needed.
  209. '** Arguments:
  210. '**     szDir$  - full directory path (with optional ending "\")
  211. '**     szFile$ - filename to append to directory
  212. '** Returns:
  213. '**     Resulting fully qualified path name.
  214. '*************************************************************************
  215. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  216.     IF szDir$ = "" THEN
  217.     MakePath = szFile$
  218.     ELSEIF szFile$ = "" THEN
  219.     MakePath = szDir$
  220.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  221.     MakePath = szDir$ + szFile$
  222.     ELSE
  223.     MakePath = szDir$ + "\" + szFile$
  224.     END IF
  225. END FUNCTION
  226.  
  227.