;
; PM5 Installer v1.2
;
(complete 5)

(askbool
	(prompt "\n\nPhonemaster is shareware, and should be registered,\n"
		   "If used on a regulary basis...  Thanks!\n\n"
		   "Phonemaster v5.xx was created by Fini 'Warp' Alring of GiGA Prod.©96/97\n\n"
		   "Phonemaster needs Reqtools.library and Rexxreqtools.library\n"
		   "You can get them on AmiNET etc... You probably have them already.\n\n"
		   "Sys:System/Rexxmast must also be running...\n"
		   "NOTE: You can saftely UPDATE, phonemaster with this installer!!!"
	)	   
	(choices "Okay!" "Okay!")
	(help "Go on, and install!")
)

(complete 10)

(set PM5_dest (
           (askdir
            (prompt "Please select where you want to install Phonemaster v5.xx.\n"
                    "A drawer called Phonemaster will be created for it of'coz!"
            )
            (help @askdir-help)
            (default "Sys:tools/")
           )
           )
)

(complete 20)

(copyfiles (source "")
           (dest PM5_dest)
           (prompt "Installing the Phonemaster dir...")
           (infos)
           (choices "Phonemaster")
           (Optional "askuser" "force")
)    

(complete 50)

(copyfiles (source "")
           (dest "C:")
           (prompt "Installing C:PM5...")
           (choices "C/PM5")
           (Optional "askuser" "force")
)                  

(complete 55)

(set OPUS
	(askbool
		(prompt "Do you want to install  DOpus v5.xx filetype?\n Hit Help for more info...")
		(choices "Yes, I do" "No, I don't have DOpus v5.xx")
		(help "You can choose to install a Filetype for Dopus v5.xx\n"
			 "It will allow you to double click on Phone-files, to start phonemaster automatically...\n Recommended!"
		)
	)
)

(complete 60)

(if OPUS
	(copyfiles (source "")
	           (dest "DOpus5:filetypes/")
	           (prompt "Installing Dopus v5.xx filetype...")
	           (choices "DOpus5/filetypes/Phonemaster-file")
	           (Optional "askuser" "force")
	)  
)


(complete 70)

(set BOOL
	(askbool
		(set eChar (substr PM5_dest (- (strlen PM5_dest) 1)) )
			(if (= eChar ":")
				(
					(prompt  "A single assignment need to be added to your user-startup.\n"
					    "It looks like this:   Assign PM5: "PM5_dest"Phonemaster\n"
					    "(See help for more info)"
					)
				)
				(
					(prompt  "A single assignment need to be added to your user-startup.\n"
			    			"It looks like this:   Assign PM5: "PM5_dest"/Phonemaster\n"
			    			"(See help for more info)"
					)
				)	
			)      
		
	
		 (help    "PM5 needs a single assignment to be added "
	               "to the s:user-startup file. "
	               "If you do not do this, then PM5 will not work."
	               "If you have MCP, AssignEngine etc. Skip this part,"
	               "And assign PM5: with that manually instead."
	 	 )
	   	(choices "OK! Add the line" "Skip it! - I'll do it myself!")
	   	(default 0)
	)
)

(complete 80)


(set eChar (substr PM5_dest (- (strlen PM5_dest) 1)) )
(if (= eChar ":")
	(	
		(set PM5_fulldest (cat PM5_dest "Phonemaster"))
		(makeassign "PM5" PM5_fulldest)
	)
	(
		(set PM5_fulldest (cat PM5_dest "/Phonemaster"))
		(makeassign "PM5" PM5_fulldest)
	)	
)      


(complete 85)

(if BOOL
	
	(startup   "Phonemaster v5.xx"
		(prompt " The required Assignment has been set for you to run PM5. \n\n"
			"You may wish to check the s:User-Startup file to "
			"be sure everything is in the proper place."	
		)
		(help "No more help here...")
	
	
		(set eChar (substr PM5_dest (- (strlen PM5_dest) 1)) )
		(if (= eChar ":")
			(command "assign PM5: \"" PM5_dest "Phonemaster\"\n")
			(command "assign PM5: \"" PM5_dest "/Phonemaster\"\n")
		)      
	)
)


(complete 99)

(askbool
   (prompt "To start phonemaster type >  PM5  < from shell.\n"
   		 "Or use the icons in the Phonemaster drawer.\n\n"
   		 "Please read the guide for further info...\n\n"
   		 "You may have to reboot, in order for the assign to work.\n"
		 "NOTE: If you have updated Phonemaster, then delete PM5: Fini.jpeg."
   )
   (help   "No help here...")
   (choices "Have fun!" "Have even more fun!!!")
   (default 0)
)

(complete 100)
