Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- flavor: win-x64
os: windows-latest
script: build_win-x64.bat
- flavor: win-arm64
os: windows-latest
script: build_win-arm64.bat
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
19 changes: 19 additions & 0 deletions build_win-arm64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off
setlocal enabledelayedexpansion

if "%~1"=="" (
echo Version number is required.
echo Usage: build.bat [version] [extra_args...]
exit /b 1
)

set "version=%~1"

echo.
echo Compiling Launcher with dotnet...
echo %~dp0publish
dotnet publish .\src\Launcher.slnx -c Release --no-self-contained -r win-arm64 --property:PublishDir="%~dp0publish"

echo.
echo Building Velopack Release v%version%
vpk pack --packTitle "OSFR Launcher" --packAuthors "OSFR Team" -u OSFRLauncher -e Launcher.exe -o "%~dp0releases" -p "%~dp0publish" -i "%~dp0publish\App.ico" -f net10-arm64-desktop -v %*
31 changes: 12 additions & 19 deletions src/Launcher/Helpers/Dx9Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,28 @@ public static bool IsInstalled()
{
try
{
string? systemPath = null;

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
string winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
systemPath = Path.Combine(winDir, "System32");
// Wine uses wined3d which it ships with, not native DirectX DLLs
return WineHelper.IsInstalled();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
if (string.IsNullOrEmpty(WineHelper.GetPath()))
return false;

var winePrefix = Environment.GetEnvironmentVariable("WINEPREFIX") ??
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".wine");

systemPath = Path.Combine(winePrefix, "drive_c", "windows", "system32");
}
else
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Unknown platform
return false;
}

if (!Directory.Exists(systemPath))
return false;
string winDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);

// The game client is 32-bit, so its DLLs are loaded from SysWOW64 on 64-bit Windows.
// Since the launcher is 64-bit only, this is the dir we need to check; not System32
string sysWow64Path = Path.Combine(winDir, "SysWOW64");

foreach (var requiredDll in RequiredDlls)
{
if (!File.Exists(Path.Combine(systemPath, requiredDll)))
if (!File.Exists(Path.Combine(sysWow64Path, requiredDll)))
return false;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/Launcher/Helpers/WineHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ public static string GetPath()

return string.Empty;
}

public static bool IsInstalled()
{
return !string.IsNullOrEmpty(GetPath());
}
}