/* rexx */ '@echo off' esc= D2C(27) cr = D2C(13) vers = '1999-10-12' testrun = 'FALSE' /* the source-zip-file to unpack: */ source_file = 'Diary' /* install (and overwrite) or update (an existing program) */ install_method = 'install' say esc'[0;30;46m'esc'[K'esc'[2J' /* black on green */ say '' say 'norrsken data teknik' say '' say 'Install.CMD version' vers say '' say 'now trying to 'install_method' the 'source_file 'program...' say '' /* the usual stuff */ call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs /* parsing arguments */ /* parse arg source_file */ /* getting own path */ parse source . . this_cmd this_drive = filespec( 'drive', this_cmd ) this_path = filespec( 'path', this_cmd ) this_file = this_drive || this_path || source_file destination_path = 'D:\'source_file entered = '_______________________' say '' if (install_method = 'install') then do say 'The 'source_file' will be installed to 'destination_path'...' end else do say 'The 'source_file' will be updated in 'destination_path'...' end say 'If You want a different drive or directory, please enter it now:' do while (LENGTH(entered) > 3) entered = '' parse pull entered if (LENGTH(entered) <= 2) then do entered = '' end do while (LENGTH(entered) > 2) destination_path = entered say '' if (install_method = 'install') then do say 'The 'source_file' will be installed to 'destination_path'...' end else do say 'The 'source_file' will be updated in 'destination_path'...' end say 'If You want a different drive or directory, please enter it now:' parse pull entered end /* LENGTH(entered) */ end /* entered = '' */ if (RIGHT(destination_path, 1) \= '\') then do destination_path = destination_path || '\' end d_path = filespec('drive', destination_path) || filespec('path', destination_path) d_path = LEFT(d_path, (LENGTH(d_path)-1)) destination_path = d_path command = "unzip -o "this_file" -d "destination_path if (testrun = 'TRUE') then do say command call SysSleep 5 end command say '' say 'Well, all done for now.' say 'Bye' call SysSleep 10 exit