;COPYRIGHT Hewlett-Packard Company 1987, 1988, 1989, 1990, 1991


;variables map	
;	macro setvar.txt

	macro setmsg.txt
        macro ovmsg.txt			;specific for application
	macro breakit.txt
        macro setutl.txt
	macro setutl2.txt
	macro symbol.txt

	onbreak gosub break_it
	echo off

	set status 12345

install_app		   
		   
 	gosub welcome_init
 	gosub get_windows
 	gosub get_winini
 	set var022 1	
 	gosub get_app
	gosub build_dirs			   

	set var007 var004		;Set app path to OV path 
	strcat var007 var005		;  for start_install
	gosub start_install
	if var093 != null gosub install_bkground

; switch_back routine
;  If other disks were used, switch back to first disk: uncomment
;  these lines. Do not reset variables.  May be moved to line
;  where should switch back to 1st disk to finish copying. 
;  Note: Must be in the first disk for all routines except install_help,
;  install_bitmaps, install_bkgr. (Note: must be used after each 
;  switch_disk.)
	set var050 app_name1		
	set var051 app_label1
  	onerror gosub floppy_out
   	changedrive var003		
    	cd \

	gosub print_welcome		
	gosub install_bitmaps		
	gosub unpack_runtime		
	gosub print_welcome		
 	gosub install_help
  	gosub update_symbol		;Copy Symbol.ovw if not there and
					;  some versions will update.
   	gosub modify_addwin
    	gosub update_windows
 	gosub update_misc 		;modify the procedure as necessary

     	set box_fare21 up_path1		;only for Openview Windows
    	set box_fare22 up_path2		;ditto
    	gosub farewell
    	print cr 
    	print over1 cr
     	print run1 
     	if run2 != "" print run2
	print cr
    	set status 1
quit
    	if status != 1 print cr not_over cr
 	cd \
	stop

modify_addwin
;This procedure sets up the info for searching label in ADDWIN.INI.
;For more than one label, repeat the four-lines instructions.
					
	set var081 var004 	;which path to be put into ADDWIN.INI
	strcat var081 var005	
	set var082 app_hdr	;which section to be identified in ADDWIN.INI
 	set var080 app_logtxt	;for log label to be modified in ADDWIN.INI
	gosub update_addwin

        ;
	; Use same path and header values (var081, var082)
	;
 	set var080 app_alarmtxt	;alarm log label to be modified in ADDWIN.INI
	gosub update_addwin

        ;
	; Use same path and header values (var081, var082)
	;
	set var080 app_helpfile ;help file label to be modified 
	gosub update_addwin

	set var080 app_hlptxt 	;for helpdir label to be modified in ADDWIN.INI
	set var081 var006	;which path to be put into ADDWIN.INI
	set var082 app_hdr	;which section to be identified in ADDWIN.INI
	gosub update_addwin	

	set var080 app_symdtxt 	;for symbolsdir label to be modified 
				;  in ADDWIN.INI
	set var081 var095 	;which path to be put into ADDWIN.INI
	set var082 app_hdr	;which section to be identified in ADDWIN.INI
	gosub update_addwin
						
	set var080 app_bkgrtxt 	;for bkground dir label to be modified 
				;  in ADDWIN.INI
	set var081 var093 	;which path to be put into ADDWIN.INI
	set var082 app_hdr	;which section to be identified in ADDWIN.INI
	gosub update_addwin

return

update_misc

;Modifies the Autoexec.bat file 
	      
	set var068 backup_file
	set var069 bkp_file
					;Consider deleting this section.
	set update_file var004		
	set var066 var004
	set var067 null
	strcat update_file bslash backup_file
	exist update_file status
	if status = 1 goto update_misc1
					;Consider deleting this section.
	set update_file var070
	set var066 var070
	set var067 null			   
	strcat update_file bslash backup_file
	exist update_file status
	if status = 1 goto update_misc1
					;Consider deleting this section.
	strcat update_file var073
	set var067 var073		   
	strcat update_file bslash backup_file
	exist update_file status
	if status = 1 goto update_misc1 

	set update_file "C:" 
	set var066 "C:"
	set var067 null			   
	strcat update_file bslash backup_file
	exist update_file status
	if status != 1 return	       

update_misc1		   
	print cr cr cr up_arch4 	;Print 'updating AutoExec file'
	pause 3

	gosub save_backup_file

	onerror gosub floppy_out
	changedrive var003
        cd app_inst

	set find_info var004		
	strcat find_info var005

	set tmp_file var004
	strcat tmp_file bslash

	onerror gosub mod_auto_error
	run mdini.exe "appendpath" find_info update_file tmp_file

update_misc2
return

unpack_runtime
; cd to OV directory and unpack runtime executable archive

	changedrive var004
	cd var005
	
	print cr cr cr cp_arch6 cr
	print cr ucomp_warn1 cr
	print ucomp_warn2 cr
	print ucomp_warn3 cr cr
	
	run runarc_file		  ; execute self extracting archive
	delete runarc_file
return
