From cffc01ab28f9f255097d3abb488034cab4906f60 Mon Sep 17 00:00:00 2001 From: penev92 Date: Thu, 21 May 2015 20:38:07 +0300 Subject: [PATCH 1/3] Register .orarep file type and openra:// URI scheme on Windows --- packaging/windows/OpenRA.nsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index c88d9ff867..722da967a6 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -53,7 +53,21 @@ Var StartMenuFolder ;Section Definitions ;*************************** Section "-Reg" Reg + + ; Installation directory WriteRegStr HKLM "Software\OpenRA" "InstallDir" $INSTDIR + + ; Replay file association + WriteRegStr HKLM "Software\Classes\.orarep" "" "OpenRA_replay" + WriteRegStr HKLM "Software\Classes\OpenRA_replay\DefaultIcon" "" "$INSTDIR\OpenRA.ico,0" + WriteRegStr HKLM "Software\Classes\OpenRA_replay\Shell\Open\Command" "" "$INSTDIR\OpenRA.exe Launch.Replay=%1" + + ; OpenRA URL Scheme + WriteRegStr HKLM "Software\Classes\openra" "" "URL:OpenRA scheme" + WriteRegStr HKLM "Software\Classes\openra" "URL Protocol" "" + WriteRegStr HKLM "Software\Classes\openra\DefaultIcon" "" "$INSTDIR\OpenRA.ico,0" + WriteRegStr HKLM "Software\Classes\openra\Shell\Open\Command" "" "$INSTDIR\OpenRA.exe Launch.URI=%1" + SectionEnd Section "Game" GAME From 42af5f0939dcccac5eb52792c58377870238dfdd Mon Sep 17 00:00:00 2001 From: penev92 Date: Thu, 21 May 2015 21:15:42 +0300 Subject: [PATCH 2/3] Fix how OpenRA.exe launches OpenRA.Game.exe --- OpenRA.GameMonitor/GameMonitor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.GameMonitor/GameMonitor.cs b/OpenRA.GameMonitor/GameMonitor.cs index 6f968047eb..bbf9c74aea 100644 --- a/OpenRA.GameMonitor/GameMonitor.cs +++ b/OpenRA.GameMonitor/GameMonitor.cs @@ -9,9 +9,9 @@ #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; @@ -20,12 +20,14 @@ namespace OpenRA { class GameMonitor { - static string processName = "OpenRA.Game.exe"; static Process gameProcess; [STAThread] static void Main(string[] args) { + var executableDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var processName = Path.Combine(executableDirectory, "OpenRA.Game.exe"); + var psi = new ProcessStartInfo(processName, string.Join(" ", args)); try From b1c36246cf7c2c34550757a2ddafdbf5ae1f4a15 Mon Sep 17 00:00:00 2001 From: penev92 Date: Fri, 22 May 2015 18:49:45 +0300 Subject: [PATCH 3/3] Clean Windows registry on uninstall --- packaging/windows/OpenRA.nsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 722da967a6..f9d661bbeb 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -228,7 +228,12 @@ Function ${UN}Clean Delete $INSTDIR\freetype6.dll Delete $INSTDIR\SDL2-CS.dll RMDir /r $INSTDIR\Support + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA" + DeleteRegKey HKLM "Software\Classes\.orarep" + DeleteRegKey HKLM "Software\Classes\OpenRA_replay" + DeleteRegKey HKLM "Software\Classes\openra" + Delete $INSTDIR\uninstaller.exe RMDir $INSTDIR