home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 30 fixes_v
/
30-fixes_v.zip
/
vxrx20a.zip
/
BUILDVRX.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-05-04
|
12KB
|
449 lines
/*
* buildvrx.cmd -- Build the VX REXX folder and the associated
* icons.
*/
address CMD
'@echo off'
call RXFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
call setlocal
/*
* The target directory is the parm we were passed... make sure
* the directory exists...
*/
target_dir = ''
folder_title = ''
parse arg target_dir folder_title
if( target_dir = '?' | target_dir = '/?' )then
call Usage
if( folder_title = '' )then
folder_title = 'WATCOM VX-REXX'
if( target_dir = '' )then
target_dir = directory()
if( directory( target_dir ) = '' )then
call Usage
target_dir = directory( target_dir )
if( right( target_dir, 2 ) = ':\' )then do
target_dir = left( target_dir, length( target_dir ) - 1 );
end
/*
* Clean things up first...
*/
call CleanIni
call AssignTypes
/*
* Create the main folder object
*/
say 'Building Workplace Shell VX-REXX Objects...'
classname = 'WPFolder'
title = folder_title
location = '<WP_DESKTOP>'
iconparm = 'ICONFILE=' || target_dir || '\watcom2.ico;'
setup = 'OBJECTID=<VXREXX_FOLDER>;' || iconparm
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create a Color Palette
*/
classname = 'WPColorPalette'
title = 'Color Palette'
location = '<VXREXX_FOLDER>'
call SysCreateObject classname, title, location
/*
* Create a Font Palette
*/
classname = 'WPFontPalette'
title = 'Font Palette'
location = '<VXREXX_FOLDER>'
call SysCreateObject classname, title, location
/*
* Create the book program objects
*/
classname = 'WPProgram'
title = "VX-REXX" || "0a"x || "Programmer's Guide"
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=view.exe;' ||,
'PROGTYPE=PM;' ||,
'PARAMETERS=' || target_dir || '\ProgGuid.INF;' ||,
'STARTUPDIR=' || target_dir || ';'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPProgram'
title = 'VX-REXX' || '0a'x || 'Reference'
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=view.exe;' ||,
'PROGTYPE=PM;' ||,
'PARAMETERS=' || target_dir || '\A2Z.INF;' ||,
'STARTUPDIR=' || target_dir || ';'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPProgram'
title = 'VXQE Library'
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=view.exe;' ||,
'PROGTYPE=PM;' ||,
'PARAMETERS=' || target_dir || '\VXQE.INF;' ||,
'STARTUPDIR=' || target_dir || ';'
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create the projects folder
*/
classname = 'WPShadow'
title = 'Projects'
location = '<VXREXX_FOLDER>'
setup = 'SHADOWID=' || target_dir || '\PROJECTS;OBJECTID=<VXREXX_PROJECTS>;'
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create the Samples folder
*/
classname = 'WPShadow'
title = 'Samples'
location = '<VXREXX_FOLDER>'
setup = 'SHADOWID=' || target_dir || '\SAMPLES;OBJECTID=<VXREXX_SAMPLES>;'
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create the Macros folder
*/
classname = 'WPShadow'
title = 'Macros'
location = '<VXREXX_FOLDER>'
setup = 'SHADOWID=' || target_dir || '\MACROS;OBJECTID=<VXREXX_MACROS>;'
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create a shadow of the REXX information
*/
classname = 'WPProgram'
title = 'REXX Information'
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=view.exe;' ||,
'PROGTYPE=PM;' ||,
'PARAMETERS=rexx.inf;'
call SysCreateObject classname, title, location, setup, 'r'
/* Create the Readme program object
*/
classname = 'WPProgram'
title = 'Read Me First'
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=view.exe;' ||,
'PROGTYPE=PM;' ||,
'PARAMETERS=' || target_dir || '\readme.inf;' ||,
'STARTUPDIR=' || target_dir || ';'
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create the VX REXX program object
*/
classname = 'WPProgram'
title = 'VX-REXX'
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=' || target_dir || '\vrxedit.exe;' ||,
'PROGTYPE=PM;' ||,
'ASSOCFILTER=*.VRP;' ||,
'ASSOCTYPE=VX-REXX Project;'
call SysCreateObject classname, title, location, setup, 'r'
/*
* Create the VX REXX macro-launcher object
*/
/*
Don't include this for now.
Its presence in the VX-REXX folder is confusing. People click on it and
expect something to happen. Nothing does.
We don't really expect people to drag and drop macros, or to rename them *.VRM and
double click on them. Macro's are really only run from applications.
*/
/*
classname = 'WPProgram'
title = 'VX-REXX Macro'
location = '<VXREXX_FOLDER>'
setup = 'EXENAME=' || target_dir || '\vrx.exe;' ||,
'PROGTYPE=PM;' ||,
'ASSOCFILTER=*.VRM;' ||,
'ASSOCTYPE=VX-REXX Macro;'
call SysCreateObject classname, title, location, setup, 'r'
*/
/*
* Add the project template
*/
call AddTemplate
/*
* Set the executable icon.
*/
call AddSample "Bounce", "Bounce", "Bounce"
call AddSample "button", "Button", "Button"
call AddSample "calc", "Calculator", "Calculat"
call AddSample "DDE", "DDE Explorer", "DDE_Expl"
call AddSample "DragDrop", "DragDrop", "DragDrop"
call AddSample "FileBro", "File browser", "File_Bro"
call AddSample "Focus", "Hocus focus", "Hocus_Fo"
call AddSample "hinthelp", "Hint and Help", "Hint_And"
call AddSample "mindgame", "Mind Game", "Mind_Gam"
call AddSample "mmw", "MMW", "MMW"
call AddSample "movies", "Movies", "Movies"
call AddSample "Notebook", "Notebook", "Notebook"
call AddSample "Popup", "Popup", "Popup"
call AddSample "Printing", "Printing", "Printing"
call AddSample "QEText", "Q+E Text", "Q!E_Text"
call AddSample "RGB", "RGB", "RGB"
call AddSample "threads", "Threads", "Threads"
call AddSample "sampledb", "Sample Database", "Sample_d"
call AddSample "UpdateDB", "Update DB Sample", "Update_d"
call AddSample "WinCtrl", "Window Controller","Window_C"
/* Add an icon to run the EPM demos
*/
call AddScan
exit
/****************************** End of Program ****************************/
/*
* AddTemplate
*/
AddTemplate:
classname = 'WPFolder'
title = 'VX-REXX Project'
location = target_dir || '\Projects'
setup = 'OBJECTID=<VXREXX_TEMPLATE>;' ||,
'TEMPLATE=yes;'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPDataFile'
title = 'Project.VRP'
location = '<VXREXX_TEMPLATE>'
setup = ''
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPDataFile'
title = 'Window1.VRY'
location = '<VXREXX_TEMPLATE>'
setup = ''
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPDataFile'
title = 'Window1.VRX'
location = '<VXREXX_TEMPLATE>'
setup = ''
call SysCreateObject classname, title, location, setup, 'r'
return
AddSample:
/*********
Parms: 1 directory name
2 long name
3 alternate directory name (8.3 equivalent of the long name)
*/
changeTitle = 0
startup = target_dir || '\Samples\' || arg( 1 )
folder_name = startup
exe_parms = ''
exe_name = arg( 1 ) || '.EXE'
ico_name = arg( 1 ) || '.ICO'
vrp_name = arg( 1 ) || '.VRP'
/* Are the files in the original or the alternate directory?
*/
filename = startup || "\Source\" || vrp_name
if( stream( filename, "c", "open read" ) \= "READY:" ) then do
startup = target_dir || "\Samples\" || arg(3)
filename = startup || "\Source\" || vrp_name
if( stream( filename, "c", "open read" ) \= "READY:" ) then do
return
end
end
else do
changeTitle = 1
end
call stream filename, "c", "close"
/* Make a shadow of the VRP file
*/
call SysCreateObject "WPShadow", arg(1) || ".VRP", folder_name,,
"SHADOWID=" || startup || "\Source\" || vrp_name || ";"
/* Make a program reference to the executable
*/
classname = 'WPProgram'
title = arg( 2 )
location = folder_name
setup = 'EXENAME=' || startup || '\Source\' || exe_name || ';' ||,
'PROGTYPE=PM;' ||,
'ICONFILE=' || startup || '\Source\' || ico_name || ';' ||,
'STARTUPDIR=' || startup || '\Source\;' ||,
'PARAMETERS=' || exe_parms || ';'
call SysCreateObject classname, title, location, setup, 'r'
/* Set the directory's long name
*/
if changeTitle = 1 then do
call SysSetObjectData startup, "TITLE=" || arg(2) || ";"
end
return
/*
* AddScan
*/
AddScan:
startup = target_dir || '\Samples\Scan'
folder_name = startup
ico_name = 'Scan.ICO'
classname = 'WPProgram'
title = 'EPM with Scan'
location = folder_name
setup = 'EXENAME=epm.exe;' ||,
'PROGTYPE=PM;' ||,
'ICONFILE=' || startup || '\Source\' || ico_name || ';' ||,
'STARTUPDIR=' || startup || '\Source;' ||,
"PARAMETERS=scan.erx;"
call SysCreateObject classname, title, location, setup, 'r'
/* Set the directory's long name
*/
call SysSetObjectData startup, "TITLE=Scan;"
return
/*
* AssignTypes -- Assigns the 'VX-REXX Project' type to all the .VRP files
* that have been installed.
*/
AssignTypes:
/*
type = 'VX-REXX Project'
typevalue = 'DFFF00000100FFDF'x || d2c(length(type)) || '00'x || type
call SysIni 'USER', 'PMWP_ASSOC_TYPE', type
call SysIni 'USER', 'PMWP_ASSOC_FILTER', '*.VRP'
call SysFileTree target_dir || '\*.VRP', 'files.', 'fso'
do i = 1 to files.0
call SysPutEa files.i, '.TYPE', typevalue
end
*/
return
/*
* CleanIni -- Clean up the .INI file out of old VX-REXX information.
* Cleans up old beta stuff, too.
*/
CleanIni:
call SysIni 'user', 'PMWP_ASSOC_FILTER', '*.VRP', 'DELETE:'
call SysIni 'user', 'PMWP_ASSOC_TYPE', 'VX-REXX Project', 'DELETE:'
call SysIni 'user', 'PMWP_ASSOC_TYPE', 'VRx Project', 'DELETE:'
call sysini 'user', 'PM_Workplace:Templates', 'All:', 'ids.'
do i = 1 to ids.0
if( pos( 'REXX', ids.i ) \= 0 & pos( 'VX', ids.i ) \= 0 & ,
pos( 'Project', ids.i ) \= 0 )then do
call SysIni 'user', 'PM_Workplace:Templates', ids.i, 'DELETE:'
end
if( pos( 'VRx', ids.i ) \= 0 & pos( 'Project', ids.i ) \= 0 )then do
call SysIni 'user', 'PM_Workplace:Templates', ids.i, 'DELETE:'
end
end
call SysDestroyObject '<VXREXX_SAMPLES>'
call SysDestroyObject '<VXREXX_TEMPLATE>'
call SysDestroyObject '<VXREXX_PROJECTS>'
call SysDestroyObject '<VXREXX_MACROS>'
call SysDestroyObject '<VXREXX_FOLDER>'
return
/*
* FileExists
*/
FileExists:
return( stream( arg(1), 'c', 'query exists' ) <> '' )
/*
* Usage
*/
Usage:
say ''
say 'Usage: buildvrx [target_dir] [title]'
say ''
say ' target_dir = path where WATCOM VX-REXX has been installed'
say ' title = folder title (defaults to "WATCOM VX-REXX")'
say ''
say 'This program builds/rebuilds the various Workplace Shell objects'
say 'needed to run WATCOM VX-REXX.'
exit