[
  {
    "Id": "208147",
    "ThreadId": "61360",
    "Html": "<p>I've tried both modes for creating a self extractor for a strongly encrypted (AES128/256) password protected zip. It creates the file which appears to be a reasonable size. However the file throws errors when I try to execute it. Has anyone else seen this?&nbsp; I'm developing a web application. Creating a standard zip file seems to work just fine.&nbsp; I've tried a number of other packages (sharp/7-zip) but none compare to this one in terms of shear ease of use/ intelligence of design. I'm sure I'm missing something simple. Any help would be appreciated.</p>\r\n<p>Here is the error</p>\r\n<pre>Microsoft Windows XP [Version 5.1.2600]\r\n\r\nException while extracting: System.IO.FileLoadException: Could not load file or\r\nassembly 'Ionic.Zip, Version=1.8.4.2, Culture=neutral, PublicKeyToken=edbe51ad94\r\n2a3f5c' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x8\r\n0004003 (E_POINTER))\r\nFile name: 'Ionic.Zip, Version=1.8.4.2, Culture=neutral, PublicKeyToken=edbe51ad\r\n942a3f5c' ---&gt; System.NullReferenceException: Object reference not set to an ins\r\ntance of an object.\r\n   at Ionic.Zip.SelfExtractor.Resolver(Object sender, ResolveEventArgs args)\r\n   at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName)\r\n   at Ionic.Zip.SelfExtractor.Run()\r\n   at Ionic.Zip.SelfExtractor.Main(String[] args)\r\n\r\n\r\n\r\nAnd here is the code that produced it</pre>\r\n<pre><pre>            using (ZipFile zip = new ZipFile())\r\n            {\r\n                zip.Password = thePassword.Trim();\r\n                zip.Encryption = EncryptionAlgorithm.WinZipAes128;\r\n                zip.AddDirectory(inputFolderPath);\r\n                //zip.Save(outputFilePath);\r\n                zip.SaveSelfExtractor(outputFilePath, SelfExtractorFlavor.ConsoleApplication);\r\n            }\r\n</pre>\r\n</pre>",
    "PostedDate": "2009-07-02T16:06:02.053-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208169",
    "ThreadId": "61360",
    "Html": "<p>Hmm, that's very odd.</p>\r\n<p>You're seeing a loader error.&nbsp; When you call SaveSelfExtractor(), DotNetZip embeds the Ionic.Zip.dll into the executable.&nbsp; When you run the SFX, the exe unpacks the DLL from within *itself*, and then calls into that DLL.&nbsp; It sounds tricky but it's really just a packing convenience.&nbsp;&nbsp;It's not&nbsp;reasonable to have to distribute&nbsp;the DLL with every SFX.</p>\r\n<p>The error you are seeing is a null pointer exception&nbsp;in the assembly resolver method. In other words, The SFX is having trouble finding and extracting the DLL which is embedded within itself.&nbsp;&nbsp; I'm trying to imagine how that might happen, and I just can't come up with any good ideas.</p>\r\n<p>Are you doing anything unusual with the EXE?&nbsp; Running it from a network share?&nbsp; Modifying it after it is built?&nbsp; Renaming it?&nbsp; I'm trying to think what would lead to this kind of problem.</p>\r\n<p>I have this exact scenario in the set of tests that I run every time I cut a release.&nbsp;&nbsp; (The tests succeed)</p>\r\n<p>&nbsp; I'll wait for you to get back to me, in the meantime I will think some more about it.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-02T18:48:36.6-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208170",
    "ThreadId": "61360",
    "Html": "<p>Do you work in an enterprise where they have modified the machine.config for managed machines?&nbsp; Not sure, but It may be possible to disable the loading of assemblies the way I have done it in the SFX, via an enteprise policy.&nbsp; Could that be a possibility?</p>",
    "PostedDate": "2009-07-02T18:50:07.393-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208182",
    "ThreadId": "61360",
    "Html": "<p>Since I'm working in ASP.Net, I am using the debug version of the Ionic.Zip.ddl. I imagine that its offsets may be different. Could this be the problem??</p>\r\n<p>I have full control of my machine.config and it is totally untweaked. So I doubt that is it.</p>",
    "PostedDate": "2009-07-02T20:19:33.143-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208188",
    "ThreadId": "61360",
    "Html": "<p>Nope.&nbsp; I don't think it's offsets.</p>\r\n<p>What do you mean &quot;since you're working in ASP.NET, you're using the debug version of the DLL.&quot;&nbsp; Are the two things related in some way I don't understand?&nbsp; What does ASP.NET have to do with whether you use the debug version versus the Release version?&nbsp; It doesn't matter for the purposes of this puzzle, but I wanna make sure I understand what you're doing.</p>\r\n<p>Can you try to run the fusion log viewer to help diagnose this failure?&nbsp; The instructions are here:&nbsp; <a href=\"http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx\">http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx</a>&nbsp;</p>\r\n<p>At the same time I'm putting together a version of the library that I hope will produce a more informative error message when the failure occurs.&nbsp; It will be v1.8.4.4.&nbsp; you will be able to download it soon.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-02T20:56:34.113-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208199",
    "ThreadId": "61360",
    "Html": "<p>ok, v1.8.4.4 is up, available for you to try.</p>",
    "PostedDate": "2009-07-02T22:30:33.413-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208387",
    "ThreadId": "61360",
    "Html": "<p>Thanks for uploading the new version.</p>\r\n<p>I'm sorry my earlier message wasn't particularly clear. What I meant to say is that I'm writing this code as an ASP.Net application that will reside locally. In these cases, I generally don't bother with the release version and only drag &amp; drop the debug versions over to my Visual Studio 2005 project window (one full set in the bin directory and one full set in the project directory).</p>\r\n<p>I've tried the new code and this is the error message that it produces:</p>\r\n<pre>\r\nC:\\Test&gt;test_7e4b2440-2.exe\r\nException while extracting: System.IO.FileLoadException: Could not load file or\r\nassembly 'Ionic.Zip, Version=1.8.4.4, Culture=neutral, PublicKeyToken=edbe51ad94\r\n2a3f5c' or one of its dependencies. General Exception (Exception from HRESULT: 0\r\nx80131500)\r\nFile name: 'Ionic.Zip, Version=1.8.4.4, Culture=neutral, PublicKeyToken=edbe51ad\r\n942a3f5c' ---&gt; System.Exception: GetManifestResourceStream returns null. Availab\r\nle resources: [Ionic.Zip.DLL]\r\n   at Ionic.Zip.SelfExtractor.Resolver(Object sender, ResolveEventArgs args)\r\n   at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName)\r\n   at Ionic.Zip.SelfExtractor.Run()\r\n   at Ionic.Zip.SelfExtractor.Main(String[] args)\r\n\r\nC:\\Test&gt;</pre>\r\n<pre>I can't see where this would matter, but here is how I am defining the output path for the </pre>\r\n<pre><pre>        string filename = ZipFilenameTextBox.Text.Trim().Replace(&quot; &quot;, &quot;_&quot;);\r\n        int dot = filename.IndexOf(&quot;.&quot;);\r\n        if (dot &gt; 1) filename = filename.Remove(dot);\r\n        filename = filename + &quot;_&quot; + Session[&quot;Guid&quot;].ToString().Trim() + &quot;.exe&quot;;\r\n        string outputFilePath = @&quot;\\\\server14\\filestore_data\\&quot; + filename;\r\n</pre>\r\n<pre>I'll try the fusion log next. Thanks again for your help. -pb</pre>\r\n</pre>",
    "PostedDate": "2009-07-03T10:33:57.847-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208396",
    "ThreadId": "61360",
    "Html": "<p>PB, I have the answer.&nbsp;</p>\r\n<p>The problem is&nbsp;that the self-extractor is looking for an embedded assembly named &quot;Ionic.Zip.dll&quot;.&nbsp; What it has found instead&nbsp;is an embedded assembly named &quot;Ionic.Zip.DLL&quot;.&nbsp; The case of the extension is different.&nbsp; And so it fails.&nbsp;</p>\r\n<p>I think you may be able to fix this in your setup by renaming the assembly to Ionic.Zip.dll, rather than Ionic.Zip.DLL, in your ASP.NET bin directory.&nbsp;&nbsp; Just to be clear, it is the name of the DLL that is used when the self-extractor is being <em>built</em>, not the name of the DLL when the SFX is being run.&nbsp; It really should not matter, but the self-extractor code is currently sensitive to the case mismatch.</p>\r\n<p>The permanent fix for this is to allow a match even when the case of the extension is different (dll versus DLL versus Dll etc).&nbsp;</p>\r\n<p>I'll submit a fixed&nbsp;assembly shortly.&nbsp;</p>",
    "PostedDate": "2009-07-03T11:20:46.863-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208400",
    "ThreadId": "61360",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7978\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2009-07-03T11:27:11.7-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "208420",
    "ThreadId": "61360",
    "Html": "<p>If you grab release v1.8.4.5, it should work for you (whether or not you rename the DLL).</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-03T14:00:40.98-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]