This code was working fine... I made zero modifications to the software.
I formated the computer today, reinstalled Visual Studio 2010, and tried to compile it Now it gives me an error...
This is the code:
- ICSharpCode.SharpZipLib.Zip.FastZip shpZip = new ICSharpCode.SharpZipLib.Zip.FastZip();
- shpZip.ExtractZip("update.zip", Application.StartupPath, ".*");
- System.Diagnostics.Process.Start("generator.exe");
It was working 100% fine, untill I reinstalled it... Some other friend told me he had a problem too a month ago, but i thoght it was somethign wrong with his machine, but now I realize
the error really exists (I dont know why It was working before).
This is the error:
Cannot find central directory
It points the error at this line:
shpZip.ExtractZip("update.zip", Application.StartupPath, ".*");Thanks guys...
Why did it work before and now it doesn't ? I don't understand... Thats the error inside the compiler..
This is the error outside of the compiter when I run the program:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
ICSharpCode.SharpZipLib.Zip.ZipException: Cannot find central directory
at ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries()
at ICSharpCode.SharpZipLib.Zip.ZipFile..ctor(String name)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(String zipFileName, String targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, String fileFilter, String directoryFilter, Boolean restoreDateTime)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(String zipFileName, String targetDirectory, String fileFilter)
at SelfUpdate.Form1.Completed(Object sender, AsyncCompletedEventArgs e)
at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)
at System.Net.WebClient.DownloadFileOperationCompleted(Object arg)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
SelfUpdate
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Ultra/Desktop/c-sharp_Generator/1_SelfUpdate.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
Thanks alot guys
FroglegPosted Jan 27, 2011, 1:47 AM
Try to open the file with winzip - it may be currupt
thiago costaPosted Jan 27, 2011, 4:28 PM
Frogleg, once again man ! Thank you so much...
I will be more than happy to try your zip program :D
Hey, sorry to ask,
Do you use anything for versioning?
Like turtoisesvn ? ...
I ask because, it will br an honor having you there
Thx bro
Sam HobbsPosted Jan 27, 2011, 4:08 PM
For what it is worth, I have been working on my own zip file extraction program and some day I will put it into an article.
thiago costaPosted Jan 27, 2011, 4:01 PM
Thanks man, you were right again ! ...
I tripple checked everything, and what happened was,
The software downloads the file via http, then extracts it..
BUT, in the software, I dont use "localhost", I use the static IP ..
What happened was, my router got reset (i dont know how) and the Static NAT got disabled ...
So the local file not corrupt, BUT, the downloaded file was...
I don't know why but, even if the server is offline, it still downloads the file !
LOL !!!..
Thanks again Frogleg
FroglegPosted Jan 27, 2011, 3:12 PM
How did you create "update.zip"
"update.zip" resides in application folder ?
thiago costaPosted Jan 27, 2011, 2:54 PM
But for some reason, it worked before, and now it doesn't ... I wonder why ...
Also, I want to extract it to the Application.StartupPath .
So the root folder of my application ...
Any ideas?