
; Make sure user has muFS installed.
IF NOT EXISTS "LIBS:multiuser.library"
	echo "You need to have muFS installed to install muLog."
	QUIT
ENDIF

; muFS installed, now make sure the user is root (super-user)

IF `who am i q` EQ "root"

; User is root, now copy binaries, and set the permissions.
	echo "Copying binaries."
	Copy log c:           ; The two binaries.
	Copy logd c:          ;
	echo "Setting permissions."
	MProtect c:log rewd GROUP re OTHER re      ; Normal permissions.
	MProtect c:logd urewd GROUP re OTHER re    ; Set the U bit (IMPORTANT).


	Ask "Do you want to copy the documentation to HELP:English ? (Yes/No) => "
	IF WARN
		copy mulog.guide HELP:English
	ENDIF

	; Give option of starting logd from user-startup
	Ask "Do you want logd to be run on boot-up ? (Yes/No)  => "
	IF WARN
		echo "run >nil: c:logd" >> S:User-Startup  ; This will run the daemon in the background.
	ELSE
		echo "Ok, you will need to run logd manually when you wish to use log."
	ENDIF

	Ask "Do you want to start logd now ?"
	IF WARN
		; Dont redirect to >nil: in case there are any errors.
		run c:logd
		echo "Ok, you can log to the logfile by using the program c:log"
	ENDIF

ELSE
	echo "You need to login as root to install muLog"
ENDIF



