Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

M2HPatcher

Discussion in 'Made With Unity' started by MikeHergaarden, Oct 1, 2010.

  1. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Last edited: Nov 16, 2011
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    On 1. don't zip it, dmg it so they can drag - drop it. thats more standard anyway than zipping.

    that being said they should carry over the chmod too if the zip was generated with osx compression functionality
     
  3. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Thanks for the feedback. Well the zip file works just fine when unzipping it on Mac. However it's the unzip code that I use in unity that doesn't respect the permissions (Due to the File.Create call I guess, but I dont think I can add any permission flags here).
    I'd prefer automating this as a .dmg is just as much work as using a .zip here.
     
    Last edited: Oct 1, 2010
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Awesome Leepo, was looking for something like this for a while now. I'll give it a try.
     
  5. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    Verry cool *thumbsup*

    would really like to see the editor script to know how it works ;)
     
  6. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    This sounds great! Can't wait to see support for "modified files only" updates!
     
  7. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    hey guys
    Ive started to make ma own patcher....

    I went so far that it downloads a zip file...

    But how can i make the zip file to be extracted in my folder?

    Thanks for every answer :)
    /Robert
     
  8. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
  9. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    i dont really undestand the sharpziplib :(
    mostly i script in js but i know a bit c#

    but thats too high for me :D

    How do i have to use it?
    Where to put the downloaded file?
    How to do after having downloaded a file from the net?

    Is there a way to save the file locally before extracting or something?

    Many questions i know but i hope u can answer them easily ;)

    Thanks
    /Robert
     
  10. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    did you write your patcher in C# ?
     
  11. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    what i have now :
    Yes...

    But it s only a script that downloads a file when u click on a button whit a progress bar...

    Note:
    I have the same script in js :D
    But i think i need it in c# to use sharpziplib right? :D

    Robert
     
  12. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
  13. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    hey thanks appels

    I think thgis is what i need...
    But not exactly:
    Do u know an example for a normal zip file?
    Not gzip not tar not targz normal zip?

    And where do i have to put the library file i downloaded?the sharpziplib?
     
  14. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
  15. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    last question for today...
    Tomorrow ill check it out ;)

    So my question:
    Lets say we have 3 scenes:patcher menu game...
    When i patch the game in the first scene with a patch to have 2 more levels are they integrated automatically or do i have to restart the application to male the changes beeing applyed?
     
  16. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    i know nothing about in game patching, i made an updater that patches all and then starts the new game.
     
  17. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    I love you.
     
  18. Robbilie2

    Robbilie2

    Joined:
    Aug 4, 2010
    Posts:
    262
    can anybody pls help me?

    i am getting errors when i use the aboves examples:


    Assets/UnZipFile.cs(33,7): error CS0246: The type or namespace name `ICSharpCode' could not be found. Are you missing a using directive or an assembly reference?


    Assets/UnZipFile.cs(34,7): error CS0246: The type or namespace name `ICSharpCode' could not be found. Are you missing a using directive or an assembly reference?


    how can i fix these errors?

    Thanks
    /Robert
     
  19. cristian gallego

    cristian gallego

    Joined:
    Aug 25, 2010
    Posts:
    9
    OH my god! very Thanks! I needed.
     
  20. mikesgames

    mikesgames

    Joined:
    Apr 16, 2010
    Posts:
    1,071
    This rocks out loud!

    Thanks for this guys :)
     
  21. spartikus

    spartikus

    Joined:
    Nov 29, 2010
    Posts:
    1
    Dude I just DL'd this. Hoping it works but jsut wanted to say muchos gratzie :)

    Many thanks,
    Mark
     
  22. digoxy

    digoxy

    Joined:
    Dec 3, 2010
    Posts:
    6
    Hello Leepo (et ALL).

    @Leepo, thank you for your contributions to the Unity community, I have seen many things by you and just wanted to personally thank you.

    @ALL

    I am working on getting the M2H updater working and would like to do this through my own website. Its a classic ASP page and I dont understand enough about PHP to do the conversion. Any PHP savy people out there that could convert this to Classic ASP?

    Code (csharp):
    1.  
    2. <?php
    3. $GAME_VERSION = 1; //Please use int only: 1,2,3,4)
    4. $platform = $_POST['platform'];
    5. $clientsversion = $_POST['clientsversion'];
    6. if($platform=='WindowsEditor' || $platform=='WindowsPlayer'){
    7. $downlink= 'http://www.MYWEBSITE.com/LatestWindowsUpdate.zip';
    8. }else if($platform='OSXEditor' || $platform='OSXPlayer' ){
    9. $downlink= 'http://www.MYWEBSITE.com/LatestMacUpdate.zip';
    10. }else{
    11. echo 'Invalidplatform!';
    12. exit();
    13. }/
    14. /Format:VERSION#FORCEUPDATE#DOWNLOADLINK#DISABLEDLI
    15. //Version: version info // Forceupdate: Leave this to 0 (ALWAYS update)
    16. //DownloadLink; the link to the .zip for this platform
    17. //DisabledLink: Used when i.e. the patcher would need to be updated.
    18. // Asks the user to visit this link with explanation. Leave this blank otherwise!
    19. echo "$GAME_VERSION#0#$downlink##";
    20. ?>
    21.  
    any help would be appreciated.
     
  23. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    At the risk of sounding like a complete idiot: What is this?

    Patch what with what for what reason? It works in Windows and on Macs from within the editor... and does what exactly?

    You all seem quite grateful for this but I just can't figure out what it actually is... Help, please?

    Initially I thought it adds content to a pre-existing binary, but with that being the case (at least on Mac) you could simply replace the old with a new so clearly it isn't that... Sorry for sounding like an idiot but I just don't know... :(
     
  24. digoxy

    digoxy

    Joined:
    Dec 3, 2010
    Posts:
    6
    Using this product, you are able to create a game launcher that firsts checks for updates via the web. If it is found that you need an update, it gives you the option to download.
     
  25. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    ...I can see how that could be useful. :)
     
  26. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Digoxi, you could also use a plain txt file like this:

    i.e.:
    Increase the version number to have player update
     
  27. digoxy

    digoxy

    Joined:
    Dec 3, 2010
    Posts:
    6
    Hello Mike,

    This is a working model of the ASP script.

    There would be one thing you could do for this that would put a cherry on top, of course, from the editor a 1 button update of course.. but also, the revision information could really be expanded to 0.0.0, Release/Beta/Alpha respectivly. Or, some way to drill this out a bit.

    Great idea, I will play with this and see how well it works for our developers, I think though, with the revisions we will be going through, it would be nice to document this within the text file.


     
    Last edited: Dec 7, 2010
  28. digoxy

    digoxy

    Joined:
    Dec 3, 2010
    Posts:
    6
    Leepo, in the script file you have several commented lines:

    /Format:VERSION#FORCEUPDATE#DOWNLOADLINK#DISABLEDLI
    //Version: version info // Forceupdate: Leave this to 0 (ALWAYS update)
    //DownloadLink; the link to the .zip for this platform
    //DisabledLink: Used when i.e. the patcher would need to be updated.
    // Asks the user to visit this link with explanation. Leave this blank otherwise!


    Can you expand on this? I understand the "format" is simply stating the format of the return string. "DownloadLink" and "DisabledLink" I dont see a reference to these anywhere.

    Maybe a step by step of what can be included in the patchtext? I have the website to connect to and version, but not sure of anything else that may be useful.
     
  29. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    //DownloadLink; the link to the .zip for this platform
    //DisabledLink: Used when i.e. the patcher would need to be updated.

    DownloadLink: A direct link to the latest download (full game, without patcher)
    DisabledLink: To what page should the program link in case you want to disable this version of the patcher. Users will see the patching is disabled and are asked to "click here for more information".
     
  30. kidovate

    kidovate

    Joined:
    Feb 28, 2010
    Posts:
    26
    Hey,

    I am having some problems with this. I get the error, current version is incorrect, 2<-Should be 5.

    Also, in the pdf, it says, "Make sure that the thisVersion parameter is set correctly or it will download the game again every time you want to play." In the parameters text, there isn't a setVersion. There's just the link to the PHP page with the latest download information. How does the client updater know what version it currently has?

    I think there might be something missing from the clientParamaters.txt.


    Has anyone actually used this? Can you give me a sample PHP script, and sample clientParamaters.txt?

    Thanks,
    Christian Stewart
     
  31. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    Nice Patcher :) Could you release the source code?
    I'm on the way to making an own game and your patcher looks great.
     
    Last edited: Jan 29, 2011
  32. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    Wa,take a look.
     
  33. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Is it possible to make it so that the users are require to log in before they can download patches?
     
  34. J3-Gaming

    J3-Gaming

    Joined:
    Dec 23, 2010
    Posts:
    55
    PHP:
    if ($platform == 'WindowsEditor' || $platform == 'WindowsPlayer')
    {
        
    $downlink'http://www.MYWEBSITE.com/LatestWindowsUpdate.zip';
    }
    else if (
    $platform 'OSXEditor' || $platform 'OSXPlayer')
    In the first if statement you use double equals for comparison, but what I do not understand is that you use a single equals in the second conditional. Wouldn't that be an assignment like in C++? That would mean your second statement will always be true.



    - - - - - - -

    Also, im getting that
    Latest version information is wrong (3 <- should be 5)! Is the patch server offline?
    error, here is the output log file, any idea what I might be doing wrong?
    - - - - - -
    EDIT: //FIXED!

    You get this error when the php page gives you an unexpected result. Such as the invalid platform, or if you delete the trailing ## from the final print, ect.
     
    Last edited: Apr 24, 2011
  35. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    An update on the editor script?
     
  36. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    For simple implementations I did fully automate our updating (1 button to build, zip, upload new versions, with the Updater recognizing them).
    However, ideally there should be patching applied as well and not just plain updating, this gets a bit more complicated. Therefore I don't have anything ready thats clean to be shared.
     
  37. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    Is there any way for getting the source code?
    Just say because i could need it but i would like to use my own design for it (without break the functionality). :S
     
  38. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Shortly I'll announce an all-in solution on the asset store for building,updating,patching,deploying to your clients in one click from the Unity editor. This will make this simple updater obsolete.
     
  39. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    woohooo have free time to play with other stuff now... :)) I was going to start writing out how to go about this next weekend and have way to many other things to sort out on my DB comms right now, so thank you.

    Regards

    Graham
     
  40. KillerScript

    KillerScript

    Joined:
    Aug 20, 2010
    Posts:
    368
    dude, I don't understand anything!.
    PLEASE MAKE A VIDEO TUTORIAl.
     
  41. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    (bookmarked)
     
  42. davebuchhofer

    davebuchhofer

    Joined:
    Nov 9, 2007
    Posts:
    126
    Good deal, was about to start writing my own! i'm sure paying is much cheaper heh ;)
     
  43. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,663
    Hm, for me this simple updater/patcher isn't obsolete.
     
  44. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    This would be useful to me, but I really need it right now, or within a few weeks.

    Will it be available anytime soon?

    Also will you be able to change the graphics and logos in the updater window yourself? As that would be necessary for me.

    I was thinking about writing something like this myself, but was thinking that just writing it using plain old mono would be superior to unity, it would be more lightweight.
     
  45. Unamine

    Unamine

    Joined:
    Mar 23, 2011
    Posts:
    28
    I found the project interesting, but I take a course, I compile a game, and then in Unity if I add another level for example, I will not have to recompile all the files again, including also the executable?
    That is, the patch would not have to re-download the "new" game completely?
    That would only add this new level.

    I hope to answer, and thank you for everything
     
  46. any_user

    any_user

    Joined:
    Oct 19, 2008
    Posts:
    374
    The patcher works fine if you always take the same machine to build, but I had some problems when building the game on different machines: When I build a patch on top of my teammate's build, the patches are huge (50-60mb for a 250mb game of which most of the content is music). Even with no changes. Same happens when I build the game on a different OS (windows, in my case).

    Unfortunately, this behaviour makes the patcher in this version unusable for team projects.. do you have an idea how this problem could be solved?

    EDIT: I made a mistake when checking this: The problem occurs only with different OSes, not on different machines with the same OS (at least on OSX). But then (same OS, different machine) it takes much longer to create the patch than creating a patch on the same machine. which is no problem. So I guess the problem is still there if you're working together with different operating systems.
     
    Last edited: Jul 18, 2012
  47. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I'm afraid I wont be able to fix that. Apparantly building on a different OS will leave some different "signatures" causing a bigger changeset. I recommend sticking to 1 machine to publish all patches&builds.
     
  48. kaolas

    kaolas

    Joined:
    Nov 29, 2012
    Posts:
    1
    Does this patcher update code as well as art/models/sounds/etc.? The biggest shortcoming of Unity's built in Asset Bundles is that you cannot update code with them, so if your patcher allows me to update code as well as content, that could be a big win for my project.
     
    juan-jo likes this.
  49. zatrix

    zatrix

    Joined:
    Jul 19, 2012
    Posts:
    19


    please help!
     
  50. Hims

    Hims

    Joined:
    Jul 9, 2012
    Posts:
    2
    $eror.png

    getting this error while publishing using m2hpatcher. cant connect to the hosting server.

    "server returned an error : 530 user cannot log in "!! please help to solve the error.

    i tried to connect by disabling the avast and firewall , still couldn't connect to the server.
     
    Last edited: May 22, 2013