Skip to content

Commit f24aaa0

Browse files
committed
fix windows and mac
1 parent 47bbeb8 commit f24aaa0

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

MSBuild/Launcher.DefineConstants.targets

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
22
<!-- Adds to the DefineConstants to provide things such as platform-specific defines. -->
3+
<PropertyGroup>
4+
<OS Condition="'$(OS)' == ''">Windows_NT</OS>
5+
</PropertyGroup>
6+
<Choose>
7+
<When Condition="'$(OS)' != 'Unix'">
8+
<PropertyGroup>
9+
<ActualOS>Windows</ActualOS>
10+
</PropertyGroup>
11+
</When>
12+
<!-- Folders that *probably* only exist on MacOS and not Linux. -->
13+
<When Condition="Exists('/Volumes') And Exists('/System') And Exists('/Library')" >
14+
<PropertyGroup>
15+
<ActualOS>MacOS</ActualOS>
16+
</PropertyGroup>
17+
</When>
18+
<When Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">
19+
<PropertyGroup>
20+
<ActualOS>FreeBSD</ActualOS>
21+
</PropertyGroup>
22+
</When>
23+
<Otherwise>
24+
<PropertyGroup>
25+
<ActualOS>Linux</ActualOS>
26+
</PropertyGroup>
27+
</Otherwise>
28+
</Choose>
29+
<PropertyGroup>
30+
<TargetOS Condition="'$(TargetOS)' == ''">$(ActualOS)</TargetOS>
31+
</PropertyGroup>
332
<Choose>
433
<When Condition="'$(TargetOS)' == 'Windows'">
534
<PropertyGroup>

SS14.Launcher/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void RegisterProtocol()
108108
Log.Information("Registering SS14 protocol handler for Windows");
109109
foreach (var protocol in protocols)
110110
{
111-
var key = Registry.ClassesRoot.CreateSubKey(protocol);
111+
var key = Registry.CurrentUser.CreateSubKey($@"SOFTWARE\Classes\{protocol}");
112112
key.SetValue(string.Empty, $"URL: {protocol}");
113113
key.SetValue("URL Protocol", string.Empty);
114114

0 commit comments

Comments
 (0)