home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m416 / 1.ddi / PHOTOSHP.MST < prev    next >
Encoding:
Text File  |  1994-08-26  |  23.7 KB  |  769 lines

  1. '*           Adobe Photoshop Installer
  2. '*
  3. '* June 5, 1993  Marshall Spight (original Premiere ver)
  4. '* June 16, 1993 Dave Corboy (modified for Photoshop)
  5. '*
  6. '*
  7. '*
  8. '*
  9.  
  10. '$DEFINE DEBUG  ''Define for script development/debugging
  11.  
  12. '$INCLUDE 'setupapi.inc'
  13. '$INCLUDE 'msdetect.inc'
  14.  
  15. ''CONST B$ = "Installation Problem"
  16. ''CONST C$ = "Setup sources were corrupted!"
  17.  
  18. ''following were taken from windows.h. &H means they're hex
  19. CONST WS_VISIBLE=&H10000000
  20. CONST WS_BORDER =&H00800000
  21. CONST WS_CLIPCHILDREN =&H02000000
  22. CONST GWL_STYLE =-16
  23. CONST SW_SHOWMAXIMIZED=3
  24.  
  25.  
  26. DECLARE FUNCTION ShowWindow  LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  27. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  28.  
  29.  
  30. ''Dialog ID's
  31. CONST ASKQUIT      = 100
  32. CONST DESTPATH     = 200
  33. CONST EXITFAILURE  = 300
  34. CONST EXITQUIT     = 400
  35. CONST EXITSUCCESS  = 500
  36. CONST EXITRESTART  = 550
  37. CONST OPTIONS      = 600
  38. CONST APPHELP      = 700
  39. CONST CUSTINST     = 800
  40. CONST TOOBIG       = 900
  41. CONST BADPATH      = 1000
  42. CONST NOVM         = 1100
  43. CONST NEED31       = 1200
  44. CONST NEEDENH      = 1300
  45. CONST NEEDSHARE    = 1400
  46. CONST CORRUPT      = 1500
  47.  
  48. CONST PERSONALIZE  = 10000
  49.  
  50. ''Bitmap ID
  51. CONST LOGO         = 1
  52.  
  53. ''File Types
  54.  
  55. CONST PROGRAMFILES  = 1
  56. CONST TUTORIALFILES = 2
  57. CONST PATTERNFILES  = 3
  58. CONST DUOTONEFILES  = 4
  59. CONST FILTERFILES   = 5
  60.  
  61. CONST    NUMGROUPS      = 5    '' Number of file groups: PROGRAM to TUTORIAL
  62.  
  63.  
  64. GLOBAL DEST$        ''Default destination directory.
  65. GLOBAL DESTSYS$
  66. GLOBAL DEST32S$
  67. GLOBAL WINDRIVE$    ''Windows drive letter.
  68. GLOBAL ENOUGHDISK%  ''Enough space to install
  69.  
  70. ''CustInst list symbol names
  71.  
  72. GLOBAL PROGRAMNEEDS$
  73. GLOBAL TUTORIALNEEDS$
  74. GLOBAL PATTERNNEEDS$
  75. GLOBAL DUOTONENEEDS$
  76. GLOBAL FILTERNEEDS$
  77.  
  78. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  79. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  80.  
  81. ''Dialog list symbol names
  82. GLOBAL CHECKSTATES$
  83. GLOBAL STATUSTEXT$
  84. GLOBAL DRIVETEXT$
  85.  
  86. GLOBAL InstallWin32s%
  87.  
  88. DECLARE SUB AddOptFilesToCopyList (ftype%, bogus%)
  89. DECLARE SUB RecalcOptFiles (ftype%)
  90. DECLARE SUB RecalcPath
  91. DECLARE SUB SetDriveStatus
  92. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  93. DECLARE SUB XXX LIB "mscuistf.dll" (arg$)
  94. DECLARE SUB FixScreenProc LIB "mscuistf.dll" (arg%)
  95. DECLARE SUB UpdateSystemIni
  96.  
  97. DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
  98. DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
  99. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  100. DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
  101. DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
  102. DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
  103. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  104.  
  105.  
  106.  
  107. INIT:
  108.     hWnd%=HwndFrame()
  109.     FixScreenProc ( hWnd% )
  110.     SWLxx&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  111.     SWyy%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  112.  
  113.     INSTALLDLL$ = "mscuistf.dll"        ''custom functions
  114.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  115.  
  116.     SetBitmap INSTALLDLL$, LOGO
  117.     SetTitle "Adobe Photoshop Installer"
  118.  
  119.     MajorVer% = GetWindowsMajorVersion()
  120.     MinorVer% = GetWindowsMinorVersion()
  121.  
  122.     IF  MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  123.     sz$ = UIStartDlg(INSTALLDLL$, NEED31, "FInfo0DlgProc", 0, "")
  124.     UIPop 1
  125.     ERR% = STFQUIT '' Need windows 3.1 or later.
  126.     GOTO QUIT
  127.     END IF
  128.  
  129.     InstallWin32s = 1
  130.     IF  MajorVer% > 3 THEN
  131.     InstallWin32s% = 0
  132.     END IF
  133.  
  134.     IF OnWindowsNT() THEN
  135.     InstallWin32s% = 0
  136.     ELSE
  137.     IF GetWindowsMode < 2  THEN
  138.         sz$ = UIStartDlg(INSTALLDLL$, NEEDENH, "FInfo0DlgProc", 0, "")
  139.         UIPop 1
  140.         ERR% = STFQUIT '' Not Enhanced mode.
  141.         GOTO QUIT
  142.     END IF
  143.     END IF
  144.  
  145.  
  146.     '' Get version of Win32s to be installed from version info in file
  147.     szNewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "WIN32S16.DLL" )
  148.  
  149.     DESTSYS$ = GetWindowsSysDir()
  150.     DEST32S$ = DESTSYS$ + "WIN32S\"
  151.     szOldVer$ ="1.00.000     "        ''Reserve space in string for version
  152.     '' If Win32s is already installed, get running version number
  153.     i% = DoesFileExist( DESTSYS$ + "W32SYS.DLL", femExists )
  154.     IF i% = 1 THEN
  155.     i% = IsWin32sLoaded( szOldVer$ )
  156.     ENDIF
  157.  
  158.     IF i% <> 0  AND  szNewVer$ <> "" THEN
  159.         IF szNewVer$ > szOldVer$ THEN
  160.             '' do nothing
  161.         ELSE
  162.             InstallWin32s% = 0
  163.         END IF
  164.     END IF
  165.  
  166.     IF InstallWin32s = 1 AND PagingEnabled() = 0 THEN
  167.     sz$ = UIStartDlg(INSTALLDLL$, NOVM, "FInfo0DlgProc", 0, "")
  168.     UIPop 1
  169.     ERR% = STFQUIT '' Enhanced mode but not paging
  170.     GOTO QUIT
  171.     END IF
  172.  
  173.     IF ShareEnabled() = 0 THEN
  174.     sz$ = UIStartDlg(INSTALLDLL$, NEEDSHARE, "FInfo0DlgProc", 0, "")
  175.     UIPop 1
  176.     ERR% = STFQUIT '' Enhanced mode but not paging
  177.     GOTO QUIT
  178.     END IF
  179.  
  180.  
  181.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  182.     IF szInf$ = "" THEN
  183.         szInf$ = GetSymbolValue("STF_CWDDIR") + "PHOTOSHP.INF"
  184.     END IF
  185.     ReadInfFile szInf$
  186.  
  187.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  188.     IF OnWindowsNT() THEN
  189.         DEST$ = WINDRIVE$ + ":\WIN32APP\PHOTOSHP"
  190.     ELSE
  191.         DEST$ = WINDRIVE$ + ":\PHOTOSHP"
  192.     END IF
  193.     SetRestartDir GetWindowsDir()
  194.  
  195.     ''CustInst list symbols
  196.     CHECKSTATES$ = "CheckItemsState"
  197.     STATUSTEXT$  = "StatusItemsText"
  198.     DRIVETEXT$   = "DriveStatusText"
  199.     FOR i% = 1 TO NUMGROUPS STEP 1
  200.         AddListItem CHECKSTATES$, "ON"
  201.     NEXT i%
  202.     FOR i% = 1 TO NUMGROUPS STEP 1
  203.         AddListItem STATUSTEXT$, ""
  204.     NEXT i%
  205.     FOR i% = 1 TO 7 STEP 1
  206.         AddListItem DRIVETEXT$, ""
  207.     NEXT i%
  208.     ReplaceListItem DRIVETEXT$, 7, DEST$
  209.  
  210.     ''Disk cost list symbols
  211.  
  212.     PROGRAMNEEDS$  = "ProgramNeeds"
  213.     TUTORIALNEEDS$ = "TutorialNeeds"
  214.     PATTERNNEEDS$  = "PatternNeeds"
  215.     DUOTONENEEDS$  = "DuotoneNeeds"
  216.     FILTERNEEDS$   = "FilterNeeds"
  217.  
  218.     EXTRACOSTS$ = "ExtraCosts"
  219.     BIGLIST$    = "BigList"
  220.  
  221.     FOR i% = 1 TO NUMGROUPS STEP 1
  222.         AddListItem BIGLIST$, ""
  223.     NEXT i%
  224.     FOR i% = 1 TO 26 STEP 1
  225.         AddListItem EXTRACOSTS$, "0"
  226.     NEXT i%
  227.  
  228.     RecalcPath
  229.     SetDriveStatus
  230.  
  231. '$IFDEF DEBUG
  232.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  233. '$ENDIF ''DEBUG
  234.  
  235.  
  236.  
  237. CUSTINST:
  238.     sz$ = UIStartDlg(INSTALLDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  239.  
  240.     IF sz$ = "CONTINUE" THEN
  241.         ''Install only if it will fit.
  242.         IF ENOUGHDISK% = 0 THEN
  243.           GOSUB TOOBIG
  244.           GOTO CUSTINST
  245.         END IF
  246.         UIPop 1
  247.         GOTO INSTALL
  248.     ELSEIF sz$ = "PATH" THEN
  249.         GOTO GETPATH
  250.     ELSEIF sz$ = "CHK1" THEN
  251.         RecalcOptFiles PROGRAMFILES
  252.         SetDriveStatus
  253.         GOTO CUSTINST
  254.     ELSEIF sz$ = "CHK2" THEN
  255.         RecalcOptFiles TUTORIALFILES
  256.         SetDriveStatus
  257.         GOTO CUSTINST
  258.     ELSEIF sz$ = "CHK3" THEN
  259.         RecalcOptFiles PATTERNFILES
  260.         SetDriveStatus
  261.         GOTO CUSTINST
  262.     ELSEIF sz$ = "CHK4" THEN
  263.         RecalcOptFiles DUOTONEFILES
  264.         SetDriveStatus
  265.         GOTO CUSTINST
  266.     ELSEIF sz$ = "CHK5" THEN
  267.         RecalcOptFiles FILTERFILES
  268.         SetDriveStatus
  269.         GOTO CUSTINST
  270.     ELSEIF sz$ = "REACTIVATE" THEN
  271.         RecalcPath
  272.         SetDriveStatus
  273.         GOTO CUSTINST
  274.     ELSE
  275.         GOSUB ASKQUIT
  276.         GOTO CUSTINST
  277.     END IF
  278.  
  279.  
  280.  
  281. INSTALL:
  282.  
  283.     CreateDir DEST$, cmoNone
  284.  
  285.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  286.          sz$ = UIStartDlg(INSTALLDLL$, PERSONALIZE, "dlgPERinstall", 0, "" )
  287.          IF sz$ <> "VALID" THEN
  288.              sz$ = UIStartDlg(INSTALLDLL$, EXITFAILURE, "FInfo0DlgProc", 0, "")
  289.              UIPop 1
  290.              END
  291.          END IF
  292.     END IF
  293.  
  294.     IF GetListItem( CHECKSTATES$, PROGRAMFILES ) = "ON" THEN
  295.     RemoveFile GetWindowsDir() + "PHOTOS30.INI", cmoNone
  296.     RemoveFile GetWindowsDir() + "PHOTOS30.PSP", cmoNone
  297.         CreateDir DEST$ + "\PLUGINS", cmoNone
  298.         CreateDir DEST$ + "\CALIBRAT", cmoNone
  299.         CreateDir DEST$ + "\BRUSHES", cmoNone
  300.         CreateDir DEST$ + "\PALETTES", cmoNone
  301.  
  302.     IF OnWindowsNT() = 0 THEN
  303.         CreateDir GetWindowsDir() + "PHOTOCD", cmoNone
  304.     END IF
  305.  
  306.     IF InstallWin32s = 1 THEN
  307.         CreateDir DEST32S$, cmoNone
  308.         IF  DoesFileExist( GetWindowsSysDir() + "olecli.dll", femExists ) = 1 THEN
  309.             IF  DoesFileExist( GetWindowsSysDir() + "olecli.w31", femExists ) = 0 THEN
  310.                 CopyFile GetWindowsSysDir() + "olecli.dll", GetWindowsSysDir() + "olecli.w31", cmoOverwrite, 0
  311.             END IF
  312.         END IF
  313.     END IF
  314.  
  315.     END IF
  316.  
  317.     IF GetListItem( CHECKSTATES$, TUTORIALFILES ) = "ON" THEN
  318.         CreateDir DEST$ + "\TUTORIAL", cmoNone
  319.     END IF
  320.  
  321.     IF GetListItem( CHECKSTATES$, PATTERNFILES ) = "ON" THEN
  322.         CreateDir DEST$ + "\PATTERNS", cmoNone
  323.     END IF
  324.  
  325.     IF GetListItem( CHECKSTATES$, DUOTONEFILES ) = "ON" THEN
  326.         CreateDir DEST$ + "\DUOTONES\DUOTONE\PMS", cmoNone
  327.         CreateDir DEST$ + "\DUOTONES\DUOTONE\PROCESS", cmoNone
  328.         CreateDir DEST$ + "\DUOTONES\DUOTONE\GRAY", cmoNone
  329.         CreateDir DEST$ + "\DUOTONES\TRITONE\PMS", cmoNone
  330.         CreateDir DEST$ + "\DUOTONES\TRITONE\PROCESS", cmoNone
  331.         CreateDir DEST$ + "\DUOTONES\TRITONE\GRAY", cmoNone
  332.         CreateDir DEST$ + "\DUOTONES\QUADTONE\PMS", cmoNone
  333.         CreateDir DEST$ + "\DUOTONES\QUADTONE\PROCESS", cmoNone
  334.         CreateDir DEST$ + "\DUOTONES\QUADTONE\GRAY", cmoNone
  335.     END IF
  336.  
  337.     IF GetListItem( CHECKSTATES$, FILTERFILES ) = "ON" THEN
  338.         CreateDir DEST$ + "\PLUGINS", cmoNone
  339.         CreateDir DEST$ + "\PLUGINS\LtStyles", cmoNone
  340.         CreateDir DEST$ + "\3RDPARTY", cmoNone
  341.         CreateDir DEST$ + "\3RDPARTY\XL77XX\TABLES", cmoNone
  342.     END IF
  343.  
  344.     ClearCopyList
  345.     AddOptFilesToCopyList PROGRAMFILES, 0
  346.     AddOptFilesToCopyList TUTORIALFILES, 0
  347.     AddOptFilesToCopyList PATTERNFILES, 0
  348.     AddOptFilesToCopyList DUOTONEFILES, 0
  349.     AddOptFilesToCopyList FILTERFILES, 0
  350.     CopyFilesInCopyList
  351.  
  352. ''    IF  DoesFileExist( GetWindowsDir() + "photos30.ini", femExists ) = 0 THEN
  353. ''    RenameFile GetWindowsDir() + "photoshp.ini", "photos25.ini"
  354. ''    RenameFIle GetWindowsDir() + "photoshp.psp", "photos25.psp"
  355. ''    END IF
  356.  
  357.     IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  358.         ''Updating PHOTOSHOP.INI and SYSTEM.INI
  359.         IF  DoesFileExist( GetWindowsDir() + "photoshp.ini", femExists ) = 1 THEN
  360.             CreateIniKeyValue GetWindowsDir() + "photoshp.ini", "Photoshop", "NOTE", "The name of the INI file for Photoshop 3.0 is photos30.ini", cmoOverwrite
  361.         END IF
  362.  
  363.         CreateIniKeyValue GetWindowsDir() + "photos30.ini", "Photoshop", "PHOTOSHOPDIRECTORY", DEST$, cmoOverwrite
  364.         CreateIniKeyValue GetWindowsDir() + "photos30.ini", "Photoshop", "PLUGINDIRECTORY", DEST$ + "\PLUGINS", cmoOverwrite
  365.         CopyFile GetWindowsDir() + "system.ini", GetWindowsDir() + "system.bak", cmoOverwrite, 0
  366.         CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobekey", "adobekey.drv", cmoOverwrite
  367.         CreateIniKeyValue GetWindowsDir() + "system.ini", "drivers", "adobemse", "adobemse.drv", cmoOverwrite
  368.  
  369.  
  370.         XXX ( DEST$ )
  371.  
  372.         IF InstallWin32s = 1 THEN
  373.  
  374.             CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "0", cmoOverwrite
  375.  
  376.             '' Indicate Win32s install failure until all files known to be copied.
  377.             ExitCode% = EXITFAILURE
  378.             ERR = 0
  379.             UpdateSystemIni
  380.             '' Terminate if unhandled fatal error
  381.             IF ERR <> 0 THEN
  382.                 GOTO QUIT
  383.             END IF
  384.  
  385.             CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "1", cmoOverwrite
  386.             CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Version", szNewVer$, cmoOverwrite
  387.             CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Nls", "AnsiCP", "1252", cmoOverwrite
  388.  
  389.         END IF
  390.  
  391.         IF OnWindowsNT() = 0 THEN
  392.             CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KEPS Precision", "DRIVE", WINDRIVE$ + ":", cmoOverwrite
  393.             CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "API", "PT_DIR", GetWindowsDir() + "PHOTOCD\", cmoOverwrite
  394.             CreateIniKeyValue GetWindowsDir() + "KPCMS.INI", "KCP", "CP_DIR", GetWindowsDir() + "PHOTOCD\", cmoOverwrite
  395.         END IF
  396.  
  397.         CreateProgmanGroup "Adobe", "", cmoNone
  398.         ShowProgmanGroup  "Adobe", 1, cmoNone
  399.         CreateProgmanItem "Adobe", "Photoshop 3.0", MakePath( DEST$, "photoshp.exe" ), "", cmoOverwrite
  400.         CreateProgmanItem "Adobe", "Photoshop ReadMe", "write.exe " + MakePath( DEST$, "psreadme.wri" ), "", cmoOverwrite
  401.  
  402.     END IF                            
  403.  
  404.  
  405.  
  406. QUIT:
  407.     ON ERROR GOTO ERRQUIT
  408.  
  409.     IF ERR = 0 THEN
  410.     IF RestartListEmpty() = 0  OR  InstallWin32s = 1  THEN
  411.         GOTO QUITR
  412.     ELSE
  413.             dlg% = EXITSUCCESS
  414.     END IF
  415.     ELSEIF ERR = STFQUIT THEN
  416.         dlg% = EXITQUIT
  417.     ELSE
  418.         dlg% = EXITFAILURE
  419.     END IF
  420. QUITL1:
  421.     sz$ = UIStartDlg(INSTALLDLL$, dlg%, "FInfo0DlgProc", 0, "")
  422.     IF sz$ = "REACTIVATE" THEN
  423.         GOTO QUITL1
  424.     END IF
  425.     UIPop 1
  426.  
  427.     END
  428.  
  429. QUITR:
  430.     sz$ = UIStartDlg(INSTALLDLL$, EXITRESTART, "FInfo0DlgProc", 0, "")
  431.     IF sz$ = "REACTIVATE" THEN
  432.     GOTO QUITR
  433.     END IF
  434.     UIPop 1
  435.  
  436.     i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  437.  
  438. ''    i% = RestartListEmpty()
  439. ''    IF i% = 0 THEN
  440. ''        i% = ExitExecRestart()
  441. ''    ELSE
  442. ''        i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  443. ''    ENDIF
  444.     GOTO QUITR
  445.  
  446. ERRQUIT:
  447.     sz$ = UIStartDlg(INSTALLDLL$, CORRUPT, "FInfo0DlgProc", 0, "")
  448.     UIPop 1
  449.     END
  450.  
  451. GETPATH:
  452.     SetSymbolValue "EditTextIn", DEST$
  453.     SetSymbolValue "EditFocus", "END"
  454. GETPATHL1:
  455.     sz$ = UIStartDlg(INSTALLDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  456.  
  457.     IF sz$ = "CONTINUE" THEN
  458.         olddest$ = DEST$
  459.         DEST$ = GetSymbolValue("EditTextOut")
  460.  
  461.         ''Validate new path.
  462.         IF IsDirWritable(DEST$) = 0 THEN
  463.             GOSUB BADPATH
  464.             GOTO GETPATHL1
  465.         END IF
  466.         UIPop 1
  467.  
  468.         ''Truncate display if too long.
  469.         IF LEN(DEST$) > 23 THEN
  470.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  471.         ELSE
  472.             ReplaceListItem DRIVETEXT$, 7, DEST$
  473.         END IF
  474.  
  475.         ''Recalc if path changed.
  476.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  477.             RecalcPath
  478.             SetDriveStatus
  479.         END IF
  480.  
  481.         olddest$ = ""
  482.         GOTO CUSTINST
  483.     ELSEIF sz$ = "REACTIVATE" THEN
  484.         RecalcPath
  485.         SetDriveStatus
  486.         GOTO GETPATHL1
  487.     ELSEIF sz$ = "EXIT" THEN
  488.         GOSUB ASKQUIT
  489.         GOTO GETPATHL1
  490.     ELSE
  491.         UIPop 1
  492.         GOTO CUSTINST
  493.     END IF
  494.  
  495.  
  496.  
  497. TOOBIG:
  498.     sz$ = UIStartDlg(INSTALLDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  499.     IF sz$ = "REACTIVATE" THEN
  500.         RecalcPath
  501.         SetDriveStatus
  502.         GOTO TOOBIG
  503.     END IF
  504.     UIPop 1
  505.     RETURN
  506.  
  507.  
  508.  
  509. BADPATH:
  510.     sz$ = UIStartDlg(INSTALLDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  511.     IF sz$ = "REACTIVATE" THEN
  512.         RecalcPath
  513.         SetDriveStatus
  514.         GOTO BADPATH
  515.     END IF
  516.     UIPop 1
  517.     RETURN
  518.  
  519.  
  520.  
  521. ASKQUIT:
  522.     sz$ = UIStartDlg(INSTALLDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  523.  
  524.     IF sz$ = "EXIT" THEN
  525.         UIPopAll
  526.         ERROR STFQUIT
  527.     ELSEIF sz$ = "REACTIVATE" THEN
  528.         GOTO ASKQUIT
  529.     ELSE
  530.         UIPop 1
  531.     END IF
  532.     RETURN
  533.  
  534.  
  535.  
  536. '**
  537. '** Purpose:
  538. '**     Adds the specified option files to the copy list.
  539. '** Arguments:
  540. '**     ftype%  - type of files to add, one of the following:
  541. '**             PROGRAMFILES, DUOTONEFILES ...
  542. '** Returns:
  543. '**     none.
  544. '*************************************************************************
  545. SUB AddOptFilesToCopyList (ftype%, bogus%) STATIC
  546.  
  547.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  548.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  549.         IF ftype% = PROGRAMFILES THEN
  550.             AddSectionFilesToCopyList "ProgramFiles", SrcDir$, DEST$
  551.             AddSectionFilesToCopyList "PluginFiles", SrcDir$, DEST$ + "\plugins"
  552.             AddSectionFilesToCopyList "ProgramWinSysNTFiles", SrcDir$, GetWindowsSysDir()
  553.             IF OnWindowsNT() = 0 THEN
  554.                 AddSectionFilesToCopyList "PluginFiles16", SrcDir$, DEST$ + "\plugins"
  555.                 AddSectionFilesToCopyList "ProgramWinSysFiles", SrcDir$, GetWindowsSysDir()
  556.  
  557.                 AddSectionFilesToCopyList "PhotoCDWin", SrcDir$, GetWindowsDir()
  558.                 AddSectionFilesToCopyList "PhotoCDWinPhotoCD", SrcDir$, GetWindowsDir() + "photocd"
  559.             ELSE
  560.                 AddSectionFilesToCopyList "PluginFiles32", SrcDir$, DEST$ + "\plugins"
  561.             END IF
  562.             AddSectionFilesToCopyList "ProgramWinFiles", SrcDir$, GetWindowsDir()
  563.             AddSectionFilesToCopyList "CalibrateFiles", SrcDir$, DEST$ + "\calibrat"
  564.             AddSectionFilesToCopyList "BrushFiles", SrcDir$, DEST$ + "\brushes"
  565.             AddSectionFilesToCopyList "PaletteFiles", SrcDir$, DEST$ + "\palettes"
  566.       IF bogus% = 1 THEN
  567.             AddSectionFilesToCopyList "BogusFiles", SrcDir$, DEST$
  568.       ELSE
  569.             AddSectionFilesToCopyList "SplitFiles", SrcDir$, DEST$
  570.       END IF
  571.       IF InstallWin32s = 1 THEN
  572.         AddSectionFilesToCopyList "Win32sWinSys", SrcDir$, DESTSYS$
  573.         AddSectionFilesToCopyList "Win32sWinSysWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
  574.       END IF
  575.         ELSEIF ftype% = TUTORIALFILES THEN
  576.             AddSectionFilesToCopyList "TutorialFiles", SrcDir$, DEST$ + "\tutorial"
  577.         ELSEIF ftype% = PATTERNFILES THEN
  578.             AddSectionFilesToCopyList "PatternFiles", SrcDir$, DEST$ + "\patterns"
  579.         ELSEIF ftype% = DUOTONEFILES THEN
  580.             AddSectionFilesToCopyList "DuoDuoPms", SrcDir$, DEST$ + "\duotones\duotone\pms"
  581.             AddSectionFilesToCopyList "DuoDuoProc", SrcDir$, DEST$ + "\duotones\duotone\process"
  582.             AddSectionFilesToCopyList "DuoDuoGray", SrcDir$, DEST$ + "\duotones\duotone\gray"
  583.             AddSectionFilesToCopyList "DuoTriPms", SrcDir$, DEST$ + "\duotones\tritone\pms"
  584.             AddSectionFilesToCopyList "DuoTriProc", SrcDir$, DEST$ + "\duotones\tritone\process"
  585.             AddSectionFilesToCopyList "DuoTriGray", SrcDir$, DEST$ + "\duotones\tritone\gray"
  586.             AddSectionFilesToCopyList "DuoQuadPms", SrcDir$, DEST$ + "\duotones\quadtone\pms"
  587.             AddSectionFilesToCopyList "DuoQuadProc", SrcDir$, DEST$ + "\duotones\quadtone\process"
  588.             AddSectionFilesToCopyList "DuoQuadGray", SrcDir$, DEST$ + "\duotones\quadtone\gray"
  589.     ELSEIF ftype% = FILTERFILES THEN
  590.             AddSectionFilesToCopyList "FilterFiles", SrcDir$, DEST$ + "\plugins"
  591.             AddSectionFilesToCopyList "FilterDispFiles", SrcDir$, DEST$ + "\plugins\dispmaps"
  592.             ''AddSectionFilesToCopyList "FilterVideoFiles", SrcDir$, DEST$ + "\plugins\video"
  593.             ''AddSectionFilesToCopyList "ThirdPartyFiles", SrcDir$, DEST$ + "\3rdparty"
  594.             ''AddSectionFilesToCopyList "XL77xxFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx"
  595.             ''AddSectionFilesToCopyList "XL77xxTableFiles", SrcDir$, DEST$ + "\3rdparty\xl77xx\tables"
  596.             AddSectionFilesToCopyList "LightingStyles", SrcDir$, DEST$ + "\plugins\ltstyles"
  597.         END IF
  598.         SrcDir$ = ""
  599.     END IF
  600. END SUB
  601.  
  602.  
  603. '**
  604. '** Purpose:
  605. '**     Recalculates disk space for the given option files and sets
  606. '**     the status info symbol "StatusItemsText".
  607. '** Arguments:
  608. '**     ftype% - type of files to add, one of the following:
  609. '**             PROGRAMFILES, PLUGINFILES...
  610. '** Returns:
  611. '**     none.
  612. '*************************************************************************
  613. SUB RecalcOptFiles (ftype%) STATIC
  614.     CursorSave% = ShowWaitCursor()
  615.     ClearCopyList
  616.     AddOptFilesToCopyList ftype%, 1
  617.  
  618.     fExtra% = 0
  619.     IF ftype% = PROGRAMFILES THEN
  620.         ListSym$ = PROGRAMNEEDS$
  621.         IF GetListItem(CHECKSTATES$, PROGRAMFILES) = "ON" THEN
  622.             ''Add extra cost to Windows drive for ini/progman, etc.
  623.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  624.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  625.             fExtra% = 1
  626.         END IF
  627.     ELSEIF ftype% = TUTORIALFILES THEN
  628.         ListSym$ = TUTORIALNEEDS$
  629.     ELSEIF ftype% = PATTERNFILES THEN
  630.         ListSym$ = PATTERNNEEDS$
  631.     ELSEIF ftype% = DUOTONEFILES THEN
  632.         ListSym$ = DUOTONENEEDS$
  633.     ELSEIF ftype% = FILTERFILES THEN
  634.     ListSym$ = FILTERNEEDS$
  635.     END IF
  636.  
  637.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  638.  
  639.     cost& = 0
  640.     FOR i% = 1 TO 26 STEP 1
  641.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  642.     NEXT i%
  643.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  644.  
  645.     IF StillNeed& > 0 THEN
  646.         ReplaceListItem BIGLIST$, ftype%, "YES"
  647.     ELSE
  648.         ReplaceListItem BIGLIST$, ftype%, ""
  649.     END IF
  650.  
  651.     IF fExtra% THEN
  652.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  653.     END IF
  654.     RestoreCursor CursorSave%
  655.     ListSym$ = ""
  656. END SUB
  657.  
  658.  
  659. '**
  660. '** Purpose:
  661. '**     Recalculates disk space and sets option status info according
  662. '**     to the current destination path.
  663. '** Arguments:
  664. '**     none.
  665. '** Returns:
  666. '**     none.
  667. '*************************************************************************
  668. SUB RecalcPath STATIC
  669.  
  670.     CursorSave% = ShowWaitCursor()
  671.  
  672.     RecalcOptFiles PROGRAMFILES
  673.     RecalcOptFiles TUTORIALFILES
  674.     RecalcOptFiles PATTERNFILES
  675.     RecalcOptFiles DUOTONEFILES
  676.     RecalcOptFiles FILTERFILES
  677.  
  678.     RestoreCursor CursorSave%
  679. END SUB
  680.  
  681.  
  682. '**
  683. '** Purpose:
  684. '**     Sets drive status info according to latest disk space calcs.
  685. '** Arguments:
  686. '**     none.
  687. '** Returns:
  688. '**     none.
  689. '*************************************************************************
  690. SUB SetDriveStatus STATIC
  691.  
  692.     ENOUGHDISK% = 1
  693.     drive$ = MID$(DEST$, 1, 1)
  694.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  695.     cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  696.     cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  697.     cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
  698.     cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
  699.     cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
  700.     free& = GetFreeSpaceForDrive(drive$)
  701.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  702.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  703.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  704.     IF cost& > free& THEN
  705.       ENOUGHDISK% = 0
  706.     END IF
  707.  
  708.     IF drive$ = WINDRIVE$ THEN
  709.         ReplaceListItem DRIVETEXT$, 4, ""
  710.         ReplaceListItem DRIVETEXT$, 5, ""
  711.         ReplaceListItem DRIVETEXT$, 6, ""
  712.     ELSE
  713.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  714.         cost& = VAL( GetListItem( PROGRAMNEEDS$, ndrive% ) )
  715.         cost& = cost& + VAL( GetListItem( TUTORIALNEEDS$, ndrive% ) )
  716.         cost& = cost& + VAL( GetListItem( PATTERNNEEDS$, ndrive% ) )
  717.         cost& = cost& + VAL( GetListItem( DUOTONENEEDS$, ndrive% ) )
  718.         cost& = cost& + VAL( GetListItem( FILTERNEEDS$, ndrive% ) )
  719.         IF cost& = 0 THEN
  720.             ReplaceListItem DRIVETEXT$, 4, ""
  721.             ReplaceListItem DRIVETEXT$, 5, ""
  722.             ReplaceListItem DRIVETEXT$, 6, ""
  723.         ELSE
  724.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  725.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  726.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  727.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  728.             IF cost& > free& THEN
  729.               ENOUGHDISK% = 0
  730.             END IF
  731.         END IF
  732.     END IF
  733. END SUB
  734.  
  735.  
  736. '**
  737. '** Purpose:
  738. '**     Appends a file name to the end of a directory path,
  739. '**     inserting a backslash character as needed.
  740. '** Arguments:
  741. '**     szDir$  - full directory path (with optional ending "\")
  742. '**     szFile$ - filename to append to directory
  743. '** Returns:
  744. '**     Resulting fully qualified path name.
  745. '*************************************************************************
  746. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  747.     IF szDir$ = "" THEN
  748.         MakePath = szFile$
  749.     ELSEIF szFile$ = "" THEN
  750.         MakePath = szDir$
  751.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  752.         MakePath = szDir$ + szFile$
  753.     ELSE
  754.         MakePath = szDir$ + "\" + szFile$
  755.     END IF
  756. END FUNCTION
  757.  
  758.  
  759.  
  760. SUB UpdateSystemIni STATIC
  761.  
  762.     VxDPath$ = DEST32S$ + "W32S.386"
  763.     SystemIniPath$ = GetWindowsDir()
  764.  
  765.     t% = MakeSystemIni(SystemIniPath$, VxdPath$)
  766.  
  767. END SUB
  768.  
  769.