$! install-ps-supplement.com adds ps_supplement.ps as a resource to the $! PrintServer specified. The file must be run for each PrintServer $! that is to be modified. $! $! The file prompts for all information needed to do this. Note that the $! file handles only the default installation configuration. If files have $! moved to other directories, you will have to modify this file for your $! installation. $! $! Revision history: $! $! V1.0 -- Created file. $ $! define some local symbols $ vms_err = "%DCPS-E-" $ vms_err_c = "_DCPS-E-" $ vms_i = "%DCPS-I-" $ vms_i_c = "_DCPS-I-" $ werr := write sys$error $ wout := write sys$output $ $ wout "''vms_i'Welcome, This procedure will install a resource to fix problems" $ wout "''vms_i_c'Welcome, with printing PostScript files from Macs and PCs" $! Check to see if running V4.0 or higher supporting host. $ if f$trnlnm("lps$root") .eqs. "" $ then $ werr "''vms_err'NoAction, Your system is not running at least V4.0 of the " $ werr "''vms_err_c'NoAction, Supporting Host software." $ exit $ endif $ $! Now that we know we have the right software, turn on privs to do $! everything $ on control_y then goto reset_privs $ privs = "OPER, BYPASS" ! Privs needed to run this procedure $ old_privs = f$setprv(privs) ! save privs when started $ if f$priviledge(privs) .eqs. "FALSE" then goto no_privs $! Copy file over. Remember to update file protection when it is known. $! Future improvement, copy code over only on diff of file. $ copy sys$common:[syshlp.examples.dcps]ps_supplement.ps lps$support: $ $ set default lps$support: $ $ ASK_NAME: $ inquire node_name "PrintServer node name" $ if node_name .eqs. "" then goto reset_privs $ res_file = "lpsresources." + node_name $! Check for resource file $ if f$search(res_file) .eqs. "" $ then $ werr "''vms_err'NoFile, Could not find resource file: ''res_file'" $ goto ask_name $ endif $ $! We have the resource file, now check to see if we already installed the fix $! Make search quiet $ define/user sys$output nl: $ define/user sys$command nl: $ define/user sys$error nl: $ search 'res_file' "ps_supplement.ps"/out=nl: $ s = $status $ if s .ne. %X08D78053 ! no strings match $ then $ wout "''vms_i'AlreadyUpdated, ''node_name' already has this fix" $ goto ask_name $ endif $ $! Update the resource file $ open/append res 'res_file' $ write res "# Code to improve MAC & PC file behavior" $ write res "filename ps_supplement.ps" $ write res "type prologue" $ write res "name ps_supplement" $ write res "version V1.0" $ close res $ $! Reboot PrintServer $ inquire reboot "Reboot ''node_name' to activate the fix [Y]" $ if reboot .eqs. "" then reboot = "YES" $ if reboot then mcr ncp trigger node 'node_name' $ goto ask_name $ $! Reset privs as appropriate $ goto reset_privs $ NO_PRIVS: $ werr "''vms_err'NoPrivs, Insufficient priviledges to run this com file" $ werr "''vms_err_c'NoPrivs, The following priviledges are needed: " + privs $ RESET_PRIVS: $ old_privs = f$setprv(old_privs) $ wout "''vms_i'Reminder, Your default directory is now: ''f$environment("default")' $ exit