Skip to content

Commit

Permalink
Merge pull request #20 from mathieudel/master
Browse files Browse the repository at this point in the history
Fixed zip checks
  • Loading branch information
ryanjon2040 authored Jan 22, 2020
2 parents 26e9e6d + 26267d0 commit e5da5d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Unreal Binary Builder/PostBuildSettings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ public bool ShouldSaveToZip()

public bool DirectoryIsWritable()
{
bool bDirectoryExists = Directory.Exists(ZipPath.Text);
DirectoryInfo ZipDirectory = new FileInfo(ZipPath.Text).Directory;
bool bDirectoryExists = (ZipDirectory != null) && ZipDirectory.Exists;
bool bHasWriteAccess = false;
if(bDirectoryExists)
{
try
{
AuthorizationRuleCollection collection = Directory.GetAccessControl(ZipPath.Text).GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount));
AuthorizationRuleCollection collection = Directory.GetAccessControl(ZipDirectory.FullName).GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount));
foreach (FileSystemAccessRule rule in collection)
{
if (rule.AccessControlType == AccessControlType.Allow)
Expand Down

0 comments on commit e5da5d6

Please sign in to comment.