Learn how to create self-extracting archives (SFX or SEA) in C#: https://blog.aspose.com/2022/01/10/create-self-extracting-archive-in-csharp/
Last active
January 10, 2022 09:07
-
-
Save aspose-com-gists/affc766964fa27f6b59c8008481e2ae8 to your computer and use it in GitHub Desktop.
Create Self-extracting Archives (SFX or SEA) in C# .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create FileStream to save SFX archive | |
using (FileStream zipFile = File.Open("Archives/archive.exe", FileMode.Create)) | |
{ | |
// Create a new archive | |
using (var archive = new Archive()) | |
{ | |
// Add files/folders to archive | |
archive.CreateEntry("SourceFile1.txt", "Archives/SourceFile1.txt"); | |
// Create and set options for SFX archive | |
var sfxOptions = new SelfExtractorOptions() | |
{ | |
ExtractorTitle = "Extractor", | |
CloseWindowOnExtraction = true, | |
}; | |
// Create SFX archive | |
archive.Save(zipFile, new ArchiveSaveOptions() { SelfExtractorOptions = sfxOptions }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment