/
config.lua
99 lines (86 loc) · 3.02 KB
1
local GAME_INSTALL_SIZE = 886535138;
2
3
4
local _ = MojoSetup.translate
5
6
7
8
9
10
-- We override MojoSetup.gui.destination to make sure we have a real p2:stp
-- install at that point. This happens to work at the moment, but hooks an
-- internal, undocumented API. We'll add a formal hook later. Don't emulate
-- this behaviour!
local origdestfn = MojoSetup.gui.destination
MojoSetup.gui.destination = function(recommend, thisstage, maxstage)
11
12
13
14
15
16
17
18
19
20
-- Trim the game id off of the recommends...
local newrec = nil
if recommend ~= nil then
newrec = {}
for i,v in ipairs(recommend) do
newrec[i] = string.gsub(recommend[i], "/postal2aw$", "")
end
recommend = newrec
end
21
22
23
24
25
26
27
28
29
30
31
32
while true do
local rc, dst = origdestfn(recommend, thisstage, maxstage)
if rc ~= 1 then
return rc, dst
end
if MojoSetup.platform.exists(dst .. "/System/Postal2Game.u") then
return rc, dst
end
-- Some versions (Postal 10th Anniversary disc) have several titles
-- installed in one base dir.
33
if MojoSetup.platform.exists(dst .. "/postal2game/System/Postal2Game.u") then
34
35
36
37
38
39
40
41
dst = dst .. "/postal2game"
return rc, dst
end
MojoSetup.msgbox(_("Wrong path"), _("We don't see a copy of Postal 2: Share the Pain in that directory. You need Share the Pain to install Apocalypse Weekend. Please pick another directory."));
end
end
42
43
44
Setup.Package
{
vendor = "runningwithscissors.com",
45
id = "postal2aw",
46
47
48
49
50
51
52
53
54
55
description = _("Postal 2: Apocalypse Weekend"),
version = "1.0",
splash = "splash.bmp",
superuser = false,
write_manifest = true,
support_uninstall = true,
recommended_destinations =
{
MojoSetup.info.homedir .. "/postal2",
"/opt/games/postal2",
56
"/usr/local/games/postal2",
57
58
MojoSetup.info.homedir .. "/postal_10th_anniversary/postal2game",
"/opt/games/postal_10th_anniversary/postal2game",
59
"/usr/local/games/postal_10th_anniversary/postal2game",
60
61
62
MojoSetup.info.homedir .. "/postal_fudge_pack/postal2game",
"/opt/games/postal_fudge_pack/postal2game",
"/usr/local/games/postal_fudge_pack/postal2game"
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
},
Setup.Eula
{
description = _("Postal License"),
source = _("postal2aw_license.txt")
},
Setup.Option
{
value = true,
required = true,
disabled = false,
bytes = GAME_INSTALL_SIZE,
description = _("Postal 2: Apocalypse Weekend"),
Setup.File
{
-- Just install everything we see...
},
Setup.DesktopMenuItem
{
disabled = false,
name = _("Postal 2: Apocalypse Weekend"),
genericname = _("Postal 2"),
tooltip = _("Politically incorrect expansion pack from Running With Scissors"),
builtin_icon = false,
icon = "p2aw_rws.png",
commandline = "%0/postal2aw",
category = "Game"
}
}
}
-- end of config.lua ...