tags:

views:

58

answers:

3

Hello! i have a .zip file that my application needs to extract, and run how would i go about doing this? it needs to extract Programs\Test\Build.zip to the directory:

string tempFolder = System.Environment.GetEvironmentVariable("HomeDrive");

then it needs to wait till its finished, then run the exe "Compile.exe" that was extracted, ideas?

+1  A: 

Well, for one thing you could extract it in code, using SharpZipLib.

There's a sample for unpacking a complete zip file.

Once that's done, just use Process.Start to launch the executable.

Jon Skeet
well its just for one single .zip and alot of that looks confusing and unnecessarily.
NightsEVil
@NightsEvil: Why does it matter whether it's a single zip file or not? How would that affect how complex the code is going to be?
Jon Skeet
@jon well i dont know im still new to all this. I just figured that if it could be simplified, or cut down some id bring it up.
NightsEVil
@Nights: You could cut down that sample a bit since it does some extra things (like for example skipping directories etc) but if your zip file don't contain any directories you could probably copy that code just as it is (assuming that's ok license wise) into your app and all you'd have to do would be to call it with those simple parameters.
ho1
ok and as for the password part would that work for a .zip file thats passworded made with 7-zip? (.zip NOT .7z)
NightsEVil
@NightsEvil: I'd expect so; I think the password protection is standardised in the zip format - but the easiest way to find out is probably just to try it.
Jon Skeet
wow please be patient with me as i am a noobie and im trying to learn this all my self with no 1 else to bounce ideas off in real life, and this is just way confusing for me, i just wanna extract a .zip file to a folder LOL why does that have to be so complicated?
NightsEVil
A: 

I suggest using SharpZipLib as described here. It's easy to use and I think it's synchronous by default. See this page for samples on how to use it.

And then just execute it using Process.Start

ho1