Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drpetersonfernandes committed May 15, 2024
1 parent 8ca2d11 commit 4dc4cf5
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion SimpleLauncher/ExtractCompressedFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,34 @@ internal class ExtractCompressedFile

private ExtractCompressedFile() { } // Private constructor to enforce singleton pattern

//public string ExtractArchiveToTemp(string archivePath)
//{
// string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
// Directory.CreateDirectory(tempDirectory);

// // Keep track of the temp directory
// _tempDirectories.Add(tempDirectory);

// using var archive = ArchiveFactory.Open(archivePath);
// foreach (var entry in archive.Entries)
// {
// if (!entry.IsDirectory)
// {
// entry.WriteToDirectory(tempDirectory, new ExtractionOptions()
// {
// ExtractFullPath = true,
// Overwrite = true
// });
// }
// }
// return tempDirectory;
//}

public string ExtractArchiveToTemp(string archivePath)
{
string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
// Use the application's directory for the temporary directory
string appDirectory = AppDomain.CurrentDomain.BaseDirectory;
string tempDirectory = Path.Combine(appDirectory, "temp", Path.GetRandomFileName());
Directory.CreateDirectory(tempDirectory);

// Keep track of the temp directory
Expand Down

0 comments on commit 4dc4cf5

Please sign in to comment.