.key DUMMY
.bra {
.ket }

; $VER: +AFCD_Setup+ 2.2 (20.11.97)
; by Oliver Roberts
; edited by Errol 9.2.98
;;
; Amiga Format CD Setup Script

;***********
; CD number
;
Set cdnum 25

;*************************
; Useful global variables
;
Set reqtitle "*"Amiga Format CD$cdnum*""

;******
; Init
;
FailAt 21
Resident >NIL: :C/RequestChoice FORCE

;*************************
; Check if booted from CD
;
If exists env:Choices_Run
   RequestChoice >NIL: $reqtitle "You don't need to run this script when you have*nbooted from the CD" OK
   Skip END
EndIf

;***************************************************************************
; Check to see if this script has already been run and remove assigns if so
;
If exists ENV:AFCD_Assigns
   Set choice `RequestChoice $reqtitle "Removing the assigns to Amiga Format CD$cdnum" OK Cancel`
   If $choice EQ 1
      Delete >NIL: ENV:AFCD_Assigns
      Assign C:       CD:C remove
      Assign S:       CD:S remove
      Assign Libs:    CD:Libs remove
      Assign Fonts:   CD:Fonts remove
      Path CD:C remove
      Assign CD: AFCD$cdnum: remove
   EndIf
   Skip END
Endif

;*************************
; Setup assigns and paths
;

; Echo "Now setting up assigns for the Amiga Format CD$cdnum..."

SetENV AFCD_Assigns Yes!
Assign CD: AFCD$cdnum: add

CD:c/AFCDView CD:s/disclaimer.iff >nil:

Assign C:       CD:C add
Assign S:       CD:S add
Assign Libs:    CD:Libs add
Assign Fonts:   CD:Fonts add
Path CD:C add

; Check AFCDPrefs settings and startup chosen programs
Resident >NIL: CD:C/CheckAFCDPrefs PURE

CheckAFCDPrefs
If ERROR
   Set choice `RequestChoice $reqtitle "Would you like to run the AFCD preferences program?*n*nThis will allow you to preset your choices for this*nscript and your preferred file viewers." Yes No`
   If $choice EQ 1
      CD:Prefs/AFCDPrefs
   EndIf
EndIf

CheckAFCDPrefs FONTPREFS
If ERROR
   Set choice `RequestChoice $reqtitle "Would you like our font prefs run?*n*nThis will ensure that snapshotted icons look right*nand won't affect your permanent Workbench settings." Yes No`
   If $choice EQ 1
      sys:prefs/Font use CD:+System+/Handy_Tools/FontPrefs
   EndIf
Else
   CheckAFCDPrefs FONTPREFS
   If WARN
      sys:prefs/Font use CD:+System+/Handy_Tools/FontPrefs
   EndIf
EndIf

CheckAFCDPrefs TOOLMAN
If ERROR
   Set choice `RequestChoice $reqtitle "Would you like to run ToolManager and ToolsDaemon?*n*nThey will give you added menus with some of the*nhighlights of AFCD$cdnum." Yes No`
   If $choice EQ 1
      run >nil: <nil: CD:+System+/Handy_Tools/Toolmanager config cd:+System+/Handy_Tools/tm.config
      run >nil: <nil: CD:+System+/Handy_Tools/toolsdaemon
   EndIf
Else
   CheckAFCDPrefs TOOLMAN
   If WARN
      run >nil: <nil: CD:+System+/Handy_Tools/Toolmanager config CD:+System+/Handy_Tools/tm.config
      run >nil: <nil: CD:+System+/Handy_Tools/toolsdaemon
   EndIf
EndIf

CD:C/FoW newicon.library library
If WARN
   ; NewIcons not already running
   CheckAFCDPrefs NEWICONS
   If ERROR
      Set choice `RequestChoice $reqtitle "Would you like to run NewIcons?*n*nThis will change the look of some of the icons on*nthe CD." Yes No`
      If $choice EQ 1
         run >nil: <nil: c:newicons
      EndIf
   Else
      CheckAFCDPrefs NEWICONS
      If WARN
         run >nil: <nil: c:newicons
      EndIf
   EndIf
EndIf

Resident >NIL: CheckAFCDPrefs REMOVE

EndIf

;******
; Exit
;
lab END

Resident >NIL: RequestChoice REMOVE
