Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

fix(game-mode): sign an unsigned Wine loader ad hoc instead of failing (ray.26)

raymondchins324b0cc4d5f0
diff --git a/dylib/version.h b/dylib/version.h
index 9b76c4c..8b11709 100644
--- a/dylib/version.h
+++ b/dylib/version.h
@@ -2,6 +2,6 @@
#ifndef NOTPROTON_VERSION_H
#define NOTPROTON_VERSION_H
-#define NOTPROTON_VERSION "1.1.7-winehq.1-ray.25"
+#define NOTPROTON_VERSION "1.1.7-winehq.1-ray.26"
#endif // NOTPROTON_VERSION_H
diff --git a/helpers/prepare-game-loader.swift b/helpers/prepare-game-loader.swift
index 46f4bba..d2d9b93 100644
--- a/helpers/prepare-game-loader.swift
+++ b/helpers/prepare-game-loader.swift
@@ -147,8 +147,14 @@ func prepare(_ target: URL, _ info: URL) throws {
let attributes = try files.attributesOfItem(atPath: target.path)
try files.setAttributes(
[.posixPermissions: attributes[.posixPermissions] ?? 0o755], ofItemAtPath: staged.path)
- let entitlements = try runCodesign(["-d", "--entitlements", ":-", target.path])
- var arguments = ["--force", "--sign", "-", "--identifier", identity, "--options", "runtime"]
+ // CrossOver's loader is signed with the hardened runtime and entitlements; a free
+ // runtime's loader (WineCX) is not signed at all. Re-signing that one under the
+ // hardened runtime with no entitlements would refuse the DYLD_INSERT_LIBRARIES the
+ // launcher relies on, so it gets a plain ad hoc signature instead.
+ let signed = (try? runCodesign(["-d", target.path])) != nil
+ let entitlements = signed ? try runCodesign(["-d", "--entitlements", ":-", target.path]) : Data()
+ var arguments = ["--force", "--sign", "-", "--identifier", identity]
+ if signed { arguments += ["--options", "runtime"] }
if !entitlements.isEmpty {
_ = try PropertyListSerialization.propertyList(from: entitlements, format: nil)
let file = temporary.appendingPathComponent("entitlements.plist")