This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
Expand file tree
/
Copy pathstackbehavior.livecodescript
More file actions
106 lines (94 loc) · 3.13 KB
/
stackbehavior.livecodescript
File metadata and controls
106 lines (94 loc) · 3.13 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
script "InstallerStackBehavior"
################################################################################
#
# STARTUP METHOD
#
on startup
local tAction
if $1 is "install" then
put "install" into tAction
else if $1 is "doinstall" then
put "doinstall" into tAction
else if $1 is "uninstall" then
put "uninstall" into tAction
else if $1 is "douninstall" then
put "douninstall" into tAction
else
set the itemDelimiter to slash
if the last item of $0 contains "setup" then
put "uninstall" into tAction
else
put "install" into tAction
end if
end if
switch tAction
case "install"
if the environment is "installer command line" then
runFacelessInstall
else
hide me
send "runInstallerUI" to me in 0 millisecs
end if
break
case "uninstall"
if the environment is "installer command line" then
runFacelessUninstall
else
hide me
send "runUninstallerUI" to me in 0 millisecs
end if
break
case "doinstall"
runInstallerActions
break
case "douninstall"
runUninstallerActions
break
default
quit 1
end switch
end startup
-- MM-2011-04-01: Catch the relaunch message to make sure only a single installer is ever running
-- Ensures only a single updater is ever run, even if launched by multiple browsers.
on relaunch pArgs
if pArgs is empty then
return empty
else
pass relaunch
end if
end relaunch
////////////////////////////////////////////////////////////////////////////////
// Utility functions removed from the "Tools Installer" stack.
function resolveImageId pImage
return the id of image (pImage & ".png") of stack "Resources"
end resolveImageId
function resolveImageLongId pImage
return the long id of image (pImage & ".png") of stack "Resources"
end resolveImageLongId
function getInstallerType
return the cInstallerType of card "Resources" of stack "Resources"
end getInstallerType
command configureFonts pStack
set the textFont of stack pStack to empty
end configureFonts
command setTitleField pField, pTitle, pSubTitle
if pSubTitle is empty then
set the text of pField to pTitle
set the textStyle of word 1 to -1 of pField to "bold"
set the textColor of word 1 to -1 of pField to "#444444"
else
set the text of pField to pSubTitle && "//" && pTitle
set the textColor of word 1 to -1 of pField to "#555555"
set the textStyle of word (-the number of words of pTitle) to -1 of pField to "bold"
set the textColor of word (-the number of words of pTitle) to -1 of pField to "#444444"
end if
end setTitleField
on errorDialog pError
if the environment is "installer command line" then
write "[" && the internet date && "]" && ": ERROR " && pError & return to stdout
quit 1
else
answer error "An error occurred when running the installer. Please submit a screenshot of this dialog to http://quality.livecode.com" & return & pError
quit 1
end if
end errorDialog