2011-02-04 00:18:21 +01:00
|
|
|
local GAME_INSTALL_SIZE = 680000000;
|
2011-05-04 23:00:34 +02:00
|
|
|
local GAME_VERSION = "3.5.1";
|
2010-04-25 05:01:17 +02:00
|
|
|
|
|
|
|
local _ = MojoSetup.translate
|
|
|
|
|
|
|
|
Setup.Package
|
|
|
|
{
|
2011-01-22 07:20:09 +01:00
|
|
|
vendor = "megaglest.org",
|
2010-04-25 05:01:17 +02:00
|
|
|
id = "megaglest",
|
2010-08-12 08:23:42 +02:00
|
|
|
description = _("Mega Glest v" .. GAME_VERSION),
|
|
|
|
version = GAME_VERSION,
|
2010-04-25 05:01:17 +02:00
|
|
|
splash = "glestforumsheader.bmp",
|
|
|
|
superuser = false,
|
|
|
|
write_manifest = true,
|
|
|
|
support_uninstall = true,
|
|
|
|
recommended_destinations =
|
|
|
|
{
|
|
|
|
MojoSetup.info.homedir,
|
|
|
|
"/opt/games",
|
|
|
|
"/usr/local/games"
|
|
|
|
},
|
|
|
|
|
2011-04-14 08:57:52 +02:00
|
|
|
precheck = function(package)
|
|
|
|
-- MojoSetup.msgbox('Test#1', MojoSetup.info.homedir .. '/megaglest/uninstall-megaglest.sh')
|
|
|
|
|
|
|
|
local previousPath = ''
|
|
|
|
if MojoSetup.platform.exists(MojoSetup.info.homedir .. '/megaglest/uninstall-megaglest.sh') then
|
|
|
|
previousPath = MojoSetup.info.homedir .. '/megaglest/'
|
|
|
|
elseif MojoSetup.platform.exists('/opt/games/megaglest/uninstall-megaglest.sh') then
|
|
|
|
previousPath = '/opt/games/megaglest/'
|
|
|
|
elseif MojoSetup.platform.exists('/usr/local/games/megaglest/uninstall-megaglest.sh') then
|
|
|
|
previousPath = '/usr/local/games/megaglest/'
|
|
|
|
end
|
|
|
|
|
|
|
|
if previousPath ~= '' then
|
2011-04-14 17:40:53 +02:00
|
|
|
if MojoSetup.promptyn(_("Megaglest Uninstall Title"), _("Megaglest Uninstall Prompt") .. '\n\n[' .. previousPath .. ']') then
|
2011-04-14 08:57:52 +02:00
|
|
|
os.execute(previousPath .. 'uninstall-megaglest.sh')
|
|
|
|
end
|
2011-04-14 17:40:53 +02:00
|
|
|
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
|
|
|
preinstall = function(package)
|
|
|
|
local previousPath = ''
|
|
|
|
if MojoSetup.platform.exists(MojoSetup.info.homedir .. '/megaglest/mydata/') then
|
2011-04-14 20:52:25 +02:00
|
|
|
previousPath = MojoSetup.info.homedir .. '/megaglest/'
|
2011-04-14 17:40:53 +02:00
|
|
|
elseif MojoSetup.platform.exists('/opt/games/megaglest/mydata/') then
|
2011-04-14 20:52:25 +02:00
|
|
|
previousPath = '/opt/games/megaglest/'
|
2011-04-14 17:40:53 +02:00
|
|
|
elseif MojoSetup.platform.exists('/usr/local/games/megaglest/mydata/') then
|
2011-04-14 20:52:25 +02:00
|
|
|
previousPath = '/usr/local/games/megaglest/'
|
2011-04-14 17:40:53 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Move mod data folder to new location if we find it
|
|
|
|
if previousPath ~= '' then
|
|
|
|
local instPathData = MojoSetup.info.homedir .. '/.megaglest/'
|
|
|
|
local instPath = instPathData
|
|
|
|
-- MojoSetup.msgbox('Moving mod folder','About to move mod folder from [' .. previousPath .. '] to [' .. instPath .. ']')
|
|
|
|
|
|
|
|
os.execute('mkdir ' .. instPathData)
|
2011-04-14 20:52:25 +02:00
|
|
|
os.execute('mv ' .. previousPath .. 'mydata/* ' .. instPath)
|
|
|
|
os.execute('mv ' .. previousPath .. 'glestuser.ini ' .. instPath .. 'glestuser.ini')
|
2011-04-14 08:57:52 +02:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
2010-04-25 05:01:17 +02:00
|
|
|
postinstall = function(package)
|
2011-04-19 05:50:49 +02:00
|
|
|
if MojoSetup.promptyn(_("Megaglest Visit Website Title"), _("Megaglest Visit Website Prompt")) then
|
|
|
|
MojoSetup.launchbrowser("http://megaglest.org/get-started.html")
|
|
|
|
end
|
2010-04-25 05:01:17 +02:00
|
|
|
end,
|
|
|
|
|
2011-05-07 13:30:25 +02:00
|
|
|
postuninstall = function(package)
|
|
|
|
-- Cleanup additional files
|
|
|
|
if MojoSetup.destination ~= '' then
|
|
|
|
if MojoSetup.platform.exists(MojoSetup.destination .. '/lib/') then
|
|
|
|
os.execute('rm -rf ' .. MojoSetup.destination .. '/lib/')
|
|
|
|
end
|
|
|
|
if MojoSetup.platform.exists(MojoSetup.destination) then
|
|
|
|
os.execute('rm -rf ' .. MojoSetup.destination)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
2010-04-25 05:01:17 +02:00
|
|
|
Setup.Eula
|
|
|
|
{
|
|
|
|
description = _("Megaglest License"),
|
2011-05-04 23:00:34 +02:00
|
|
|
source = _("docs/README.data-license.txt")
|
2010-04-25 05:01:17 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
Setup.Readme
|
|
|
|
{
|
|
|
|
description = _("Megaglest README"),
|
2011-05-04 23:00:34 +02:00
|
|
|
source = _("docs/README.txt")
|
2010-04-25 05:01:17 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
Setup.Option
|
|
|
|
{
|
|
|
|
value = true,
|
|
|
|
required = true,
|
|
|
|
disabled = false,
|
|
|
|
bytes = GAME_INSTALL_SIZE,
|
2010-08-12 08:23:42 +02:00
|
|
|
description = _("Mega Glest v" .. GAME_VERSION),
|
2010-04-25 05:01:17 +02:00
|
|
|
|
|
|
|
Setup.File
|
|
|
|
{
|
|
|
|
-- Just install everything we see...
|
2011-01-24 16:47:21 +01:00
|
|
|
source = "base:///mgdata.tar.xz",
|
2010-04-25 05:01:17 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
Setup.DesktopMenuItem
|
|
|
|
{
|
|
|
|
disabled = false,
|
2011-02-04 00:18:21 +01:00
|
|
|
name = _("MegaGlest v" .. GAME_VERSION),
|
2010-04-25 05:01:17 +02:00
|
|
|
genericname = _("MegaGlest"),
|
|
|
|
tooltip = _("A real time strategy game."),
|
|
|
|
builtin_icon = false,
|
2010-06-26 00:04:40 +02:00
|
|
|
icon = "megaglest.ico",
|
2011-05-05 05:31:18 +02:00
|
|
|
commandline = "%0/start_megaglest",
|
2011-02-04 00:18:21 +01:00
|
|
|
category = "Game;StrategyGame"
|
2010-06-26 20:19:57 +02:00
|
|
|
},
|
|
|
|
|
2010-06-26 00:04:40 +02:00
|
|
|
Setup.DesktopMenuItem
|
|
|
|
{
|
|
|
|
disabled = false,
|
2011-02-04 00:18:21 +01:00
|
|
|
name = _("MegaGlest Map Editor v" .. GAME_VERSION),
|
2010-06-26 00:04:40 +02:00
|
|
|
genericname = _("MegaGlest"),
|
|
|
|
tooltip = _("A real time strategy game."),
|
|
|
|
builtin_icon = false,
|
|
|
|
icon = "editor.ico",
|
2011-04-09 21:47:59 +02:00
|
|
|
commandline = "%0/start_megaglest_mapeditor",
|
2011-04-14 08:57:52 +02:00
|
|
|
category = "Game;StrategyGame",
|
|
|
|
--mimetype = {"application/x-gbm", "application/mgm"}
|
2010-06-26 20:19:57 +02:00
|
|
|
},
|
|
|
|
|
2010-06-26 00:04:40 +02:00
|
|
|
Setup.DesktopMenuItem
|
|
|
|
{
|
|
|
|
disabled = false,
|
2011-02-04 00:18:21 +01:00
|
|
|
name = _("MegaGlest G3D Model Viewer v" .. GAME_VERSION),
|
2010-06-26 00:04:40 +02:00
|
|
|
genericname = _("MegaGlest"),
|
|
|
|
tooltip = _("A real time strategy game."),
|
|
|
|
builtin_icon = false,
|
|
|
|
icon = "g3dviewer.ico",
|
2011-04-09 21:13:10 +02:00
|
|
|
commandline = "%0/start_megaglest_g3dviewer",
|
2011-04-14 08:57:52 +02:00
|
|
|
category = "Game;StrategyGame",
|
|
|
|
--mimetype = {"application/x-g3d"}
|
2011-02-04 00:18:21 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
Setup.DesktopMenuItem
|
|
|
|
{
|
|
|
|
disabled = false,
|
|
|
|
name = _("MegaGlest Uninstall v" .. GAME_VERSION),
|
|
|
|
genericname = _("MegaGlest"),
|
|
|
|
tooltip = _("A real time strategy game."),
|
|
|
|
builtin_icon = false,
|
|
|
|
icon = "megaglest_uninstall.ico",
|
|
|
|
commandline = "%0/uninstall-megaglest.sh",
|
|
|
|
category = "Game;StrategyGame"
|
2010-06-26 00:04:40 +02:00
|
|
|
}
|
|
|
|
|
2010-04-25 05:01:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-- end of config.lua ...
|
|
|
|
|