Merge pull request #8208 from penev92/bleed_registerFileTypes
Register .orarep file type and openra:// URI scheme on Windows
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Media;
|
using System.Media;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -20,12 +20,14 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
class GameMonitor
|
class GameMonitor
|
||||||
{
|
{
|
||||||
static string processName = "OpenRA.Game.exe";
|
|
||||||
static Process gameProcess;
|
static Process gameProcess;
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main(string[] args)
|
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));
|
var psi = new ProcessStartInfo(processName, string.Join(" ", args));
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -53,7 +53,21 @@ Var StartMenuFolder
|
|||||||
;Section Definitions
|
;Section Definitions
|
||||||
;***************************
|
;***************************
|
||||||
Section "-Reg" Reg
|
Section "-Reg" Reg
|
||||||
|
|
||||||
|
; Installation directory
|
||||||
WriteRegStr HKLM "Software\OpenRA" "InstallDir" $INSTDIR
|
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
|
SectionEnd
|
||||||
|
|
||||||
Section "Game" GAME
|
Section "Game" GAME
|
||||||
@@ -214,7 +228,12 @@ Function ${UN}Clean
|
|||||||
Delete $INSTDIR\freetype6.dll
|
Delete $INSTDIR\freetype6.dll
|
||||||
Delete $INSTDIR\SDL2-CS.dll
|
Delete $INSTDIR\SDL2-CS.dll
|
||||||
RMDir /r $INSTDIR\Support
|
RMDir /r $INSTDIR\Support
|
||||||
|
|
||||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA"
|
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
|
Delete $INSTDIR\uninstaller.exe
|
||||||
RMDir $INSTDIR
|
RMDir $INSTDIR
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user