Search Unity

M2HPatcher - The Unity patching solution

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

  1. crawler

    crawler

    Joined:
    Aug 9, 2012
    Posts:
    27
    Hi Mike,
    I have bought M2H Patcher and have bsdiff.exe freezes issue and patching process stops on file resources.assets. Previously it worked fine.



    Old version resources.assets filesize is 49.6 Mb
    New version resources.assets filesize is 64.1 Mb
    I have 8GB RAM and memory is used only at the half size. I tried to make patch on different PCs and have no results.

    We really need to release a new version of our commercial product. People are waiting for update. Could you help me please?

     
    Last edited: Dec 23, 2012
  2. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    How it is possible, that M2HPatcher create tiny patches? Unity pack (on building) all files in some big ones.,,
    Can you please explain?
     
  3. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    crawler: can you mail me the file it's stuck on?
    vampir26: It compared all files and stores the changes only.
     
  4. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    Hey Mike, I dont know if I miss somewhere... does your solution supports Unity 4 already?
    I am developing a game that will surelly needs this.
     
  5. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Yes there dont seem to be any Unity4 specific problems. However as you can see in this thread I am still working to resolve some problems users are having (both Unity3 and 4).
     
  6. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    Ok, thank you
     
  7. magnetica

    magnetica

    Joined:
    Jan 3, 2008
    Posts:
    86
    any news for a Linux version? i'm searching for an autoupdate solution crossplatform
    thanks
     
  8. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I have just submitted an update to the asset store. This adds splitting of files and some other fixes. Per default files of 100mb are split to prevent OutOfMemory crashes. I have succesfully patched a 50mb project to a 700mb projects several times now and have not been able to reproduce any crashes or malfunctioning patches on this build.

    Please give this new version a try as soon as it's available on the asset store and let me know if this addresses your issues. If you do find any issues I'll work on a solution with the help of any additional information you can provide.

    magnetica: No Linux could be easy to support since Mac already works (I'll just have to see if file permissions are a pain..). However, I don't want to officially support Linux before seeing confirmed that Mac Windows work smoothly.
     
  9. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    Is there any way to use this without needing to include the entire patch data in a public release? Our current project is just under 1 GB in size without the M2H stuff. Including the entire data folder, which seems to just be a copy of everything that's already in the build, would mean 2 GB downloads for our customers, which makes a mess of our bandwidth and some people's data caps and so on.
     
  10. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Im not aware of the release builds including the patch data? Where/how is it included?
     
  11. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    Whenever I make a build from the M2HPatcher menu the folder it's created in within the "builds" folder for my project has twice as much stuff as if I just do it through Unity's build option. For Mac there is the regular app, and a patcher app. For PC there's the regular data folder and exe, and also a patch data folder and patcher exe file. The documentation indicates that users can use the patcher client next to the game executable to update the game, is that not actually intended to be packaged in?
     
  12. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Aha, yes patcher.exe and the pacther data folder do need to be included. This is a one time extra of about 20mb, this is a set size and does not depend on your game. So if your game doubles in size the patcher will remain it's +- 20mb.
    It is required for the patcher to be a seperate program as your own .exe needs to be closed when patching.

    I think the 20mb is easily worth the file size patching saves, it's just a one time extra. Furthermore Unity is heavy, but it's dead easy to customize your patcher application.
    If you need to minimize your initial download size even further you can swap the unity patch client with a .net application by reusing the same code but removing Unity specific parts.
     
  13. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    My patcher data folder is 979 MB at the moment. My patcher.app for Mac versions is 990 MB. It's this folder that is doubling the size of my public release builds from what it would be without including any patch data for customers.
     
  14. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Right thats NOT ok, I'll check it out. It must be adding files from the "Resources" folders to the patcher builds (do check if your using the latest version from the asset store)
     
  15. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    I had originally downloaded the M2HPatcher stuff in October, I just re-downloaded it today to see if there's newer stuff to resolve the issue that I was having and now having a much more serious issue. It seems that while making builds the software renames the "Resources" folder to "ResourcesTMP" which breaks quite a bit of our code during the compilation and build process and prevents the game from running.
     
  16. wilco64256

    wilco64256

    Joined:
    Jul 3, 2012
    Posts:
    20
    OK the ResourcesTMP thing seems to have been a freak accident. I completely removed all the M2HPatcher stuff and redownloaded it to start my builds back from version 0, but the patch folder is still just over 260 MB in size. It seems to have given itself a full copy of my own "StreamingAssets" folder which I use for video playback.
     
  17. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Thanks, got it. The Resources/ renaming is done on purpose but that should be cleaned up after rebuilding the patchers. So if it stayed on ResourcesTMP it must have bugged somewhere.. Please let me know if you see any nullrefs when rebuilding the patch clients if it ever happens again.

    For the StreamingAssets, apply this fix. Search for
    and replace it with the following code
    Make sure to enforce rebuilding of the patch clients after applying this fix (Delete "builds/patchers" OR run M2Hpatcher->settings->Rebuild patcher clients.)

    Thanks for reporting this!
     
    Last edited: Jan 29, 2013
  18. scassidy

    scassidy

    Joined:
    Jan 29, 2013
    Posts:
    6
    Hello,
    I have download and integrated the m2hpatcher. I am having problems with ftp upload when using publish it is giving the error "unable to open passive connection", I verified with visual studios and the upload setting all work correctly in visual studios but not in unity any suggestions would be great. I am running 3.5.6f4 of unity pro. I am connecting to the amazon cloud if that makes any difference.

    Thank you,
    Shawn
     
    Last edited: Jan 29, 2013
  19. hhartford

    hhartford

    Joined:
    Dec 8, 2012
    Posts:
    10
    Hello,

    I just bought the M2H patcher a couple days ago. I have it all setup so that it is uploading the patches to my server and also updating the build version #. The problem I run into and I have tried this from 2 seperate computers is that after successfuly downloading my patch the patcher client just sits on unzipping. This seems to only happen when I am bringing a new scene in as a patch. If I update an existing scenes it seems to get through the unzipping proccess quickly. I can see that Patcher.exe is churning away at 20-30% cpu , but I have waited for a hour or so and it still doesn't look like it has moved. Is this normal? I am building to Windows Standalone. Let me know if you need any more information.

    Hunter Hartford
    Digital Empire LLC.
     
    Last edited: Feb 2, 2013
  20. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    scassidy : Please check if this fixes it.
    Add the following line for M2HPatcher.cs +- line 429
    Code (csharp):
    1. reqFTP.UsePassive = false;
    I better add a boolean to set active or passive FTP transfers.


    hhartford
    Nope that's def. not OK. Can you please check the log of the patcher app? Thats "Patcher_Data/output.txt". There must be some error.
     
  21. hhartford

    hhartford

    Joined:
    Dec 8, 2012
    Posts:
    10
    View attachment $output_log.txt

    Hello,

    I have attached the output log. It says that it can not find a file but I definetely see it inside the tmp folder. Let me know if you need anything else.

    Hunter Hartford
    Digital Empire LLC.
     
  22. scassidy

    scassidy

    Joined:
    Jan 29, 2013
    Posts:
    6
    I have attempted to do so still giving me the "unable to open passive connection" error, I have done a work around right now using wwwform and server side scripting. This is still a problem though, I have also tried compiling the same upload code into visual studios and it would upload no problem. It may be something with unity as well. Any additional advise would be helpful would like to get this working out of the box, which would allow updating of the patcher easier.
     
  23. scassidy

    scassidy

    Joined:
    Jan 29, 2013
    Posts:
    6
    How would I create it that the versions would go like 1.0.0 to 1.0.1 etc?
     
  24. hhartford

    hhartford

    Joined:
    Dec 8, 2012
    Posts:
    10
    View attachment $screenshots.pdf
    Hey Mike, I thought I would post some pictures incase they help you. You can email me at hhartford@digitalempire3d.com or post back here. I am using the patcher as it came from the asset store. Please let me know if there is any other information your need.


    Hunter Hartford
    Digital Empire LLC.
     

    Attached Files:

    Last edited: Feb 5, 2013
  25. The-Scripter

    The-Scripter

    Joined:
    Nov 10, 2009
    Posts:
    30
    I had to spend a few days hunting down a bug that meant patches couldn't be applied even after they had been downloaded, but I found the solution.

    After searching the scripts I found that one of them looks for the file bspatch.exe inside the build folder, but it wasn't there, and that was what was causing the problem.

    The default build location is inside the project folder, next to Assets, which is an inconvenient place, especially when using version control, so when I set up the Patcher settings I changed the build folder. This was done using the M2HPatcher GUI, not a hack, and it didn't result in any warnings or error messages. (In fact there wasn't even a player log either). However, I found that this bug was caused by trying to build outside the project folder, and when I changed it back it worked.

    Mike, if it is not possible to build the patch client outside the project folder then please add an error message and stop the build, or don't give the option to change the folder, otherwise the build appears successful until it is time to apply a patch. It would be nice if I could choose a different folder though.
     
  26. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    For some reason when I update, my game continually tells me I have an old version (even though it has been updated and I see changes to my game from the patch). Is the new SettingsDeploy bundled in the patch? I couldn't find source code that actually updates that.
     
    Last edited: Feb 7, 2013
  27. scassidy

    scassidy

    Joined:
    Jan 29, 2013
    Posts:
    6
    Hey Mike,

    You said that the patcher is now setup to break up the zips into 100MB chunks by default While trying to zip I am still getting out of memory issue when zipping the files as I add more scenes to the project is slowly grows and it errors out. The zip file sometimes works but is still at 236mb. Could you tell me where to adjust this setting?
    Thank you,
    Shawn
     
  28. hhartford

    hhartford

    Joined:
    Dec 8, 2012
    Posts:
    10
    Hey Mike,
    I have tried to look at the code and can't figure out how to get it to patch a scene in. Any help would be greatly appreciated .

    Thank you,
    Hunter Hartford
     
  29. scassidy

    scassidy

    Joined:
    Jan 29, 2013
    Posts:
    6
    hey hhartford,

    I found that if I changed the code around line 96 of the UtilsPatcher to the following:

    public static List<string> SplitFile(string fileName)
    {
    List<string> outputFiles = new List<string>();
    FileInfo fInfo = new FileInfo(fileName);
    int pieces = 1;
    if(File.Exists(fileName))
    {
    float fileMB = ((fInfo.Length/1024.0f)/1024.0f);
    pieces = (int)Mathf.Ceil( fileMB /splitSizeMB);
    if (pieces < 1) pieces = 1;
    }

    The code then resumes at "FileStream inFile"

    This fixed the patcher to include new files it was giving an error due to a file not existing. I am now able to patch with new scenes included.
     
  30. hhartford

    hhartford

    Joined:
    Dec 8, 2012
    Posts:
    10
    Thank you !
     
  31. SylphWorks

    SylphWorks

    Joined:
    Jul 13, 2011
    Posts:
    8
    Hi,

    I came up against a trouble.

    I publish my project, the following error occurs.

    OutOfMemoryException: Out of memory
    UtilsPatcher.SplitFile (System.String fileName) (at Assets/M2HPatcher/Plugins/UtilsPatcher.cs:111)

    Are there any solutioen?
     
  32. namursite

    namursite

    Joined:
    Dec 31, 2012
    Posts:
    5
    yes, update to android, and I am a new customer :D
     
  33. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Hmm... This look like a pretty good tool, but I see there are many bugs included.
    If it ever work I'll give it a try.
     
  34. John-Higuera

    John-Higuera

    Joined:
    Oct 14, 2012
    Posts:
    20
    Hello Mike, and everyone here, we bought the Patcher Package, and we imported it into a new project and everything it’s OK, but now we are importing the package to a project we already were working on, and we are getting this error.


    Assets/M2HPatcher/Editor/SettingsDev.cs(17,23): error CS0433: The imported type `Ionic.Zlib.CompressionLevel' is defined multiple times

    We are working with Unity 4.1.2f1 on windows 8.

    Thanks for your help, support and advice.

    ----

    I think we already solve it, cheers!
     
    Last edited: May 17, 2013
  35. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,643
    Hi,

    I have to create a launcher/auto patcher for my game. This launcher must work like all the stand alone online game launchers, showing some graphic and autopatching the game if needed. Now I reckon I will manage the graphic part, so I wonder if this autopatcher is still a viable solution to manage the patching part. If so, what is the best strategy to handle the game resource? I was thinking about using bundles.
     
  36. Djekaster

    Djekaster

    Joined:
    Dec 17, 2012
    Posts:
    7
    Hey guys from M2H Studio. I have a question: are you planning to support a Linux with your patcher? It's not about I'm a big fan of Linux, but we have a group of gamers, who love Linux, and they force us to port our games to Linux too. So currently we add Linux into the list of supported platforms, and would like to get all-in-one solution by using your atcher for our game distribution in all platforms we support now (Windows, MacOS and Linux)
     
  37. Hades714

    Hades714

    Joined:
    Oct 28, 2012
    Posts:
    7
    Hello guys!
    Um, a friend of mine gave me the M2H patcher but I never used it because I was still learning how to use Unity.
    This week I got a chance to use it, but I'm stuck and it gives me an error.
    For a webserver I used WAMPSREVER, in it I created a folder/project called "Test". Inside that folder I dropped "patcher.php" and "uploadEditorData.php".
    Inside M2HPatcher --> Setings --> Edit Build --> URL.................. I pasted the address from WAMPSERVER "http://localhost/Test/"....

    The error shows up when ever I start the scene:

    Does anyone knows what I am doing wrong and how to fix the bug?
    :confused:

    P.S:
    I am a beginner in this whole Patcher thing and I have no experts to help me around Unity so I will make a lot of dumb mistakes. :(

    EDIT:
    Maybe instead of WAMPSERVER I should use only FileZilla...
     
    Last edited: Aug 6, 2013
  38. Cyberspeed

    Cyberspeed

    Joined:
    Oct 4, 2010
    Posts:
    2
    Hi guys, I have a problem with updating the game. Patch is downloaded, but if it has to expand and give error. Thank you for your help.

    $error_01.jpg
     

    Attached Files:

    Last edited: Oct 9, 2013
  39. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    This looks cool but costs way to much
    Cant even customize the update window!
     
  40. Psyche_RTS

    Psyche_RTS

    Joined:
    Oct 8, 2012
    Posts:
    26
    @MikeHergaarden

    Hi! I'm using your product for some times now, but after testing it on a mac yesterday it seems that
    after the patcher have downloaded the ".m2hpatch" file on my server the process is stuck on unzipping.
    Any clue on how I can fix it?

    The updating works fine on PC.
     
  41. Tony-Butterfield

    Tony-Butterfield

    Joined:
    Oct 19, 2012
    Posts:
    14
    I am having the same error. it says that it is unzipping but it doesn't look like it downloaded anything.
     
  42. vfehring

    vfehring

    Joined:
    Feb 1, 2014
    Posts:
    1
    Is this still available for download? I cannot seem to find it on the asset store, and would love to incorporate it into my games.
     
  43. Hades714

    Hades714

    Joined:
    Oct 28, 2012
    Posts:
    7
    Can anyone give me a simple tutorial and explainations on the Patcher and the whole setup step-by-step?
    It would really help me out because, since my game is too large for me to upload every time the update is made (example: posting the updates on IndieDB or similar sites)... but I keep getting errors that I just don't understand.
    I have read the Documentation file many times, but I just can't figure out what I am doing wrong... :(

    If someone could help me out on the Patcher a little, it would help out a lot.
    Thanks.

    EDIT #1:
    Okay, so I was KINDA messing around the webserver I use and the Patcher. Now, when I open the scene with the "Version Check" it points me to this error:

    .... does anyone have any idea what is MAINLY causing this problem and how to make it NOT appear again? Is viewing the "Version check" scene WHILE in editor causing this or should it work fine?


    Now, to my second error....and this one happened when I accidentaly pressed "Publish":
     
    Last edited: Feb 5, 2014
  44. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    While the patcher works fine 99% of the time, there are some ghost bugs where applying an update on the client doesn't always work. I haven't been able to find the cause of this yet. We have been using the patcher extensively in Verdun, this worked great for a few months, we got a handful of mails from users that the patcher didn't work: they had to redownload the full game instead.

    So while it did help save us many gigabytes of bandwidth much user time, I can not yet guarantee a perfect patcher. That's why I decided to not display it in the asset store for now, everyone who has bought the patcher should still be able to download use it (otherwise, just send me a message). If any customer wants a refund you can apply at the Unity asset store, I could also offer you a free copy of any of my other packages instead.

    Tony Butterfield: Anything in the logs? (see console for UnityPlayer)


    Hades714:
    1) Does the link work in your browser?
    2) Could you add a debug log at that Upload method (line 456) to check the host it is trying to connect to, and verify if it works via a normal ftp account?
     
  45. Hades714

    Hades714

    Joined:
    Oct 28, 2012
    Posts:
    7
    @MikeHergaarden

    Thanks for replying. :)

    1)
    The link is working in my browser. It keeps telling me that it can't connect itself to the server, which made me to do some experiments with my modem/internet and to do some research... and it turns out that...well, it's kinda a long story but I'll try to make it as short as possible:
    ~ In Croatia (a country that I currently live in) there's a special type of modem that doesn't allow anyone or anything to connect itself on a server, it will instantly direct a user to a some weird website, or even ask for some extra information...
    The thing is.........I have that.... :(

    2)
    I can try that, thanks. :D
     
  46. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    When will you be able to get this?
     
  47. Kaz_Yamof

    Kaz_Yamof

    Joined:
    Jan 17, 2013
    Posts:
    28
    Hi. I'm not finding this tool on the Asset Store. Can someone help me, please?
    Thanks.
     
  48. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
     
  49. FairGamesProductions

    FairGamesProductions

    Joined:
    Mar 8, 2014
    Posts:
    81
    Hi.

    I've been looking for a patching system for some time now, and yours seems to be the most viable one. Any ideas when it may be available on the Asset Store again?
     
  50. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    The situation hasn't changed, doesn't look like I'll be re-adding it to the store since I can't sell a product that has some flaws and I simply don't have the time to fix it.