( set @default-dest "SYS:" )
( set vernum ( getversion "exec.library" ( resident ) ) )
( set ver ( / vernum 65536 ) )

( complete 0 )

; --------------------
; Ask what to install
; --------------------

( set parts
 ( askoptions
  ( prompt "Choose the items you would like installed." )
  ( choices "C include file"
            "MUI image sets"
            "MUI image construction kit (ILBM picture)"
            "Palettes"
            "Patterns"
            "OS 2.x window patterns"
            "Icon templates (ILBM picture)"
            "English documentation"
            "German documentation" )
  ( help "C include file: Useful new definitions for MUI programming\n\n"
         "MUI image sets: 6 new MUI image sets\n\n"
         "MUI image construction kit: Picture file in ILBM format with all MUI images\n\n"
         "Palettes: A few new palettes (alternatives to the original MagicWB palette)\n\n"
         "Patterns: New Workbench background patterns\n\n"
         "OS 2.x window patterns: old-style window patterns for the \"WBPattern\" prefs-ed\n\n"
         "Icon templates: Picture file in ILBM format with new (and old) icon templates\n\n"
         "English documentation: AmigaGuideŽ file in English language\n\n"
         "German documentation: AmigaGuideŽ file in German language\n\n" )
 )
)

( complete 10 )
  
; --------------------
; Install the include file
; --------------------

( if( IN parts 0 )
(

 ( set includedest
  ( askdir
   ( prompt "Please select a place for the include file." )
   ( default "INCLUDE:libraries/" )
   ( help "Choose a directory where the include file should be copied to. The best place is"
          "INCLUDE:libraries/." )
  )
 )

 ( makedir includedest )
 ( working "Installing include file" )
 ( copyfiles ( source "include/libraries/muidefs.h" ) ( dest includedest ) )

)
)

( complete 20 )

; --------------------
; Install the MUI image sets
; --------------------

( if( IN parts 1 )
(

 (set imgsetsdest
  ( askdir
   ( prompt "Please select a place for the MUI image sets." )
   ( default "SYS:Prefs/MUI-Images" )
   ( help "Choose a directory where the MUI image sets will be copied to. You should use the same "
          "directory as you selected during installation of MUI (default: SYS:Prefs/Mui-Images/)." )
  )
 )

 ( makedir imgsetsdest )
 
 ( set imgsets
  ( askoptions
   ( prompt "Choose the MUI image sets you would like installed.\n" )
   ( choices "Jojo_Black_11pt (You MUST have this one)"
             "Jojo_Black_13pt"
             "Jojo_3D_11pt"
             "Jojo_3D_13pt"
             "Jojo_Outline_11pt"
             "Jojo_Outline_13pt" )
   ( help "You should install at least Jojo_Black_11pt because this set contains all images.\n\n"
          "The best way is, to install all the sets. Later you can delete the sets you don't like." )
  )
 )

 ( working "Installing MUI image sets" )

 ( if( IN imgsets 0 )
 (

  ( copyfiles
   ( prompt "Installing MUI image set Jojo_Black_11pt.." )
   ( source "MUI-Images/Jojo_Black_11pt" )
   ( all )
   ( dest ( tackon imgsetsdest "Jojo_Black_11pt" ) )
  )

 )
 )
 
 ( if( IN imgsets 1 )
 (

  ( copyfiles
   ( prompt "Installing MUI image set Jojo_Black_13pt.." )
   ( source "MUI-Images/Jojo_Black_13pt" )
   ( all )
   ( dest ( tackon imgsetsdest "Jojo_Black_13pt" ) )
  )

 )
 )
 
 ( if( IN imgsets 2 )
 (

  ( copyfiles
   ( prompt "Installing MUI image set Jojo_3D_11pt.." )
   ( source "MUI-Images/Jojo_3D_11pt" )
   ( all )
   ( dest ( tackon imgsetsdest "Jojo_3D_11pt" ) )
  )

 )
 )
 
 ( if( IN imgsets 3 )
 (

  ( copyfiles
   ( prompt "Installing MUI image set Jojo_3D_13pt.." )
   ( source "MUI-Images/Jojo_3D_13pt" )
   ( all )
   ( dest ( tackon imgsetsdest "Jojo_3D_13pt" ) )
  )

 )
 )
 
 ( if( IN imgsets 4 )
 (

  ( copyfiles
   ( prompt "Installing MUI image set Jojo_Outline_11pt.." )
   ( source "MUI-Images/Jojo_Outline_11pt" )
   ( all )
   ( dest ( tackon imgsetsdest "Jojo_Outline_11pt" ) )
  )

 )
 )
 
 ( if( IN imgsets 5 )
 (

  ( copyfiles
   ( prompt "Installing MUI image set Jojo_Outline_13pt.." )
   ( source "MUI-Images/Jojo_Outline_13pt" )
   ( all )
   ( dest ( tackon imgsetsdest "Jojo_Outline_13pt" ) )
  )

 )
 )
 
)
)

( complete 30 )

; --------------------
; Install the MUI image construction kit
; --------------------

( if( IN parts 2 )
(

 ( set conkitdest
  ( askdir
   ( prompt "Please select a place for the MUI image construction file." )
   ( help "Choose a directory where the ILBM file should be copied to." )
   ( default "" )
  )
 )
 
 ( working "Installing MUI image construction kit" )
 ( makedir conkitdest )
 ( copyfiles ( source "JojoMBrKit.ilbm" ) ( dest conkitdest ) )
 ( copyfiles ( source "JojoMBrKit.ilbm.info" ) ( dest conkitdest ) )

)
)

( complete 40 )

; --------------------
; Install the palettes
; --------------------

( if( IN parts 3 )
(

 ( set palettedest
  ( askdir
   ( prompt "Please select a place for the color palettes." )
   ( default "SYS:Prefs/Presets" )
   ( help "Choose a directory where the palettes should be copied to." )
  )
 )
 
 ( working "Installing color palettes" )
 ( makedir palettedest )
 
 ( if ( < ver 39 )
 (

  ( copyfiles
   ( prompt "Installing OS 2.x palettes.." )
   ( source "OS2Palettes" )
   ( all )
   ( dest palettedest )
  )

 )
 (

  ( copyfiles
   ( prompt "Installing OS 3.x palettes.." )
   ( source "OS3Palettes" )
   ( all )
   ( dest palettedest )
  )

 )
 )

)
)

( complete 50 )

; --------------------
; Install the background patterns
; --------------------

( if( IN parts 4 )
(

 ( set patdest
  ( askdir
   ( prompt "Please select a place for the background patterns." )
   ( default "SYS:Prefs/Patterns" )
   ( help "Choose a directory where the background patterns should be copied to. This should be "
          "the same directory as your old directory with the MagicWB patterns in it." )
  )
 )

 ( working "Installing background patterns" )
 ( makedir patdest )

 ( copyfiles
  ( prompt "Installing background patterns.." )
  ( source "Patterns" )
  ( all )
  ( dest patdest )
 )

)
)

( complete 60 )

; --------------------
; Install the 2.x background patterns
; --------------------

( if( IN parts 5 )
(

 ( set winpatdest
  ( askdir
   ( prompt "Please select a place for the OS 2.x window background patterns." )
   ( default "SYS:Prefs/Presets" )
   ( help "Choose a directory where the window patterns should be copied to. This is normally "
          "SYS:Prefs/Presets/." )
  )
 )

 ( working "Installing OS 2.x window background patterns" )
 ( makedir winpatdest )

 ( copyfiles
  ( prompt "Installing OS 2.x window patterns.." )
  ( source "OS2WinPatterns" )
  ( all )
  ( dest winpatdest )
 )

)
)

( complete 70 )

; --------------------
; Install the icon templates
; --------------------

( if( IN parts 6 )
(

 (set templdest
  ( askdir
   ( prompt "Please select a place for the icon template ILBM file." )
   ( help "Choose a directory where the icon template ILBM file should be copied to." )
   ( default "" )
  )
 )
 
 ( working "Installing icon template ILBM file" )
 ( makedir templdest )
 ( copyfiles ( source "Templates.ilbm" ) ( dest templdest ) )
 ( copyfiles ( source "Templates.ilbm.info" ) ( dest templdest ) )

)
)

( complete 80 )

; --------------------
; Install the English documentation
; --------------------

( if( IN parts 7 )
(

 ( set readmepath
  ( askdir
   ( prompt "Please select a place for the English documentation." )
   ( help "Choose a place for the English documentation." )
   ( default "" )
  )
 )

 ( working "Installing the English documentation" )
 ( makedir readmepath )
 ( copyfiles ( source "ME_English.guide" ) ( dest readmepath ) )
 ( copyfiles ( source "ME_English.guide.info" ) ( dest readmepath ) )
 
)
)

( complete 90 )

; --------------------
; Install the German documentation
; --------------------

( if( IN parts 8 )
(

 ( set liesmichpath
  ( askdir
   ( prompt "Please select a place for the German documentation." )
   ( help "Choose a place for the German documentation." )
   ( default "" )
  )
 )

 ( working "Installing the German documentation." )
 ( makedir liesmichpath )
 ( copyfiles ( source "ME_deutsch.guide" ) ( dest liesmichpath ) )
 ( copyfiles ( source "ME_deutsch.guide.info" ) ( dest liesmichpath ) )

)
)

( complete 100 )



( exit "Installation of MagicExpansion complete. Hope you'll have fun with it. "
       "And don't forget this:\n\nMagicExpansion is Giftware." )
