;MSWordView Installer by Nicholai Benalal


(set @default-dest "")
(set #where (cat "Where should I...."))
(set #badcpu (cat "Sorry you need at least a 68020 to run MSWordView"))
(set #about (cat "Welcome to MSWordView 0.5.2. \n\n\nWith this program it's possible to convert Microsoft Word8 files to html-format.\nThis will give you to possibility to read them with your favorite browser\n\nThis program was written by Caolan McNamara\nIt was compiled for AmigaOS by Nicholai Benalal"))
(set #assign (cat "To be able to read files created with MSWordView\nYou need to create an assign named 'MSWordView:'\nDo you want the installer to add this assign to your\n           user-startup?\n\nNB: If you choose no, you will need to add this manually"))

(if (patmatch "68000" (database "cpu"))
  (abort #badcpu))
(if (patmatch "68010" (database "cpu"))
  (abort #badcpu))

(message #about)


(set #destination
(askdir (prompt "Select a location to install the MSWordView. A Drawer \"MSWordView\" will be created")
(help @askdir-help)
(default "ram:")
)
)

(if (NOT (exists #destination))
 (makedir #destination))

(copyfiles
(source "")
(dest (tackon #destination "MSWordView"))
(infos)
(all)
(optional "oknodelete" "force" "askuser")
)

(
   (set #startup-addition (cat
    "assign MSWordView: \"" (expandpath (tackon #destination "MSWordView")) "\"\n"
    )
   )
   (if
    (askbool
     (prompt #assign)
     (help #assign)
     (choices "Yes" "No")
    )
    (startup "MSWordView"
     (command #startup-addition)
     (prompt "Installer will modify your s:user-startup "
      "script. The following lines will be added:\n\n"
      #startup-addition)
     (help "Installer will modify your s:user-startup "
      "script. The following lines will be added:\n\n"
      #startup-addition)
    )
    (textfile
     (dest (tackon #destination "MSWordView" "addition-to-user-startup"))
     (append #startup-addition)
    )
   )
)

(makeassign "MSWordView" (expandpath (tackon #destination "MSWordView")))
