home *** CD-ROM | disk | FTP | other *** search
/ Crazy Collection 13 / CC-13_2.iso / gms__win / wildcard / setup.mst < prev    next >
Encoding:
Text File  |  1995-04-24  |  16.4 KB  |  607 lines

  1. '**************************************************************************
  2. '*                      Corel Wild Cards 1.0 Setup
  3. '*              hacked together by Chris Chan,  -March 6, 1995
  4. '**************************************************************************
  5.  
  6. '$INCLUDE 'setupapi.inc'
  7. '$INCLUDE 'mscpydis.inc'    ''System
  8. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  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 APPHELP2      = 1500
  20. CONST APPHELP3      = 1700
  21. CONST CHECK         = 2500
  22. CONST TOOBIG        = 6300
  23. CONST BADPATH       = 6400
  24. CONST REGANDREAD    = 6500
  25. CONST DESTGRP       = 6600
  26. CONST RESTARTII     = 2700
  27.  
  28. ''Bitmap ID
  29. CONST LOGO = 1
  30.  
  31. ''Disk Sizes
  32.  
  33. GLOBAL File1
  34. GLOBAL File2
  35. GLOBAL WantedDiskSize&
  36.  
  37. ''File Types
  38. GLOBAL DEST$        ''Default destination directory.
  39. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  40. GLOBAL OPTCUR$      ''Option selection from option dialog.
  41. GLOBAL CHECKSTATES$
  42. GLOBAL RUNTIME$
  43. GLOBAL AVITOOLS$
  44. GLOBAL MDKTOOLS$
  45. GLOBAL TOOLS$
  46.  
  47. SrcDir$ = GetSymbolValue("STF_SRCDIR")
  48. WinDir$ = GetWindowsDir()
  49. WinSysDir$ = GetWindowsSysDir()
  50.  
  51.  
  52. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  53. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  54. DECLARE SUB Reboot LIB "iniupd.dll"
  55. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  56.  
  57.  
  58. '**************************************************************************
  59. '*                       WinG Setup Program
  60. '**************************************************************************
  61.  
  62. '$DEFINE DEBUG  ''Define for script development/debugging
  63.  
  64. '' removed in wing merge -cchan $INCLUDE 'setupapi.inc'
  65.  
  66. ''Dialog ID's
  67. CONST WINGWELCOME       = 100
  68. CONST WINGASKQUIT       = 200
  69. CONST WINGDESTPATH      = 300
  70. CONST WINGDESTPATH2     = 301
  71. CONST WINGEXITFAILURE   = 400
  72. CONST WINGEXITQUIT      = 600
  73. CONST WINGEXITSUCCESS   = 700
  74. CONST WINGAPPHELP       = 900
  75. CONST WINGCHECK         = 2500
  76. CONST WINGBADPATH       = 6400
  77. CONST RESTART       = 1000
  78.  
  79. ''File Types
  80. CONST WING_RUNFILES     = 1
  81. CONST WING_BUILDFILES   = 2
  82.  
  83. ''Bitmap ID
  84. CONST WINGLOGO = 1
  85.  
  86. GLOBAL FILEDIALOG   ''File path dialog ID
  87.  
  88. GLOBAL WINGDEST$        ''Default destination directory.
  89.  
  90. GLOBAL WINGCHECKSTATES$ ''Dialog list symbol names
  91.  
  92. GLOBAL TMPDEST$     '' tmpfile destination
  93.  
  94. GLOBAL bInstallDVA%
  95.  
  96. DECLARE FUNCTION WinGMakePath (szDir$, szFile$) AS STRING
  97. DECLARE FUNCTION GetRealWindowsSysDir AS STRING
  98. DECLARE SUB UpdateWinG32 (szOrig$) 
  99.  
  100. DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
  101. ''DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
  102. DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
  103. DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
  104. DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
  105. DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$) 
  106.  
  107.  
  108.  
  109. WINGINIT:
  110.     bInstallDVA% = 0
  111.     
  112.     WINGCUIDLL$ = "wingcui.dll"            ''Custom wing interface dll
  113.     WINGHELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  114.  
  115.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  116.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  117.  
  118.     SetBitmap WINGCUIDLL$, WINGLOGO
  119.     SetTitle "Corel Wild Cards Installation"
  120.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  121.     IF szInf$ = "" THEN
  122.     szInf$ = GetSymbolValue("STF_CWDDIR") + "setup.inf"
  123.     END IF
  124.     ReadInfFile szInf$
  125.  
  126. WINGWELCOME:
  127. WINGCHECK:
  128. WELCOME:
  129.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  130.     IF sz$ = "CONTINUE" THEN
  131.     UIPop 1
  132.     ELSE
  133.     GOSUB ASKQUIT
  134.     GOTO WELCOME
  135.     END IF
  136.  
  137. ''cc removed the wing requester -cchan
  138. ''cc    sz$ = UIStartDlg(WINGCUIDLL$, WINGCHECK, "FCheckDlgProc", WINGAPPHELP, WINGHELPPROC$)
  139. ''cc    IF sz$ = "CONTINUE" THEN
  140. ''cc    UIPop 1
  141. ''cc    ELSE
  142. ''cc    GOSUB WINGASKQUIT
  143. ''cc    GOTO WINGCHECK
  144. ''cc    END IF
  145.  
  146.  
  147. '' .....Actual WinG Realtime installation ...-cchan
  148.  
  149.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  150.     WINGDEST$ = GetWindowsSysDir
  151.     
  152.     AddSectionFilesToCopyList "runtime", SrcDir$, WINGDEST$
  153.     
  154.     '
  155.     ' only use DVA on Windows 3.x
  156.     '
  157.     IF OnWin3x() = 1 THEN
  158.         AddSectionFilesToCopyList "dva", SrcDir$, WINGDEST$
  159.         IF VflatdPresent() = 0 THEN
  160.         CreateSysIniKeyValue GetWindowsDir + "system.ini", "386Enh", "device", GetWindowsSysDir+"dva.386", cmoOverwrite
  161.         bInstallDVA% = 1
  162.         END IF
  163.     END IF
  164.     
  165.     WINGDEST$ = GetRealWindowsSysDir
  166.     
  167.     AddSectionFilesToCopyList "wing32", SrcDir$, WINGDEST$
  168.     Dest1$ = WinGMakePath(WINGDEST$,"wing32.dll")
  169.     Dest2$ = WinGMakePath(WINGDEST$,"wing32.xxx")
  170.     RenameFilePlease Dest1$,Dest2$
  171.  
  172.     CopyFilesInCopyList
  173.     
  174.     UpdateWinG32 GetRealWindowsSysDir()
  175.  
  176.  
  177. WINGQUIT:
  178.     ON ERROR GOTO WINGERRQUIT
  179.  
  180.     IF ERR = 0 THEN
  181.     dlg% = WINGEXITSUCCESS
  182.     ELSEIF ERR = STFQUIT THEN
  183.     dlg% = WINGEXITQUIT
  184.     ELSE
  185.     dlg% = WINGEXITFAILURE
  186.     END IF
  187.  
  188. WINGQUITL1:
  189.     GOTO INIT
  190. ''cc   if dlg% = WINGEXITSUCCESS then
  191. ''cc  temp go until WinG dialogs are fixed
  192. ''cc    sz$ = UIStartDlg(WINGCUIDLL$, RESTART, "FInfoDlgProc", WINGAPPHELP, WINGHELPPROC$)
  193. ''cc    UIPop 1
  194. ''cc    IF sz$ = "CONTINUE" THEN
  195. ''cc        rc% = RestartWindows
  196. ''cc    ENDIF
  197. ''cc    endif
  198.  
  199.     sz$ = UIStartDlg(WINGCUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  200.     IF sz$ = "REACTIVATE" THEN
  201.     GOTO WINGQUITL1
  202.     END IF
  203.     UIPop 1
  204.     
  205.     END
  206.  
  207. WINGERRQUIT:
  208.     i% = DoMsgBox("Microsoft setup sources were not installed correctly!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  209.     END
  210.  
  211.  
  212.  
  213. WINGASKQUIT:
  214.     sz$ = UIStartDlg(WINGCUIDLL$, WINGASKQUIT, "FQuitDlgProc", 0, "")
  215.  
  216.     IF sz$ = "EXIT" THEN
  217.     UIPopAll
  218.     ERROR STFQUIT
  219.     ELSEIF sz$ = "REACTIVATE" THEN
  220.     GOTO WINGASKQUIT
  221.     ELSE
  222.     UIPop 1
  223.     END IF
  224.     RETURN
  225.  
  226.  
  227. '**
  228. '** Purpose:
  229. '**     Appends a file name to the end of a directory path,
  230. '**     inserting a backslash character as needed.
  231. '** Arguments:
  232. '**     szDir$  - full directory path (with optional ending "\")
  233. '**     szFile$ - filename to append to directory
  234. '** Returns:
  235. '**     Resulting fully qualified path name.
  236. '*************************************************************************
  237. FUNCTION WinGMakePath (szDir$, szFile$) STATIC AS STRING
  238.     IF szDir$ = "" THEN
  239.     WinGMakePath = szFile$
  240.     ELSEIF szFile$ = "" THEN
  241.     WinGMakePath = szDir$
  242.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  243.     WinGMakePath = szDir$ + szFile$
  244.     ELSE
  245.     WinGMakePath = szDir$ + "\" + szFile$
  246.     END IF
  247. END FUNCTION
  248.  
  249.  
  250. FUNCTION GetRealWindowsSysDir STATIC AS STRING
  251.     szBuf$ = string$(260, 32)
  252.     cbBuf% = GetRealSystemDir(szBuf$, 260)
  253.     IF cbBuf% = 0 THEN
  254.     ERROR STFERR
  255.     ELSE
  256.     IF cbBuf% > 259 THEN
  257.         res% = DoMsgBox("Buffer Overflow", "MS-Setup Error", MB_ICONHAND+MB_OK)
  258.         ERROR STFERR
  259.     END IF
  260.     szBuf$ = RTRIM$(szBuf$)
  261.     IF MID$(szBuf$, 1, 1) = "\" THEN
  262.         szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
  263.     ELSEIF MID$(szBuf$, 2, 1) <> ":" THEN
  264.         szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
  265.     END IF
  266.     IF MID$(szBuf$, LEN(szBuf$), 1) <> "\" THEN
  267.         szBuf$ = szBuf$ + "\"
  268.     END IF
  269.     GetRealWindowsSysDir = szBuf$
  270.     END IF
  271.  
  272.     szBuf$ = ""
  273. END FUNCTION
  274.  
  275. SUB UpdateWinG32 (szOrig$) STATIC 
  276.     '
  277.     ' Here we check the version ourselves of wing32.dll, since 
  278.     ' we can't get version checking for Win32 apps from Win16
  279.     '
  280.     FileNew$ = WinGMakePath(szOrig$, "wing32.dll")
  281.     FileOrig$ = WinGMakePath(szOrig$, "wing32.xxx")
  282.     IF IsWin32FileNewer( FileOrig$, FileNew$ ) THEN
  283.     RemoveFile FileOrig$, cmoForce
  284.     ELSE
  285.     RemoveFile FileNew$, cmoForce           ' get rid of new file
  286.     RenameFilePlease FileOrig$,FileNew$     ' put back old file
  287.     END IF
  288. END SUB
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317. INIT:
  318. ClearCopyList
  319.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  320.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  321.  
  322.     MajorVer% = GetWindowsMajorVersion()
  323.     MinorVer% = GetWindowsMinorVersion()
  324.  
  325.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  326.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  327.     END
  328.     END IF
  329.  
  330.     SetBitmap CUIDLL$, LOGO
  331.     SetTitle "Corel Wild Cards Installation"
  332.  
  333.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  334.     IF szInf$ = "" THEN
  335.     szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  336.     END IF
  337.     ReadInfFile szInf$
  338.  
  339.     WINDRIVE$ = MID$(WinDir$, 1, 1)
  340.     cdromdrive$ = MID$(SrcDir$, 1, 3)
  341.  
  342. ClearCopyList
  343. '' Mike: set to hard drive space needed for Video for Windows (probably leave at 1689000)
  344.     WantedDiskSize&=1689000
  345.  
  346.     DiskSize&=GetFreeSpaceForDrive(WINDRIVE$)
  347.  
  348.     If WantedDiskSize& > DiskSize& then
  349.         GOSUB TOOBIG
  350.         ERROR STFQUIT
  351.     EndIf
  352.  
  353.  
  354. '' Setting Video for Windows RUNTIME files to be copied
  355.  
  356.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  357.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  358.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  359.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  360.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  361.     AddSectionFilesToCopyList "Indeo-ini", SrcDir$, WinDir$
  362.  
  363. CopyFilesInCopyList
  364.  
  365. ''Updating WIN.INI and SYSTEM.INI
  366.     IF VflatdPresent() = 0 THEN
  367.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  368.     END IF
  369.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  370.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  371.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  372.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  373.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  374.     IF I% = 0  THEN
  375.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  376.     END IF
  377.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  378.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  379.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  380.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  381.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  382.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  383.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  384.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  385.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  386.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  387.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  388.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  389.  
  390.  
  391.  
  392.  
  393. '' and, oh yeah I almost forgot.., Wildcards itself
  394.     DEST$ = WINDRIVE$ + ":\wildcard"
  395.  
  396.  
  397. GETPATH:
  398.     SetSymbolValue "EditTextIn", DEST$
  399.     SetSymbolValue "EditFocus", "END"
  400.  
  401. GETPATHL1:
  402.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  403.     DEST$ = GetSymbolValue("EditTextOut")
  404.  
  405.     IF sz$ = "CONTINUE" THEN
  406.     IF IsDirWritable(DEST$) = 0 THEN
  407.         GOSUB BADPATH
  408.         GOTO GETPATHL1
  409.     END IF
  410.     UIPop 1
  411.     ELSEIF sz$ = "REACTIVATE" THEN
  412.     GOTO GETPATHL1
  413.     ELSEIF sz$ = "BACK" THEN
  414.     UIPop 1
  415.     GOTO WELCOME
  416.     ELSE
  417.     GOSUB ASKQUIT
  418.     GOTO GETPATH
  419.     END IF
  420.  
  421. CreateDir DEST$, cmoNone
  422.     DESTDRIVE$ = MID$(DEST$, 1, 1)
  423.  
  424. ClearCopyList
  425.     AddSectionFilesToCopyList "wildcards", SrcDir$, DEST$
  426.  
  427. '' Mike: set to hard drive space needed for Wildcards
  428.     WantedDiskSize&=10000000
  429.  
  430.     DiskSize&=GetFreeSpaceForDrive(DESTDRIVE$)
  431.  
  432.     If WantedDiskSize& > DiskSize& then
  433.         GOSUB TOOBIG
  434.         ERROR STFQUIT
  435.     EndIf
  436.  
  437. SetRestartDir WinDir$
  438. CopyFilesInCopyList
  439. '' Mike: Win95 Autorun feature
  440. CreateIniKeyValue WinDir$ + "wc.ini", "wildcards", "dir", DEST$, cmoOverwrite
  441.  
  442.  
  443.  
  444.  
  445.  
  446. '' Run the Video For Windows profiler AFTER everything, for completeness
  447.  
  448. '' Mplayer
  449. '' cc -Don't: who cares !    CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  450.  
  451.     Run ("profdisp.exe")   
  452.  
  453. ' ******* Mike, modify this section for the program group and icon
  454.  
  455. GETGROUP:
  456.     DESTGROUP$ = "Corel CD Home"
  457.     SetSymbolValue "EditTextIn", DESTGROUP$
  458.     SetSymbolValue "EditFocus", "END"
  459.  
  460. GETGROUPL1:
  461.     sz$ = UIStartDlg(CUIDLL$, DESTGRP, "FEditDlgProc", 0, "")
  462.     DESTGROUP$ = GetSymbolValue("EditTextOut")
  463.  
  464.     IF sz$ = "CONTINUE" THEN
  465.  
  466. '' Mike...This is a really stupid test to ensure the user has entered something
  467.     IF DESTGROUP = "" OR DESTGROUP = " " OR DESTGROUP = "  " OR DESTGROUP = "   " THEN
  468.         GOTO GETGROUPL1
  469.     END IF
  470.     UIPop 1
  471.     ELSEIF sz$ = "REACTIVATE" THEN
  472.     GOTO GETGROUPL1
  473.     ELSE
  474.     GOSUB ASKQUIT
  475.     GOTO GETGROUP
  476.     END IF
  477.  
  478.  
  479.        CreateProgmanGroup DESTGROUP$, "", cmoNone
  480.        ShowProgmanGroup  DESTGROUP$, 1, cmoNone
  481.        CreateProgmanItem DESTGROUP$, "Corel Wild Cards", DEST$+"\wildcard.exe" , "", cmoOverwrite
  482. '' Mike: rename test.txt to readme
  483.     CreateProgmanItem DESTGROUP$, "Corel Wild Cards Read Me", "notepad.exe "+DEST$+"\readme.txt" , "", cmoOverwrite
  484.     
  485.  
  486. QUIT:
  487.     ON ERROR GOTO ERRQUIT
  488.  
  489.     IF ERR = 0 THEN
  490.     dlg% = EXITSUCCESS
  491.     ELSEIF ERR = STFQUIT THEN
  492.     dlg% = EXITQUIT
  493.     ELSE
  494.     dlg% = EXITFAILURE
  495.     END IF
  496. QUITL1:
  497.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  498.     IF sz$ = "REACTIVATE" THEN
  499.     GOTO QUITL1
  500.     END IF
  501.     UIPop 1
  502.  
  503.     
  504. '' Message: (remind user of registration)
  505. '' Message: (ask if user wants to read the readme file)
  506.  
  507.    sz$ = UIStartDlg(CUIDLL$, REGANDREAD, "FInfoDlgProc", 0, "")
  508.    UIPop 1
  509.    IF sz$ = "CONTINUE" THEN
  510. '' yes, read the readme file...
  511. '' Mike,rename the file test.txt...
  512.     Run("notepad.exe "+DEST$+"\readme.txt")
  513.    ENDIF
  514.  
  515.  
  516. RESTARTWINDOWS:
  517.     RESTRT% = RestartListEmpty ()
  518.     Exe$ = WinDir$ + "\_msrstrt.exe"
  519.     Batch$ = WinDir$ + "\_mssetup.bat"
  520.     empty$ = ""
  521. RESTART:
  522.     IF RESTRT% = 0 THEN
  523.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  524.        IF sz$ = "REACTIVATE" THEN
  525.       GOTO RESTART
  526.        ENDIF
  527.        I% = ExitExecRestart ()
  528.        RemoveFile Exe$, cmoForce
  529.        RemoveFile Batch$, cmoForce
  530.        END
  531.     ELSE
  532.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  533.        IF sz$ = "CONTINUE" THEN
  534.       I% = ExitWindowsExec (Exe$, empty$)
  535.       IF I% = 0 THEN
  536.          GOTO RESTART
  537.       ELSE
  538.          END
  539.      ENDIF
  540.        ELSEIF sz$ = "EXIT" THEN
  541.       UIPopAll
  542.       END
  543.        ELSEIF sz$ = "REACTIVATE" THEN
  544.       GOTO RESTART
  545.        ELSE
  546.       UIPop 1
  547.        END IF
  548.     END IF
  549.  
  550.  
  551. ERRQUIT:
  552.     i% = DoMsgBox("Setup sources were corrupted!", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  553.     END
  554.  
  555. ASKQUIT:
  556.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  557.  
  558.     IF sz$ = "EXIT" THEN
  559.     UIPopAll
  560. ''        ERROR STFQUIT
  561.     END
  562.     ELSEIF sz$ = "REACTIVATE" THEN
  563.     GOTO ASKQUIT
  564.     ELSE
  565.     UIPop 1
  566.     END IF
  567.     RETURN
  568.  
  569. TOOBIG:
  570.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  571.     IF sz$ = "REACTIVATE" THEN
  572.     GOTO TOOBIG
  573.     END IF
  574.     UIPop 1
  575.     RETURN
  576.  
  577. BADPATH:
  578.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  579.     IF sz$ = "REACTIVATE" THEN
  580.     GOTO BADPATH
  581.     END IF
  582.     UIPop 1
  583.     RETURN
  584.  
  585. '**
  586. '** Purpose:
  587. '**     Appends a file name to the end of a directory path,
  588. '**     inserting a backslash character as needed.
  589. '** Arguments:
  590. '**     szDir$  - full directory path (with optional ending "\")
  591. '**     szFile$ - filename to append to directory
  592. '** Returns:
  593. '**     Resulting fully qualified path name.
  594. '*************************************************************************
  595. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  596.     IF szDir$ = "" THEN
  597.     MakePath = szFile$
  598.     ELSEIF szFile$ = "" THEN
  599.     MakePath = szDir$
  600.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  601.     MakePath = szDir$ + szFile$
  602.     ELSE
  603.     MakePath = szDir$ + "\" + szFile$
  604.     END IF
  605. END FUNCTION
  606.  
  607.