.KEY dest/A
.BRA {
.KET }

; Generate one floppy disk.  Loops by calling itself recursively
; (to get around a bug in Execute scripts).

; Default (success) termination message.
echo >GD_TempDir:Message " Installation complete."

echo "*N[;33m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[m*N"
instutil ask -dy " Do you want to create a(nother) diskette [Y/N]? Y"
if warn
    skip DFQuit
endif

assign GD_Dest:         ; So we can test for its existence later

echo noline "*N Are you adding new fonts to an existing *E[;1mExtraFonts*E[m diskette [Y/N]? N"
instutil ask -dn ""     ; Echo kludge since ask doesn't understand "*E"
if warn

    echo "*N A new *E[;1mExtraFonts*E[m diskette will be created.*N"
    execute GD_SourceDisk:Install/CreateDisk "{dest}"

else

    echo "*N Fonts will be added to your *E[;1mExtraFonts*E[m diskette,"
    echo " and utility files will be updated if necessary.*N"
    execute GD_SourceDisk:Install/DiskMount "the *E[;1mExtraFonts*E[m disk to be updated" ExtraFonts: GD_Dest: "{dest}"

    instutil exists GD_Dest:
    if not warn
        execute GD_SourceDisk:Install/UpdateUtilities
        if not $GDIRC eq "ok"    ; If we choked ...
            assign GD_Dest:             ; ... don't proceed any further
        endif
    endif
endif

; Don't try to install if we don't have a destination
; (ie. if CreateDisk or DiskMount failed).
instutil exists GD_Dest:
if warn
    echo >GD_TempDir:Message "*E[;33m Installation aborted.*E[m"
else
    echo "*N~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

    ; Initialize free-space counter.
    instutil >GD_TempDir:free freespace GD_Dest:
    instutil -eGDIFREE join GD_TempDir:free

    execute GD_SourceDisk:Install/CopyAllFonts
endif

lab DFDiskDone

echo "*N~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
instutil join GD_TempDir:Message

; Go do another disk.  Have to do it recursively -- "skip back" doesn't
; work with sub-Execute's.
execute GD_SourceDisk:Install/DoOneFloppy "{dest}"

lab DFQuit
