This project is read-only.

How to use this with SevenZipSharp??

Jun 23, 2010 at 8:19 AM

hi i'm relatively new to the programing game and iv been looking for a way (other than SFX which is what i am currently doing) to incorporate 7zip into my application but im having some trouble anyways this is my code currently for using the 7zip SFX's it extracts to the APPDATA folder runs the application and once the application is closed it deletes it (and just in case there's any flamers this is not for a virus this is a disk defragmentation software that i have packaged to be portable)

 

        {
            string tempFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            System.Diagnostics.Process defrag1 = System.Diagnostics.Process.Start(@"Programs\Optimize\AusLogics_Defrag.exe", string.Format(" -o{0} -y -Pmegapassword", tempFolder));
            defrag1.WaitForExit();
            string executableDirectoryName = Path.GetDirectoryName(Application.ExecutablePath);
            System.Diagnostics.Process defrag2 = System.Diagnostics.Process.Start(tempFolder + "\\" + "AusLogics_Defrag" + "\\" + "DiskDefrag.exe", "");
            defrag2.WaitForExit();
            System.IO.Directory.Delete(tempFolder + "\\" + "AusLogics_Defrag", true);
        }
so how can i get this to work with sevenzipsharp?

Jul 17, 2010 at 5:45 AM

using (var extr = new SevenZipExtractor(Assembly.GetExecutingAssembly().GetManifestResourceStream("path to the embedded archive with your program")))
{
    extr.ExtractArchive("path where to extract the program");
}
// all the steps to deal with it

Jul 20, 2010 at 9:24 AM

how would i add in the password for the .7z archive? and how would i have something like the "

defrag1.WaitForExit();" for while its extracting?