Search Unity

P.A.T.C.H. - Ultimate Patching System

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

  1. Ultroman

    Ultroman

    Joined:
    Mar 10, 2014
    Posts:
    46
    I need this asset in my life. If you ever get Android and iOS running, a buy is a no-brainer! For now, I'll keep making my game, and keep watching this thread.

    You seem like a very good person. Keep it all up :D

    Cheers for creating something that helps us all!
     
    ManHunterITA likes this.
  2. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Thank you! I really appreciate this!
    For now I'm still investigating about some issues on OSX El Capitan and I'm introducing new interesting features in next release (I know all of you will appreciate these features!).

    Also, I added an issue tracker on my website: in this way all customers can submit their bugfix requests, ideas and features requests! You can find it here: http://mhlab.altervista.org/issues-tracker/

    Have a nice day,
    Emanuele
     
    Ultroman likes this.
  3. hejaaa

    hejaaa

    Joined:
    Sep 14, 2014
    Posts:
    22
    If I use some dll plugins like JsonFX, MsgPack, agsXMPP,... then PATCHER not work... Please fix it
     
    ManHunterITA likes this.
  4. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    What is your generated error?

    Because last time I saw "agsXMPP.dll" it was running under another process, so on Windows a file cannot be edited during runtime...

    On 2.0.6 I added a little workaround to allow my patcher to edit files also if they are owned by another process on Windows: I should test it as soon as I can!
     
    Last edited: May 16, 2016
    Ultroman likes this.
  5. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    215
    Hey i also bought it now :)

    since dark patcher is not being supported anymore its useless.


    It would be nice to be able to limited download speed also in some options :)


    i really love it since it also prevents from starting the game.exe directly.

    I hope this will not be unfinished stopped :)

    and btw how to register on the bugtracker to also write feature requests and such stuff.
     
    ManHunterITA likes this.
  6. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    You need to register an account on my website! I added a direct link to register it in my footer, on right part of the screen! Check it! :)
     
    UltraTM likes this.
  7. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    215
    GEt this when trying to register

    Registrazione per questo sito

    *** Unknown response from http://78.47.96.11/api2.0. Host di destinazione non consentito, sblocca la connessione nel pannello di AlterVista (Risorse > Impostazioni PHP) Antispam service cleantalk.org ***
     
    ManHunterITA likes this.
  8. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Ok, I deactived that plugin: retry now! I registered a new account for myself, to test it and seems to work!
     
  9. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    116
    @ManHunterITA - Hi there, will this work in Unity 5.4 B17? Thanks.
     
    ManHunterITA likes this.
  10. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Sincerely, I don't know: I have to try it as soon as I can on Unity's beta. But I can't see any reason because it shouldn't work properly on 5.4 :p
     
  11. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    116
    Ok great, thanks.
     
    ManHunterITA likes this.
  12. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Hi LoftyTheMetroid,

    I'm sorry for huge delay, but this issue was extremely hard to detect!

    Luckily, now I know how to fix it.
    As you noticed, after you patch your game, it cannot be opened anymore.

    This because it loses its "execute" privileges.
    After you patch your game, try to write this in your Terminal:
    Code (CSharp):
    1. chmod +x /Users/manhunter/PATCH/MyBuild.app/Contents/MacOS/MyBuild
    (Of course you can change the path accordingly with your own situation)
    This worked for me, I am able to run again my test.
    This fix is already introduced in 2.1.0 release!

    If you want to try a fix you can open your Launcher.cs and add this function:

    Code (CSharp):
    1. protected void EnsureExecutePrivileges()
    2. {
    3.      
    4.         #if !UNITY_STANDALONE_WIN
    5.         System.Diagnostics.Process process = new System.Diagnostics.Process();
    6.         string file = Path.GetFileName(SettingsManager.LAUNCH_APP);
    7.         process.StartInfo.FileName = "chmod";
    8.         process.StartInfo.Arguments = "+x " + file + "/Contents/MacOS/" + file.Replace(".app", "");
    9.         process.Start();
    10.         #endif
    11. }
    So go in your OnTaskCompleted callback and add this:
    Code (CSharp):
    1. #if !UNITY_STANDALONE_WIN
    2. EnsureExecutePrivileges();
    3. #endif
    And about 2.1.0 release, I can announce the introduction of in-game embedded patcher.
    You can embed P.A.T.C.H. in your game as first scene, so it will update your game when you run it!

    This is a new skin I made for this new feature:


    Also, various improvements and fixes are added. This is the complete changelog for now:

    V2.1.0
    • CORE: Solved platform dependent issue for root path on Linux

    • CORE: Introduced in-game embedded patching process

    • CORE: Introduced new WPF Standalone Launcher

    • CORE: Introduced news system

    • CORE: Introduced patch notes

    • GUI: Introduced options and tools for Launcher

    • CORE: Added “Force repairing” feature
     
    Last edited: May 31, 2016
    LoftyTheMetroid and UltraTM like this.
  13. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    215
    PLease dont forget the autoupdate feature for the launcher on version 2.1.0 :p
     
    ManHunterITA likes this.
  14. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    The in-game embedded patcher contains already a self-updater :p
     
  15. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    Awesome, thanks for looking into this! I had to move on to some other tasks in the meantime and have put patching on the backburner, but I'll be able to take another look at integrating P.A.T.C.H. into our project in a couple weeks. I'll let you know how it goes!
     
    ManHunterITA likes this.
  16. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    304
    One of the issues I encountered with DarkPatcher is if the launcher is able to update itself. Namely, the patcher should check if a new version of the patcher itself is available, and if so, then update the patcher first before checking if there is a new version of the game.

    Can P.A.T.C.H. do this on all platforms?
     
    ManHunterITA likes this.
  17. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    At the current state, P.A.T.C.H. can update itself with some tricks.
    In next release (2.1.0) I introduced a new in-game embedded patcher that supports self-updating and I introduced some new workaround to allow P.A.T.C.H. to patch running files.
    I'm also working on workflow improvement for this specific task.

    P.A.T.C.H.'s community is testing 2.1.0 beta version in those days!
     
  18. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    304
    Unfortunately, our game doesn't prefer to use an in-game embedded patcher.

    Our patcher launches separately from our game and passes login information to the game client, which expects user credentials when it starts.

    We're looking for a patcher that can run separate from the game and still patch itself, on all platforms.
     
  19. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    As I said, P.A.T.C.H. can patch itself.
    In current version (2.0.5p1) it can patch itself with some tricks (just create two patcher: an agent and a primary launcher).
    The agent will update the primary launcher and the primary launcher will update your game and the agent.
    To better understand the idea, see at PVP.NET: it is League of Legends' Launcher.
    It uses a "loading form" with their logo as agent: if required, this form will update their Launcher.
    When done, it automatically starts the Launcher. It will update the agent and the game.

    In next version (2.1.0) I'm working on a better integration for this specific task (the self-update):
    - I introduced an embedded patcher (if somebody needs)
    - I introduced a workaround to patch running or locked files (so also the running Launcher): it allows you to patch your Launcher and all running or locked files.

    The last point is a must: thanks to it, I can plan also on-the-fly patches, to patch unused assets during your game is running.

    Of course, all those features are in the package but you can use only what you need!


    I hope I better explained this, probably last time it was confusing!

    Best regards,
    Emanuele - MHLab
     
    hopeful and Exeneva like this.
  20. bradshep

    bradshep

    Joined:
    Jan 5, 2014
    Posts:
    49
    When do you expect 2.1 to be live? I bought P.A.T.C.H but want to wait for 2.1 before I start to replace the current patcher I have.
     
    ManHunterITA likes this.
  21. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I already sent 2.1.0 to some beta testers in our P.A.T.C.H.'s community on Discord, we are working to improve it!
    Join us if you want to test it too!
     
  22. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    304
    Same. I'm waiting for the self-patching updates to all be integrated first.

    We are thinking of switching in 2.2 so it can address any issues 2.1 might have had.
     
    ManHunterITA likes this.
  23. Jromano0

    Jromano0

    Joined:
    Nov 9, 2015
    Posts:
    8
    Hello, I have get PATCH in assest store and imported on my Project. I fowlled the instructions of the documentation.
    I have unit 5.3.4.
    I created a new version.
    I Clicked in DEPLY and I have the zip created.

    Than I configure my FTP server and the problems have started.

    The problems:
    1) When I click UPLOAD on a selected build, its Works in and nothing happins. I wait more than 30 minutes and they not transfer any file . I have to aborte the editor.
    2) When I click in UPLOAD for the laucher, They compiles again (I think that the lauchers have already created in deploy, but its compiles again). Now the console is showing more than 600 messages like:

    'Assets/MHLab/PATCH/Plugins/deploy/Launcher/zCoolDayz_launcher_Data/Managed/Assembly-CSharp-firstpass.dll' shouldn't be queried by IsAssemblyCompatible, missing IsInternalOrCompiledAssembly check ?

    UnityEditor.AssetPostprocessingInternal:postprocessAllAssets(String[], String[], String[], String[], String[])UnityEditorInternal.InternalEditorUtility:GetMonoIslands()'Assets/MHLab/PATCH/Plugins/deploy/Launcher/zCoolDayz_launcher_Data/Managed/Assembly-CSharp-firstpass.dll' shouldn't be queried by IsAssemblyCompatible, missing IsInternalOrCompiledAssembly check ?

    Multiple plugins with the same name 'sqlite3' (found at 'Assets/Plugins/SQLiter/DLLs/sqlite3.dll' and 'Assets/MHLab/PATCH/Plugins/deploy/Launcher/zCoolDayz-launcher_Data/Plugins/sqlite3.dll'). That means one or more plugins are set to be compatible with Editor. Only one plugin at the time can be used by Editor.

    UnityEditor.Scripting.ScriptCompilers.CreateCompilerInstance (MonoIsland island, Boolean buildingForEditor, BuildTarget targetPlatform, Boolean runUpdater) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilers.cs:96)ApplicationException: Unable to find a suitable compiler for sources with extension 'dll' (Output assembly: Temp/Assembly-CSharp-firstpass.dll)


    Please help me.
     
  24. Jromano0

    Jromano0

    Joined:
    Nov 9, 2015
    Posts:
    8

    More informations:

    I think that the buil of the laucher as made in the Asset structure, see this message:

    Assembly DLL name is reserved for internal use: Assets/MHLab/PATCH/Plugins/deploy/Launcher/zCoolDayz-launcher_Data/Managed/mscorlib.dll (did files generated by a build accidentally end up in your Assets/ folder?)
     
  25. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Since you're asking me for months for a step-by-step video, I decided to make one! Last night I had a free hour, so I made a quick video. Let me know if it is clear enough!

     
    Bartolomeus755, UltraTM and hopeful like this.
  26. IsntCo

    IsntCo

    Joined:
    Apr 12, 2014
    Posts:
    141
    Ever since I added PATCH, it requires Admin privileges - is that expected?
     
  27. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Yes sir!
    Each executable that needs to edit files, move them or delete them should require admin privileges :p On unix systems you can solve it with chmod, on Windows you have UAC.

    If you're using WinForms version, I provided for an app manifest to request admin privileges. In Unity version this is not possible within Unity Editor!
     
  28. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    New version (2.1.0) submitted to the Asset Store! I didn't added all bugfixes I have in my mind, but I added new nice features that I was planning for months, this is the official changelog:

    • CORE - IMPORTANT: Solved platform dependent issue for root path on Linux

    • CORE - IMPORTANT: Introduced in-game embedded patching process

    • CORE - IMPORTANT: Introduced self-update feature

    • CORE - IMPORTANT: Introduced locked/running files update

    • CORE: Introduced “IsDirty” internal state to communicate when Launcher needs to be restarted

    • CORE: Introduced new WPF Standalone Launcher

    • CORE: Introduced news system

    • CORE: Introduced patch notes

    • GUI: Introduced options and tools for Launcher

    • CORE: Added “Force repairing” feature

    • CORE - IMPORTANT: Solved privilege issue for OSX after patch process

    • CORE: now Patch Builder creates an empty versions.txt when opened for the first time
     
    UltraTM, bradshep and hopeful like this.
  29. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    Hello again,

    i downloaded the latest version and have some trouble with the standalone launcher yet. the application is not starting after launch button pressed. I debuged the project and find out, that many variables in the settingsmanager are not setted. The launch app for example, has the default path to the launcher. But other variables are correctly setted.
    Any suggestion about this?

    And another Question. I planned to use the standalone launcher as installer and download the newest patcher also. Should i also upload version and index files similar to the patches? And how can i get them?

    Good job so far
     
  30. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Uhm, they should be setted. If not, you can still set them to fit with your paths (there is a method you can edit, in case).
    Yeah, you should upload atleast an empty versions.txt and the build you want to download!
    Thank you! :)
     
  31. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    It seems, that it doesn't work. In the config i setted install_patcher to true and give a suitable patcher_download_url.
    on the ftp server site, i added an empty versions.txt and a folder called 1.0.0 with all the launcher files in it.

    any suggestions?
    thx
     
  32. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Contact me on Skype/Discord: we can plan a Supremo session to help you with this!
     
  33. bradshep

    bradshep

    Joined:
    Jan 5, 2014
    Posts:
    49
    Having bit of trouble starting the launcher from installer and game from launcher. I created a build using the Unity patch builder (put current game version in "current" folder and launcher in the "patcher" folder and built first version). For some reason the launcher data folder does not copy into the build--is that supposed to happen? I couldn't run the launcher without copying its data folder into the build version folder.

    After I built an installer I ran it as administrator and was able to successfully download all of the build files, however it did not start the launcher when it finished. The log said the installation completed but "The requested feature is not implemented." after looking for the executable shortcut.

    When I copied the launcher data folder into the programfiles/game folder I was able to start the launcher and successfully look for patches, however, after it was done patching it didn't start the game executable. There was no error message other than "No remote patches available!"

    I am using Windows 10 and the integrated patcher style for both installer and launcher but as a standalone installer/launcher (i.e. not embedded into the game itself).
     
    ManHunterITA likes this.
  34. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Contact me on Skype/Discord: we will plan a Supremo session to solve your issues!
     
  35. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    problem solved allready, but thx for the offer. I have few more questions:

    Is it possible to get the current version via script in unity?
    Is there a build server support? (Jenkins etc.)

    and one more request. Can you please use namespaces in the future?

    thx for great support
     
    ManHunterITA likes this.
  36. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I'm glad you solved your issues!

    1) Yes, it is possible: LauncherManager.GetCurrentVersion() (it is an instance method)
    2) No, not yet: but you gave me a nice idea
    3) Yeah, of course: the entire code in MHLab.PATCH.dll (or full version) is under namespaces. Only things haven't namespaces are in MHLab/PATCH/Source/Launcher and PatchBuilderWindow.cs

    Thank you for your compliments!

    --------------------

    I'm thinking about a new addon for P.A.T.C.H.: something like Battle.NET. An app hub that can manage multiple apps/games in a single Launcher, with installer/repairer/patcher features.
    What do you think about it?
     
    Last edited: Jul 20, 2016
  37. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    how can i get a launchmanager instance?

    battle.net like extension is a nice idea
     
  38. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    In your Launcher.cs script you already have a LauncherManager instance: it is called m_launcher, it is a Launcher class member.

    I'm glad you like it! :)
     
  39. diegonatibes

    diegonatibes

    Joined:
    Jul 20, 2016
    Posts:
    6
    Anyone knows how to access the config path when the config file has been added as a resource in the build?
     
  40. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    Hello again!

    at the moment i have the problem, that in few cases the launcher stucks while downloading, then logs something about cleaning but nothing happens anymore.

    it seems that after restarting the launcher, the complete donwloading process starts new.

    any idea
     
  41. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Are you running it as admin?
     
  42. Hydrargent

    Hydrargent

    Joined:
    Dec 7, 2015
    Posts:
    4
    Hi there ^_^

    First of all, congratulations for your work on P.A.T.C.H. It is quite awesome, but...

    When in the editor, everything works fine : http://[www.xxx.com]/[mygame]/patches - builds, etc.
    And the game is installed/patched.

    But when I build the launcher, I got this :
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Installation started!
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Checking... - Checking for remote service!
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Downloading file... - Downloading index file for installation!
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Starting files copy... -
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Skipping... - Skipping version file...
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Downloading file... - Downloading file Youpi.txt from remote server!
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Build 0.0.0.1 skipped! - Object reference not set to an instance of an object
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Skipping... - Skipping version file...
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Downloading file... - Downloading file Youpi.txt from remote server!
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Build 0.0.0.0 skipped! - Object reference not set to an instance of an object
    [P.A.T.C.H. - 7/22/2016 5:55:26 AM] Installation failed, no versions installed!
    And it gets stuck on the screen below...

    Yes, I tried with a simple text file because I got the same issue with the full 500MB game :)

    Do you have an answer or a solution to my problem please ?
     

    Attached Files:

  43. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    yes
     
  44. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    i enabled the ftp usage in the config. Could this be the reason?
    btw. what happen when I disable this? Does the patcher then use the tcp protocoll?
     
  45. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Switch your P.A.T.C.H. project's API Compatibility Level from ".NET 2.0 Subset" to ".NET 2.0"! :)
    The protocol used is defined by your URLs: if you insert an "ftp://yoururl" FTP will be used, if you insert "http:// yoururl" HTTP will be used, etc.
    FTP usage flag is just to setup credentials in requests! I will change its name to avoid misunderstandings!
    If you disable it, no credentials are set in your Launcher requests.
     
    Hydrargent likes this.
  46. VRHorn

    VRHorn

    Joined:
    Apr 5, 2014
    Posts:
    10
    I can't solve the problem. Maybee the Server has a lot of disconnection. In the most cases, it helps to start the standalone launcher twice. The first time it download the half of the files, the second time the rest. Sometimes it works by the first start.
    In the error log, i only get the info, that no version was installed.

    in the config i set all urls to http. if i set it to ftp, i breaks after few files
     
  47. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Uhm, seems like a weird behaviour... Add me on Skype or join our Discord channel: you will show me your config, so I can try in my debugger!
     
  48. Hydrargent

    Hydrargent

    Joined:
    Dec 7, 2015
    Posts:
    4
    Everything worked fine, thank you very much ^_^
    This is a very promising project.

    And +1 +1 +1 +1 +1 +1 about your Battle.net-like launcher idea !! (Several games hosted in a same launcher)
     
    ManHunterITA likes this.
  49. teknic

    teknic

    Joined:
    Oct 18, 2012
    Posts:
    29
    Just started building a prototype today. I'm able to create versions and generate patches, but I want to test without an FTP server.

    We are working with a publisher whose distributors have requested a standalone patching system - i.e. we send them a patch which they make downloadable via their client as a separate file, then the game would automatically check for new local (already downloaded) patches and apply. Can P.A.T.C.H simply check a local directory for patches and apply from there? I assume the answer is yes, but I haven't found anything in the docs or forums which cover this setup.

    Thanks in advance.
     
  50. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Yeah, it can. P.A.T.C.H. can download from "file:///yourpath", so it means it can "download" files from your local drive.
    If your path is static, you can directly set them in your Launcher settings, if not your can change your settings at runtime!

    I usually test my builds and patches on local drive, instead of upload a lot of stuff on a server! :p
     
unityunity