home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 2 / PCFORMAT2.iso / PIDSETUP.MST < prev    next >
Encoding:
Text File  |  1993-09-27  |  4.3 KB  |  146 lines

  1. '**************************************************************************
  2. '*                       Setup function for Paramount Interactiv Demo
  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 EXITFAILURE   = 400
  14. CONST EXITQUIT      = 600
  15. CONST EXITSUCCESS   = 700
  16. CONST APPHELP       = 900
  17.  
  18. ''Bitmap ID
  19. ''CONST LOGO = 1
  20.  
  21. GLOBAL DEST$        ''Default destination directory.
  22.  
  23. DECLARE SUB Install
  24. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  25.  
  26.  
  27. INIT:
  28.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  29.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  30.  
  31.     ''SetBitmap CUIDLL$, LOGO
  32.     SetTitle "Paramount Interactive Demo Setup"
  33.     SetAbout "Welcome to Paramount Interactive Demo version 1.0", ""
  34.     
  35.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  36.     IF szInf$ = "" THEN
  37.         szInf$ = GetSymbolValue("STF_CWDDIR") + "PIDEMO.INF"
  38.     END IF
  39.     ReadInfFile szInf$
  40.  
  41.     DEST$ = "C:\PIDEMO"
  42.  
  43. WELCOME:
  44.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  45.     IF sz$ = "CONTINUE" THEN
  46.         UIPop 1
  47.     ELSE
  48.         GOSUB ASKQUIT
  49.         GOTO WELCOME
  50.     END IF
  51.  
  52.  
  53.     Install
  54.  
  55.  
  56. QUIT:
  57.     ON ERROR GOTO ERRQUIT
  58.  
  59.     IF ERR = 0 THEN
  60.         dlg% = EXITSUCCESS
  61.     ELSEIF ERR = STFQUIT THEN
  62.         dlg% = EXITQUIT
  63.     ELSE
  64.         dlg% = EXITFAILURE
  65.     END IF
  66. QUITL1:
  67.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  68.     IF sz$ = "REACTIVATE" THEN
  69.         GOTO QUITL1
  70.     END IF
  71.     UIPop 1
  72.  
  73.     END
  74.  
  75. ERRQUIT:
  76.     i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  77.     END
  78.  
  79. ASKQUIT:
  80.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  81.  
  82.     IF sz$ = "EXIT" THEN
  83.         UIPopAll
  84.         ERROR STFQUIT
  85.     ELSEIF sz$ = "REACTIVATE" THEN
  86.         GOTO ASKQUIT
  87.     ELSE
  88.         UIPop 1
  89.     END IF
  90.     RETURN
  91.  
  92. '**
  93. '** Purpose:
  94. '**     Builds the copy list and performs all installation operations.
  95. '** Arguments:
  96. '**     none.
  97. '** Returns:
  98. '**     none.
  99. '*************************************************************************
  100. SUB Install STATIC
  101.  
  102.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  103.     szOther$ = MakePath(SrcDir$, "pidemo\busytown\bt.ico")
  104.     CreateDir DEST$, cmoNone
  105.  
  106.     CreateProgmanGroup "PIDemo", "", cmoNone
  107.     ShowProgmanGroup  "PIDemo", 1, cmoNone
  108.     CreateProgmanItem "PIDemo", "Paramount Interactive Demo", MakePath(SrcDir$, "pidemo\exe\pidemo.exe"), "", cmoOverwrite
  109.     CreateProgmanItem "PIDemo", "Lenny Test", MakePath(SrcDir$, "pidemo\lenny\lenny.exe #99"), "", cmoOverwrite
  110.     CreateProgmanItem "PIDemo", "BusyTown", MakePath(SrcDir$, "pidemo\busytown\busydemo.exe /pbt.pre"), szOther$, cmoOverwrite
  111.     CreateProgmanItem "PIDemo", "Video for Windows Install", MakePath(SrcDir$, "vidplay\setup.exe"), "", cmoOverwrite
  112.     CreateProgmanItem "PIDemo", "ReadMe", "notepad.exe "+MakePath(SrcDir$, "readme.txt"), "", cmoOverwrite
  113.  
  114.     
  115.     ''CreateProgmanItem "Paramount Interactive Demo", "Wizard", MakePath(DEST$,"wizard.exe"), "", cmoOverwrite
  116.     ''CreateProgmanItem "Paramount Interactive Demo", "ReadMe", "notepad.exe "+MakePath(DEST$,"readwiz.txt"), "", cmoOverwrite
  117.  
  118.     ''AddDos5Help "YOURAPP", "A brief help text for your Windows application."+chr$(10)+"It can be continued on another line with chr$(10).", cmoNone
  119.  
  120. END SUB
  121.  
  122.  
  123.  
  124. '**
  125. '** Purpose:
  126. '**     Appends a file name to the end of a directory path,
  127. '**     inserting a backslash character as needed.
  128. '** Arguments:
  129. '**     szDir$  - full directory path (with optional ending "\")
  130. '**     szFile$ - filename to append to directory
  131. '** Returns:
  132. '**     Resulting fully qualified path name.
  133. '*************************************************************************
  134. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  135.     IF szDir$ = "" THEN
  136.         MakePath = szFile$
  137.     ELSEIF szFile$ = "" THEN
  138.         MakePath = szDir$
  139.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  140.         MakePath = szDir$ + szFile$
  141.     ELSE
  142.         MakePath = szDir$ + "\" + szFile$
  143.     END IF
  144. END FUNCTION
  145.  
  146.