Adding 7zip functionality INTO my application?

currently useing SFX but would like my application to unzip .7z files

Page 1 of 1

5 Replies - 5259 Views - Last Post: 08 July 2010 - 07:09 AM Rate Topic: -----

#1 NightsEvil  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 85
  • Joined: 23-May 10

Adding 7zip functionality INTO my application?

Posted 22 June 2010 - 11:17 PM

i currently have this code to extract a passworded 7zip SFX to the appdata location run it then clean up after its self, but i'm losing a lot of compression i think also would just like to learn how to do this, so id like to learn how to make it so my application can extract a .7z file without having 7-zip installed on the computer (the application is ment to be ran on computers without 7-zip) i know it has to do with adding some dll files and such but any more than that and i'm clueless lol, also it would be cool to see how to add UHARC archiving functionality as well, any ways here's my coding for the SFX's

string tempFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
        System.Diagnostics.Process defrag1 = System.Diagnostics.Process.Start(@"AusLogics_Defrag.exe", string.Format(" -o{0} -y -Pthisisthepass", 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);




and i found this http://sevenzipsharp.codeplex.com/ and i can add the reference but im also supposed to add in a .DLL like 7za.dll but i cant any help would be really nice thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Adding 7zip functionality INTO my application?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9393
  • View blog
  • Posts: 35,278
  • Joined: 12-June 08

Re: Adding 7zip functionality INTO my application?

Posted 23 June 2010 - 08:14 AM

A few things..

View PostNightsEvil, on 23 June 2010 - 12:17 AM, said:

i currently have this code to extract a passworded 7zip SFX to the appdata location run it then clean up after its self,

Let me get this straight, you are circumventing the passwords on 7zip archives?

View PostNightsEvil, on 23 June 2010 - 12:17 AM, said:

and i found this http://sevenzipsharp.codeplex.com/ and i can add the reference but im also supposed to add in a .DLL like 7za.dll but i cant any help would be really nice thanks!

What do you mean you can't add a 7za.dll? Right click on your project.. click add reference.. go to the location of the dll.. and there you go!
Was This Post Helpful? 1
  • +
  • -

#3 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: Adding 7zip functionality INTO my application?

Posted 23 June 2010 - 01:21 PM

Don't think this will work for 7zipped files specifically but for unzipping normal zip files you could look into using the System.IO.Compression namespace or ICSharpCode.SharpZipLib.Zip.

-Frinny

This post has been edited by Frinavale: 23 June 2010 - 01:40 PM

Was This Post Helpful? 0
  • +
  • -

#4 NightsEvil  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 85
  • Joined: 23-May 10

Re: Adding 7zip functionality INTO my application?

Posted 23 June 2010 - 01:29 PM

the SFX's are passworded so that they cannot be accessed except by the use of the program
and as for adding the .DLL i cant add it in because i get the error:

"A reference to 7za.dll could not be added. please make sure that the file is accessible, and that it is a valid assembly or COM component."
Was This Post Helpful? 0
  • +
  • -

#5 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: Adding 7zip functionality INTO my application?

Posted 23 June 2010 - 03:48 PM

I'm guessing you downloaded the file in a .zip file?

Make sure your .dll is extracted somewhere (like the Desktop) and then reference that .dll from within your Solution Explorer.
Was This Post Helpful? 0
  • +
  • -

#6 Guest_Guest*


Reputation:

Re: Adding 7zip functionality INTO my application?

Posted 08 July 2010 - 07:09 AM

View PostNightsEvil, on 23 June 2010 - 12:29 PM, said:

the SFX's are passworded so that they cannot be accessed except by the use of the program
and as for adding the .DLL i cant add it in because i get the error:

"A reference to 7za.dll could not be added. please make sure that the file is accessible, and that it is a valid assembly or COM component."

i get the same error when i try to reference it
Was This Post Helpful? 0

Page 1 of 1