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

PATCH - Updating System

Discussion in 'Assets and Asset Store' started by ManHunterITA, Jul 20, 2015.

  1. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    That folder is created to workaround the UnityPlayer.dll conflict.
    It should not affect the version location in any way (atleast from my tests).
    Can you open an issue on GitHub to explain what happens? In this way we will keep it logged on GitHub! :)
     
  2. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    283
    Hi,

    After importing P.A.T.C.H I'm getting also errors about compression type. I use Unity 2018.3.0f2. Is there a fix for this issue?

     
    ManHunterITA likes this.
  3. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Hi,

    yeah: Unity 2018.3.0f2 added a new type (CompressionType) in UnityEngine.dll.
    CompressionType is also a type of my MHLab.PATCH.dll, so there is a names conflict.

    I submitted a new version (2.1.6) to the Asset Store with this fix: it should be available in few days.

    If you want to fix it yourself, just add MHLab.PATCH.Compression in front of all those CompressionType occurrences.
     
    Bartolomeus755 likes this.
  4. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    283
    Thank you very much and also for your great product and support!
     
    ManHunterITA likes this.
  5. Zaeran

    Zaeran

    Joined:
    Dec 14, 2012
    Posts:
    12
    Hey hey!

    Just checking to see if the Globalgamemanager sharing violation has been fixed. It still appears to be in the 'to do' list for 2.1.4, and I still seem to be getting the sharingviolation issue in v2.1.5.

    It seems that the new if(isLocked) section of the ProcessFile method in PatchApplier.cs is still throwing the error, as even though its been detected as a locked file, the sharing violation still occurs when attempting to call FileManager.Rename.
     
  6. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Yeah, it is still in the todo list and has not been fixed yet, sadly.

    I am experiencing something weird: if you look at that code, you can see how the method throws an IOException also if there is a try/catch block for that IO operation. The raised exception is not catched at runtime (I only managed to get it catched with an attached debugger).
    I never experienced similar issue, so I don't know how I will solve it. I can't understand why that specific exception cannot be catched at all.

    I am pretty confident I will find a solution for this problem in the 3.0.0. If I can't, I will have to change the logic behind Embedded Patcher, by creating an external patcher applier agent (who closes the game process and starts the updating process externally).
    Atleast, this is the only B plan I can think of.
     
  7. Zaeran

    Zaeran

    Joined:
    Dec 14, 2012
    Posts:
    12
    I'm fairly sure it's because the IsFileLocked method is catching the thrown exception, but it isn't throwing a new exception for the outer try/catch to find. isLocked is still being set though, so that part is working alright.

    I'm thinking an external patching tool is the way we'll go about it.
     
    ManHunterITA likes this.
  8. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    The problem is that IsFileLocked hasn't to throw exceptions at all. The only thing it has to do is catching an exception if any and return true/false.

    This is the code:

    On globalgamemanager file processing, when the method call:
    var isLocked = IsFileLocked(file);
    an IOException is thrown OUTSIDE of IsFileLocked method, making the Launcher to crash. And this makes no sense at all, since no exceptions should be thrown outside of that method.
    If you attach a debugger, instead, and follow the code flow until this point, the IOException is correctly catched and true is returned.

    This only happens with globalgamemanagers file: all other locked files work as expected.

    Isn't it weird?
     
  9. Zaeran

    Zaeran

    Joined:
    Dec 14, 2012
    Posts:
    12
    That's pretty damn weird!

    I'm still running this code for IsFileLocked
    Code (CSharp):
    1.   public static bool IsFileLocked(string file)
    2.         {
    3.             FileStream stream = null;
    4.             try
    5.             {
    6.                 stream = File.Open(file, FileMode.Open, FileAccess.ReadWrite, FileShare.Delete | FileShare.ReadWrite);
    7.             }
    8.             catch (IOException)
    9.             {
    10.                 return true;
    11.             }
    12.             finally
    13.             {
    14.                 if (stream != null)
    15.                 {
    16.                     stream.Dispose();
    17.                     stream.Close();
    18.                 }
    19.             }
    20.            
    21.             return false;
    22.         }
    and it's correctly returning true with the IOException.

    The problem I'm seeing is here:

    Code (CSharp):
    1.  try
    2.                         {
    3.                             isLocked = FileManager.IsFileLocked(oldFile.Replace(".patch", ""));
    4.                         }
    5.                         catch (Exception e)
    6.                         {
    7.                             isLocked = true;
    8.                             Debugger.Log("A sharing violation happened. Workarounding it on file: " +
    9.                                             oldFile.Replace(".patch", ""));
    10.                         }
    11.  
    12.                         if (isLocked)
    13.                         {
    14.                             string newName = oldFile.Replace(".patch", "") + ".delete_me";
    15.                             FileManager.FileRename(oldFile.Replace(".patch", ""), newName);
    16.                             FileManager.FileCopy(FileManager.PathCombine(Path.GetDirectoryName(oldFile.Replace(".patch", "")), newName), oldFile.Replace(".patch", ""));
    17.                             this.IsDirtyWorkspace = true;
    18.                         }
    isLocked is getting set correctly in the IsFileLocked method, which then doesn't throw an exception and jumps past the "A sharing violation happened" part. isLocked is still being set to true via the IsFileLocked method.

    The FileRename method is throwing the error, because it's trying a File.Move even though it knows the file is locked, which throws the sharing violation.
     
  10. Zaeran

    Zaeran

    Joined:
    Dec 14, 2012
    Posts:
    12
    Ended up creating an external patcher which solved the problem anyway :)
     
  11. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Yeah, an external patcher solves the problem.

    But I have to solve the sharing violation exception too, in order to make the Embedded Patcher usable again!
    It is just matter of time: it will be solved in a way or another! :D
     
  12. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    45
    Is it possible to integrate P.A.T.C.H. with Unity Cloud Builds?
     
  13. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    To be honest: I never tried it. If you try, please let me know. I can consider to test the next release against Unity Cloud Builds too.
    You can add an issue in the P.A.T.C.H.'s issue tracker on GitHub. In this way I will remember it! :)
     
    attaway likes this.
  14. nsfnotthrowingaway

    nsfnotthrowingaway

    Joined:
    Feb 18, 2016
    Posts:
    48
    Hi. I'm probably going to purchase your asset, but the documentation link doesn't work. When I click it from the asset store I get to a site that says:
    "alterVista
    The requested file is downloadable here"

    but the link just takes me to the same page (the altervista with the download link). Even if I copy paste the link to a new tab it takes me back there.

    Also, you have two versions in the store, and there's no way to tell the difference between the full version. I was able to find it on your site, but on the Asset Store there isn't an easy way to tell.
     
    ManHunterITA likes this.
  15. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Hi,

    sorry for the broken link: I will be sure to fix it asap!
    Meanwhile, here is the correct link for documentation: http://mhlab.altervista.org/p-a-t-c-h-documentation/

    About the difference about normal and full version: it is stated in the first line of the full package.

    This is the only difference!

    EDIT: anyway, I submitted an update to the Asset Store with updated documentation URL and a statement on the full package that explains how that one is the only difference between my two packages.
     
    Last edited: Jan 9, 2019
  16. nsfnotthrowingaway

    nsfnotthrowingaway

    Joined:
    Feb 18, 2016
    Posts:
    48
    Excellent. Thank you.
     
    ManHunterITA likes this.
  17. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Project management is completed! Targets and Branches management is completed!
    Now I am dealing with builds management! Here a preview:
     
    Bartolomeus755 likes this.
  18. zadda

    zadda

    Joined:
    Sep 18, 2016
    Posts:
    7
    Hello,

    I am having an issue with using P.A.T.C.H with the ingame embeded system. It downloads the files fine but upon installing it gives a
    "Patch failed! - Sharing violation on path C:\projects\builds\1.0.0.0\Game\Prototype_Data\data.unity3d"

    error. Is there a workaround for this? This is using the latest version of P.A.T.C.H. and Unity 2018.3.0.

    Thanks for making this asset available!
     
    ManHunterITA likes this.
  19. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
  20. zadda

    zadda

    Joined:
    Sep 18, 2016
    Posts:
    7
    Hi,

    Thanks for the quick response! Hope you'll be able to tackle this issue as it's the feature I was mainly interested in :)
     
  21. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178
    so I can not buy P.A.T.C.H. on asset store now?
     
  22. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    It is now back on Asset Store! :D
    _______________________________


    Compression Level and Ignorelist have been successfully added to the new builds manager! Give me feedback!
     
    zyzyx likes this.
  23. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Build Time has been added in the Builds section:


    Also, now P.A.T.C.H. captures metrics about builds and patches and stores them in a JSON metrics file, one per platform/branch:


    You can easily parse it in order to aggregate and combine your custom metrics, if you need more control.
     
    zyzyx likes this.
  24. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    @ManHunterITA - When it's time to update the docs, be sure to make them easily readable. Right now the docs are a little hard on the eyes, at least for me.
     
    Ony likes this.
  25. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Sure thing! Any advice? What do you think I should improve?
     
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    The font isn't very easy to read and the spacing seems jammed up.

    patchdocs.png
     
    Ony and ManHunterITA like this.
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I guess I should also add that I find the light colored highlight text in the Patch Builder window difficult to read on the light gray non-Pro Unity editor background. The text also looks smaller in pitch than the normal text. My preference is that it be at least the same size pitch, or even larger or in CAPS to attract attention, and a more contrasting color. Or perhaps be set in a colored window, where the color will remain the same regardless of Pro / non-Pro window themes, thereby allowing you to keep consistent window / lettering colors.
     
    Last edited: Mar 22, 2019
    Ony and ManHunterITA like this.
  28. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Does the latest version of Patch work on 2017.x ? I've not upgraded to 2018 or above yet.. too much work involved right now.
     
    ManHunterITA likes this.
  29. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Yeah, it should work on all Unity versions >= 5.6. I had some problems uploading it with other versions since the Asset Store Tool for uploading it does not work on my Unity Editor < 2018.2 (atleast the latest version).
     
  30. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Great, i'll give it a go. Thanks.
     
    ManHunterITA likes this.
  31. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Bartolomeus755 likes this.
  32. taboxz

    taboxz

    Joined:
    Mar 20, 2019
    Posts:
    1
    Hiya! Any idea why the launcher is being detected as virus (Compiled in VS2017 with a custom .ico)?



    (If this isn't the place to ask for support if someone can point me to where I can that would be awesome!)
     
    ManHunterITA likes this.
  33. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    The file PATCH_LAUNCHER_WPF.EXE contained in PATCH.WPF.7z is showing up as a Heuristic virus on my Anti Virus, using the lastest available version of Patch. If this is a virus, or has something in the code that would cause virus detection when you game in installed would cause a lot of issues - even if a false flag. Any ideas?
     
    ManHunterITA likes this.
  34. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Well, it of course is not a virus (the code is fully available in the FULL version, so you can check it out).
    It is a false positive, probably triggered by the fact that it scans/edits files.
    I am not an expert about this topic, so I don't think I will be a lot helpful, but: you can try to sign your executable, whitelisting the hash, etc.

    Try to google a little bit about it, I've found this article that describes the pain of avoiding false positives: https://weblog.west-wind.com/posts/2016/oct/05/dealing-with-antivirus-false-positives
     
    julianr likes this.
  35. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    of course. Just checking in case something crept into the package. It is often the patching system that causes these sorts of issues due to the writing of files. My google drive picked it up as a virus when I tried to transfer the files from my 2018.x project to my 2017.x and wouldn't allow the transfer, so had to place it on a zip drive. Then Nortons picked it up. The downside to this is anyone who uses Patch may need to submit it to every anti virus package and get it tested as false positive to be approved otherwise their game will be shown as having a virus/trojan/malware. Previous version of patch prior to v2? didn't have this issue so I'll stick with that for now. It might be worth looking into what is causing this at your end and get that white listed if its just the compression/packing process, however if it includes the same files/library in the game to blow up/decompress anything then this will cause issues with the game.exe or using the external launcher it will flag it up and the game will not launch or update if removed or quarantined.
     
    Last edited: Apr 8, 2019
  36. Robintj

    Robintj

    Joined:
    Jan 10, 2016
    Posts:
    9
    I plan to test the local disk and build a simple web service locally. Now I can access this address in the browser, but I use the local website http://127.0.0.1 to package and download. It always shows 404 request errors. Please help solve them. Thank you~

    upload_2019-4-18_17-12-2.png

    upload_2019-4-18_17-6-32.png
    error:
    System.Net.WebException: The remote server returned an error: (404) Not Found.
    at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0
    at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0
    UnityEngine.Debug:LogError(Object)
    <CreateThread>c__AnonStorey2D:<>m__35(ActionThread) (at Assets/MHLab/PATCH/Source/Core/Utilities/Threading/UnityThreadHelper.cs:118)
    UnityThreading.ActionThread:Do() (at Assets/MHLab/PATCH/Source/Core/Utilities/Threading/Thread.cs:326)
    UnityThreading.ThreadBase:DoInternal() (at Assets/MHLab/PATCH/Source/Core/Utilities/Threading/Thread.cs:231)
     
  37. Robintj

    Robintj

    Joined:
    Jan 10, 2016
    Posts:
    9

    The solution has been found:
    Add MIME type file extension set to: .
    And add as application/octet-stream,
    can download the file without extension.
     
    ManHunterITA likes this.
  38. Beru

    Beru

    Joined:
    Dec 9, 2013
    Posts:
    15
    Does this plugin work with Megaupload or similar hosting services? Thanks.
     
  39. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
  40. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    Earlier in the thread I saw posts that you planned to add support for Android at the start of 2018, but i've seen no updates on the current status. Is Android support live now, and it just didn't get mentioned yet?
     
    ManHunterITA and skwsk8 like this.
  41. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    The Android support is not implemented, currently. It is not even "in progress". I worked a little bit on it, but it requires more studying and knowledge on my side, so its status for now is just "planned" with no ETA and with low priority.
    I prefer to focus on desktop platforms (already supported by current version) for next major release (and probably for a bunch of minor releases after it).
     
  42. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    thanks for the update.
     
  43. Beru

    Beru

    Joined:
    Dec 9, 2013
    Posts:
    15
    ManHunterITA likes this.
  44. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    I thinking of buying it but im using an old version of unity, does it work with that please ? :
    Unity 2018.2.18f1 (64-bit)
     
    ManHunterITA likes this.
  45. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    That's nice, I can think about building a MEGA compatible downloader.
     
  46. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Yeah, totally. It works with older versions of Unity.
     
  47. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    ok thx
     
  48. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Hey.

    I'm currently working on a project that uses PATCH for updating it's builds. Now I'm trying to automate the whole process and have a really hard time to get my job running, mostly due to the usage of many static variables in methods. I'm using version 2.1.3 currently and wonder if this gets better or worse when I upgrade to 2.1.7 or if I'm missing some easy way to build patches in an automated process (e.g. via a Jenkins build job).

    Thanks for help.
     
    ManHunterITA likes this.
  49. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    341
    Depends on what is your issue.
    You should be able to automatize everything with the commandline tool. I remember we successfully set it to work with Jenkins, in a company I worked for.
     
    pahe likes this.
  50. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Ok, that looks like the way to go for me then. There are some customizations done in the past (not by me) which altered or extended the const fields by more variables and now I need to adjust the automized process to adjust those values too.
    But the current version has already that command line tool so I'll check that and figure out what's missing on our side.
    Thanks!
     
    ManHunterITA likes this.