From 0e785d04b77db6c0488e42f9d184b3f5f76ea59a Mon Sep 17 00:00:00 2001 From: js6pak Date: Wed, 14 Jul 2021 01:50:37 +0200 Subject: [PATCH] Set executable permissions to files with Executable flag --- DepotDownloader/ContentDownloader.cs | 8 +++++++- DepotDownloader/DepotDownloader.csproj | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index ba1ced91..3937e8f8 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; @@ -7,6 +7,7 @@ using System.Net; using System.Threading; using System.Threading.Tasks; using SteamKit2; +using Mono.Unix; namespace DepotDownloader { @@ -1046,6 +1047,11 @@ namespace DepotDownloader throw new ContentDownloaderException(String.Format("Failed to allocate file {0}: {1}", fileFinalPath, ex.Message)); } + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && file.Flags.HasFlag(EDepotFileFlag.Executable)) + { + UnixFileSystemInfo.GetFileSystemEntry(fileFinalPath).FileAccessPermissions |= FileAccessPermissions.UserExecute | FileAccessPermissions.GroupExecute | FileAccessPermissions.OtherExecute; + } + neededChunks = new List(file.Chunks); } else diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index b4933488..b6c3460e 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -13,5 +13,6 @@ +