[
  {
    "Id": "539328",
    "ThreadId": "239252",
    "Html": "\r\n<p>Hi all,<br>\r\n<br>\r\nI have integrated DotNetZip in my Patcher project. All works fine until I'm unzipping my .app file.</p>\r\n<p>The unzip code works well, but after that the application wont start! Any one idea that could it be?</p>\r\n<p>File permission, or maybe plist problem?&nbsp;<br>\r\n<br>\r\nmy code:</p>\r\n<p>&nbsp;</p>\r\n<pre>void Unzip ()\r\n{\r\n\ttry {\r\n\t\tusing (ZipFile zf = ZipFile.Read (&quot;update.zip&quot;)) {\r\n\t\t\t\r\n\t\t\tforeach (ZipEntry zEntry in zf) {\r\n\t\t\t\t\r\n\t\t\t\tif (!zEntry.FileName.StartsWith (&quot;__&quot;)) {\r\n\t\t\t\t\tzEntry.Extract\r\n                             (Directory.GetCurrentDirectory () &#43; &quot;/tmp&quot;, \r\nExtractExistingFileAction.OverwriteSilently);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tzf.Dispose ();\r\n\t\t}\r\n\t} catch (System.Exception ex) {\r\n\t\tDebug.Log (ex);\r\n\t\tStartGame ();\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\tDeleteTemp ();\r\n\t}\r\n}</pre>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-12-22T05:22:46.15-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539639",
    "ThreadId": "239252",
    "Html": "\r\n<p>Hi Iwan,</p>\r\n<p>Just a hunch here, but what actually makes your application start? If it's &quot;StartGame()&quot; then you might try moving it out of the &quot;Catch&quot; part of the Try ... Catch block and into the main &quot;Try&quot; part. The &quot;Catch&quot; part only runs if an error occurs in your program,\r\n so as your code stands at the moment it will only run if the unzip process *fails*.</p>\r\n<p>As an aside, you also don't need the &quot;zf.Dispose()&quot;, as that is called implicitly&nbsp;at the end of&nbsp;the &quot;using&quot; statement.</p>\r\n<p>Hope this helps,</p>\r\n<p>Mike</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2010-12-22T16:18:49.62-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539643",
    "ThreadId": "239252",
    "Html": "\r\n<p>Hi pointy,</p>\r\n<p>&nbsp;</p>\r\n<p>no the probem isn't in code i have posted. The unzipping works fine. But unzipped .app won't launch. I've checked the content of app and that was same like in orginal file. So i have no idea why the app will not execute.</p>\r\n<p>If I unpack with standard unzip on MacOS the app executing. So i think something while unzipiing going wrong, or its permission problem.</p>\r\n<p>&nbsp;</p>\r\n<p>P.S: sorry for my bad english :D</p>\r\n",
    "PostedDate": "2010-12-22T16:25:00.443-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539654",
    "ThreadId": "239252",
    "Html": "\r\n<p>Hi Iwan,</p>\r\n<p>It sounds like an OS-specific problem, so&nbsp;I'm not sure I can help in that case - I don't really&nbsp;use Macs, I'm afraid.</p>\r\n<p>Did you create &quot;update.zip&quot; using DotNetZip? I'm totally guessing now, but it's possible that the zip file has some &quot;embedded resource forks&quot; which DotNetZip doesn't handle, but the native Mac OS unzip does. In that case there might be secondary data streams\r\n attached to the &quot;.app&quot; file which aren't being extracted from the zip by DotNetZip.</p>\r\n<p>From <a href=\"http://xahlee.org/UnixResource_dir/macosx.html\">http://xahlee.org/UnixResource_dir/macosx.html</a><br>\r\n&quot;In Mac OS X, data files is not suppose to use resource forks, so that Mac's files is compatible with other OS, however, program executable files such as those &ldquo;.app&rdquo; may still need the resource fork intact to work, and many programs including Apple's\r\n still creates resource fork as of 2010-07&quot;.</p>\r\n<p>Other than that, I'm not sure what else to suggest...</p>\r\n<p>M</p>\r\n",
    "PostedDate": "2010-12-22T16:54:30.65-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539657",
    "ThreadId": "239252",
    "Html": "\r\n<p>Actually, that's&nbsp;probably what your &quot;__&quot; files are all about. They're probably resource forks (&quot;alternate data streams&quot; in NTFS-speak).</p>\r\n<p>I've got no idea what they do or mean in Mac terms, but I suspect they're the best place to look for a solution...</p>\r\n<p>Hope this helps,</p>\r\n<p>M</p>\r\n",
    "PostedDate": "2010-12-22T16:58:58.13-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539659",
    "ThreadId": "239252",
    "Html": "Ah thats makes sense. The zip was maked with macos. The code I've posted works fine on windows. Mac os saves &quot;__MACOS&quot; folder in the zip, maybe that's the fork. Thank you very much, I'll look for that tomorrow :) I'll post the result Thank you\r\n again P.S: if __MACOS folder is the fork, any idea how to connect that to my first stream?",
    "PostedDate": "2010-12-22T17:03:16.23-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539678",
    "ThreadId": "239252",
    "Html": "\r\n<p>Cool. Let&nbsp;me know how you get on.</p>\r\n<p>In terms of reconstructing the multi-stream file, it looks like the MacOS zip program stores the data fork and the resource fork as separate files in the *.zip. You can extract them using DotNetZip, but they'll appear as separate files in the output folder&nbsp;(the\r\n resource fork will be in the &quot;__MACOS&quot; sub-folder). You&nbsp;could extract both files to an NTFS drive using DotNetZip&nbsp;and then reconstruct the single file using the alternate data stream APIs (see some examples below):</p>\r\n<p><a href=\"http://support.microsoft.com/kb/105763\">http://support.microsoft.com/kb/105763</a><br>\r\n<a href=\"http://msdn.microsoft.com/en-us/magazine/cc163677.aspx\">http://msdn.microsoft.com/en-us/magazine/cc163677.aspx</a></p>\r\n<p>However, I don't know how this would&nbsp;appear to a Mac if you copied it&nbsp;to the local drive&nbsp;or tried to access it over a network.</p>\r\n<p>Another option is to extract the streams and build a single file on an NTFS drive - there are at least two different file formats which incorporate the data and resource forks into a single data file for MacOS to consume:</p>\r\n<p><a href=\"http://en.wikipedia.org/wiki/MacBinary\">http://en.wikipedia.org/wiki/MacBinary</a><br>\r\n<a href=\"http://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats\">http://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats</a></p>\r\n<p>That's about as much help as I can offer down that road though, I'm afraid...</p>\r\n<p>Cheers,</p>\r\n<p>Mike</p>\r\n",
    "PostedDate": "2010-12-22T18:07:20.443-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539873",
    "ThreadId": "239252",
    "Html": "\r\n<p>Thank you very much for you help :)</p>\r\n<p>I've found the solution. It was not the unzipping code. It was writing and execution permissions under MacOS. The Apps under MacOS are folders. The file in App/Content/MacOS need execution flag or execution permission, like rxw-rxw-rx</p>\r\n<p>Im using Diagnostic.Process to call chmod after unzipping the File. Now it works! :)</p>\r\n<p>&nbsp;</p>\r\n<p>P.S: if you want to be in Credits for our game give me short email and which name we should write in :)</p>\r\n",
    "PostedDate": "2010-12-23T05:09:19.237-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "539875",
    "ThreadId": "239252",
    "Html": "\r\n<p>Hi Iwan,</p>\r\n<p>Glad you found the answer you needed.</p>\r\n<p>If you want to add credits in your game maybe just mention DotNetZip and add the codeplex url. That would be plenty.</p>\r\n<p>Happy holidays,</p>\r\n<p>Mike</p>\r\n",
    "PostedDate": "2010-12-23T05:13:39.16-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]