; Installer generated by installjst v1.0, a script by JF Fabre
; 
; Command line: installjst Flashback f flashback flash dosfilehd
; 
(set GameDir "Flashback")

;try to figure out a place where the user usually installs his games
(if (exists "Games:" (noreq) )
    (set @default-dest "Games:")
    (if (exists "SYS:Games" (noreq) )
        (set @default-dest "SYS:Games")
        (if (exists "Work:Games" (noreq) )
            (set @default-dest "Work:Games")
            (if (exists "JEUX:" (noreq) )
               (set @default-dest "JEUX:")
               (set @default-dest "SYS:")
            )
        )
    )
)

;ask the user to select a directory to install the game into
(set default-dest
     (tackon (askdir (prompt "Where would you like " @app-name " installed?\n"
                             "A drawer called " GameDir " will be created.")
                     (help @askdir-help)
                     (default @default-dest)
                     (newpath)
             )
     GameDir
     )
)
(set @default-dest default-dest)

;create the selected directory
(makedir @default-dest
         (infos)
)

(copyfiles (source "flashback.icon")
           (dest @default-dest)
	   (newname "flashback.info")
)

(copyfiles (source "flashbackhd.readme")
           (dest @default-dest)
           (infos)
)

(askdisk
	(prompt	("\n\n\n\n\n\nPlease insert %s disk 1 in any drive" @app-name))
	(dest		"Flashback Disk 1")
	(help		"Insert disk in any floppy drive\nor you'll wait for a while!")
)

(copyfiles (source "Flashback Disk 1:")
           (dest @default-dest)
           (all)
)

(message "\n\n\n\n\nI will now patch the executable")

	(if

		(= 0 (run ("patchexe %s" (tackon @default-dest "flashback") )) )
		("")
		(abort "Could not patch executable!")
	)

(askdisk
	(prompt	("\n\n\n\n\n\nPlease insert %s disk 2 in any drive" @app-name))
	(dest		"Flashback Disk 2")
	(help		"Insert disk in any floppy drive\nor you'll wait for a while!")
)

(copyfiles (source "Flashback Disk 2:")
           (dest @default-dest)
	   (all)
)

(askdisk
	(prompt	("\n\n\n\n\n\nPlease insert %s disk 3 in any drive" @app-name))
	(dest		"Flashback Disk 3")
	(help		"Insert disk in any floppy drive\nor you'll wait for a while!")
)

(copyfiles (source "Flashback Disk 3:")
           (dest @default-dest)
	   (all)
)

(askdisk
	(prompt	("\n\n\n\n\n\nPlease insert %s disk 4 in any drive" @app-name))
	(dest		"Flashback Disk 4")
	(help		"Insert disk in any floppy drive\nor you'll wait for a while!")
)

(copyfiles (source "Flashback Disk 4:")
           (dest @default-dest)
	   (all)
)

;(delete (tackon @default-dest ".info"))

