-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall_SetCmd
More file actions
116 lines (100 loc) · 3.04 KB
/
Install_SetCmd
File metadata and controls
116 lines (100 loc) · 3.04 KB
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
; $VER: Installation script for SetCmd
; vim: set syntax=lisp ts=2 expandtab:
(set @app-name "SetCmd")
(set #setcmd-version "1.1.0")
; I have only currently tested this on a few OS 4 systems.
; There will be an update at some point that will support classic AmigaOS, but until then this
; check needs to stay. For versions, I used https://wiki.amigaos.net/wiki/AmigaOS_Versions .
(if (< (/ (getversion) 65536) 52)
(
(abort "SetCmd has only been tested on OS 4.x (v52+), so not installing on this OS!")
)
)
(message
"Welcome to the SetCmd " #setcmd-version " Installer!\n"
"This will install the SetCmd utility and documentation on your system.\n\n"
"NOTE: It will not automatically initialise SetCmd for you, for information on how to do this, "
"please make sure you read the included documentation.\n"
)
(welcome)
(procedure get_and_create_destination
(
(set #dname
(askdir
(prompt (cat "Choose destination directory.\n"
"A drawer called SetCmd will be created." ))
(help @askdir-help)
(default "Work:")
)
)
(set #dname (tackon #dname "SetCmd"))
; This is the built-in variable that gets displayed to the user at the end of the installation
(set @default-dest #dname)
(makedir #dname
(prompt ("Create drawer %s?" #dname))
(help @makedir-help)
(safe)
)
(makedir (tackon #dname "support"))
(makeassign "SETCMD" #dname (safe))
(set #new_install 1)
)
)
(get_and_create_destination)
(set #dname (getassign "SETCMD" "a"))
; Set these variables as they're useful later and avoid excessive nested tackons!
(set #path-dir (tackon #dname "path"))
(set #cmd-dir (tackon #dname "cmds"))
(set #setcmd-cmd-dir (tackon #cmd-dir "setcmd"))
(set #setcmd-full-path (tackon #setcmd-cmd-dir #setcmd-version))
; Set up the link database directory structure
(makedir #path-dir)
(makedir #cmd-dir)
(makedir #setcmd-cmd-dir)
(copyfiles
(source "setcmd")
(dest #setcmd-cmd-dir)
(newname #setcmd-version)
(prompt ("Copy SetCmd program file?"))
(confirm "expert")
(all)
(help @copyfiles-help)
)
(copyfiles
(source "stub")
(dest #dname)
(prompt ("Copy SetCmd stub file?"))
(confirm "expert")
(all)
(help @copyfiles-help)
)
(copyfiles
(source "")
(pattern "README.txt#?")
(dest #dname)
(prompt ("Copy SetCmd README.txt documentation?"))
(confirm "expert")
(help @copyfiles-help)
)
(copyfiles
(source "")
(pattern "SetCmd.guide#?")
(dest #dname)
(prompt ("Copy SetCmd AmigaGuide documentation?"))
(confirm "expert")
(help @copyfiles-help)
)
; delete the old version links if they exist
(if (exists (tackon #path-dir "setcmd") (noreq))
(
(delete (tackon #path-dir "setcmd"))
)
)
(if (exists (tackon #dname "setcmd") (noreq))
(
(delete (tackon #dname "setcmd"))
)
)
; Set up the links pointing setcmd to our installed version
(run (cat "C:MakeLink FROM \"" (tackon #path-dir "setcmd") "\" TO \"" #setcmd-full-path "\" SOFT"))
(run (cat "C:MakeLink FROM \"" (tackon #dname "setcmd") "\" TO \"" (tackon #path-dir "setcmd") "\" SOFT"))