Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Don't try to delete the running process (closes #40)
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Feb 19, 2022
1 parent 01aab4d commit 1fc9760
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Squirrel/Internal/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ private static void DeleteFsiTree(FileSystemInfo fileSystemInfo)

private static void DeleteFsiVeryHard(FileSystemInfo fileSystemInfo)
{
// don't try to delete the running process
if (fileSystemInfo.FullName.Equals(AssemblyRuntimeInfo.EntryExePath, StringComparison.InvariantCultureIgnoreCase))
return;

// try to remove "ReadOnly" attributes
try { fileSystemInfo.Attributes = FileAttributes.Normal; } catch { }
try { fileSystemInfo.Refresh(); } catch { }
Expand Down

0 comments on commit 1fc9760

Please sign in to comment.