; Update device
CopyStore diskimage_device/Devs/diskimage.device DEVS:

; Update plugins
If NOT EXISTS DEVS:DiskImage
; Create the plugins dir if it doesn't exist.
; User must have a really ancient device version installed.
Makedir DEVS:DiskImage
EndIf

CopyStore diskimage_device/Devs/DiskImage/CCD DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/CISO DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/CPC DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/Crypt DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/CUE DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/DAA DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/DAX DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/DMG DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/DMS DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/G64 DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/GI DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/IPF DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/ISZ DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/MDS DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/NRG DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/UIF DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/VDI DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/VMDK DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/XAD DEVS:DiskImage
CopyStore diskimage_device/Devs/DiskImage/XPK DEVS:DiskImage

; Update DiskImageGUI
If EXISTS ENV:AppPaths/DiskImageGUI
Set DiskImageGUI `GetEnv AppPaths/DiskImageGUI`
CopyStore diskimage_device/DiskImageGUI "$DiskImageGUI"
Else
If EXISTS ENV:AppDir/DiskImageGUI
Set DiskImageGUI `GetEnv AppDir/DiskImageGUI`
CopyStore diskimage_device/DiskImageGUI "$DiskImageGUI"
Else
; No envvar so check in some common system directories.
If EXISTS SYS:WBStartup/DiskImageGUI
CopyStore diskimage_device/DiskImageGUI SYS:WBStartup
EndIf
If EXISTS SYS:System/DiskImageGUI
CopyStore diskimage_device/DiskImageGUI SYS:System
EndIf
If EXISTS SYS:Utilities/DiskImageGUI
CopyStore diskimage_device/DiskImageGUI SYS:Utilities
EndIf
EndIf
EndIf

; Update commandline programs
If EXISTS C:MountDiskImage
Set MountDiskImage `Which MountDiskImage`
Set MountDiskImage `PathPart DIR "$MountDiskImage"`
CopyStore diskimage_device/C/MountDiskImage "$MountDiskImage"
EndIf
If exists C:DiskImage
Set DiskImage `Which DiskImage`
Set DiskImage `PathPart DIR "$DiskImage"`
CopyStore diskimage_device/C/DiskImage "$DiskImage"
EndIf
If exists C:FixHDF
Set FixHDF `Which FixHDF`
Set FixHDF `PathPart DIR $FixHDF"`
CopyStore diskimage_device/C/FixHDF "$FixHDF"
EndIf

; Update catalogs
Copy diskimage_device/Catalogs/~(#?.#?) ALL LOCALE:Catalogs/

