Skip to content

Commit

Permalink
tryfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mossimos committed Mar 17, 2022
1 parent f721c66 commit 6158b30
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packaging/build-osx-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ emit_plist "$APPNAME" "$APPDIR" true

mv -f "${{ Steam++_APPDIR }}" "$APPDIR/MacOS"
chmod +x "$APPDIR/MacOS/Steam++"

mkdir "${{ Steam++_APPDIR }}"
mv -f "${{ Steam++_OutPutFilePath }}/$BINARYNAME.app" "${{ Steam++_APPDIR }}/$BINARYNAME.app"
32 changes: 28 additions & 4 deletions src/ST.Tools.Publish/Steps/Step_cd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -569,9 +571,8 @@ static void OSXBuild(bool dev, string[] osx_val)
{
Console.WriteLine($"找不到 destPath 文件夹,值:{destPath}");
continue;
}
var isArm = item == "osx-x64";
var appName = $"Steam++{(isArm ? "" : " Arm64")}";
}
var appName = $"Steam++{(item == "osx-x64" ? "" : " Arm64")}";
var shFileContent2 = shFileContent
.Replace("${{ Steam++_AppName }}", appName)
.Replace("${{ Steam++_Version }}", CFBundleVersion)
Expand All @@ -582,7 +583,7 @@ static void OSXBuild(bool dev, string[] osx_val)
.Replace("${{ Steam++_RunName }}", "Steam++")
;
File.WriteAllText(shFilePath, shFileContent2);

Chmod(shFilePath, (int)EUnixPermission.UserExecute);
var process = Process.Start(new ProcessStartInfo()
{
FileName = shFilePath,
Expand All @@ -592,5 +593,28 @@ static void OSXBuild(bool dev, string[] osx_val)
process!.WaitForExit();
}
}
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[DllImport("libc", EntryPoint = "chmod", SetLastError = true)]
[SupportedOSPlatform("FreeBSD")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("MacOS")]
internal static extern int Chmod(string path, int mode);
[Flags]
[SupportedOSPlatform("FreeBSD")]
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("MacOS")]
internal enum EUnixPermission : ushort
{
OtherExecute = 0x1,
OtherWrite = 0x2,
OtherRead = 0x4,
GroupExecute = 0x8,
GroupWrite = 0x10,
GroupRead = 0x20,
UserExecute = 0x40,
UserWrite = 0x80,
UserRead = 0x100,
Combined777 = UserRead | UserWrite | UserExecute | GroupRead | GroupWrite | GroupExecute | OtherRead | OtherWrite | OtherExecute
}
}
}

0 comments on commit 6158b30

Please sign in to comment.