Author Topic: mPlayer install script & add dereg of old avi codecs ???  (Read 10874 times)

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #15 on: August 16, 2013, 11:59:37 am »
ok, I'll do that...
Allow one to turn up the volume that UNIAUD produce (louder than a whisper)
The beta work with my Sony Vaio Laptop, but can only be controlled by the OS/2 Volume control and not the other UNIAud aware mixers nor MPLayer.

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #16 on: August 26, 2013, 07:53:05 am »
The problem seem to be within UNIAUD that has to be fixed there.

PCM Volume control not available with HD Audio.
Only a whisper forum the loud speakers even when volume has been set to max.

I have to test the problem with stall/CPU 100% as I can't reproduce it reliably.

//Jan-Erik

Silvan Scherrer

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 128
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #17 on: August 26, 2013, 11:41:48 am »
please post your unimix -list. usually some switches are wrong and needs to be adjusted

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #18 on: August 26, 2013, 12:46:29 pm »
ok... I use the defaults.

UniAud #189

Silvan Scherrer

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 128
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #19 on: August 26, 2013, 02:48:55 pm »
you need to enable the front speakers probably. please play with unimix, as noted in ticket 195

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #20 on: August 28, 2013, 03:37:39 pm »
I moved the speakers to the front... and indeed the sound is louder than the whisper, though I still have to use max volume. Tweaking unimix settings as suggested didn't help though, just as I tried a few years ago.

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #21 on: September 05, 2013, 12:44:58 pm »
I added the option to install the MP3 codec and the ability to remove the MMAVI class to the script.

 Is there any more use of this class MMAVI ?

And is there a way to restore MMAVI if needed ?


Greggory

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #22 on: September 06, 2013, 02:02:10 pm »
Nice!
Please do post your code here Greggory.

I wouldn't mind if there where an Icon for program object. perhaps embedded within the script code?!
« Last Edit: September 11, 2013, 10:52:25 am by Jan-Erik Lärka »

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #23 on: December 06, 2013, 01:25:42 pm »
Nice!
Please do post your code here Greggory.

I wouldn't mind if there where an Icon for program object. perhaps embedded within the script code?!

Thanks Jan-Erik for all the code !

One thing though - what's the easiest way to add specify a specific directory from the user and pass it to your code ( Nevermind I got it). From inside the the program and NOT using the /I option from the command line.  Keep in mind that I just started on Rexx.

But drag & drop install, backup old install, add MP3, and de-register MMAVI are all done, just hung up on that one thing.

I could I send you my changes by email to look over ? The forum said it was to long to post here, I guess I could break it into two parts.

Thanks Greggory
« Last Edit: December 06, 2013, 08:29:53 pm by Greggory Shaw »

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #24 on: December 06, 2013, 01:36:29 pm »
Hi Greggory

I will also like to invite you to write some lines about MPlayer and OS/2 on the OS2World.com/wiki
It uses the same userid/password of this forum.

Regards
Martin

Sure, I'm about finished !

Drag & Drop install with backup, add MP3 codec and de-register old MMAVI class so mPlayer is the default player now !

Greggory

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #25 on: December 07, 2013, 11:38:24 am »
Hello,

I'm sure I'm not the only one that would like to see it!
Post or send it any way you like. A link here would be nice as well.

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #26 on: December 07, 2013, 12:59:23 pm »
Hello,

I'm sure I'm not the only one that would like to see it!
Post or send it any way you like. A link here would be nice as well.

NOTE: I just realized i posted the wrong version that doesn't have the advance install but that does not affect anything.


You must create a program object for this CMD file /w parameters %*%**N for drag & drop to work as intended  (This is not the whole package).

- now any mPlayer zip file dropped on the program obj is automatically installed in the x:\programs\mplayer directory.

- advanced install allow you to choose where

- a backup is made of the original install if present.

- allows you to de-register the old worthless MMAVI class so mplayer becomes the default player.

- allows you to add the MP3 codec to your system.


Here is the first half, the forum wouldn't let post the entire listing. Keep in mind that that I have little experience in Rexx and the main work is from Jan-Erik.

Thanks

Greggory


Code: [Select]
/*.  */

call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs

SIGNAL ON SYNTAX
SIGNAL ON HALT

Parse arg String var1 var2

Date = '12.06.2013'
Version='004'
FileName = var1
Location = String

cfg.snap = 0
cfg.dive = 0
cfg.vman = 0
cfg.t23 = 0
cfg.uniaud = 0
cfg.noshare = 0
cfg.bufsize = 0

Currentdir = Directory()
ProgramsDir = VALUE('PROGRAMS',,'OS2ENVIRONMENT')


/***********************************************************************
 * ATTENTION - For the DEFAULT option:                                 *
 *                                                                     *
 * In some cases this script may not find the right default path!      *
 *                                                                     *
 *     mPlayerDir = x:\Programs\mPlayer                                *
 *                                                                     *
 ***********************************************************************/

mPlayerDir =  ProgramsDir || '\MPLAYER'

BootDrive = GetOS2BootDrive()


CALL ColorPage
CALL Banner

theSelect=getSelection()

SELECT
  WHEN theSelect=1 THEN DO
SAY ""
call InstallmPlayer
        Exit 0;
  END
  WHEN theSelect=2 THEN DO
SAY ""
call Dereg
        Exit 0;
  END
  WHEN theSelect=3 THEN DO
SAY ""
call AddCodecMP3
        Exit 0;
  END
  WHEN theSelect=4 THEN DO
SAY ""
        call mPlayerAdv
  END
OTHERWISE
NOP
END

Exit 0;



getSelection: PROCEDURE

QUIT=0
SAY "Select option:"
SAY ""
SAY "    1: Install mPlayer to Boot Partition"
SAY ""
SAY "    2: De-register MMAVI multmedia class"
SAY "    3: Add the MP3 codec to the system."
SAY ""
SAY "    ('h' for help)"
SAY "    ('q' for exit)"
SAY ""
Do UNTIL QUIT=1
  say '>'
  parse value SysCurPos() with aktzeile aktspalte
  newposition=SysCurPos(aktzeile-1,2)
  pull theChar
  IF theChar='H' then call mPlayerHelp
  IF theChar='Q' then EXIT 1
  if LENGTH(theChar)==1 & VERIFY(theChar, "1234")==0 THEN QUIT=1
  ELSE
   call beep 100, 100
  call SysCurPos aktzeile-1, 0
  SAY "1B"x || "[K"
  call SysCurPos aktzeile-1, 0
END
  SAY ""
RETURN theChar


/***********************************************************************

 Install or Update Os2/eCS default mPlayer installations

 ***********************************************************************/


InstallmPlayer:

NewVer = FileName
parse var NewVer FileName "-" .

CALL mBanner

IF stream( programs_path'\MPlayer\mplayer.exe', 'C', 'query exists' ) <> ''
  THEN
      DO   
        CALL BackupMplayer
        CALL DeleteMplayer
      END

address cmd 'unzip -o ' || Location || ' -d ' || mPlayerDir;

RunDir = CurrentDir
Dir = mPlayerDir || '\' || Filename ;

CALL mPlayerConfig

say ''
say color.green || 'Updated the default ' || FileName || ' installation on your desktop...' || color.gray;
pause

RETURN


mPlayerAdv:

NewVer = FileName
parse var NewVer FileName "-" .


CALL AdvInstBanner
CALL DeleteMplayer

address cmd 'unzip -o ' || String || ' -d ' || mPlayerDir ;


RETURN


/***********************************************************************/


/***********************************************************************/


BackupMplayer:

CALL DeleteBackup

Copy_Cmd = mPlayerDir || ' ' || mPlayerDir || '-BAK\ /S /E'
XCOPY Copy_Cmd

CALL SysPutEA mPlayerDir || '-BAK', '.LONGNAME', ''

RETURN


DeleteBackup:

fDir = ProgramsDir || '\' || FileName || '-BAK'

/* We only care about the fully qualified path names and in subfolders as well,
 *  so use "O" option to drop dates, times, attribs, etc.
 */
    rtc = SysFileTree( STRIP( fDir, 'T', '\' )||"\*", "filelist", "SFO" )

/* Create worker loops */
    Do A = 1 to filelist.0    /* Loop through file list using count in stem base */
        rtc = SysFileDelete( filelist.A )                         /* delete file */
    End

RETURN


DeleteMplayer:

fDir = mPlayerDir


/* Create Match list of do-not-deletes, upper case! */
    NoDel.1='MPLAYER.EXE'
    NoDel.2='MENCODER.EXE'
    NoDel.3='CODECS'

    NoDel.0=3              /* Set stem array length */

              /* List files and delete each of them */


/* Read directory and all sub-directories and create file list in stem array filelist,
 *  take care of possible trailing back slash.
 */

/* We only care about the fully qualified path names and in subfolders as well,
 *  so use "O" option to drop dates, times, attribs, etc.
 */
    rtc = SysFileTree( STRIP( fDir, 'T', '\' )||"\*", "filelist", "SFO" )

/* Create worker loops */
    Do A = 1 to filelist.0          /* Loop through file list using count in stem base */
        Do B = 1 to NoDel.0                    /* Compare to each value in NoDel array */
            If Pos( NoDel.B, Translate( filelist.A ) ) > 0 Then   /* found a match - using upper case to ensure proper matching */
            Iterate A /* Jump to the next file in the list and don't process this one! */
        End
        rtc = SysFileDelete( filelist.A )                               /* delete file */


        /* Add programming code here to check error codes if wanted - for instance cant delete because locked file */
        /* If rtc = 0 Then Say FileSpec( filelist.A, 'N' ) 'deleted' */
    End
PAUSE

RETURN


/***********************************************************************/


/***********************************************************************/




ColorPage:

/***********************************************************************
   Set some colors, thanx to Dmitry A.Steklenev for the inspiration    *
   enable ANSI extended screen and keyboard control                    *
                                                                       */

'@ansi on > nul'
color.brown   = "1B"x"[0;33m"
color.red     = "1B"x"[1;31m"
color.green   = "1B"x"[1;32m"
color.yellow  = "1B"x"[1;33m"
color.blue    = "1B"x"[1;34m"
color.magenta = "1B"x"[1;35m"
color.cyan    = "1B"x"[1;36m"
color.white   = "1B"x"[1;37m"
color.gray    = "1B"x"[0m"

RETURN


Banner:

/***********************************************************************
   Startup Message                                                     *
                                                                       */

say color.gray  || 'Thank you for using '|| color.magenta || 'mPlayerDD' ||,
color.gray || ', an automated tool for Os2/eCs.'
say color.cyan || 'Version ' || Version || color.gray || ' -- ' || Date
say ''
say color.gray || 'This Program is released under the Gnu Public Licence',
|| '(GPL).'
say 'See the file COPYING for further information.'
say color.gray  || 'Copyright (c) 2011 by '|| color.white ||,
'Greggory Shaw'
say ''
say color.gray  || 'Default option will install or upgrade the default ' || color.green  || 'mPlayer' || color.gray || ' installation'
say '(as defined by SET PROGRAMS=' || color.green || mPlayerDir || color.gray || ') on your eCS system.'
say ''
say 'Use the advance option to specify the install locations.'
say ''

RETURN


mBanner:

/***********************************************************************
   Default Option Message                                              *
                                                                       */
cls
say ''
say color.green || 'Default Option:' || color.gray
say ''
say color.gray  || 'This option automatically installs' color.green || FileName || color.gray || ' to the'
say "default location " || color.green || mPlayerDir || color.gray ||' set by eCS.'
say ''
say 'A backup of the original will be create in ' || color.green || mPlayerDir || '-BAK' || color.gray
say ''
say 'Is this the correct default path ?'
say ''
say color.green || ProgramsDir || '\' || FileName || color.gray

   key = SysGetKey()
   parse upper var key key
   if key <> 'Y' then call DontInstall

RETURN


AdvInstBanner:

/***********************************************************************
   Advanced Option Message                                             *
                                                                       */
cls
say ''
say color.green || 'Advanced Option:' || color.gray
say ''
say 'Please enter the installation directory for ' || FileName || '.'
say ''
say 'If installing to root do not use the backslash (\),'
say 'use this format (E:)'
say ''
say '----------------------------------------------------'

PARSE PULL mPlayerDir

cls
say ''
say 'Is this the correct path ?'
say ''
say color.green ||mPlayerDir || color.gray
say ''
say 'y/n?'
say ''

key = SysGetKey()
parse upper var key key
if key <> 'Y' then call DontInstall

say ''
say ''
say 'If you are installing to a existing ' || FileName || ' directory'
say 'would you like to create a backup of your current installation?'
say ''
say color.green ||mPlayerDir || color.gray

fDir = mPlayerDir || '\' || FileName || '-BAK'

key = SysGetKey('NOECHO')
parse upper var key key
if key == 'Y' then call BackupMplayer

RETURN


mHelp:

/***********************************************************************
   Help Message                                                        *
                                                                       */

CLS
say ''
SAY color.green || 'Default install option:' || color.gray
say ''
say ''
pause

CLS
say ''
say color.green || 'Advanced install option:' || color.gray
say ''
say ''
pause

CLS
say ''
say ''
pause
CLS

RETURN


/***********************************************************************/


/***********************************************************************/




mPlayerConfig:

/***********************************************************************
   Install mPlayer to the x:\PROGRAMS directory                        *
                                                                       */

env = 'ENVIRONMENT'
cfg.wo = ( pos( '/WO', translate( ARG(1) ) ) > 0 )
if cfg.wo = 0 then
do
   cfg.snap = ( pos( '/SNAP', translate( ARG(1) ) ) > 0 )
   if cfg.snap = 0 then
      cfg.vman = ( pos( '/VMAN', translate( ARG(1) ) ) > 0 )
   if cfg.snap = 0 & cfg.vman = 0 then
      cfg.t23 = ( pos( '/T23', translate( ARG(1) ) ) > 0 )
   if cfg.snap = 0 & cfg.vman = 0  & cfg.t23 = 0 then
      cfg.dive = ( pos( '/DIVE', translate( ARG(1) ) ) > 0 )
   else cfg.dive = 0
end
cfg.vo = ( pos( '/VO', translate( ARG(1) ) ) > 0 )
cfg.dart = ( pos( '/DART', translate( ARG(1) ) ) > 0 )
if cfg.dart = 0 then
   cfg.uniaud = ( pos( '/UNIAUD', translate( ARG(1) ) ) > 0 )
if cfg.dart = 0 & cfg.uniaud = 0 then
   cfg.noshare = ( pos( '/NOSHARE', translate( ARG(1) ) ) > 0 )
if cfg.dart = 0 & cfg.uniaud = 0 & cfg.noshare = 0 then
   parse value translate( ARG(1) ) with .'/BUFSIZE'buf_size'/'.
if datatype( strip( buf_size ), 'W' ) then
   cfg.bufsize = strip( buf_size )

home_path = VALUE( 'HOME',, env )
if length( home_path ) = 0 then
    home_path = OSBootDrive()'\Apps'
   
if pos( '/I', translate( ARG(1) ) ) >  0 then
do
   parse value translate( ARG(1) ) with .'/I'programs_path'/'.
   programs_path = strip( programs_path )
end
if directory( programs_path ) = '' then
do
   programs_path = VALUE( 'PROGRAMS',, env )
   if length( programs_path ) = 0 then
       programs_path = VALUE( 'MMBASE',, env )
   if length( programs_path ) = 0 then
       programs_path = OSBootDrive()
end
if stream( programs_path'\MPlayer\mplayer.exe', 'C', 'query exists' ) <> '' then
   programs_path = programs_path'\MPlayer' /* Change MPlayer by hand if you use another folder name */
else
do
   call SysFileTree programs_path'\*mplayer.exe', 'file', 'SFO'
   if file.0 > 0 then
       programs_path = strip( filespec( 'd', file.i )||filespec( 'p', file.i ), 't', '\' )
   else
   do
       say "Can't find MPlayer in the programs directory"
       drives = SysDriveMap( 'C:', 'USED' )
       do i = 1 to words( drives )
          call SysFileTree subword( drives, i )||'\*mplayer.exe', 'file', 'SFO'
          if file.0 > 0 then
          do
             programs_path = strip( filespec( 'd', file.i )||filespec( 'p', file.i ), 't', '\' )
             leave i
          end
       end
   end
end
if stream( programs_path'\mplayer.exe', 'C', 'query exists' ) = '' then
do
    say "Can't find MPlayer on your computer"
    return 1
end

'SET MPLAYER_HOME='home_path'\.mplayer'
'SET MPLAYER_CODECS_DIR='programs_path'\Codecs'
'SET MPLAYER_PATH='programs_path'\mplayer.exe'

if ChkCreatePath( programs_path ) = 0 then
    say 'Installation Directory for MPlayer is ready'
else do
    say "Couldn't create Installation directory"
    Exit -1
end

if ChkCreatePath( VALUE( 'MPLAYER_CODECS_DIR',, env ) ) = 0 then
    say 'Directory to store MPlayer Codecs is ready'
else say 'Codec directory not available'

mplayer_home = VALUE( 'MPLAYER_HOME',, env )
if ChkCreatePath( mplayer_home ) = 0 then
do
    say 'Directory to store MPlayer configuration prepared'
    call WriteCfg mplayer_home'\config'
    call WriteInput mplayer_home'\input.conf'
    say 'Configuration written'
end
else do
    say "Couldn't create directory for MPlayer configuration,"
    say "will use standard settings instead..."
end

prgm.destpath = programs_path
prgm.name = 'mplayer.exe'
prgm.objid = 'MPPLAYER'
prgm.icon = 'Video.ico'
prgm.wpname = 'MPlayer'
prgm.wpdest = ''
prgm.params = '"%**P\%**F"'
prgm.assocfilter = '*.mpg,*.avi,*.wmv,*.mov,*.divx,*.flv,*.mpeg,*.vob,*.mp4,*.asf,*.mkv,*.matroska,*.fli,*.m4v,*.rm,*.ram'
rc = CreatePrgmObj()
exit rc

CreatePrgmObj: procedure expose prgm.
    setupstring = 'OBJECTID=<'prgm.objid'>;EXENAME='prgm.destpath'\'prgm.name';PROGTYPE=PM;PARAMETERS='prgm.params';ASSOCFILTER='prgm.assocfilter';ICONFILE='prgm.icon';'

/*Create program in folder and attach icon*/
    rc = SysCreateObject( 'WPProgram', prgm.wpname, prgm.wpdest, setupstring, 'U' )
    if rc then
        say prgm.wpname' has been successfully installed'
    else
        say  prgm.wpname' failed installation'
Return rc
   
WriteCfg: procedure expose cfg.
    retval = stream( ARG(1), 'C', 'QUERY EXIST' )
    if retval <> '' then '@DEL 'ARG(1)' /F'
    if stream( ARG(1), 'C', 'OPEN WRITE' ) = 'READY:' then
    do
        call lineout ARG(1), '# Write your default config options here!'
        call lineout ARG(1), 'ao=kai:dart'
        call lineout ARG(1), ''
        call lineout ARG(1), '# Settings for stream/file caching'
        call lineout ARG(1), 'cache=12288'
        call lineout ARG(1), 'cache-min=30'
        call lineout ARG(1), ''
        call lineout ARG(1), '# Setting for Browser User Agent response'
        call lineout ARG(1), 'user-agent=NSPlayer/4.1.0.3856'
        if cfg.wo then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use WarpOverlay'
            call lineout ARG(1), 'vo=kva:wo'
        end
        else if cfg.snap then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use SNAP'
            call lineout ARG(1), 'vo=kva:snap'
        end
        else if cfg.vman then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use VMAN'
            call lineout ARG(1), 'vo=kva:vman'
        end
        else if cfg.dive then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use DIVE'
            call lineout ARG(1), 'vo=kva:dive'
        end
        if cfg.dart then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use DART'
            call lineout ARG(1), 'ao=kai:dart'
        end
        else if cfg.uniaud then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use UniAUD'
            call lineout ARG(1), 'ao=kai:uniaud'
        end
        else if cfg.noshare then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use DART No Share'
            call lineout ARG(1), 'ao=kai:noshare'
        end
        if cfg.bufsize then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use buffer size'
            call lineout ARG(1), 'ao=kai:bufsize'||cfg.bufsize
        end
        if cfg.vo then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Video Overlay Options and VIO Message Window Options'
            call lineout ARG(1), 'really-quiet=yes'
            call lineout ARG(1), 'fixed-vo=yes'
            call lineout ARG(1), 'colorkey=0x000001'
        end
        call stream ARG(1), 'C', 'CLOSE'
    end
Return 0
   
WriteInput: procedure expose cfg.
    retval = stream( ARG(1), 'C', 'QUERY EXIST' )
    if retval <> '' then '@DEL 'ARG(1)' /F'
    if stream( ARG(1), 'C', 'OPEN WRITE' ) = 'READY:' then
    do
        call lineout ARG(1), '# Settings for User Control of mPlayer playback'
        call lineout ARG(1), 'MOUSE_BTN2 vo_fullscreen'
        call lineout ARG(1), 'PGUP pt_step -1'
        call lineout ARG(1), 'PGDWN pt_step 1'
        call lineout ARG(1), '+ volume 5'
        call lineout ARG(1), '- volume -5'
        call stream ARG(1), 'C', 'CLOSE'
    end
Return 0
   
OSBootDrive: procedure
    BootDrive = substr( value( 'RUNWORKPLACE' ,, 'ENVIRONMENT' ), 1, 2 )

    if BootDrive = '' then
        BootDrive = substr( value( 'COMSPEC' ,, 'ENVIRONMENT' ), 1, 2 )

    if length( BootDrive ) = 0 then
        BootDrive = 'C:'
Return BootDrive
   
ChkCreatePath: procedure
    rc = ( directory( ARG(1) ) = '' )
    if rc = 1 then
        call ChkCreatePath strip( filespec( 'D', ARG(1) )||filespec( 'P', ARG(1) ), 'T', '\' )
    if rc = 1 then
        '@mkdir 'ARG(1)
Return RC

/* End of part one */


« Last Edit: December 07, 2013, 04:58:00 pm by Greggory Shaw »

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #27 on: December 07, 2013, 01:10:27 pm »
Here's the second half.

Code: [Select]



Dereg:

/***********************************************************************
   De-register MMAVI classes                                           *
                                                                       */
cls
say 'Option - De-register the MMAVI class'
say ''
say ''
say color.red ||'*** Warning *** -- You are about to de-register a WPS class.' || color.gray
say ''
say 'The MMAVI class is very old and out of date. I have never had problems'
say 'deleting MMAVI, however be sure to have a backup before proceeding.'
say ''
say 'This will allow mPlayer to become the first play option for AVI files.'
say ''
say 'Y/n?'
say ''

key = SysGetKey()
parse upper var key key
if key <> 'Y' then call DontInstall

    Call SysDeregisterObjectClass("MMAVI")
Return


AddCodecMP3:

/***********************************************************************
   Register MP3 codecs                                                 *
                                                                       */

cls
say 'Option - Add the MP3 codec to Os2/eCs'
say ''
say 'Y/n?'
say ''

key = SysGetKey()
parse upper var key key
if key <> 'Y' then call DontInstall

progPath = CurrentDir
progName = "install_MP3.cmd"

/* code sequence to call another CMD file from within an CMD file     */

  cmdLine = progPath || '\' || progName
  "cmd /c " cmdLine
                        /* "RC" contains the return code              */
  if rc <> 0 & rc <> "RC" then
    say "Error: The program ends with RC = " || rc

pause;

RETURN



/***********************************************************************
   Query the bootdrive                                                 *
                                                                       */
GetOS2BootDrive: PROCEDURE expose (exposeList)

                    /* install a local error handler                   */
  signal on Syntax name GetOS2BootDrive1

  boot_drive = ''
  boot_drive = SysBootDrive()

GetOS2BootDrive1:
                    /* if SysBootDrive() failed, boot_drive is still   */
                    /* empty                                           */
                    /* SysBootDrive() is only in the newer versions    */
                    /* of REXXUTIL!                                    */

  if boot_drive = '' then
  do
                    /* You should do further tests to ensure that      */
                    /* the result of this method is correct!           */

    parse upper value VALUE( "PATH",, prog.__env ) with "\OS2\SYSTEM" -2,
                        boot_drive +2
  end                                       /* if boot_drive = '' then */

return boot_drive


DontInstall:

say ''
say ''
say color.red || 'Installation was canceled.'  || color.gray;
pause;

EXIT 0;


SYNTAX:
 SAY 'SYNTAX ERROR:' errortext( rc ) 'in:'
 SAY sourceline( sigl )
 'pause'
 EXIT
 RETURN

HALT:
 SAY 'HALT occurred in:'
 SAY sourceline( sigl )
 'pause'
 EXIT
 RETURN

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #28 on: April 01, 2014, 07:33:04 pm »
Hi Greggory

I will also like to invite you to write some lines about MPlayer and OS/2 on the OS2World.com/wiki
It uses the same userid/password of this forum.

Regards
Martin


I'm going to be offline for about a week, but I'll write something up during that time. I just finished an install script for mplayer, mp3 codec and remove the old MMAVI codecs !

Greggory

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 415
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #29 on: July 11, 2014, 01:57:02 am »
Upadated Media Pack & Drag & Drop Install script for Mplayer/2 !

Updated to v.008 - http://www.os2notes.com/os2mplayer.html

Need help improving this please !

Media Pack started as a Rexx install script for mPlayer, now it has the ablity to install mPlayer/2 by Drag & Drop. The ability to install the MP3 codec and remove the old MMAVI class has also been added to the script.

With the MMAVI class gone Mplayer becomes the default player for AVI files, no more right clicks just to play.  :D


Cheers

Greggory
« Last Edit: July 11, 2014, 02:53:17 am by Greggory Shaw »