I'v been using the DotNetZip library for uncompressing some files from a ZIP file, compressed using the same library. That ZIP file contains exe files, but once decompressed, some of the exe file decompressed is not opening anymore. That problem is not happening if i decompress the file manually with WinRAR.
The code i'm using is this one...
if (!System.IO.File.Exists("ApplicationSample.zip")) { MessageBox.Show("No data found", "Warning"); return false; }
var Archive = ZipFile.Open(DatFilePath, ZipArchiveMode.Read);
var InstallPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"/ApplicationSample";
if (Directory.Exists(InstallPath))
Directory.Delete(InstallPath, true);
Directory.CreateDirectory(InstallPath);
Archive.ExtractToDirectory(InstallPath);
var ArchiveEd = new Ionic.Zip.ZipFile("ApplicationSample.zip");
ArchiveEd.UseUnicodeAsNecessary = true;
ArchiveEd.ZipError += ApplicationSample_ZipError;
ArchiveEd.ExtractAll(InstallPath);
ArchiveEd.Dispose();
ShellLink link = new ShellLink();
link.WorkingDirectory = InstallPath;
link.Target = InstallPath + "/ApplicationSample.exe";
link.IconPath = InstallPath + "/ApplicationSample.ico";
link.Save(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/ApplicationSample.lnk");
The exe file i'm trying to open is an WPF application that works correctly if i do the same operation manually.
I don't know what's happening here and i would like to know what's the problem.
Thanks!!