diff --git a/mk/linux/mojosetup/megaglest-installer/scripts/app_localization.lua b/mk/linux/mojosetup/megaglest-installer/scripts/app_localization.lua index a5929247..0f1725e2 100644 --- a/mk/linux/mojosetup/megaglest-installer/scripts/app_localization.lua +++ b/mk/linux/mojosetup/megaglest-installer/scripts/app_localization.lua @@ -30,6 +30,15 @@ MojoSetup.applocalization = { it = "Licenza di Megaglest", }; + ["Megaglest Uninstall Prompt"] = { + en_GB = "We have detected a previous installation of Megaglest, should we remove it?", + en_CA = "We have detected a previous installation of Megaglest, should we remove it?", + de = "We have detected a previous installation of Megaglest, should we remove it?", + es = "We have detected a previous installation of Megaglest, should we remove it?", + pl = "We have detected a previous installation of Megaglest, should we remove it?", + it = "We have detected a previous installation of Megaglest, should we remove it?", + }; + ["docs/LICENSE"] = { }; diff --git a/mk/linux/mojosetup/megaglest-installer/scripts/config.lua b/mk/linux/mojosetup/megaglest-installer/scripts/config.lua index 437cad65..bcbbb30d 100644 --- a/mk/linux/mojosetup/megaglest-installer/scripts/config.lua +++ b/mk/linux/mojosetup/megaglest-installer/scripts/config.lua @@ -20,6 +20,25 @@ Setup.Package "/usr/local/games" }, + 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 + if MojoSetup.promptyn('Remove previous version', _("Megaglest Uninstall Prompt") .. '\n\n[' .. previousPath .. ']') then + os.execute(previousPath .. 'uninstall-megaglest.sh') + end + end + end, + postinstall = function(package) MojoSetup.launchbrowser("http://www.megaglest.org") end, @@ -71,7 +90,8 @@ Setup.Package builtin_icon = false, icon = "editor.ico", commandline = "%0/start_megaglest_mapeditor", - category = "Game;StrategyGame" + category = "Game;StrategyGame", + --mimetype = {"application/x-gbm", "application/mgm"} }, Setup.DesktopMenuItem @@ -83,7 +103,8 @@ Setup.Package builtin_icon = false, icon = "g3dviewer.ico", commandline = "%0/start_megaglest_g3dviewer", - category = "Game;StrategyGame" + category = "Game;StrategyGame", + --mimetype = {"application/x-g3d"} }, Setup.DesktopMenuItem