From af3e3f795f211aca7d188910a429d4f918ac0b1a Mon Sep 17 00:00:00 2001 From: steelphase Date: Sat, 11 Oct 2014 14:37:14 -0400 Subject: [PATCH 1/7] Add Game Monitor Add Game Monitor and update sln. This also removes CrashDialog --- .../GameMonitor.cs | 94 +++++++++++++------ .../OpenRA.GameMonitor.csproj | 10 +- .../Settings.StyleCop | 0 OpenRA.sln | 6 +- 4 files changed, 71 insertions(+), 39 deletions(-) rename OpenRA.CrashDialog/Program.cs => OpenRA.GameMonitor/GameMonitor.cs (66%) rename OpenRA.CrashDialog/OpenRA.CrashDialog.csproj => OpenRA.GameMonitor/OpenRA.GameMonitor.csproj (84%) rename {OpenRA.CrashDialog => OpenRA.GameMonitor}/Settings.StyleCop (100%) diff --git a/OpenRA.CrashDialog/Program.cs b/OpenRA.GameMonitor/GameMonitor.cs similarity index 66% rename from OpenRA.CrashDialog/Program.cs rename to OpenRA.GameMonitor/GameMonitor.cs index de59d416a0..fdaf6625a6 100644 --- a/OpenRA.CrashDialog/Program.cs +++ b/OpenRA.GameMonitor/GameMonitor.cs @@ -9,23 +9,45 @@ #endregion using System; +using System.Collections.Generic; using System.Diagnostics; using System.Drawing; -using System.IO; using System.Media; using System.Reflection; using System.Windows.Forms; -namespace OpenRA.CrashDialog +namespace OpenRA { - class FatalErrorDialog + class GameMonitor { - static Settings settings; + static string processName = "OpenRA.Game.exe"; + static Process gameProcess; + [STAThread] - public static void Main(string[] args) + static void Main(string[] args) { - settings = new Settings(Platform.ResolvePath("^", "settings.yaml"), new Arguments()); + var psi = new ProcessStartInfo(processName, string.Join(" ", args)); + try + { + gameProcess = Process.Start(psi); + } + catch + { + return; + } + + if (gameProcess == null) + return; + + gameProcess.EnableRaisingEvents = true; + gameProcess.Exited += GameProcessExited; + + Application.Run(); + } + + static void ShowErrorDialog() + { var form = new Form { Size = new Size(315, 140), @@ -34,6 +56,7 @@ namespace OpenRA.CrashDialog MaximizeBox = false, FormBorderStyle = FormBorderStyle.FixedDialog, StartPosition = FormStartPosition.CenterScreen, + TopLevel = true, Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location) }; @@ -44,69 +67,78 @@ namespace OpenRA.CrashDialog Text = "OpenRA has encountered a fatal error and must close.{0}Refer to the crash logs and FAQ for more information.".F(Environment.NewLine), TextAlign = ContentAlignment.TopCenter }; - form.Controls.Add(notice); - - var dontShowAgain = new CheckBox - { - Location = new Point(25, 50), - AutoSize = true, - Text = "Don't show this message again", - }; - form.Controls.Add(dontShowAgain); - + var viewLogs = new Button { Location = new Point(10, 80), Size = new Size(75, 23), Text = "View Logs" }; - viewLogs.Click += ViewLogsClicked; - form.Controls.Add(viewLogs); - + var viewFaq = new Button { Location = new Point(90, 80), Size = new Size(75, 23), Text = "View FAQ" }; - viewFaq.Click += ViewFaqClicked; - form.Controls.Add(viewFaq); var quit = new Button { Location = new Point(225, 80), Size = new Size(75, 23), - Text = "Quit" + Text = "Quit", + DialogResult = DialogResult.Cancel }; - quit.DialogResult = DialogResult.Cancel; + + form.Controls.Add(notice); + form.Controls.Add(viewLogs); + form.Controls.Add(viewFaq); form.Controls.Add(quit); - form.FormClosed += (sender, e) => - { - settings.Debug.ShowFatalErrorDialog = !dontShowAgain.Checked; - settings.Save(); - }; + viewLogs.Click += ViewLogsClicked; + viewFaq.Click += ViewFaqClicked; + form.FormClosed += FormClosed; SystemSounds.Exclamation.Play(); form.ShowDialog(); } + static void GameProcessExited(object sender, EventArgs e) + { + if (gameProcess.ExitCode != 0) + ShowErrorDialog(); + + Exit(); + } + static void ViewLogsClicked(object sender, EventArgs e) { try { Process.Start(Platform.ResolvePath("^", "Logs")); } - catch { } + catch + { } } static void ViewFaqClicked(object sender, EventArgs e) { try { - Process.Start(settings.Debug.FatalErrorDialogFaq); + Process.Start("http://wiki.openra.net/FAQ"); } - catch { } + catch + { } + } + + static void FormClosed(object sender, EventArgs e) + { + Exit(); + } + + static void Exit() + { + Environment.Exit(0); } } } diff --git a/OpenRA.CrashDialog/OpenRA.CrashDialog.csproj b/OpenRA.GameMonitor/OpenRA.GameMonitor.csproj similarity index 84% rename from OpenRA.CrashDialog/OpenRA.CrashDialog.csproj rename to OpenRA.GameMonitor/OpenRA.GameMonitor.csproj index a3ab69b70f..561169dcd0 100644 --- a/OpenRA.CrashDialog/OpenRA.CrashDialog.csproj +++ b/OpenRA.GameMonitor/OpenRA.GameMonitor.csproj @@ -2,11 +2,11 @@ Debug - AnyCPU - {47F1B0EE-EB35-47F2-93E4-273C70909157} - Exe + x86 + {68295755-7902-4602-AC2C-9A8AC36D5EF7} + WinExe OpenRA - OpenRA.CrashDialog + OpenRA true @@ -34,7 +34,7 @@ - + \ No newline at end of file diff --git a/OpenRA.CrashDialog/Settings.StyleCop b/OpenRA.GameMonitor/Settings.StyleCop similarity index 100% rename from OpenRA.CrashDialog/Settings.StyleCop rename to OpenRA.GameMonitor/Settings.StyleCop diff --git a/OpenRA.sln b/OpenRA.sln index 89b342a0ab..125b1a8330 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -70,7 +70,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "System Lua scripts", "Syste lua\stacktraceplus.lua = lua\stacktraceplus.lua EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.CrashDialog", "OpenRA.CrashDialog\OpenRA.CrashDialog.csproj", "{47F1B0EE-EB35-47F2-93E4-273C70909157}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.GameMonitor", "OpenRA.GameMonitor\OpenRA.GameMonitor.csproj", "{68295755-7902-4602-AC2C-9A8AC36D5EF7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -101,8 +101,8 @@ Global {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|x86.Build.0 = Debug|x86 {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|x86.ActiveCfg = Debug|x86 {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|x86.Build.0 = Debug|x86 - {47F1B0EE-EB35-47F2-93E4-273C70909157}.Debug|x86.ActiveCfg = Debug|x86 - {47F1B0EE-EB35-47F2-93E4-273C70909157}.Debug|x86.Build.0 = Debug|x86 + {68295755-7902-4602-AC2C-9A8AC36D5EF7}.Debug|x86.ActiveCfg = Debug|x86 + {68295755-7902-4602-AC2C-9A8AC36D5EF7}.Debug|x86.Build.0 = Debug|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From beef3242b8ef260cdf83d16d10f3b61a89024e24 Mon Sep 17 00:00:00 2001 From: steelphase Date: Sat, 11 Oct 2014 11:19:04 -0400 Subject: [PATCH 2/7] Disable internal Error Message Rely on GameMonitor to display error message. --- OpenRA.Game/Platform.cs | 43 ---------------------------------- OpenRA.Game/Support/Program.cs | 6 ----- 2 files changed, 49 deletions(-) diff --git a/OpenRA.Game/Platform.cs b/OpenRA.Game/Platform.cs index a2f3cf716d..0ac8c34650 100644 --- a/OpenRA.Game/Platform.cs +++ b/OpenRA.Game/Platform.cs @@ -127,48 +127,5 @@ namespace OpenRA return path; } - public static void ShowFatalErrorDialog() - { - var process = "OpenRA.CrashDialog.exe"; - var args = ""; - - if (CurrentPlatform == PlatformType.OSX) - { - // Winforms requires X11 under OSX, which may not exist. - // Show a native dialog using applescript instead. - var title = "Fatal Error"; - var logsButton = "View Logs"; - var faqButton = "View FAQ"; - var quitButton = "Quit"; - var message = "OpenRA has encountered a fatal error.\nRefer to the crash logs and FAQ for more information."; - - var faqPath = Game.Settings.Debug.FatalErrorDialogFaq; - var logsPath = "file://" + Platform.SupportDir + "Logs" + Path.DirectorySeparatorChar; - - var iconPath = new [] { "./OpenRA.icns", "./packaging/osx/template.app/Contents/Resources/OpenRA.icns" }.FirstOrDefault(f => File.Exists(f)); - var icon = iconPath != null ? "with icon alias (POSIX file \\\"file://{0}\\\")".F(Environment.CurrentDirectory + "/" + iconPath) : ""; - - process = "/usr/bin/osascript"; - args = ( - "-e \"repeat\"\n" + - "-e \" tell application \\\"Finder\\\"\"\n" + - "-e \" set question to display dialog \\\"{1}\\\" with title \\\"{0}\\\" {2} buttons {{\\\"{3}\\\", \\\"{5}\\\", \\\"{7}\\\"}} default button 3\"\n" + - "-e \" if button returned of question is equal to \\\"{3}\\\" then open (POSIX file \\\"{4}\\\")\"\n" + - "-e \" if button returned of question is equal to \\\"{5}\\\" then open location \\\"{6}\\\"\"\n" + - "-e \" if button returned of question is equal to \\\"{7}\\\" then exit repeat\"\n" + - "-e \" activate\"\n" + - "-e \" end tell\"\n" + - "-e \"end repeat\"" - ).F(title, message, icon, logsButton, logsPath, faqButton, faqPath, quitButton); - } - - if (CurrentPlatform == PlatformType.Linux) - process = "error-dialog.sh"; - - var psi = new ProcessStartInfo(process, args); - psi.UseShellExecute = false; - psi.CreateNoWindow = true; - Process.Start(psi); - } } } diff --git a/OpenRA.Game/Support/Program.cs b/OpenRA.Game/Support/Program.cs index 60b3333ff5..b219f96921 100644 --- a/OpenRA.Game/Support/Program.cs +++ b/OpenRA.Game/Support/Program.cs @@ -60,12 +60,6 @@ namespace OpenRA var rpt = BuildExceptionReport(e).ToString(); Log.Write("exception", "{0}", rpt); Console.Error.WriteLine(rpt); - - if (Game.Settings.Debug.ShowFatalErrorDialog && !Game.Settings.Server.Dedicated) - { - Game.Renderer.Device.Dispose(); - Platform.ShowFatalErrorDialog(); - } } static StringBuilder BuildExceptionReport(Exception e) From 307eaecc9eb4a325241e4c8d6a70d2c948c50007 Mon Sep 17 00:00:00 2001 From: steelphase Date: Wed, 15 Oct 2014 00:43:19 -0400 Subject: [PATCH 3/7] Update Windows installer and Makefile Update windows installer to point to OpenRA.exe replace CrashDialog with GameMonitor in MakeFile Fix and simplify packaging scripts --- Makefile | 22 +++++++++++----------- packaging/linux/buildpackage.sh | 6 ------ packaging/osx/buildpackage.sh | 3 ++- packaging/package-all.sh | 5 ++++- packaging/windows/OpenRA.nsi | 13 ++++++------- 5 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index a1dcf74860..484c655d93 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,6 @@ INSTALL_DATA = $(INSTALL) -m644 # program targets CORE = rsdl2 rnull game utility ralint TOOLS = editor tsbuild crashdialog - VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) @@ -207,14 +206,14 @@ tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormN ##### Launchers / Utilities ##### -crashdialog_SRCS := $(shell find OpenRA.CrashDialog/ -iname '*.cs') -crashdialog_TARGET = OpenRA.CrashDialog.exe -crashdialog_KIND = exe -crashdialog_DEPS = $(game_TARGET) -crashdialog_LIBS = $(COMMON_LIBS) $(crashdialog_DEPS) System.Windows.Forms.dll -crashdialog_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico -PROGRAMS += crashdialog -crashdialog: $(crashdialog_TARGET) +gamemonitor_SRCS := $(shell find OpenRA.GameMonitor/ -iname '*.cs') +gamemonitor_TARGET = OpenRA.exe +gamemonitor_KIND = winexe +gamemonitor_DEPS = $(game_TARGET) +gamemonitor_LIBS = $(COMMON_LIBS) $(gamemonitor_DEPS) System.Windows.Forms.dll +gamemonitor_FLAGS = -win32icon:OpenRA.Game/OpenRA.ico +PROGRAMS += gamemonitor +gamemonitor: $(gamemonitor_TARGET) # Backend for the launcher apps - queries game/mod info and applies actions to an install utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs') @@ -257,9 +256,9 @@ default: cli-dependencies core core: game renderers mods utility ralint -tools: editor tsbuild crashdialog +tools: editor tsbuild gamemonitor -package: dependencies core editor crashdialog docs version +package: dependencies core editor gamemonitor docs version mods: mod_common mod_ra mod_cnc mod_d2k mod_ts @@ -344,6 +343,7 @@ install-tools: tools @-echo "Installing OpenRA tools to $(DATA_INSTALL_DIR)" @$(INSTALL_DIR) "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) $(foreach prog,$(TOOLS),$($(prog)_TARGET)) "$(DATA_INSTALL_DIR)" + @$(RM) $(DATA_INSTALL_DIR)/OpenRA.TilesetBuilder.exe # TODO: won't work outside the source tree install-linux-icons: @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/" diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 928b9474e1..32dea3f898 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -26,12 +26,6 @@ cp $DEPSDIR/* $PWD/packaging/linux/$ROOTDIR/usr/lib/openra/ # Install startup scripts, desktop files and icons make install-linux-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" -# Remove the WinForms dialog which is replaced with a native one provided by zenity -rm $PWD/packaging/linux/$ROOTDIR/usr/lib/openra/OpenRA.CrashDialog.exe - -# Remove the WinForms tileset builder which does not work outside the source tree -rm $PWD/packaging/linux/$ROOTDIR/usr/lib/openra/OpenRA.TilesetBuilder.exe - # Documentation mkdir -p $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/ cp *.html $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/ diff --git a/packaging/osx/buildpackage.sh b/packaging/osx/buildpackage.sh index f8cc1f847e..a21a70fb2a 100755 --- a/packaging/osx/buildpackage.sh +++ b/packaging/osx/buildpackage.sh @@ -18,9 +18,10 @@ cp -rv $2/* $3/* "OpenRA.app/Contents/Resources/" || exit 3 # Remove unused icon rm OpenRA.app/Contents/Resources/OpenRA.ico + # Remove broken WinForms applications +rm OpenRA.app/Contents/Resources/OpenRA.exe rm OpenRA.app/Contents/Resources/OpenRA.Editor.exe -rm OpenRA.app/Contents/Resources/OpenRA.CrashDialog.exe # Set version string sed "s/{DEV_VERSION}/${1}/" OpenRA.app/Contents/Info.plist.template > OpenRA.app/Contents/Info.plist diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 3944fc59e4..cc8319e9e8 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -30,7 +30,7 @@ markdown DOCUMENTATION.md > DOCUMENTATION.html markdown Lua-API.md > Lua-API.html # List of files that are packaged on all platforms -FILES=('OpenRA.Game.exe' 'OpenRA.Editor.exe' 'OpenRA.Utility.exe' 'OpenRA.CrashDialog.exe' \ +FILES=('OpenRA.Game.exe' 'OpenRA.Editor.exe' 'OpenRA.Utility.exe' \ 'OpenRA.Renderer.Sdl2.dll' 'OpenRA.Renderer.Null.dll' \ 'lua' 'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \ 'AUTHORS' 'COPYING' 'README.html' 'CONTRIBUTING.html' 'DOCUMENTATION.html' 'CHANGELOG.html' \ @@ -68,6 +68,9 @@ cp thirdparty/RestSharp.dll packaging/built # Copy game icon for windows package cp OpenRA.Game/OpenRA.ico packaging/built +# Copy the Windows crash monitor +cp OpenRA.exe packaging/built + cd packaging echo "Creating packages..." diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 9b5dfebb9f..db8fd6f95b 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -65,9 +65,9 @@ Section "Game" GAME File /r "${SRCDIR}\mods\modchooser" SetOutPath "$INSTDIR" + File "${SRCDIR}\OpenRA.exe" File "${SRCDIR}\OpenRA.Game.exe" File "${SRCDIR}\OpenRA.Utility.exe" - File "${SRCDIR}\OpenRA.CrashDialog.exe" File "${SRCDIR}\OpenRA.Renderer.Null.dll" File "${SRCDIR}\OpenRA.Renderer.Sdl2.dll" File "${SRCDIR}\ICSharpCode.SharpZipLib.dll" @@ -97,8 +97,8 @@ Section "Game" GAME !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$StartMenuFolder" - CreateShortCut "$SMPROGRAMS\$StartMenuFolder\OpenRA.lnk" $OUTDIR\OpenRA.Game.exe "" \ - "$OUTDIR\OpenRA.Game.exe" "" "" "" "" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\OpenRA.lnk" $OUTDIR\OpenRA.exe "" \ + "$OUTDIR\OpenRA.exe" "" "" "" "" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\README.lnk" $OUTDIR\README.html "" \ "$OUTDIR\README.html" "" "" "" "" !insertmacro MUI_STARTMENU_WRITE_END @@ -125,8 +125,8 @@ SectionEnd SectionGroup /e "Settings" Section "Desktop Shortcut" DESKTOPSHORTCUT SetOutPath "$INSTDIR" - CreateShortCut "$DESKTOP\OpenRA.lnk" $INSTDIR\OpenRA.Game.exe "" \ - "$INSTDIR\OpenRA.Game.exe" "" "" "" "" + CreateShortCut "$DESKTOP\OpenRA.lnk" $INSTDIR\OpenRA.exe "" \ + "$INSTDIR\OpenRA.exe" "" "" "" "" SectionEnd SectionGroupEnd @@ -181,10 +181,9 @@ Function ${UN}Clean RMDir /r $INSTDIR\maps RMDir /r $INSTDIR\glsl RMDir /r $INSTDIR\lua - Delete $INSTDIR\OpenRA.Launcher.exe + Delete $INSTDIR\OpenRA.exe Delete $INSTDIR\OpenRA.Game.exe Delete $INSTDIR\OpenRA.Utility.exe - Delete $INSTDIR\OpenRA.CrashDialog.exe Delete $INSTDIR\OpenRA.Editor.exe Delete $INSTDIR\OpenRA.Renderer.Null.dll Delete $INSTDIR\OpenRA.Renderer.Sdl2.dll From c0e7718fd55a07e0386455540b9fc23d0ff20a1d Mon Sep 17 00:00:00 2001 From: steelphase Date: Sat, 18 Oct 2014 19:30:28 -0400 Subject: [PATCH 4/7] Remove Unused Settings This removes unused settings related to CrashDialog --- OpenRA.Game/Settings.cs | 3 --- OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs | 2 -- mods/cnc/chrome/settings.yaml | 21 +++++++------------ mods/ra/chrome/settings.yaml | 21 +++++++------------ 4 files changed, 14 insertions(+), 33 deletions(-) diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index a8430f3da5..bdaf1a9f7f 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -72,9 +72,6 @@ namespace OpenRA public bool SanityCheckUnsyncedCode = false; public int Samples = 25; public bool IgnoreVersionMismatch = false; - - public bool ShowFatalErrorDialog = true; - public string FatalErrorDialogFaq = "http://wiki.openra.net/FAQ"; } public class GraphicSettings diff --git a/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs index 99de7937b9..53c4154ed1 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/SettingsLogic.cs @@ -466,7 +466,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic BindCheckboxPref(panel, "PERFGRAPH_CHECKBOX", ds, "PerfGraph"); BindCheckboxPref(panel, "CHECKUNSYNCED_CHECKBOX", ds, "SanityCheckUnsyncedCode"); BindCheckboxPref(panel, "BOTDEBUG_CHECKBOX", ds, "BotDebug"); - BindCheckboxPref(panel, "CRASH_DIALOG_CHECKBOX", ds, "ShowFatalErrorDialog"); BindCheckboxPref(panel, "FETCH_NEWS_CHECKBOX", gs, "FetchNews"); return () => { }; @@ -487,7 +486,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic ds.PerfGraph = dds.PerfGraph; ds.SanityCheckUnsyncedCode = dds.SanityCheckUnsyncedCode; ds.BotDebug = dds.BotDebug; - ds.ShowFatalErrorDialog = dds.ShowFatalErrorDialog; }; } diff --git a/mods/cnc/chrome/settings.yaml b/mods/cnc/chrome/settings.yaml index 35e289d2e4..821dcab639 100644 --- a/mods/cnc/chrome/settings.yaml +++ b/mods/cnc/chrome/settings.yaml @@ -437,13 +437,6 @@ Container@SETTINGS_PANEL: Height: 20 Font: Regular Text: Enable Network Discovery (UPnP) - Checkbox@CRASH_DIALOG_CHECKBOX: - X: 310 - Y: 40 - Width: 300 - Height: 20 - Font: Regular - Text: Show Fatal Error dialog Checkbox@PERFTEXT_CHECKBOX: X: 15 Y: 70 @@ -451,6 +444,13 @@ Container@SETTINGS_PANEL: Height: 20 Font: Regular Text: Show Performance Text + Checkbox@FETCH_NEWS_CHECKBOX: + X: 310 + Y: 40 + Width: 300 + Height: 20 + Font: Regular + Text: Fetch Community News Checkbox@PERFGRAPH_CHECKBOX: X: 310 Y: 70 @@ -458,13 +458,6 @@ Container@SETTINGS_PANEL: Height: 20 Font: Regular Text: Show Performance Graph - Checkbox@FETCH_NEWS_CHECKBOX: - X: 15 - Y: 100 - Width: 300 - Height: 20 - Font: Regular - Text: Fetch Community News Label@DEBUG_TITLE: Y: 140 Width: PARENT_RIGHT diff --git a/mods/ra/chrome/settings.yaml b/mods/ra/chrome/settings.yaml index c34e3d248d..850c6aa776 100644 --- a/mods/ra/chrome/settings.yaml +++ b/mods/ra/chrome/settings.yaml @@ -438,13 +438,6 @@ Background@SETTINGS_PANEL: Height: 20 Font: Regular Text: Enable Network Discovery (UPnP) - Checkbox@CRASH_DIALOG_CHECKBOX: - X: 310 - Y: 40 - Width: 300 - Height: 20 - Font: Regular - Text: Show Fatal Error dialog Checkbox@PERFTEXT_CHECKBOX: X: 15 Y: 70 @@ -452,6 +445,13 @@ Background@SETTINGS_PANEL: Height: 20 Font: Regular Text: Show Performance Text + Checkbox@FETCH_NEWS_CHECKBOX: + X: 310 + Y: 40 + Width: 300 + Height: 20 + Font: Regular + Text: Fetch Community News Checkbox@PERFGRAPH_CHECKBOX: X: 310 Y: 70 @@ -459,13 +459,6 @@ Background@SETTINGS_PANEL: Height: 20 Font: Regular Text: Show Performance Graph - Checkbox@FETCH_NEWS_CHECKBOX: - X: 15 - Y: 100 - Width: 300 - Height: 20 - Font: Regular - Text: Fetch Community News Label@DEBUG_TITLE: Y: 140 Width: PARENT_RIGHT From 571b80546bbe4703affaa12c7a536b377d843c61 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 19 Oct 2014 14:15:42 +1300 Subject: [PATCH 5/7] Add crash dialog to OSX launcher. --- .../osx/template.app/Contents/MacOS/OpenRA | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packaging/osx/template.app/Contents/MacOS/OpenRA b/packaging/osx/template.app/Contents/MacOS/OpenRA index f4a7ffe35f..6cb51f0d59 100755 --- a/packaging/osx/template.app/Contents/MacOS/OpenRA +++ b/packaging/osx/template.app/Contents/MacOS/OpenRA @@ -14,6 +14,10 @@ TITLE="Cannot launch OpenRA" MESSAGE="OpenRA requires Mono $REQUIRED_MAJOR.$REQUIRED_MINOR or later. Please install the Mono MRE package and try again." MONO_URL="http://www.mono-project.com/download/" +CRASH_TITLE="Fatal Error" +CRASH_MESSAGE="OpenRA has encountered a fatal error.\nRefer to the crash logs and FAQ for more information." +FAQ_URL="http://wiki.openra.net/FAQ" + DIR=$(cd "$(dirname "$0")"; pwd) RESOURCES="$DIR/../Resources" @@ -35,4 +39,23 @@ then fi # Override fontconfig with our own dummy config that prevents long cache delays -cd "$RESOURCES" && FONTCONFIG_PATH="." $MONO_BIN --debug OpenRA.Game.exe Graphics.Renderer=Sdl2 \ No newline at end of file +cd "$RESOURCES" && FONTCONFIG_PATH="." $MONO_BIN --debug OpenRA.Game.exe Graphics.Renderer=Sdl2 + +# Display an error dialog on game crash +if [ $? != 0 ] +then + osascript \ + -e "set logsPath to ((path to application support folder from user domain) as text) & \"OpenRA:Logs:\"" \ + -e "log logsPath" \ + -e "tell application \"Finder\"" \ + -e " repeat" \ + -e " set question to display dialog \"$CRASH_MESSAGE\" with title \"$CRASH_TITLE\" with icon alias (POSIX file \"$RESOURCES/OpenRA.icns\") buttons {\"View Logs\", \"View FAQ\", \"Quit\"} default button 3" \ + -e " if button returned of question is equal to \"View Logs\" then open logsPath" \ + -e " if button returned of question is equal to \"View FAQ\" then open location \"$FAQ_URL\"" \ + -e " if button returned of question is equal to \"Quit\" then exit repeat" \ + -e " if button returned of question is equal to \"Download Mono\" then open location \"$MONO_URL\"" \ + -e " activate" \ + -e " end repeat" \ + -e "end tell" + exit 1 +fi \ No newline at end of file From 590de11df45105cdccb1ca6bfcd27701be702821 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 19 Oct 2014 14:19:30 +1300 Subject: [PATCH 6/7] Add crash dialog to Linux launcher. --- Makefile | 9 ++++++++- error-dialog.sh | 3 --- 2 files changed, 8 insertions(+), 4 deletions(-) delete mode 100755 error-dialog.sh diff --git a/Makefile b/Makefile index 484c655d93..11701bfc48 100644 --- a/Makefile +++ b/Makefile @@ -357,7 +357,14 @@ install-linux-desktop: install-linux-scripts: @echo "#!/bin/sh" > openra @echo 'cd "$(gameinstalldir)"' >> openra - @echo 'exec mono OpenRA.Game.exe "$$@"' >> openra + @echo 'mono OpenRA.Game.exe "$$@"' >> openra + @echo 'if [ $$? != 0 ]' >> openra + @echo 'then' >> openra + @echo 'ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files."' >> openra + @echo '$$ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ' >> openra + @echo 'exit 1' >> openra + @echo 'fi' >> openra + @$(INSTALL_DIR) "$(BIN_INSTALL_DIR)" @$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)" @-$(RM) openra diff --git a/error-dialog.sh b/error-dialog.sh deleted file mode 100755 index 371ea3f178..0000000000 --- a/error-dialog.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files." -$ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ \ No newline at end of file From b7b4bf25b5a2721d1cc0b6c5b13afcd964b83d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 19 Oct 2014 11:31:59 +0200 Subject: [PATCH 7/7] add the zenity crash dialog to the Desura scripts --- launch-game.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/launch-game.sh b/launch-game.sh index 090f030f69..6b73263d68 100755 --- a/launch-game.sh +++ b/launch-game.sh @@ -1,3 +1,9 @@ #!/bin/sh # launch script (executed by Desura) -exec mono OpenRA.Game.exe Server.Dedicated=False Server.DedicatedLoop=False "$@" \ No newline at end of file +mono OpenRA.Game.exe Server.Dedicated=False Server.DedicatedLoop=False "$@" +if [ $? != 0 ] +then + ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files." + $ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ + exit 1 +fi \ No newline at end of file