Search Unity

M2HPatcher - The Unity patching solution

Discussion in 'Assets and Asset Store' started by MikeHergaarden, Nov 12, 2011.

  1. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I'm sorry for your trouble.

    Problems which should have a clear repro so I can fix them as soon as possible:
    The last open problem on the list would then be:
    This one is weird, maybe we can check this out after I've send you the fixes to the above problems. I'll send you a PM.
     
  2. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    With the help of Charabis and BY0LOG1C M2HPatcher has now been extensively tested and all known problems have been addressed.
    I'm waiting for final confirmation, after which I'll upload 1.07 to the asset store.

    Upcoming 1.07 update:
     
  3. duhprey

    duhprey

    Joined:
    Nov 13, 2009
    Posts:
    166
    How long is reasonable to wait on the diff? My project is around 80mb zipped right now but the diff ran overnight without producing anything.
     
    Last edited: Apr 21, 2012
  4. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    If the full project is 80mb zipped, the diff shouldn't take longer then a few minutes. Have you tried a second time? (What platform, unity version, etc.?)

    About the next update:
    BY0LOG1C has send me some very useful info to reproduce&fix the last open issue related to projects bigger then 500Mb. I hope to address this asap.
     
  5. duhprey

    duhprey

    Joined:
    Nov 13, 2009
    Posts:
    166
    I tried both window and mac. I also tried using bsdiff outside from the commandline on just resources.asset. there was just one small difference to test. I didn't wait for it to complete, but bsdiff ran for at least 10 minutes on that.

    However I swapped it to use xdelta and that seems to be working. As I read it probably wont be as small as bsdiff, but it runs much faster :)
     
  6. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Hey what exactly does this product do? Will it create a standalone installer as well as patches or is it just a patch builder for assets?

    I am looking for something that handles both the initial installer and also the patch releases, something that I can brand my own way. Is M2HPatcher able to do this?

    It sounds like it just does patches so i would still need an msi installer or something, and would it then handle code changes as well as asset changes in a patch?

    Thanks
     
  7. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    duhprey: good to hear that xdelta is working nicely. Might be worth it for me to check out if it's more reliable then bsdiff/patch.

    roots:
    Everything except the installer.
    Pressing the PUBLISH button will create normal full builds (and zips + uploads a full build to your website)
    Also the patches will be made and uploaded to your website.
    The patch client is included in the full builds.

    The solution does not contain a (.msi) installer as there was no proper multi platform solution available. You would have to implement this yourself. The easiest solution would be to create a installer once, containing only the patchclient.

    The patch client is fully customizable (everthing in this package is fully customizable).
     
  8. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    its possible to get this patch for free?
     
  9. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Would it be possible to have a brief step list tutorial to show the steps? e.g. create an MSI with the patch client only and then a simple list of steps to create patches inside the game and deploy these?! That would be very much appreciated.
     
  10. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
  11. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    I saw that post, good stuff, but could you add in a few bullets for me on how to create this empty patch client installer so i can then use the updater for the changes? E.g. create a new unity project, add in your Patcher and that's it? or what other steps are needed. This would be much appreciated....
     
  12. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Easiest would be to make a first build (version 1 of your game) This would include the basic version of the game + the patchclient. Then add all of this to an MSI as described in the blogpost. Further updates would be done via the patcher. At any time you can also choose to update your full installer to save new users some updating time.
    This should be pretty straight forward, but let me know if anything is unclear here.

    OR are you looking for a way to build an MSI with the patch client only, which would download the full game? The only advantage here would be a smaller initial download but it would require more patching.
     
  13. Bocaj

    Bocaj

    Joined:
    Nov 2, 2011
    Posts:
    3
    Leeop:
    Is there a way the Patcher program can be run without admin privileges, or the windows User Account Control dialogue coming up?

    Basically I want this update to be as silent (and click-free) as possible. On first install clicks are OK, but after first install I had hoped that all the end-user would see is a "patching..." bar or something like that.
     
  14. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I'm afraid not, I'm not sure, but I think Windows detects if your program writes/reads to other files.
     
  15. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    You shouldn't need admin priv's if the exe and assets reside somewhere where UAC is not required, such as %AppData%,
     
  16. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Ok I will experiment with what you described. So this doesn't work for iOS or Android correct?
     
  17. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    229
    How do I prevent the patcher build from including everything in my Resource folders. My project has a lot in those folders so the patcher size becomes 51mb instead of the around 14mb mentioned.
     
  18. ATNEDev

    ATNEDev

    Joined:
    Jul 13, 2012
    Posts:
    54
    Ah, I've been looking for this, and now I found out it's not free... Oh well, I'll probably stick to my own soluions...
     
  19. JohnnyWatt

    JohnnyWatt

    Joined:
    Jul 19, 2012
    Posts:
    10
    Hi, MikeHergaarden
    Is your solution works on the ios and Android platform? If it is, we will probablly buy your production.
     
  20. MergenGames

    MergenGames

    Joined:
    Jul 3, 2012
    Posts:
    11
    Does this tool updates my game in this condition: i have a brand new level with brand new scripts and i want to patch the old versions on clients ios device like ipad,iphone,ipod?
     
  21. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    It can easily patch levels, but iOS/Android are not supported. Also not that patching functions are not even allowed on the Mac store or the iOS app store.
     
  22. Gorgotron_Flex

    Gorgotron_Flex

    Joined:
    Jan 24, 2011
    Posts:
    10
    I'm having problems during the patch building process. I was successfully able to publish my first build (which had no patches to build obviously), but now that I am trying to publish a second time, the publish process gets stuck during what I assume to be the version comparison stage prior to building the necessary patches. The dialog in the centre of the screen no longer responds and gets stuck at 280 MB processed. Please help!

    EDIT: Never mind, it got there in the end :)
     
    Last edited: Sep 7, 2012
  23. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    Can this product be used to patch single player offline games through digital distribution sites like steam?

    Can it also be given as a standalone executable patch file that the user can run themselves for their offline game?
     
  24. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    While it should be possible, these stores usually have their own patch system and enforce that.
    On the mac store its not allowed to have your own patch/update functionality. I guess Steam also requires you to use their updater.

    Should be possibly, but you would need to modify the patcher to look for the patchfile in a folder instead of contacting the update server to download it.
     
  25. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    I bought and imported this, and now have the following nine errors:

    Assets/M2HPatcher/Editor/M2HPatcher.cs(382,41): error CS0117: `Path' does not contain a definition for `DirectorySeparatorChar'

    Assets/M2HPatcher/Editor/M2HPatcher.cs(383,25): error CS0117: `Path' does not contain a definition for `DirectorySeparatorChar'

    Assets/M2HPatcher/Editor/M2HPatcher.cs(390,51): error CS0117: `Path' does not contain a definition for `GetFileName'

    Assets/M2HPatcher/Editor/M2HPatcher.cs(390,17): error CS1502: The best overloaded method match for `M2HPatcher.copyDirectory(string, string)' has some invalid arguments

    Assets/M2HPatcher/Editor/M2HPatcher.cs(390,17): error CS1503: Argument `#2' cannot convert `object' expression to type `string'

    Assets/M2HPatcher/Editor/M2HPatcher.cs(393,47): error CS0117: `Path' does not contain a definition for `GetFileName'

    Assets/M2HPatcher/Editor/M2HPatcher.cs(393,22): error CS1502: The best overloaded method match for `System.IO.File.Copy(string, string, bool)' has some invalid arguments

    Assets/M2HPatcher/Editor/M2HPatcher.cs(393,22): error CS1503: Argument `#2' cannot convert `object' expression to type `string'

    Assets/M2HPatcher/Editor/M2HPatcher.cs(579,36): error CS0117: `Path' does not contain a definition for `GetDirectoryName'

    Would love some help getting things working.
     
  26. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    Fixed those myself, everywhere this code uses just "Path" I had to replace that with System.IO.Path and now I'm up and running again.

    Now that I can actually try this, in my scene for trying to run the patcher I get this error:

    "Unable to connect to version server."

    Despite the address it shows being a good address where the patcher.php is definitely located. I copy and paste that address directly into my internet browser and it connects just fine.
     
    Last edited: Oct 4, 2012
  27. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    And I fixed that one as well, I thought the files were on a publicly available server but it turned out they weren't and my login was just saved in my internet browser.
     
  28. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    is possible add code into visual basic for make a custom launcher??
     
  29. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    One thing that is eating up my time that seems to be a bug is even though I only have the "Win" box checked in the General Settings, it still makes a standalone Mac build and Mac patches every time.
     
  30. aadsfasdf

    aadsfasdf

    Joined:
    Sep 12, 2012
    Posts:
    3
    I'm getting some strange inconsistencies when patching between builds. I just successfully published a new build (v 2), then successfully updated an old build (v 1) to the new one. However, when running the v1 build which had been patched to v2, I'm noticing that some scenes have been completely corrupted. Camera views are bright pink with nothing in them or fail to render anything at all. Furthermore, performance is now terrible, and some scenes don't seem to work anymore at all.

    I've had mixed success with this patching system, in that sometimes old versions will patch properly with no problems at all, whilst other times, I will get weird and crippling irregularities as described above. Any ideas?
     
  31. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    aadsfasdf: Is this on windows or mac? Furthermore, what is the full size of the game in v2 (over 200mb or so?)
     
  32. aadsfasdf

    aadsfasdf

    Joined:
    Sep 12, 2012
    Posts:
    3
    Hi Mike,

    I'm running Windows. File size of the project is approximately 700 mb.
     
  33. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    When the patcher tries to run to update our full game I'm getting this error:

    Download failed for:
    Code (csharp):
    1. http://www.postudios.com/CognitionPatches/filesStandaloneWindows_1_2.m2hpatch
    It seems to me that the problem is the missing / after "files" but that forward slash is in my FTP settings in Unity before making the initial published build. Any idea what could be causing this? The file is definitely there and publicly accessible if I put it into my internet browser with the / in the proper place.
     
    Last edited: Oct 22, 2012
  34. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    And disregard that, found that the patcher.php and uploadEditorData.php on my server had been reverted to an older version when I had to get some backups restored.
     
  35. aadsfasdf

    aadsfasdf

    Joined:
    Sep 12, 2012
    Posts:
    3
    Hi Mike,

    Any update / progress towards fixing the issues I reported with patching larger projects?
     
  36. Sequence

    Sequence

    Joined:
    Feb 4, 2012
    Posts:
    44
    This looks very nice, but how well does it work?
     
  37. Artificer

    Artificer

    Joined:
    Nov 15, 2012
    Posts:
    17
    I'm having a headache of a problem trying to get the included demo to work.

    When I try to update an old build, the patcher never gets past "2\5 Downloading latest version information". It freezes here for a few seconds, and then shows the "couldnt update, please click the button..." message.

    -I'm running Windows 64-bit
    -I've tried re-naming every path a dozen different ways.
    -I've set all the permission levels correctly.
    -My .exe's are able to verify that they are outdated compared to the version on the ftp, and thus the builds will (pathetically) attempt an update.
    -As far as I know, the "pubish" process is working correctly and it's an error with the build's code but I could be completely wrong about that.

    I feel like I've missed some small detail somehow. I looked over the documentation .pdf many times, but can't seem to fix this.

    Anyone encounter something similar?
     
  38. Artificer

    Artificer

    Joined:
    Nov 15, 2012
    Posts:
    17
    Ok, I solved the problem. I actually HADN'T set the permissions correctly. I just noticed when checking every individual file in the /webserver/ directory.

    Also, make sure filezilla (if you're using it) is closed entirely when publishing new builds. That was also messing me up.

    Let me just say that this tool amazing, exactly what I needed!
     
    Last edited: Nov 15, 2012
  39. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    Does anyone know if this works with Unity 4 just released?

    Also, I know he mentioned awhile back that he was doing a re-write and the new version was going to be a lot better than the old?
     
  40. Artificer

    Artificer

    Joined:
    Nov 15, 2012
    Posts:
    17
    It works in unity 4. Although theres no need for mac builds anymore ( I think ).
     
  41. agentleo

    agentleo

    Joined:
    Jan 2, 2011
    Posts:
    56
    I would like to know this as well. It would be a deciding factor if I buy this patcher, instead of putting the time into designing my own.
     
  42. timsk

    timsk

    Joined:
    May 27, 2011
    Posts:
    177
    Could someone clarify the status of the above? How well does this handle 'mass' patching?

    I understand you can create custom patches, would we have to create a v1-v5 patch, a v2-v5 patch, a v3-v5 patch and apply the correct one based on the current build?
     
  43. trickpirata

    trickpirata

    Joined:
    Jun 17, 2011
    Posts:
    12
    I'm using 4.0 and m2h can't somewhat finish uploading my build. Always getting an "Unknown object state" error. Is it just me or someone also encounters this issue?
     
  44. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I have not yet tested the patcher on 4.0. 4.0 shouldnt be so different then 3.X so if there are any 4.X problems they should be easy to fix. Im in the middle of a game release so its very busy now but I will take a look as soon as that's over.
     
  45. agentleo

    agentleo

    Joined:
    Jan 2, 2011
    Posts:
    56
    bump
     
  46. coastwise

    coastwise

    Joined:
    Nov 29, 2010
    Posts:
    17
    Hi Mike, looks like a great tool you've built. I have a couple of questions before I can recommend it for use in our project though:

    Are there any hard limits to the size of the unity project or the size of the builds themselves? I saw your reply to aadsfasdf asking if his build was over 200MB. Our project is rather large and only going to grow (Its currently somewhere between 3 and 5 GB. A little crazy I know, we're working on weeding it out). Our current build for OSX is 205MB, and I want to be sure that we won't hit a wall somewhere down the line as the file size grows.

    Does your patching tool support updates to existing scripts and/or entirely brand new scripts? For example: if we were to add a new minigame, there would be new scenes, assets, as well as scripts. Does your solution handle this case? (I ask because this is a limitation of AssetBundles, and my search for an alternative is what brought me to you.)

    Thanks,
    Patrick
     
  47. wraxul

    wraxul

    Joined:
    Dec 10, 2012
    Posts:
    12
    Hi Mike,
    I'm having trouble actually updating to my current patch. It seems the updates are installed, but when I run the game again, the GetThisVersion call returns the previous version and it thinks it still needs to update. The patchsettings.txt has the correct version number for the newest patch. Is this a bug or am I missing something?

    Thanks in advance for any help you can give me!
     
    Last edited: Dec 10, 2012
  48. rob4097

    rob4097

    Joined:
    May 15, 2012
    Posts:
    50
    I had the same issue. I fixed it by creating a new project, exporting my entire old project as a .unitypackage, and reimporting it in. When you do so, do not export the M2H Patcher stuff from your old project, but instead grab it from the asset store and set it up again. This was a bit annoying and cost a bit of time just getting the basic stuff set again (player settings, paths, etc). There is probably a better solution out there, but it worked for me.
     
  49. wraxul

    wraxul

    Joined:
    Dec 10, 2012
    Posts:
    12
    Thanks rob. I actually just changed my checks and manually update the version number in my builds to keep track. (Just have to remember each time before I publish)
     
  50. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Hi all,

    Sorry for the delay in reply (for all messages here and the few mails/PMs).

    The only major issue I know of with the M2HPatcher right now is that diffing/patching is quite memory hungry. So a 100-200 MB file will take 1 - 2 GB memory which is getting dangerous and can cause a crash when running out of memory. Therefore I had a update in the works that would split all files before doing any patching/diffing. I have not been able to wrap that up yet so if you currently have single files in your project that are 500mb or so that'll be risky in the current version.
    (Note that having thousands of 50mb files works perfectly fine)

    I'm aiming to work on this fix this week, and will answer every PM/mail I still have left unanswered as I have them all queued.

    Mike