summaryrefslogtreecommitdiff
path: root/amiga/dist/Install
blob: 85277d73c4ebf6a956e6f6ffc0f51fca1fcac770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
; 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)
	)
)

(procedure p_copysobj #sobj
	(set #sobj-version (getversion (tackon "SObjs/" #sobj)))

	(if (= #sobj-version 0)
		(
			(transcript "Date compare copy " #sobj)

			(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)
				(
					(copyfiles
						(prompt "Copying " #sobj "...")
						(help @copyfiles-help)
						(source (tackon "SObjs/" #sobj))
						(dest "SObjs:")
						(optional "nofail" "force")
					)
				)
			)
		)
		; else if version info is available
		(
			(copylib
				(prompt "Copying " #sobj "...")
				(help @copylib-help)
				(source (tackon "SObjs/" #sobj))
				(dest "SObjs:")
				(optional "nofail" "force")
				(confirm "expert")
			)
		)
	)
)

(if (= @app-name "NetSurfAutoInstall") (set #AutoInstall 1))

(if (<> #AutoInstall 1) (welcome))

(complete 0)

(set @default-dest (getenv "AppPaths/NetSurf"))

(set @default-dest
	(askdir
		(prompt "Where would you like to install NetSurf?")
		(help @askdir-help)
		(default @default-dest)
	)
)

(working "Checking existing installation...")
(set #icon-exists (exists (tackon @default-dest "NetSurf.info")))
(set osver (getversion))
(set osver (/ osver 65536))

(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")))
		(if (<> #netsurf-exists 0)
			(
				; Guess if the installed version is static, if it
				; is bigger than 9MB then it probably is!

				(set #netsurf-size (getsize (tackon @default-dest "NetSurf")))
				(if (> #netsurf-size 9000000) (set #cairo-version 0))
			)
		)
	)
	; else
	(
		(set #cairo-version 0)
		(set #cairo-name "")		
	)
)

(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)
			)
		)
	)
)

(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)
			(newname "NetSurf")
			(infos)
			(optional "askuser" "force" "oknodelete")
			(confirm "expert")
		)
	)
;else
	(
		(run "CopyStore " #netsurf-name " " @default-dest)
	)
)

(complete 20)

(copyfiles
	(prompt "Copying files")
	(source "")
	(choices "Resources" "Rexx" "NetSurf.guide" "NetSurf.readme")
	(help @copyfiles-help)
	(dest @default-dest)
	(infos)
;	(all)
)

(complete 50)

(if (= #cairo-version 1)
	(
		(working "Copying Shared Objects")

		(p_copysobj "libc.so")
		(p_copysobj "libgcc.so")
		(p_copysobj "libjpeg.so")
		(p_copysobj "libpthread.so")

		; This is only needed for Cairo, but we have a newer version so why not?
		(p_copysobj "libexpat.so")

		; Following two are included with OS4.1
		; until I have something newer they aren't in the archive
		;(p_sodatecopy "libcurl-7.16.so")
		;(p_sodatecopy "libssl-0.9.8.so")
	)
)

(complete 70)

(set #options-exist (exists (tackon @default-dest "Resources/Options")))

(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")
		)

		(set #theme-icon (tackon @default-dest (tackon #theme "NetSurf.info")))
		(set #icon-exists (exists #theme-icon))

		(if #icon-exists
			(
				(copyfiles
					(prompt "Copying theme icon")
					(source #theme-icon)
					(help @copyfiles-help)
					(dest @default-dest)
				)
			)
		)

		(textfile
			(prompt "Setting default options")
			(help @textfile-help)
			(dest (tackon @default-dest "Resources/Options"))
			(append 	"font_min_size:12\n"
					"theme:" #theme "\n")
		)
	)
)

(complete 90)

(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")
(p_setmimetype "lha" "application/x-lha")
(p_setmimetype "zip" "application/x-zip")

(complete 100)

(if (= #AutoInstall 1)
	(
		(exit (quiet))
	)
	(
		(exit)
	)
)