2008-11-09 02:11:18 +03:00
|
|
|
; Installation script for NetSurf
|
|
|
|
|
|
|
|
(procedure p_setmimetype #type #mimetype
|
|
|
|
(transcript "Setting MIME Type " #mimetype " for default " #type " icon")
|
|
|
|
|
|
|
|
(set #fullpath (cat "ENVARC:Sys/def_" #type))
|
|
|
|
|
|
|
|
(tooltype
|
|
|
|
(prompt "Setting MIME type")
|
|
|
|
(help @tooltype-help)
|
|
|
|
(dest #fullpath)
|
|
|
|
(settooltype "MIMETYPE" #mimetype)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2009-02-21 18:53:04 +03:00
|
|
|
(procedure p_copysobj #sobj
|
|
|
|
(set #sobj-version (getversion (tackon "SObjs/" #sobj)))
|
|
|
|
|
2009-02-21 19:29:33 +03:00
|
|
|
(if (= #sobj-version 0)
|
2009-02-21 18:53:04 +03:00
|
|
|
(
|
2009-03-14 15:37:28 +03:00
|
|
|
(transcript "Date compare " #sobj)
|
2009-02-21 18:53:04 +03:00
|
|
|
|
|
|
|
(if (exists (tackon "SObjs:" #sobj))
|
|
|
|
(
|
|
|
|
(set #file-newer (earlier (tackon "SObjs:" #sobj) (tackon "SObjs/" #sobj)))
|
|
|
|
|
|
|
|
(if (= #file-newer 0)
|
|
|
|
(
|
|
|
|
(set #newer-text "has an older datestamp")
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
|
|
|
(set #newer-text "has a newer datestamp")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(set #old-size (getsize (tackon "SObjs:" #sobj)))
|
|
|
|
(set #new-size (getsize (tackon "SObjs/" #sobj)))
|
|
|
|
|
|
|
|
(if (AND (= #old-size #new-size) (= #file-newer 0))
|
|
|
|
(
|
|
|
|
(set #copy 0)
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
|
|
|
(if (OR (= @user-level 2) (AND (= @user-level 1) (<> #file-newer 0)))
|
|
|
|
; Expert users are always prompted
|
|
|
|
; Average users are prompted if the file trying to be copied is newer
|
|
|
|
; Novice users are never prompted
|
|
|
|
; This is roughly equivalent to (copylib (confirm))
|
|
|
|
; No prompting occurs if the destination does not exist (silent copy)
|
|
|
|
; or the files are the same size and the one being copied isn't newer (don't copy)
|
|
|
|
(
|
|
|
|
(set #copy
|
|
|
|
(askbool
|
|
|
|
(prompt "Copying " #sobj "...\n\n"
|
|
|
|
"Version to install: " #new-size " bytes\n"
|
|
|
|
"Version currently installed: " #old-size " bytes\n\n"
|
|
|
|
"The file to copy " #newer-text)
|
|
|
|
(help @askbool-help)
|
|
|
|
(default #file-newer)
|
|
|
|
(choices "Proceed with copy" "Skip this part")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
|
|
|
(set #copy #file-newer)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
; else if dest file does not exist
|
|
|
|
(
|
|
|
|
(set #copy 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(if (<> #copy 0)
|
|
|
|
(
|
2009-03-14 15:37:28 +03:00
|
|
|
(if (<> #AutoInstall 1)
|
|
|
|
(
|
|
|
|
(copyfiles
|
|
|
|
(prompt "Copying " #sobj "...")
|
|
|
|
(help @copyfiles-help)
|
|
|
|
(source (tackon "SObjs/" #sobj))
|
|
|
|
(dest "SObjs:")
|
|
|
|
(optional "nofail" "force")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
|
|
|
(run "CopyStore SObjs/" #sobj " SObjs:")
|
|
|
|
)
|
2009-02-21 18:53:04 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
; else if version info is available
|
|
|
|
(
|
2009-03-14 15:37:28 +03:00
|
|
|
(if (<> #AutoInstall 1)
|
|
|
|
(
|
|
|
|
(copylib
|
|
|
|
(prompt "Copying " #sobj "...")
|
|
|
|
(help @copylib-help)
|
|
|
|
(source (tackon "SObjs/" #sobj))
|
|
|
|
(dest "SObjs:")
|
|
|
|
(optional "nofail" "force")
|
|
|
|
(confirm "expert")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
|
|
|
(run "CopyStore SObjs/" #sobj " SObjs:")
|
|
|
|
)
|
2009-02-21 18:53:04 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2008-11-09 02:11:18 +03:00
|
|
|
(if (= @app-name "NetSurfAutoInstall") (set #AutoInstall 1))
|
|
|
|
|
|
|
|
(if (<> #AutoInstall 1) (welcome))
|
|
|
|
|
|
|
|
(complete 0)
|
|
|
|
|
|
|
|
(set @default-dest (getenv "AppPaths/NetSurf"))
|
|
|
|
|
|
|
|
(set @default-dest
|
|
|
|
(askdir
|
2009-02-22 15:42:20 +03:00
|
|
|
(prompt "Where would you like to install NetSurf?\n"
|
|
|
|
"(a drawer will not be created)")
|
2008-11-09 02:11:18 +03:00
|
|
|
(help @askdir-help)
|
|
|
|
(default @default-dest)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete 5)
|
|
|
|
|
2009-02-21 18:53:04 +03:00
|
|
|
(working "Checking existing installation...")
|
2008-12-14 02:19:33 +03:00
|
|
|
(set #icon-exists (exists (tackon @default-dest "NetSurf.info")))
|
2009-02-21 18:53:04 +03:00
|
|
|
(set osver (getversion))
|
|
|
|
(set osver (/ osver 65536))
|
2008-12-14 02:19:33 +03:00
|
|
|
|
2009-02-21 18:53:04 +03:00
|
|
|
(if (>= osver 53)
|
|
|
|
(
|
|
|
|
(if (= #AutoInstall 0)
|
|
|
|
(
|
|
|
|
(set #cairo-name "Shared objects/part-Cairo")
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
|
|
|
(set #cairo-name "")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(set #cairo-version 1)
|
|
|
|
(set #netsurf-exists (exists (tackon @default-dest "NetSurf")))
|
2009-04-26 01:47:39 +04:00
|
|
|
(if (<> #netsurf-exists 0)
|
|
|
|
(
|
2009-02-21 19:18:59 +03:00
|
|
|
; Guess if the installed version is static, if it
|
2009-04-26 01:47:39 +04:00
|
|
|
; is bigger than 5MB then it probably is!
|
|
|
|
(set #netsurf-size (getsize (tackon @default-dest "NetSurf")))
|
|
|
|
(if (> #netsurf-size 5000000) (set #cairo-version 0))
|
|
|
|
)
|
|
|
|
)
|
2009-02-21 18:53:04 +03:00
|
|
|
)
|
|
|
|
; else
|
|
|
|
(
|
|
|
|
(set #cairo-version 0)
|
|
|
|
(set #cairo-name "")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete 10)
|
|
|
|
|
2009-02-21 18:53:04 +03:00
|
|
|
(if (AND (> @user-level 0) (<> #cairo-name ""))
|
|
|
|
(
|
|
|
|
(set #cairo-version
|
|
|
|
(askchoice
|
|
|
|
(prompt "Which version of NetSurf would you like to install?")
|
|
|
|
(help "The Cairo/shared objects version has better rendering "
|
|
|
|
"of some graphical elements, and supports SVG. However, "
|
|
|
|
"some users report problems with the use of shared objects.\n\n"
|
|
|
|
@askchoice-help)
|
|
|
|
(choices "Static/graphics.library" #cairo-name)
|
|
|
|
(default #cairo-version)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete 15)
|
|
|
|
|
|
|
|
(set #options-exist (exists (tackon @default-dest "Resources/Options")))
|
2009-04-26 01:47:39 +04:00
|
|
|
(set #aiss-theme "")
|
2009-02-22 15:42:20 +03:00
|
|
|
|
|
|
|
(if (= #options-exist 0)
|
|
|
|
(
|
|
|
|
(if (exists "TBimages:" (noreq))
|
|
|
|
(set #aiss-theme "AISS")
|
|
|
|
)
|
|
|
|
|
|
|
|
(set #themename
|
|
|
|
(askchoice
|
|
|
|
(prompt "Please select theme")
|
|
|
|
(help "AISS theme requires AISS (and def_pointers for 32-bit "
|
|
|
|
"pointers), and will only be shown as an option if "
|
|
|
|
"AISS is installed.\n\n"
|
|
|
|
@askchoice-help)
|
|
|
|
(choices "Default" #aiss-theme)
|
|
|
|
(default 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(select #themename
|
|
|
|
(set #theme "Resources/Themes/Default")
|
|
|
|
(set #theme "Resources/Themes/AISS")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(complete 20)
|
|
|
|
|
2009-02-21 18:53:04 +03:00
|
|
|
(set #netsurf-name (select #cairo-version "NetSurf" "NetSurf_Cairo"))
|
|
|
|
|
|
|
|
(if (= #AutoInstall 0)
|
|
|
|
(
|
|
|
|
(copylib
|
|
|
|
(prompt "Please check the version of NetSurf you are copying against "
|
|
|
|
"any which might already be installed.")
|
|
|
|
(help @copylib-help)
|
|
|
|
(source #netsurf-name)
|
|
|
|
(dest @default-dest)
|
2009-02-21 19:55:50 +03:00
|
|
|
(newname "NetSurf")
|
2009-02-21 18:53:04 +03:00
|
|
|
(optional "askuser" "force" "oknodelete")
|
|
|
|
(confirm "expert")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
;else
|
|
|
|
(
|
2009-04-26 01:47:39 +04:00
|
|
|
(copyfiles
|
|
|
|
(prompt "Please check the version of NetSurf you are copying against "
|
|
|
|
"any which might already be installed.")
|
|
|
|
(help @copyfiles-help)
|
|
|
|
(source #netsurf-name)
|
|
|
|
(dest "T:")
|
|
|
|
(newname "NetSurf")
|
|
|
|
(optional "force" "oknodelete")
|
|
|
|
)
|
|
|
|
|
|
|
|
(run "CopyStore T:NetSurf" @default-dest)
|
|
|
|
(delete "T:NetSurf")
|
2009-02-21 18:53:04 +03:00
|
|
|
)
|
2008-11-09 02:11:18 +03:00
|
|
|
)
|
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete 40)
|
2008-11-09 02:11:18 +03:00
|
|
|
|
|
|
|
(copyfiles
|
|
|
|
(prompt "Copying files")
|
|
|
|
(source "")
|
2009-04-26 01:47:39 +04:00
|
|
|
(choices "Resources" "Rexx" "NetSurf.guide" "NetSurf.readme" "COPYING")
|
2008-11-09 02:11:18 +03:00
|
|
|
(help @copyfiles-help)
|
|
|
|
(dest @default-dest)
|
|
|
|
(infos)
|
|
|
|
; (all)
|
|
|
|
)
|
|
|
|
|
2009-03-12 02:48:26 +03:00
|
|
|
(set #complete 50)
|
2009-02-21 18:53:04 +03:00
|
|
|
|
|
|
|
(if (= #cairo-version 1)
|
|
|
|
(
|
|
|
|
(working "Copying Shared Objects")
|
|
|
|
|
2009-03-14 14:44:07 +03:00
|
|
|
(foreach "SObjs" "#?"
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete #complete)
|
|
|
|
(p_copysobj @each-name)
|
2009-03-31 20:39:49 +04:00
|
|
|
(set #complete (+ #complete 3))
|
2009-02-22 15:42:20 +03:00
|
|
|
)
|
2009-02-21 18:53:04 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete 90)
|
2008-11-09 02:11:18 +03:00
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(if #theme
|
2008-11-09 02:11:18 +03:00
|
|
|
(
|
2008-12-14 02:19:33 +03:00
|
|
|
(set #theme-icon (tackon @default-dest (tackon #theme "NetSurf.info")))
|
2008-12-14 22:41:16 +03:00
|
|
|
(set #icon-exists (exists #theme-icon))
|
|
|
|
|
|
|
|
(if #icon-exists
|
|
|
|
(
|
|
|
|
(copyfiles
|
|
|
|
(prompt "Copying theme icon")
|
|
|
|
(source #theme-icon)
|
|
|
|
(help @copyfiles-help)
|
|
|
|
(dest @default-dest)
|
|
|
|
)
|
|
|
|
)
|
2008-12-14 02:19:33 +03:00
|
|
|
)
|
|
|
|
|
2008-11-09 02:11:18 +03:00
|
|
|
(textfile
|
|
|
|
(prompt "Setting default options")
|
|
|
|
(help @textfile-help)
|
|
|
|
(dest (tackon @default-dest "Resources/Options"))
|
|
|
|
(append "font_min_size:12\n"
|
|
|
|
"theme:" #theme "\n")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2009-02-22 15:42:20 +03:00
|
|
|
(complete 95)
|
2008-11-09 02:11:18 +03:00
|
|
|
|
|
|
|
(working "Setting MIME types")
|
|
|
|
(p_setmimetype "css" "text/css")
|
|
|
|
(p_setmimetype "html" "text/html")
|
|
|
|
(p_setmimetype "ascii" "text/plain")
|
|
|
|
(p_setmimetype "jpeg" "image/jpeg")
|
|
|
|
(p_setmimetype "gif" "image/gif")
|
|
|
|
(p_setmimetype "png" "image/png")
|
|
|
|
(p_setmimetype "jng" "image/jng")
|
|
|
|
(p_setmimetype "mng" "image/mng")
|
|
|
|
(p_setmimetype "svg" "image/svg")
|
|
|
|
(p_setmimetype "bmp" "image/bmp")
|
|
|
|
(p_setmimetype "ico" "image/ico")
|
|
|
|
(p_setmimetype "sprite" "image/x-riscos-sprite")
|
2009-02-21 14:09:56 +03:00
|
|
|
(p_setmimetype "lha" "application/x-lha")
|
|
|
|
(p_setmimetype "zip" "application/x-zip")
|
2008-11-09 02:11:18 +03:00
|
|
|
|
|
|
|
(complete 100)
|
|
|
|
|
|
|
|
(if (= #AutoInstall 1)
|
|
|
|
(
|
|
|
|
(exit (quiet))
|
|
|
|
)
|
|
|
|
(
|
|
|
|
(exit)
|
|
|
|
)
|
|
|
|
)
|