The Archive component includes the capability of creating self-extracting archives. The SelfExtactConfiguration property provides a mechanism for creating archives that do not require the Zip component (or any other Unzip utility) to extract the files contained within. Please note that it is no longer necessary to distribute the DartAttach.bin file with your application if your application will be creating self-extracting exe files.
To encrypt items in an archive:
C# |
Copy Code |
---|---|
archive1.Add("c:\\Test\\*.txt"); //This archive will always extract to the Test directory. By default, existing files //will be overwritten, but this can be changed by the end-user archive1.SelfExtractConfiguration = new SelfExtractConfiguration("This is my self-extracting archive!", "c:\\Test", false, Overwrite.Always, true, true, true, archive1.Encoding.CodePage, SelfExtractBehavior.UserInteractive, ""); archive1.Zip("c:\\mySelfExtractingArchive.exe"); |
Visual Basic |
Copy Code |
---|---|
Archive1.Add("c:\Test\*.txt") 'This archive will always extract to the Test directory. By default, existing files 'will be overwritten, but this can be changed by the end-user Archive1.SelfExtractConfiguration = New SelfExtractConfiguration("This is my self-extracting archive!", _ "c:\Test", False, Overwrite.Always, True, True, True, Archive1.Encoding.CodePage, SelfExtractBehavior.UserInteractive, "") Archive1.Zip("c:\mySelfExtractingArchive.exe") |