home *** CD-ROM | disk | FTP | other *** search
/ PC & Mediji 1997 February / PCM_9702.iso / programi / animator / aas / disk1 / animpro.mst < prev    next >
Text File  |  1995-12-17  |  13KB  |  361 lines

  1. '**************************************************************************
  2. '*                       Anim Pro SetUp
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. CONST CURVER$= "Release 1.1"
  11.  
  12. '' Buttons and Checks
  13.  
  14. CONST IDB_Install =              2000
  15. CONST IDB_Continue =             2001
  16. CONST IDB_Exit =                 2002
  17.  
  18. ''      Dialog IDs
  19.  
  20. CONST IDD_AnimProInstall =         101
  21. CONST IDD_Welcome =                102
  22. CONST IDD_ReWelcome =              103
  23. CONST IDD_Insufficient_Memory =    104
  24. CONST IDD_AskQuit =                105
  25. CONST IDD_AppHelp =                106
  26. CONST IDD_Finished =               107
  27. CONST IDD_Update=                  108
  28.  
  29. ''Bitmap ID's
  30. CONST IDBM_BackGrnd = 999
  31.  
  32. ''Bitmap ID
  33. CONST LOGO = IDBM_BackGrnd
  34.  
  35. GLOBAL DEST$        ''Default destination directory.
  36. GLOBAL OPTCUR$      ''Option selection from option dialog.
  37. GLOBAL WinDir$      ''Windows home directory
  38. GLOBAL WinSysDir$   ''Window's System's directory
  39.  
  40. GLOBAL TempMscuistf$  '' We copy mscuistf.dll over temporary so we know where it is...
  41.  
  42. REM GLOBAL CURVER$      ''Current version
  43.  
  44. DECLARE SUB Install
  45. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  46. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  47. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  48.  
  49. REM   Initialization of global variables and operations
  50. INIT:
  51.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  52.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  53.  
  54.     REM SetBitmap CUIDLL$, LOGO
  55.     SetTitle "Animator Studio Setup"
  56.  
  57.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  58.     SetSymbolValue "SIZEINI", MakePath ( SrcDir$, "size.ini" )
  59.     SetSymbolValue "SourcePath", SrcDir$
  60.     
  61.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  62.     WinDir$ = GetWindowsDir()
  63.     WinSysDir$ = GetWindowsSysDir()
  64.  
  65.     IF szInf$ = "" THEN
  66.         szInf$ = GetSymbolValue("STF_CWDDIR") + "aas.INF"
  67.     END IF
  68.     ReadInfFile szInf$
  69.  
  70.     DEST$ = "C:\animator"      '' Destination drive string.
  71.  
  72. '$IFDEF DEBUG
  73.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  74.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  75.     IF IsDriveValid(WinDrive$) = 0 THEN
  76.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  77.         GOTO QUIT
  78.     END IF
  79. '$ENDIF ''DEBUG
  80.  
  81.     REM /* Check for previous installation */
  82.     if DoesIniSectionExist ("WIN.INI", "AnimatorStudio") = 0 THEN
  83.       GOTO WELCOME_INSTALL
  84.     ENDIF
  85.       
  86. WELCOME_REINSTALL:
  87.     REM /* Check which components have been installed.  Assume they want to
  88.     REM    those components they didn't install last time.  Load previous
  89.     REM    destination drive. */
  90.  
  91.     if DoesiniKeyExist ("WIN.INI", "AnimatorStudio", "Location") THEN 
  92.         DEST$= GetiniKeyString("WIN.INI", "AnimatorStudio", "Location")
  93.     ENDIF
  94.  
  95.     invert%= 0         
  96.  
  97.     IF DoesiniKeyExist ("WIN.INI", "AnimatorStudio", "Version") THEN
  98.         IF GetiniKeyString("WIN.INI", "AnimatorStudio", "Version") < curver$ THEN
  99.             GOTO update_dlg
  100.         ELSE
  101.             GOTO reinstall_dlg
  102.         END IF
  103.     END IF
  104.  
  105.  update_dlg:     
  106.     sz$ = UIStartDlg(CUIDLL$, IDD_ReWelcome, "FInfoDlgProc", IDD_AppHelp, HELPPROC$)
  107.     IF sz$ = "CONTINUE" THEN
  108.         UIPop 1
  109.     ELSE
  110.       IF sz$ = "CANCEL" THEN
  111.           GOSUB ASKQUIT
  112.           GOTO  update_dlg
  113.       ELSE
  114.           GOTO  update_dlg
  115.       END IF
  116.     END IF
  117.     GOTO checkcorrupted
  118.  
  119.  reinstall_dlg:
  120.     sz$ = UIStartDlg(CUIDLL$, IDD_ReWelcome, "FInfoDlgProc", IDD_AppHelp, HELPPROC$)
  121.     IF sz$ = "CONTINUE" THEN
  122.         UIPop 1
  123.     ELSE
  124.       IF sz$ = "CANCEL" THEN
  125.           GOSUB ASKQUIT
  126.           GOTO  reinstall_dlg
  127.       ELSE
  128.           GOTO  reinstall_dlg
  129.       END IF
  130.     END IF
  131.  
  132.  checkcorrupted:
  133.     REM /* Check if previous installation was interrupted.  If so, assume they
  134.     REM    they want to reinstall those components they tried to install before */
  135.     IF GetIniKeyString("WIN.INI", "AnimatorStudio", "Setup Note")= "Incomplete Installation" THEN
  136.       i%= DoMsgBox("Recommend reinstall all components.  Partial installations can corrupt functioning of Animator Studio", "Last Installation was aborted before completion", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  137.     ENDIF
  138.  
  139.     GOTO PARAMETERSCREEN
  140.     
  141. WELCOME_INSTALL:
  142.     REM /* No previous installation detected.  Display introductory dialog. */
  143.     
  144.     sz$ = UIStartDlg(CUIDLL$, IDD_Welcome, "FInfoDlgProc", IDD_AppHelp, HELPPROC$)
  145.     IF sz$ <> "CANCEL" THEN
  146.         UIPop 1
  147.     ELSE
  148.         GOSUB ASKQUIT
  149.         GOTO WELCOME_INSTALL
  150.     END IF
  151.  
  152.  
  153. PARAMETERSCREEN:
  154.     REM /* This dialog is the main dialog box.  It is passed */
  155.     SetSymbolValue "DestinationDrive", DEST$
  156.     SetSymbolValue "SelectedComponents", OPTCUR$
  157.     SetSymbolValue "VersionNumber", CURVER$
  158. OPTL1:
  159.         
  160.     sz$ = UIStartDlg(CUIDLL$, IDD_AnimProInstall, "FCheckDlgProc", IDD_AppHelp, HELPPROC$)
  161.     DEST$ = GetSymbolValue("DestinationDrive")
  162.     OPTCUR$ = GetSymbolValue("SelectedComponents")
  163.     
  164.     IF sz$ = "INSTALL" THEN
  165.         UIPop(1)
  166.     ELSEIF sz$ = "REACTIVATE" THEN
  167.         GOTO OPTL1
  168.     ELSE
  169.        GOSUB ASKQUIT
  170.        GOTO OPTL1
  171.     END IF
  172.  
  173.     IF OPTCUR$="NNNNNN" THEN
  174.         i%= DoMsgBox("Nothing to install.", "Error", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  175.         GOTO OPTL1
  176.     ENDIF
  177.      
  178.     REM /* Run install routine.  This copies all of the selected files and
  179.     REM    of the system parameters */
  180.      
  181.     Install
  182.     
  183.     REM /* Run concluding dialog box */
  184.  
  185.     RESTRT% = RestartListEmpty ()
  186.     Exe$ = WinDir$ + "\_msrstrt.exe"
  187.     Batch$ = WinDir$ + "\_mssetup.bat"
  188.     empty$ = ""
  189. RESTART:
  190.      sz$= UIStartDlg(TempMscuistf$, IDD_Finished, "FInfoDlgProc", IDD_AppHelp, HELPROC$)
  191.      IF sz$ = "CONTINUE" THEN
  192.          I% = ExitWindowsExec (Exe$, empty$)
  193.          IF I% = 0 THEN
  194.             GOTO RESTART
  195.          ELSE
  196.             UIPopAll
  197.          ENDIF
  198.      ELSEIF sz$ = "EXIT" THEN
  199.          UIPopAll
  200.      ELSEIF sz$ = "REACTIVATE" THEN
  201.          GOTO RESTART
  202.      ELSE
  203.          UIPop 1
  204.      ENDIF
  205.  
  206.      END
  207.  
  208. QUIT:
  209.     ON ERROR GOTO ERRQUIT
  210.  
  211.     IF ERR = 0 THEN
  212.         dlg% = EXITSUCCESS
  213.     ELSEIF ERR = STFQUIT THEN
  214.         dlg% = EXITQUIT
  215.     ELSE
  216.         dlg% = EXITFAILURE
  217.     END IF
  218.  
  219.     END
  220.  
  221. ERRQUIT:
  222.     i% = DoMsgBox("Setup sources were corrupted.  Contact Autodesk's Product Support.", "Error", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  223.     END
  224.  
  225. BADPATH:
  226.     i%= DoMsgBox("Unable to establish target directory"+ DEST$, "Bad Path", MB_OK+MB_TASKMODAL+MB_ICONHAND )
  227.     RETURN
  228.  
  229. ASKQUIT:
  230.     sz$ = UIStartDlg(CUIDLL$, IDD_AskQuit, "FQuitDlgProc", 0, "")
  231.  
  232.     IF sz$ = "CANCEL" THEN
  233.           UIPopAll
  234.           ERROR STFQUIT
  235.     ELSEIF sz$ = "REACTIVATE" THEN
  236.           GOTO ASKQUIT
  237.     ELSE
  238.           UIPop 1
  239.     END IF
  240.     RETURN
  241.  
  242. '**
  243. '** Purpose:
  244. '**     Builds the copy list and performs all installation operations.
  245. '** Arguments:
  246. '**     none.
  247. '** Returns:
  248. '**     none.
  249. '*************************************************************************
  250. SUB Install STATIC
  251.  
  252.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  253.     CreateDir DEST$, cmoNone
  254.     
  255.     OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 1
  256.     WriteToLogFile "----------------------------------------------------------"
  257.     WriteToLogFile "An AutoDesk Inc. Product"
  258.     WriteToLogFile "Animator Studio Installation Record - " + CURVER$ + "'"
  259.     WriteToLogFile "  Destination directory: '" + DEST$ + "'"
  260.     WriteToLogFile ""
  261.       
  262.     ini$= MakePath( GetWindowsDir (), "WIN.INI" )
  263.     animini$= MakePath(DEST$, "ANIMPRO.INI")
  264.     
  265.     TempMscuistf$ = MakePath( DEST$, "mscuistf.dll" )
  266.     CopyFile GetSymbolValue("STF_CWDDIR") + "mscuistf.dll", TempMscuistf$, 0, 0
  267.  
  268.     CreateIniKeyValue ini$, "AnimatorStudio", "Location", DEST$ , cmoOverwrite
  269.     CreateIniKeyValue ini$, "AnimatorStudio", "Version", CURVER$ , cmoOverwrite
  270.     CreateIniKeyValue ini$, "AnimatorStudio", "Setup Note", "Incomplete Installation", cmoOverwrite
  271.  
  272.     SetRestartDir WinDir$
  273.     CopyFilesInCopyList
  274.  
  275.     RemoveIniKey ini$, "AnimatorStudio", "Setup Note", cmoNone
  276.  
  277.     CreateProgmanGroup "Autodesk Multimedia", "", cmoNone
  278.     ShowProgmanGroup  "Autodesk Multimedia", 1, cmoNone
  279. REM The following line is for Live Demo Version only
  280. REM Don't remove ... comment out only if not needed - this is not documented in
  281. REM Microsoft's idiotic Setup manual 
  282.     CreateProgmanItem "Autodesk Multimedia", "Product Info", "write.exe "+DEST$+"\prodinfo.wri", "", cmoOverwrite
  283.     CreateProgmanItem "Autodesk Multimedia", "Animator Studio Readme", "write.exe "+DEST$+"\readme.wri", "", cmoOverwrite
  284.     IF MID$(OPTCUR$, 1, 1)= "Y" THEN
  285.         CreateProgmanItem "Autodesk Multimedia", "Animator Studio", MakePath(DEST$, "animator.exe"), "" ,cmoOverwrite
  286.          REM clean up this old file from c0     
  287.          IF DoesFileExist (DEST$ + "\flash.exe", femExists) THEN
  288.              RemoveFile DEST$ + "\flash.exe", cmoForce
  289.          ENDIF
  290.          IF DoesFileExist (DEST$ + "\traptxen.gge", femExists) THEN
  291.              RemoveFile DEST$ + "\traptxen.gge", cmoForce
  292.          ENDIF
  293.          IF DoesFileExist (DEST$ + "\fotrap.gge", femExists) THEN
  294.              RemoveFile DEST$ + "\fotrap.gge", cmoForce
  295.          ENDIF
  296.     END IF
  297.     IF MID$(OPTCUR$, 2, 1)= "Y" THEN
  298.         CreateProgmanItem "Autodesk Multimedia", "Animator SoundLab", MakePath(DEST$, "soundlab.exe"), "", cmoOverwrite
  299.     END IF
  300.     IF MID$(OPTCUR$, 3, 1)= "Y" THEN
  301.         CreateProgmanItem "Autodesk Multimedia", "Animator Scriptor", MakePath(DEST$, "scriptor.exe"), "", cmoOverwrite
  302.     END IF
  303.     IF MID$(OPTCUR$, 4, 1)= "Y" THEN
  304.         CreateProgmanItem "Autodesk Multimedia", "Animator Player", MakePath(DEST$, "player.exe"), "", cmoOverwrite
  305.     END IF
  306.  
  307.     REM ************** Window Video .ini setup **************
  308.    WinVidSet:
  309.     IF VflatdPresent() = 0 THEN
  310.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  311.     END IF
  312. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  313. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  314. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  315. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  316. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  317. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  318. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  319. CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  320. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  321. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  322. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  323. CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  324. CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  325. CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  326. CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  327. CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  328.  
  329.  
  330. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.AASC", "AASC.drv", cmoOverwrite
  331. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.AFLC", "flccodec.drv", cmoOverwrite
  332. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.AFLI", "flccodec.drv", cmoOverwrite
  333.  
  334.     CloseLogFile
  335.  
  336. END SUB
  337.  
  338.  
  339.  
  340. '**
  341. '** Purpose:
  342. '**     Appends a file name to the end of a directory path,
  343. '**     inserting a backslash character as needed.
  344. '** Arguments:
  345. '**     szDir$  - full directory path (with optional ending "\")
  346. '**     szFile$ - filename to append to directory
  347. '** Returns:
  348. '**     Resulting fully qualified path name.
  349. '*************************************************************************
  350. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  351.     IF szDir$ = "" THEN
  352.         MakePath = szFile$
  353.     ELSEIF szFile$ = "" THEN
  354.         MakePath = szDir$
  355.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  356.         MakePath = szDir$ + szFile$
  357.     ELSE
  358.         MakePath = szDir$ + "\" + szFile$
  359.     END IF
  360. END FUNCTION
  361.