home *** CD-ROM | disk | FTP | other *** search
Wrap
; NetPar Client Installation Script ; ; NetPar Client © MikeySoft 1997-98 "When Mikey Goes Soft" ; (transcript "NetPar Installation") ; Welcome to Netpar Installation ; (set @default-dest "DEVS:") (welcome "Please read the AmigaGuide Documentation concerning " "installation of this product. NetPar now supports the " "prt_42.50 printer package as well as the original " "parallel.device replacement. This version of NetPar is NOT " "compatible with the current NetPar Server or TestPar programs.\n\n") ;Choosing which Action the user wishes to take ; (set Action (askchoice (prompt "NetPar Client © MikeySoft 1997-98\n" "\"When Mikey Goes Soft\"\n" "\n" "What Action do you want to take?\n" "(Note: Please read AmigaGuide Docs\nabout installation first!)") (help @askchoice-help) (choices "Change Installed Settings" "Install Normal NetPar (parallel.device)" "Install PRT_42.50 NetPar (netpar.device)" "Remove NetPar Installation") (default 0) ) ) ; These are the possible Action modes. They ; are defined to make reading the installation ; script easy. (set Settings 0) (set NetPar 1) (set PRT4250 2) (set Remove 3) (debug "User Action" Action) ; ; Checking to See if NetPar Client has already been installed ; (set FinalAction 0) (set #OldPar "DEVS:orig_parallel.device") (if (exists #OldPar (noreq)) (if (= Action NetPar) (set FinalAction 1) ) ) ; Debug or Not Debug (set Mode 0) ; Debug no longer used. Mode still set by default (if (OR (= Action NetPar)(= Action PRT4250)) (if (= Mode 0) (if (patmatch "68060" (database "cpu")) ( (set #WhatCPU 3) ) ( (if (patmatch "68040" (database "cpu")) ( (set #WhatCPU 2) ) ( (if (patmatch "68030" (database "cpu")) ( (set #WhatCPU 1) ) ( (if (patmatch "68020" (database "cpu")) ( (set #WhatCPU 1) ) ( (set #WhatCPU 0) ) ) ) ) ) ) ) ) ) ) (if (OR (= Action NetPar) (= Action PRT4250 )) (if (= Mode 0) (set #MyCPU (askchoice (prompt "Which version of the NetPar Client do you \n" "want to install?\n\n") (help @askchoice-help) (choices "68000|68010" "68020|68030" "68040" "68060") (default #WhatCPU) ) ) ) ) ; NetPar Installation setup (if (= Action NetPar) (if (= Mode 0) (if (= #MyCPU 3) ( (set #NewSource "parallel.device.060") (set #NewSource2 "NetParSpool.060") ) ( (if (= #MyCPU 2) ( (set #NewSource "parallel.device.040") (set #NewSource2 "NetParSpool.040") ) ( (if (= #MyCPU 1) ( (set #NewSource "parallel.device.020") (set #NewSource2 "NetParSpool.020") ) ( (set #NewSource "parallel.device.000") (set #NewSource2 "NetParSpool.000") ) ) ) ) ) ) ) ) ; NetPar Prt_42.50 Installation setup (if (= Action PRT4250) (if (= Mode 0) (if (= #MyCPU 3) ( (set #NewSource "NetPar.device.060") (set #NewSource2 "NetParSpool.060") ) ( (if (= #MyCPU 2) ( (set #NewSource "NetPar.device.040") (set #NewSource2 "NetParSpool.040") ) ( (if (= #MyCPU 1) ( (set #NewSource "NetPar.device.020") (set #NewSource2 "NetParSpool.020") ) ( (set #NewSource "NetPar.device.000") (set #NewSource2 "NetParSpool.000") ) ) ) ) ) ) ) ) ; Start the install (if (= Action NetPar) ;Is it a New install? (if (= FinalAction 0) (if (not(exists #OldPar (noreq))) (run "rename devs:parallel.device devs:orig_parallel.device" (prompt "Renaming DEVS:Parallel.Device into DEVS:Orig_Parallel.Device. " "NetPar Client will replace your Original Parallel.device. If " "this step is skipped, the installation will not work." "\n\nNOTE: This Install Script comes with a \"Remove\" option which will " "restore your computer to it\'s original settings.") (help @run-help) (confirm) ) ) ) ) ; Copy the normal NetPar.Device (if (= Action NetPar) (if (exists #OldPar (noreq)) ; Do the Actual Copy (copylib (prompt "Copying NetPar Client into DEVS:") (help @copylib-help) (source #NewSource) (dest "DEVS:") (newname "parallel.device") (confirm) ) ) ) ; Copy the PRT_42.50 NetPar.Device (if (= Action PRT4250 ) ; Do the Actual Copy (copylib (prompt "Copying NetPar Client into DEVS:") (help @copylib-help) (source #NewSource) (dest "DEVS:") (newname "netpar.device") (confirm) ) ) ; Copy the NetParSpool (if (OR (= Action NetPar) (= Action PRT4250 )) (if (OR (exists #OldPar (noreq)) (= Action PRT4250 )) ; Do the Actual Copy (copylib (prompt "Copying NetPar Spooler into DEVS:") (help @copylib-help) (source #NewSource2) (dest "DEVS:") (newname "NetParSpool") (confirm) ) ) ) ;(if (NOT (exists "ENV:NetPar/PrinterHOST" (noreq))) ; ; Finally the Machine used message ; (if (= Action 0) ; (if (exists #OldPar (noreq)) ; (set HostName ; (askstring ; (prompt "What is the name of the host machine that you " ; "want to print to? The installer script will " ; "create a environment variable called NetPar/PrinterHOST " ; "to store this information. You can manually " ; "reset this variable later by using the setenv " ; "AmigaDOS command.") ; (help @askstring-help) ; ) ; ) ; ) ; ) ;) ;Adding the NetPar directories to env: and envarc: (if (<= Action PRT4250) (if (NOT (exists "ENV:NetPar" (noreq))) (run "makedir ENV:NetPar" (prompt "Making Directory") ) ) ) (if (<= Action PRT4250) (if (NOT (exists "ENVARC:NetPar" (noreq))) (run "makedir ENVARC:NetPar" (prompt "Making Directory") ) ) ) ;Adding the PrinterHOST ;(if (= Action 0) ; (if (exists #OldPar (noreq)) ; (run "setenv NetPar/PrinterHOST" HostName ; (prompt "Making PrinterHOST") ; ) ; ) ;) ;(if (NOT (exists "ENV:NetPar/PrinterNAME" (noreq))) ; ; PrinterName ; (if (= Action 0) ; (if (exists #OldPar (noreq)) ; (set PrintName ; (askstring ; (prompt "What is the name of the printer that you " ; "want to print to? The installer script will " ; "create a environment variable called NetPar/PrinterNAME " ; "to store this information. You can manually " ; "reset this variable later by using the setenv " ; "AmigaDOS command.") ; (help @askstring-help) ; (default "lp") ; ) ; ) ; ) ; ) ;) ;Adding the HOSTPrinter ;(if (= Action 0) ; (if (exists #OldPar (noreq)) ; (run "setenv NetPar/PrinterNAME" PrintName ; (prompt "Making PrinterNAME") ; ) ; ) ;) (if (NOT (exists "ENV:NetPar/SpoolDir" (noreq))) ; Spool Directory (if (<= Action PRT4250 ) (set SpoolDir (askdir (prompt "Where do you want to spool in printed files " "to? An additional directory will NOT be created. " "The information will be stored in ENV:NetPar/SpoolDir " "You can manually reset the variable later by using " "the setenv AmigaDOS command.") (help @askdir-help) (default "T:") ) ) ) ) ;Adding the SpoolDir (if (<= Action PRT4250) (if (exists "ENV:NetPar" (noreq)) (run "setenv NetPar/SpoolDir" SpoolDir (prompt "Making SpoolDir") ) ) ) ; ; Port Settings for Server Name and Printer Name...Go Here ; ; ; Force NetPar into a Settings mode if it appears ; as if this is the first time the program has ; been installed (set DoSetting 0) (if (OR (= Action NetPar) (= Action PRT4250)) (if (NOT (exists "ENV:NetPar/0/PrinterHOST" (noreq))) (set DoSetting 1) ) ) (if (= Action Settings) (set DoSetting 1) ) (if (= DoSetting 1) ( ; ; Getting ready to loop (set DoAgain 1) (set Unit 0) (while (= DoAgain 1) ; So Now on with the PrinterHost (set HostName "") (if (exists ("ENV:NetPar/%ld/PrinterHOST" Unit)) (set HostName (getenv ("NetPar/%ld/PrinterHOST" Unit))) ) (set HostName (askstring (prompt ("Setting up Hostname for Unit #%ld\n\nWhat is the name of the host machine that you want to print to?\nCan also be the IP Address of a Network Ready Printer.\n\n" Unit)) (help @askstring-help) (default ("%s" HostName)) ) ) ; Now comes PrinterName (set PrinterName "lp") (if (exists ("ENV:NetPar/%ld/PrinterNAME" Unit)) (set PrinterName (getenv ("NetPar/%ld/PrinterNAME" Unit))) ) (set PrinterName (askstring (prompt ("Setting up Printer Name for Unit #%ld\n\nWhat is the name of the printer connected to\n\"%s\"\n\nUse \"lp\" for Network Ready Printers.\n\n" Unit HostName)) (help @askstring-help) (default ("%s" PrinterName)) ) ) ; Time to place these values into ENV: (if (NOT (exists ("ENV:NetPar/%ld" Unit))) (run ("makedir ENV:NetPar/%ld" Unit) (prompt "Making Unit Directory") ) ) (if (exists ("ENV:NetPar/%ld" Unit)) ( (run ("setenv NetPar/%ld/PrinterHOST \"%s\"" Unit HostName) (prompt "Storing Hostname") ) (run ("setenv NetPar/%ld/PrinterNAME \"%s\"" Unit PrinterName) (prompt "Storing Printer name") ) ) ) ; Time to test for PrinterPorts (if (AND (exists "DEVS:netpar.device") (exists "DEVS:PrinterPorts")) ( ; Forcfully copy the default icon (copyfiles (prompt "Setting up PRT 42.50 Printer Port Icon") (help @copyfiles-help) (source "prt_42.50_icon/NetPar.info") (dest "DEVS:PrinterPorts") (newname ("NetPar %ld.info" Unit)) (files) (optional "force") ) ; Now set the Unit Number in the icon (tooltype (prompt "Setting up PRT 42.50 Printer Port Icon") (help @tooltype-help) (dest ("DEVS:PrinterPorts/NetPar %ld" Unit)) (settooltype "UNIT" ( "%ld" Unit)) ) ) ) ; See if we need to loop again. First loop is automatic. (set DoAgain (askchoice (prompt ("NetPar Client © MikeySoft 1997-98\n\"When Mikey Goes Soft\"\n\nWhat is next?\n\n( Next Unit : %ld )\n\n" (+ Unit 1))) (help @askchoice-help) (choices "Done Installing Ports" "Configure Next Port") (default 0) ) ) ; Add one to Unit (set Unit (+ Unit 1)) ) ) ) ; ; ; ; ; Saving settings to ENVARC: (if (<= Action PRT4250) (if (exists "ENV:NetPar" (noreq)) (run "copy ENV:NetPar ENVARC:NetPar all quiet" (prompt "Backing Up Settings") ) ) ) ;Warning message if user decides to not allow parallel.device rename... (if (= Action NetPar) (if (not (exists #OldPar (noreq))) (message "\ns s unable to rename current parallel.device to orig_parallel.device. " "Installation was NOT Complete!" (all) ) ) ) ; ; Now to check on a removal (if (= Action Remove) (if (exists #OldPar (noreq)) (if (exists "DEVS:parallel.device" (noreq)) (delete "DEVS:parallel.device" (prompt "Deleting old NetPar Client Installation") (optional "force") ) ) ) ) (if (= Action Remove) (if (exists "DEVS:NetParSpool" (noreq)) (delete "DEVS:NetParSpool" (prompt "Deleting old NetPar Client Installation") (optional "force") ) ) ) (if (= Action Remove) (if (exists "DEVS:netpar.device" (noreq)) (delete "DEVS:netpar.device" (prompt "Deleting old NetPar Client Installation") (optional "force") ) ) ) (if (= Action Remove) (if (exists #OldPar (noreq)) (rename #OldPar "DEVS:parallel.device" (prompt "Returning the original parallel.device") ) ) ) (if (= Action Remove) (if (exists "ENV:NetPar" (noreq)) (run "delete ENV:NetPar all quiet" (prompt "Removing NetPar") ) ) ) (if (= Action Remove) (if (exists "ENVARC:NetPar" (noreq)) (run "delete ENVARC:NetPar all quiet" (prompt "Removing NetPar") ) ) ) (if (= Action Remove) (if (exists "DEVS:PrinterPorts" (noreq)) (run "delete DEVS:PrinterPorts/NetPar#? quiet" (prompt "Removing NetPar") ) ) ) ; Cleaning up old NetPar setups. (if (exists "ENV:PrintHOST" (noreq)) (delete "ENV:PrintHOST" (prompt "Removing PrintHOST") (optional "force") ) ) (if (exists "ENVARC:PrintHOST" (noreq)) (delete "ENVARC:PrintHOST" (prompt "Removing PrintHOST") (optional "force") ) ) (if (exists "ENV:HOSTPrinter" (noreq)) (delete "ENV:HOSTPrinter" (prompt "Removing HOSTPrinter") (optional "force") ) ) (if (exists "ENVARC:HOSTPrinter" (noreq)) (delete "ENVARC:HOSTPrinter" (prompt "Removing HOSTPrinter") (optional "force") ) ) ;Cleaning up some Beta Versions of Netpar (if (exists "ENV:NetPar/PrinterHOST" (noreq)) (delete "ENV:NetPar/PrinterHOST" (prompt "Removing old PrinterHOST") (optional "force") ) ) (if (exists "ENVARC:NetPar/PrinterHOST" (noreq)) (delete "ENVARC:NetPar/PrinterHOST" (prompt "Removing old PrinterHOST") (optional "force") ) ) (if (exists "ENV:NetPar/PrinterNAME" (noreq)) (delete "ENV:NetPar/PrinterNAME" (prompt "Removing old PrinterNAME") (optional "force") ) ) (if (exists "ENVARC:NetPar/PrinterNAME" (noreq)) (delete "ENVARC:NetPar/PrinterNAME" (prompt "Removing old PrinterNAME") (optional "force") ) )