Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion FluentAutomation/EmbeddedResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ public static string UnpackFromAssembly(string resourceFileName, string outputFi
if (filePath != string.Empty && new FileInfo(filePath).Length == resourceStream.Length)
return filePath;

var resourceBytes = new byte[(int)resourceStream.Length];
var tmpPath = Path.Combine(Path.GetTempPath(), outputFileName);
var tmpFileInfo = new FileInfo(tmpPath);

if (tmpFileInfo.Exists && tmpFileInfo.Length == resourceStream.Length)
return tmpPath;

var resourceBytes = new byte[(int)resourceStream.Length];
resourceStream.Read(resourceBytes, 0, resourceBytes.Length);
File.WriteAllBytes(tmpPath, resourceBytes);

Expand Down