home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 27 / CDROM27.iso / share / os2 / mseq / install.cmd < prev    next >
Encoding:
Text File  |  1998-09-07  |  4.7 KB  |  149 lines

  1. /**********************************************************/
  2. /*            MIDI Station Sequencer for OS/2             */
  3. /*                    Version 1.1                         */
  4. /*                 Installation Program                   */
  5. /*         (C) Copyright 1998 Christopher Hodges          */
  6. /**********************************************************/
  7.  
  8. /* Load system functions. */
  9. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  10. Call SysLoadFuncs
  11.  
  12. InstallDir = ''
  13. StartupDir = Directory()
  14.  
  15. /* Product Information */
  16. '@cls'
  17. Say 'MIDI Station Sequencer for OS/2 Version 1.1'
  18. Say '   (C) Copyright 1998 Christopher Hodges'
  19. Say '          All rights reserved.'
  20. /* Query installation directory. */
  21.  
  22. Call GetMStationInstallDir
  23.  
  24. Call Install
  25.  
  26. Exit
  27.  
  28.  
  29. GetMStationInstallDir:
  30.  
  31.     If InstallDir = '' Then Do
  32.         Say
  33.         Say 'Please enter the directory you wish to install to:  (Ex: C:\SEQUENCE)'
  34.         Call CharOut, '=> '
  35.         Parse Pull InstallDir
  36.         Say
  37.     End
  38.     If InstallDir = '' Then Do
  39.         Say 'Error: Could not find installation dir.'
  40.         Exit
  41.     End
  42.  
  43.     /* Check if dir exists. */
  44.     If Stream( InstallDir, 'c', 'query exists' ) = '' Then Do
  45.         rc = SysMkDir( InstallDir )
  46.         If rc <> 0 & rc <> 5 Then Do
  47.             Say 'Error: Could not make directory ('InstallDir'), error code = ('rc')'
  48.             Exit
  49.         End
  50.         Else If rc = 0 Then Do
  51.                Say 'Directory ('InstallDir') created...'
  52.              End
  53.     End
  54.  
  55.     /* Write installation directory. */
  56.     Say 'Installation directory is ('InstallDir')'
  57.     return
  58.  
  59.  
  60. Install:
  61.  
  62.     /* Unpack files. */
  63.  
  64.         /* Unpack file to installation directory. */
  65.         Call ChangeDriveAndPath InstallDir
  66.         Say 'In install directory'
  67.         Attrib -r SEQUENCE.INI
  68.         Copy StartupDir'\MSEQUNCE.EXE' InstallDir
  69.         Copy StartupDir'\MSTATSEQ.HLP' InstallDir
  70.         Copy StartupDir'\MSTATSEQ.INF' InstallDir
  71.         Copy StartupDir'\METNOME.WAV'  InstallDir
  72.         Copy StartupDir'\SEQUENCE.INI' InstallDir
  73.         Copy StartupDir'\BMTMICRO.TXT' InstallDir
  74.         Copy StartupDir'\README.1ST'   InstallDir
  75.         Say
  76.         /* Change back to startup directory. */
  77.         Call ChangeDriveAndPath StartupDir
  78.         If FileSpec( Drive, StartupDir ) <> FileSpec( Drive, InstallDir ) Then
  79.             '@cd 'FileSpec( Drive, InstallDir )'\'
  80.  
  81.  
  82.     /* Create the object. */
  83.  
  84.         Say
  85.         Say 'Creating objects.'
  86.  
  87.         /* Create folder. */
  88.         rc = SysCreateObject(   'WPFolder',,
  89.                                 'MIDI Station Sequencer',,
  90.                                 '<WP_DESKTOP>',,
  91.                                 'OBJECTID=<MIDI_Station_Sequencer>;',
  92.                                 ';ICONVIEWPOS=33,33,34,34;ALWAYSSORT=YES;',
  93.                                 ,,
  94.                                 'Replace' )
  95.         If rc <> 1 Then Say  'Error: could not create the MIDI Station Sequencer Folder Object.'
  96.  
  97.         /* Create program. */
  98.         rc = SysCreateObject(   'WPProgram',,
  99.                                 'MIDI Station Sequencer',,
  100.                                 '<MIDI_Station_Sequencer>',,
  101.                                 'EXENAME='InstallDir'\MSEQUNCE.EXE;STARTUPDIR='InstallDir';OBJECTID=<MStation_Seq>;',,
  102.                                 'Replace' )
  103.         If rc <> 1 Then Say  'Error: could not create MIDI Station object.'
  104.  
  105.         setting="OBJECTID=<MSTATION_DOCS>;"||,
  106.                  "EXENAME=VIEW.EXE;"||,
  107.                  "PARAMETERS=MSTATSEQ.HLP;"||,
  108.                  "STARTUPDIR="InstallDir";"||,
  109.                  "PROGTYPE=PM;"
  110.         rc = SysCreateObject("WPProgram", "MIDI Station Sequencer Info", "<MIDI_Station_Sequencer>", setting, "R")
  111.  
  112.         If rc <> 1 Then Say  'Error: could not create MIDI Station Sequencer Information object.'
  113.  
  114.         Call SysSetObjectData '<MIDI_Station_Sequencer>', 'OPEN=DEFAULT;'
  115.  
  116.         say
  117.         say 'MIDI Station Sequencer successfully installed...'
  118.  
  119.     return
  120.  
  121.  
  122. ChangeDriveAndPath:
  123.     Parse Arg DriveAndPath
  124.  
  125.     /* Get drive and path */
  126.     Say
  127.     Say 'Changing to 'DriveAndPath
  128.     ChangeToDrive = FileSpec( Drive, DriveAndPath )
  129.     ChangeToPath = FileSpec( Path, DriveAndPath )
  130.     ChangeToPath = Left( ChangeToPath, Length( ChangeToPath ) - 1 )
  131.  
  132.     /* Change drive and path. */
  133.     Say 'Changing drive to 'ChangeToDrive
  134.     '@'ChangeToDrive
  135.     If rc <> 0 Then Do
  136.         Say 'Error: could not change drive.'
  137.         Exit
  138.     End
  139.     Say 'Changing directory to 'ChangeToPath
  140.     '@cd 'ChangeToPath
  141.     If rc <> 0 Then Do
  142.         Say 'Error: could not change directory.'
  143.         Exit
  144.     End
  145.  
  146.     return
  147.  
  148.  
  149.