Search Unity

MG Patcher

Discussion in 'Assets and Asset Store' started by mihanocho, Mar 21, 2015.

?

Do you like MGPatcherTools,?

  1. Yes

  2. No

Multiple votes are allowed.
Results are only viewable after voting.
  1. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    upload_2015-8-22_12-36-12.png Added languages
     
  2. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Another error: Run the patcher with a wrong adress, exception here:

    _PP.errorText(
    "Can't retrieve last version of files. It's possible that the server have a technical issues." +
    "If this error persists over a long period of time please contact the support of the game." +
    "\nResponse: " + response.StatusDescription);

    Because webex.Response is null in this case here:
    HttpWebResponse response = (HttpWebResponse) webex.Response;
     
  3. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Now Patcher downloads via the WWW and data lines of code there. Thank you soobschaeteob errors and omissions, thereby helping to improve the package!
     
  4. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Loading of settings doesn't seem to work - at least for scenes.
     
    Last edited: Aug 23, 2015
  5. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    What would you say if I launcher to download version 1?
     
  6. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Sorry, I am not sure I understand you :-/ Version 1 of what?
     
  7. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    I want to make the launcher download version of the game starting. Excuse me, I use a translator
     
  8. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Don't worry about using a translator, english is also not my native language :)

    You mean having kind of a separate launcher application that downloads the game prior to the game starting?
     
  9. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Yes. Loader-installer
     
  10. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    That sounds like a good idea. But I think there are other things that need to be done first, which will also come in handy when you implement the possibility to use a launcher :)
     
  11. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    I need a volunteer with the Mac Os. To test the new patcher.
     
  12. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Today is done:
    1. Changed versions. You can now create fractional version with letters, delete the version and open the folder storage versions.
    2. Added virtualization patching in Editor.
    3. Added system validation fields and removing errors.
    4. Added language system. Now you can easily change the interface language MGPatcherTools and MGPatcher. Changes in the language and includes errors in the appropriate language.
    5. Added the ability to create a version of which is starting will be compressed and uploaded to the server automatically.
    6. Added loader. The loader will download and install the game to the desired folder.
    7.Redesigned. For added convenience ScrollBars.
    8.Code formatted. A number of variables has been changed to the logical concept code.
    9. Fixed numerous bugs.

    Screenshot_1.png Screenshot_2.png Screenshot_3.png Screenshot_4.png Screenshot_5.png
     
  13. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
  14. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
  15. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Sounds good, I'm looking forward to playing around with this!

    Two annotations:
    - Your FTP username and password are visible in the screenshots - I think you should change at least your password now ;-)
    - The german translation looks to be a word by word-translation from a translator. If you want, I can translate it for you. Just drop me a PM with the file that contains the localization :)
     
  16. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Patcher has been sent for review. It will soon be available at a new price of $ 20. upload_2015-8-28_19-56-39.png
     
  17. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    The new version of patcher published!
     
  18. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    What do you want to see in future versions?
     
  19. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    I'm looking forward to have a look at the new version, it looks very promising :)

    The option to add release notes and retrieve them from the server would be very nice! :)

    Also, some integrity checking and a repair option would be a nice feature :) This could compare the currently installed version to the latest available version on a server and "repair" differences, apart from configuration etc., by replacing them with the version available on the server. Maybe a server-side script would be needed for this.
     
    Last edited: Sep 3, 2015
  20. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    If you have errors in the patcher, please send to my email (mihanocho@gmail.com)
    Invoice NO. I will send you a new patcher.
     
  21. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I had to add LoadGameScene(); to MGPatcherScript.StartPatch() inside if (current_version_string == last_version_string) because otherwise, it didn't seem to properly advance to the game scene. Are most people adding a button and having the user manually continue instead?

    When updating, it seems to update correctly (versions match) but then it tries to update again and the update file is missing so it errors. If I close and reopen, it's updated and it launches the game scene as expected. I'm on Unity 4.6.2 if it matters -- testing on mac.

    To fix it, I had it double check the version number from the database if it ran into that problem and just load the game scene if the versions match. So everything seems to be working smoothly for me now :)

    Solid asset. Really appreciate that it's open source so I can go in and tweak things :)

    edit: oh, the other problem I had -- was creating starting patches for three different platforms -- about 130MB each. The first one uploaded, but then the Unity Editor was stuck with upload progress bar and never continued responding.

    edit2: experienced the same hang with just one file.
     
    Last edited: Sep 16, 2015
  22. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Is there a reason it keeps a local copy of version.txt? Would it break anything if I have it delete it after it's updated?

    edit: found another bug.

    For the linux segment of MGPatcherScript.Start():

    This was cutting off a letter in a folder and preventing the linux version from updating. Plus it's just really messy.
    Code (CSharp):
    1. _PATH = Application.dataPath.Remove(Application.dataPath.Length-(game_name+".apk"+"/Contents").Length,
    2.  (game_name+".apk"+"/Contents").Length);
    This works:
    Code (CSharp):
    1. _PATH = Application.dataPath + "/../";
    edit2: also, if I ever try and make a patch for one platform without making patches for the other 2 platforms, It gives me a Unity editor error that I can't debug

    Screen Shot 2015-09-16 at 8.14.46 PM.png

    It's pretty weird -- can't even close Unity after that, have to force quit. If I reopen Unity, try to make patch for all platforms, same thing -- so far, only way I can fix is to remove all versions.
     
    Last edited: Sep 17, 2015
  23. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Thanks for reply. I fix this problems in feature version.
     
  24. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Another request: when specifying an FTP address, let users specify a port.

    I got it working with this:

    Code (CSharp):
    1.             Uri newUri = new Uri("ftp://" + host +path_root_directory+ remotePath + nameFileToUpload);
    2.             UriBuilder newUriBuilder = new UriBuilder(newUri);
    3.             newUriBuilder.Port = 2222;
    4.             newUri = newUriBuilder.Uri;
    5.  
    6.  
    7.             var ftpWebRequest = WebRequest.Create (newUri)as FtpWebRequest;
     
    Last edited: Sep 19, 2015
  25. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Thanks! I think better to make the field for the port.
     
  26. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Yeah definitely -- I just needed a quick fix :)
     
  27. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    So, I had tested on Mac/Linux assuming Windows would work -- turns out, Windows wasn't able to patch. Some weird behavior with directories and filepaths.

    _PATH seemed to be the issue again. I tried all sorts of ways, but finally found this to work:

    Code (CSharp):
    1. //for windows
    2. _PATH = "\\" + Directory.GetParent(Application.dataPath).ToString();
    Also, sometimes it creates a build without an updated database -- so sometimes the build thinks it's an earlier version or it looks for patches where another platform's patches are. I haven't tried fixing this yet.

    edit: here's what I ended up with for all three platforms on Unity 4.6.2

    Code (CSharp):
    1. #if UNITY_STANDALONE_WIN
    2.         _PATH = "\\" + Directory.GetParent(Application.dataPath).ToString();
    3. #elif UNITY_STANDALONE_OSX
    4.         _PATH = Application.dataPath + "/../..";
    5. #elif UNITY_STANDALONE_LINUX
    6.         _PATH = Application.dataPath + "/../";
    7. #endif
    edit2: that windows line was what worked on my VM, but actual windows installs are different. Sorry for the confusion.
     
    Last edited: Sep 22, 2015
  28. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Thanks! I have fix
     
  29. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Is available a simplified version. MG Patcher Tools - Light: Buy.
     
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    @mihanocho - What are the differences between Pro and Light?

    Is it that source code is with Pro and Light is a DLL?
     
  31. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    In Light version the source code is hidden
     
    hopeful likes this.
  32. Gaurav-Gulati

    Gaurav-Gulati

    Joined:
    Sep 22, 2014
    Posts:
    52
    Can we have a support for unity webgl?
     
  33. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    can create only manually
     
  34. Gaurav-Gulati

    Gaurav-Gulati

    Joined:
    Sep 22, 2014
    Posts:
    52
    Can you please explain "manually"? Will it be working with webgl or not?I see 4 platforms you mentioned,Mac,linux,windows and webplayer.
    Could you give it a try for webgl your side and let me know will it be working in webgl or not?
     
    ZoneOfTanks likes this.
  35. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I would like a feature to be able to upload each patch individually after build. Essentially allowing a patch to be uploaded in case there is an error during upload but the build went fine. Our connection tends to suck sometimes and drop the FTP connection and MGP thinks the patch did not complete correctly, even though the build did but the upload did not. It would be better if the two stages were allowed to be done separate with buttons next to the versions for 'upload' and 'rebuild'. Also a switch for passive ftp could be helpful for those that don't use passive on their servers.

    My next request is Amazon S3 support. It would be a bit more stable than just FTP and is widely used. It also allows the usage of S2 servers to have access to builds directly if they are used for remote hosts for games.
     
    J_P_ likes this.
  36. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Got a bug to look into. I am trying to isolate the code that is causing it, but it appears to be a threading issue where the threads either don't clean up or it loops too many back to back. I start the patch and this is what I see:


    Until eventually the patching has started so many threads that windows crashes it.


     
  37. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Ok, more info on the above. Spaces in the name causes it. It is trying to read the versions.txt but it is not finding it in the right spot so fails and still does an attempt at a download which also seems to fail but it keeps looping and firing hundreds of threads a second. It even brings my sound driver to it's knees in the meantime.
     
  38. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Patcher can't find file version on server. Check file version on server. Check path in mgpatcher.asset.
     
  39. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    The issue is that a space in the name breaks all of the searches on both local and URL attempts. Regardless it needs a lot of error trapping and some method need to not be trying so quickly. It crashes the game at the least and at the worst it has crashed two of my testing machines.
     
  40. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Feature Request: Ignore file/folder collection. I have folders in the game path that need to be user modifiable that MG Patcher sees as being deletable instead of left alone. Certain things like screenshots or save files. Would be good to have a place to set the extensions or folder names without coding it.
     
    Last edited: Sep 27, 2015
    hopeful likes this.
  41. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Feature Request: Under the content folder where the builds are, have a 'current' build that has the latest one in it for each platform chosen. This would allow us to still run those for testing in the current build folder and when the next build is done it will wipe that one out. Otherwise any changes we have made in the actual content version folder are seen as changes and put in the conf.txt file. This has led to us running into an issue with the output_log.txt file being in there as a file to remove and this it fails on the attempt since it is in use.
     
    hopeful likes this.
  42. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Run or modify the builds in the folder contents not recommended. If you want to test your build, copy it to another folder and run.
     
  43. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    A great suggestion for improvement. Will do. Thank you!
     
  44. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Check the name of the patch file, instead of the space should be "_". I tested this version of the problem. And send settings MGPatcherTools.
     
  45. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    That is why I am suggesting to have it make a 'current' folder that automatically places the latest build in it specifically for testing. It would greatly help in keeping people from accidentally modifying the build by running it. It would also allow us to make batch files that can zip up the latest version or run installer packing to get it ready to put on the web server for customers to download without having to specify a different path each time in the batch.

    The creation of the patch doesn't seem to be the issue, it is the client download and application of the patch that is. I would have to test some more to get an exact line number but it has been plaguing me since yesterday until I finally just renamed the project with dashes instead of spaces.


    I am getting a lot of unexpected behavior while running the patch on the client. The status text is constantly flickering/changing and when the first check for a version file comes up it is running so many threads or attempts that it can even interfere with the sound on the game and make it skip. I would really like to see this more event driven instead of being a polling design as it is now. Right now it seems to be really heavy on resources for what it is needing to do. I will see if I can get an event version going and help get this ironed out. So far this has been a great patcher, just needs a bit of code cleanup.
     
  46. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    Thanks for the help troubleshooting!
     
  47. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    There is a new behavior in 5.2.1 (not sure if it started in f1, but is there in p1). After 'create patches' completes the build of a project, it ends up giving 'UnathorizedAccessException: Access to the path is denied' on Directory.Move. I dug through the code and the only spot in the one spot I could find a Directory.Move used I swapped to a simple directory copy to see if that let it get past it, but it still gives that error. I am still trying to figure out where it is calling the Directory.Move and why all of a sudden something seems to be blocking it.
     
  48. mihanocho

    mihanocho

    Joined:
    Mar 10, 2015
    Posts:
    296
    I have encountered this error. It does not affect program operation in any way. Why sometimes it appears I did not understand.
     
  49. HellsPlumber

    HellsPlumber

    Joined:
    Aug 17, 2014
    Posts:
    42
    I get the "'UnathorizedAccessException: Access to the path is denied" error too.
    It's making this asset very unreliable as I'm having to recreate patches due to errors stopping the creation process.

    I've also found that if I delete a version and attempt to re-create it, it doesn't work.
    For example, I created patch 3 for my game and realized I made a mistake. So I fixed the game, deleted patch 3 so I could recreate it, but this refused to work.

    Eventually I had to recompile the entire game as Version 1 and tell people to reinstall the entire thing.
     
  50. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    As with the @HellsPlumber, mine is stopping the process with the error. I did find a possible fix in that the build process is opening an explorer window to the game path and then doing the move. I made a couple changes, first I changed the Move command to a Copy (which I initially thought didn't work, but it did) and second I changed the BuildPipeline from BuildOptions.ShowBuiltPlayer to BuildOptions.None. That keeps the explorer window from opening and causing a lock up on the files through the windows explorer doing file searches/indexing.

    Did you create and deploy patch 3 to everyone or was it only internally built? If it was deployed you just roll it to patch 4 and keep going, but internally it should have been able to be redone. The one thing that delete has done is it will delete the folder under contents with the build, but it doesn't delete the *.patch files that correspond to it. I wonder if you ran into permissions issues when it was trying to create files with the same name as existing ones.