-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-installer.yml
133 lines (107 loc) · 3.58 KB
/
sample-installer.yml
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
# sample spec for an installer program, provided for demonstration
# purposes.
# create a self extracting archive with:
# mkarchive -o installer.bin \
# -i sample-installer.yml \
# -vprogram=MySoftware \
# -vversion=1.1.0 \
# files
#
# or just the setup script with
# smartsetup -n setup.sh \
# -vprogram=MySoftware \
# -vversion=1.1.0 \
# sample-installer.yml
install:
- title: Welcome to the Installer for $program $version
type: msgbox
text: |
This is the installation program for $program $version.
I will ask you where you want $program installed, and then I will
ask you an additional question which you may answer or not, I
don't care as my purpose is to demonstrate the smartsetup utility,
not to do anything useful.
I will also write a file called install.log on your home directory.
- title: Destination Directory
type: inputbox
text: |
I need to know the location of the destination directory.
Please enter the full path where you want this software installed.
Better enter a directory that exists because I'm not creating it
if not. A real setup program should, but I am not one.
(e.g. /opt/$program/$version)
default: /home/$USER/$program
store: destdir
- title: Enter the Special Code
type: inputbox
text: |
If you the Special Code you can enter it now:
(e.g. XVTR-2342-SEKRETT)
store: specialcode
- title: Warning
condition: -z "$specialcode"
type: msgbox
text: |
You haven't entered the Special Code.
The installation will proceed, but it will self-destruct in 10
days unless you enter a valid Special Code in the configuration
file.
Press OK to continue.
- title: Installing
type: infobox
text: |
Copying files. Please wait...
- type: code
text: sleep 2
- title: Installing
type: infobox
text: |
Still Installing. Not long now.
Thank you for your patience.
- type: code
text: |
# you can enter any shell code in the 'code' sections
logfile=~/install.log
echo "== Copying $rootdir/XXX to $destdir ==" >> $logfile
if [ ! -z "$specialcode" ]; then
echo "== The special code is $specialcode ==" >> $logfile
fi
success=1
sleep 3
- title: Installation Successful
type: msgbox
condition: $success -eq 1
text: |
The installation of $program $version has been successful.
You can start to use the software straight away.
options:
- clear
- title: Installation Failed
condition: $success -eq 0
type: msgbox
text: |
The install process has failed. You can find more information on
the file $logfile
options: [clear]
uninstall:
- title: Uninstalling $program $version
type: msgbox
text: |
This will uninstall $program $version
Press Continue to proceed with the uninstallation, or press
Cancel or the ESC key to abort.
- title: Uninstalling
type: infobox
text: |
Performing the uninstallation.
This will take a few seconds...
- type: code
text: |
echo "Removing this and that"
sleep 4
- title: Finish
type: msgbox
options: [ clear ]
text: |
$program $version has successfully been uninstalled.
Sorry to see you go.