Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

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

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

  1. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268


    P.A.T.C.H. is a professional solution for applications patching and updating. It can generate very small patches thanks to included file binary diffing algorithm.
    What it means? It means that if you change only 5 bytes in your build, P.A.T.C.H. will create a patch that will change only that 5 bytes on users' builds, instead of downloading the entire edited file.
    Your users will be able to maintain updated their application copies with no pain or headaches.
    And you will be able to create patches quickly with our included tool!

    It includes Unity integrated tools and standalone version (if someone prefers to use it).
    You can export Unity integrated P.A.T.C.H. for each platform you want thanks to Unity.
    Standalone P.A.T.C.H. can be compiled for each platform you need with Xamarin/Mono. You can check out this feature in P.A.T.C.H. documentation.
    P.A.T.C.H. supports each type of application: Unity based or standalone. If you can run Launcher, you can use this patching system: games, business applications, websites, etc.

    P.A.T.C.H. - Ultimate Patching System: https://www.assetstore.unity3d.com/en/#!/content/41417
    P.A.T.C.H. - Ultimate Patching System [FULL]: https://www.assetstore.unity3d.com/en/#!/content/46639

    Features:
    • Binary diffing algorithm;
    • Enables very small patches;
    • Bandwidth saving;
    • Checking for patches hash;
    • Strong patches compression;
    • Callbacks system to monitor what P.A.T.C.H. is doing;
    • Encrypted configs;
    • Linear and non-linear patches application;
    • Unity GUI integrated;
    • Customizable settings;
    • Outstanding flexibility;
    • Comes with launcher source code;
    • If download fails, it will take care to download again failed patch for customizable amount of attempts;
    • Launching argument to avoid obsolete clients;
    • Files download over FTP;
    • Localization system integrated;

    As usual, I would so much like to receive suggestions on what to change, add or delete.
    In addition, if any of you decide to buy it, I'd like to receive feedbacks on your experience! I want to improve this software to meet the needs of the user base that will use it!

    Documentation: http://mhlab.altervista.org/p-a-t-c-h-documentation/
    Issues tracker: http://mhlab.altervista.org/issues-tracker/

    Realtime Support
    Skype: manhunterita
    Discord: https://discord.gg/0ndGBjvogdY5SnIw








    Some Launcher skins created with P.A.T.C.H.:




    Best regards,
    Emanuele
     
    Last edited: Jun 27, 2016
  2. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Is it available in the asset store?

    If so link please...
     
  3. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    421
    Supports all platform?
     
  4. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Launcher is created with .NET, so you can run it on each platform that can run .NET.
    Btw, this version comes with Launcher source code, so you can change what you want in it.

    I'm working to develop Unity 5 integration!

    P.A.T.C.H. v1.1 is out!

    Changelogs:

    - FIX: patching process run now on a new thread

    - FIX: delete file process now retry to delete files for a customizable amount (to avoid deadlocks on file deleting)

    - FIX: PatchFailed event now doesn't shutdown the patching thread before GUI updating

    - Added core version reminder and launcher version reminder to Launcher

    - Added core version reminder and patches builder version reminder to Patches Builder

    - Added patch rollback feature: if patch process fails all changes will be discarded to avoid a build corruption

    - Added generation of patch files indexer in patch building process

    - Added hash validation for patched files



    Let me know! :D
     
  5. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Here we are with a new P.A.T.C.H. update! New version, 1.2p1: https://www.assetstore.unity3d.com/en/#!/content/41417



    Changelogs:

    • Added a new event to check when current build version changes
    • API: PatchManager class now exposes GetCurrentVersion method
    • Added a reminder of current build version in Launcher
    • Patching process now will apply ever the latest patch available, so if you have 0.1>0.2 and 0.1>0.3, P.A.T.C.H. will apply 0.1>0.3 patch, skipping 0.1>0.2
    • FIX: Version constructor now strips correctly “\r” char from remote hashes
    • Added some new LogEvents to describe better what is happening during long processing
    • Added new in-game GUI that informs your users when checking of launching arguments fails
    • Added forced run-to-admin behaviour to Launcher and Patches Builder for Windows
    • FIX: now Launcher will apply patches in linear way and non-linear way both, without Launcher
    restarting
    • FIX: added a “s” char in versions.txt example URL, in this way users can't be wrong
    • Added support for FTP credentials to download files over Files Transfer Protocol.



    Let me know!
    I like your advices to improve usability and user experience, so don't be shy!



    Best regards,

    Emanuele
     
  6. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    100
    What happened to P.A.T.C.H? Looked very promising.
    Assetstore says: Unfortunately, P.A.T.C.H. - Ultimate Patching System is no longer available. :/
     
    ManHunterITA likes this.
  7. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Hi,

    sadly P.A.T.C.H. was deprecated from Asset Store admins 'cause it contains an external .exe file... I don't know why only mine was deprecated (you can admire a lot of patching solutions that work with an external executable on Asset Store).
    I received no answer by Asset Store admins, I sent about 5 emails (they deprecated it on 6th October, still no answers as of today).
    I'm very disappointed about this decision, I can't understand this incoherence... But that's it.

    What I want to say? I'm developing a new version of P.A.T.C.H., this time integrated in Unity (of course with support to the external .exe too, for compatibility purposes). So don't worry: P.A.T.C.H. will be back soon! :)

    If you have ideas or advices, or just you want to see a feature in this software, this is the time you can suggest them to me! :)


    Best regards,
    Emanuele
     
    Last edited: Oct 22, 2015
  8. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    As I promised, P.A.T.C.H. is coming back!

    I worked hard to deliver Unity integrated version!

    I also recoded an huge part of core:
    • added a lot of comments
    • introduced a new callback system to easily manage what P.A.T.C.H. is doing (now progress bars work well)
    • improved the speed of building
    • reduced the size of generated patches

    I also added a lot of new classes and features that allow me to expand it in future, like Compressor class that will allow me to change compression algorithm (for now ZIP, but in my mind I have LZMA/LZMA2), like new Version class, new Hashing, etc.

    Patch Builder: http://prntscr.com/8x0snx
    It has little new features:
    • scan for latest build
    • auto build number increment
    Launcher: http://prntscr.com/8x0xh5
    With new Launcher you can now create your own design directly in Unity with GUI system. When you done it, you can build your Launcher and use it for your projects!


    I'm adding new features, so stay tuned and give me feedbacks! :D
     
  9. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    100
    Good to hear, your patcher seems the only one with binary diff support.
     
    ManHunterITA likes this.
  10. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    A new draft has been sent to the Asset Store, version 2.0.0 is now waiting for approval!

    New features has been added:
    - Added Unity integration
    - Localized thanks to Localizatron (it's my localization software)
    - All core functions was re-coded
    - Patches are now more small
    - Changed file hashing algorithm
    - New callbacks system added
    - New versions standard format


    You can find a lot of new information in P.A.T.C.H. documentation (it is already online: http://mhlab.altervista.org/p-a-t-c-h-documentation/).

    New P.A.T.C.H. related images has been added to the first post! Check them!

    Best regards,
    Emanuele
     
    Last edited: Nov 6, 2015
    Ultroman likes this.
  11. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I'm still waiting for an answer from Asset Store admins.

    Don't worry, P.A.T.C.H. will be back soon! You can already find new version on my website.

    In meanwhile, I also added new features (they will be available in next release, 'cause I don't want to reset the queue position of my sent draft):
    I added an installer/repairer tool, it will allow you to distribute your game with a single file. This tool will take care of download and install your game on users' device (you can choose install directory, shortcut creation, etc).
    If you run again the installer, it will check and eventually repair your users' game installation (in according with your remote build indexes) by downloading again corrupted files.
     
  12. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
  13. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    Ciao Emanuele. Potresti assistermi in questo errore:

    NullReferenceException: Object reference not set to an instance of an object
    Localizatron.loadLanguageTable (System.String fileName) (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:56)
    Localizatron.SetLanguage (System.String language) (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:26)
    Localizatron.Init () (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:83)
    Localizatron.Awake () (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:87)
    UnityEngine.GameObject:AddComponent()
    Singleton`1:get_Instance() (at Assets/MHLab/PATCH/Localizatron/Core/Singleton.cs:31)
    Launcher:Start() (at Assets/MHLab/PATCH/Source/Launcher/Scripts/Launcher.cs:45)


    Quando lancio li Launcher mi tira questo errore. Ho riempito tutte le caselle correttamente nel Inspector ma qualcosa non va.
     
  14. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Of course. If someone get this error is because you need to create a "en_EN" localization file in Window > Localizatron.

    I forgot to include a localization example files in last package I sent.
     
  15. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    This is the first patch system asset that works well for me. I was having problems because i did not understand the messy documentation. For resolving that I'm making a step by step guide. The software is working good. I'm using Windows 10 and Unity 5.2.3. I was able to upload a simple game, make a patch, upload the patch, make a launcher that download the path, make the update to the game and execute the game updated. The interface is simple. The workflow it was a bit tricky.The support take a bit of time but was grate!
    I'm very happy. I wish he improve as much as he can the documentation in detail. I will help in this if he agree.Thx
     
    Last edited: Dec 5, 2015
  16. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    Step by step guide windows 10 Unity 5.2.3 PATCH 2.0.0

    Please modify and improve this tutorial as you wish.


    I didn't like the documentation I found in this asset. I prefer a manual! As a client I made this user guide. With P.A.T.C.H. you can create a launcher for updating your game beyond your imagination with the Unity Game Engine or your own software using P.A.T.C.H. external tools.


    How to use it


    Since the process of updating a software is complex in general, this section will let you understand how to use P.A.T.C.H. in a simple example. I like P.A.T.C.H. because is really smooth but can be difficult the first time. So this guide try to help beginners in a simple scene. We are going to make a simple game that can update itself. Please follow this steps draft guide and improve it as you wish.


    Making a game

    Let’s start making a simple scene, this will let you understand the workflow of using P.A.T.C.H. But first we need to make some extra work. Since the file is new it is possible that your antivirus will not recognize it. Later this game will be updated and it will be run from another application. We need to configure your antivirus for allowing this to happen. Same antivirus isolate the application or do not let them run other applications. So we can make a special folder where to run the game and later the patcher or updater launcher. Name this folder “PATCH_Example”. We are going to use this folder for all your operations regarding two particular Unity project. In it it will be our game project and the launcher project.

    example:

    C:\Unity\PATCH_Example\

    Then go to your antivirus security section and look for auto sandbox if there is one. Add the folder PATCH_Example to the ignore list. So it does not isolate the applications that run into it. You can add also Unity.exe in the exclusion ad if there is an option rule, change it from allowed application to installer Updater.

    Now you are ready and you can start making the game.

    • Open Unity as administrator. This is a good way and if you do not do it you can get problems along the road.
      • Go to your Unity icon, right click
      • In the long list, choose run as administrator
      • Enter the password if needed
    • In this Unity we are going to make a Game in a simple scene.
      • Choose “+NEW” in the top left icon
      • Enter project name “test”. This will be the name of the game.
      • Choose the location path in your PC. C:\Unity\PATCH_Example\ and add a folder name: "Game". and select it. The Location full path must be: C:\Unity\PATCH_Example\Game
      • Make it 3D and when you are ready choose “Create project”
    • Now we are going to save the game.
      • Go to “File” , “Save Scene” and
      • call it “test 0” or the name you want.
    • Make a build of the game
      • Go to “File” -> “Build Settings”
      • Add the scene by pressing “Add current”
      • Select “PC Mac Linux” and click “Build”
      • In the window make a folder call it “GameBuild”
      • Open the folder “GameBuild”
      • And in it add the Game name that in this case will be “test”. This name is important
      • Click "Save". And Unity will start building the game.
    • The build will be created and a folder window will appear containing the game “test.exe” and a folder "test_Data". This will the game that we will update later. Do not close this window.
      • Minimize the window containing “test”game.
      • In Unity, close the build settings window and
      • Do not close Unity, minimize it too.


    Making the launcher

    You can add P.A.T.C.H. in your game project with no problems and use it (or build it) from that location. Definitively, you don't need to create new project for P.A.T.C.H. because it is integrated as simple Unity plugin, but for this example we are going to make the launcher in a different Unity editor. We will have two different Unity projects open. This way it's simpler to manage the game from outside the firs-time. And if there is a problem updating the asset it will not interfere with your game production.
    Since the launcher will call and run the game “test.exe” we need to make the same configuration first to our PC. We need to tell the antivirus to not isolate the application or not to execute it in a virtual environment. Since we have done this before while setting up the folder “PATCH_Example”, we will use this folder. We need to make a new Unity application in the folder “PATCH_ExampleC:\Unity\PATCH_Example\ it will not run virtually. Remember to open Unity in administrator mode following the step by step.
    • Open a second Unity as Administrator mode. This is possible since Unity 5.
      • After entering the password, choose “+NEW”
      • in Project name: “New PATCH Project”
      • Location Path: In the path “C:\Unity\PATCH_Example\" add a new folder next to "Game" folder, call it “Launcher Example”. Select it. The final full Location path must be: "C:\Unity\PATCH_Example\Launcher Example"
      • Make it 3D and when you are ready choose “Create project”
      • In top bar go to “Window” -> “Asset store”, if is not open.
      • Choose P.A.C.H. download it and import
    • You can find same alerts (3 warnings in console). Reset the application
      • In the Unity tool icon bar on the right click "layout" and choose “Default” to reset the the application interface layout. This will close the asset store.
      • Now save the Project. Not the Scene.
      • Close Unity and open it one more time as administrator mode. Enter the password.
      • Choose “New PATCH Project” this will reload the application. Notice the as admin mode the Unity projects list is different from opening in a direct way.
    • Now we are going to make the first version note containing the version number.
      • When Unity is open, choose in the top bar “Window” -> ”P.A.T.C.H” -> “Patch builder”.
    A P.A.T.C.H. tab window will appears. This also makes a special PATCH folder. With the first run (when you click on Window -> P.A.T.C.H. -> Patch Builder), it will create a folder in your project's root folder called "PATCH"; it contains all directories and files that P.A.T.C.H. needs.
    Do not press “New version”. If you press "New version" button, P.A.T.C.H. will give you:


    "Something goes wrong during new version building process init!"

    This is because there are no info in the "current" folder. You need to fill your "current" directory with your game build. In my case if you have done other builds you can get an error:
    "Version checking error! Please check your version file!"

    In any way we need to configure Patch builder first. We are going to add the build version of our game to a particular folder. Now the folder "current" is empty and we need to add to it the game.
      • We need to go to "current" folder that will be in the path: C:\Unity\PATCH_Example\Launcher Example\New PATCH Project\PATCH\current We can go there by selecting in the editor the tab “Project”, "Assets", right click and select “Show in explorer”. this will open a window located in “New PATCH Project”. In it there will be PATCH folder.
      • Go into “PATCH” folder and there will be 3 folders: builds, current and patch
      • Go into “current” folder. Here we need to put the build of the game.
      • Do you remember that we minimized a window containing our game? Now is time to open it and put it side by side the “current” folder.
      • Drag and drop copying the content of “GameBuild” into “current”. You need to copy or move the “test.exe” file plus the folder “test_Data” into the folder "current". You can copy or move it.
      • Now return to Unity “New PATCH Project”.
      • In the editor there is a tab name “P.A.T.C.H.” that was previously opened. You can doc it in same place in the inspector as you wish.
      • Close the P.A.T.C.H. builder tab and reopen it.
      • Now you can press “New version” for making the game file version. If is hidden or if you have hit "New version" previously it will be hidden so restart Unity or reset the interface by clicking "Default" in the top right and then re-open Patch builder: Window > P.A.T.C.H. > Patch Builder. And click "New Version" only one time. If you had follow all the steps accurately, you must get blue lines and a text telling Congratulations: “A new build version has been processed!” and ”Build completed!”
      • Now save the project by going into “File” -> ”Save Project”. Do not confuse, it' is not save scene, it is save project. This is important if not there is a possibility that Patch builder is reset.
      • Return to the explorer window where it's opened “current” folder.
    • As you see the folder “current” is empty now the game is in the folder “build” with extra files
      • Go up to the PATCH folder and then go into “build” folder. There is a version 0.0.0.0 with extra files. Ignore this extra files for now.
      • Go into the folder “0.0.0.0”. Here is your not compress game and a game “version” file.
    • In this folder we need to include the launcher and we are going to do that later. The launcher will look into the game “version” file before calling the “test.exe” app game. Before that we need to configure and make the launcher.
      • Do not close the window. Minimize it
      • Now we go back to Unity “New PATCH Project”
      • Open the example scene “Launcher” that is in:
    Assets\MHLab\PATCH\Source\Launcher\Scenes\LauncherStyle1
    • In the Hierarchy click the game object “Launcher” so we can look it in the inspector.
    • In the Inspector there is a component name “Launcher" c# script
    • In version File Download field you must put the URL of your server where will be the next version file. we haven't done the file yet but you need to imagine and choose a URL path where will contain the version file to read:
    http://yourserver.com/...path.../yourgame/patches/versions.txt

    • In Patches Directory URL you need to add the path URL of your server that will contain the files to update your game.
    http://yourserver.com/...path.../yourgame/patches/

    • Build Directory Is not used in this example. Leave it how it is.
    • Go to App To Launch and add “test.exe” that is the name of the game to be launched after the update. leave the rest as default.
    • The launcher will not work in editor. Do not press play and launch it. If you did so you’ve probably got a message:
    NullReferenceException: Object reference not set to an instance of an object
    Localizatron.loadLanguageTable (System.String fileName) (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:56)
    Localizatron.SetLanguage (System.String language) (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:26)
    Localizatron.Init () (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:83)
    Localizatron.Awake () (at Assets/MHLab/PATCH/Localizatron/Core/Localizatron.cs:87)
    UnityEngine.GameObject:AddComponent()
    Singleton`1:get_Instance() (at Assets/MHLab/PATCH/Localizatron/Core/Singleton.cs:31)
    Launcher:Start() (at Assets/MHLab/PATCH/Source/Launcher/Scripts/Launcher.cs:45)

    Because we need to create a localiz
    ation file with Localizatron. We must resolve this first.

    • Go to Window -> Localizatron . (Cool name!)
    • Add in the empty field en_EN and press “Add new location file”. This will add a language English. Do not add more for this example.
    • Just close the Localizatron tab
    • Save the scene "Save Scene as" with a new name, for example "My Launcher"
    • And save the Project.
    • Do not close Unity. Do not Minimize it.


    Adding the launcher to the game

    Now that we have made the configuration to My Launcher, we are ready to cook it (compile it making a build). We are going to build and run the launcher in the same folder where is the game.

    • In unity My launcher - New PATCH Project, we must build My Launcher scene in the correct directory next to the game where is the game "version" file.
      • Make a build, by clicking in “File” -> “Build Settings”
      • Select “Add current” to add the scene in the build
      • Select “PC Mac Linux StandAlone”
      • And press “Build and Run” so we can make a first test. A window will appear.
      • Select the folder “PATCH” -> “builds” -> “0.0.0.0”.
      • In the folder “0.0.0.0” choose a name “launcher”.
      • Click “Save”. It will start making the build and then it will run.
      • Mark the check box Windows to [true] and hit “Play!”. So the Launcher will start.
    • The Launcher must run and will try to check for updates. Just move the window to refresh the launcher status if the bar are hidden. The launcher can´t check the version because we didn't make the folders in the server and launcher can't find the files. But will show in the GUI a message "Found version 0.0.0.0". So we need to upload the updates to the server.
      • You can try to run the Launcher as administrator mode.
      • Close the Launcher.


    Uploading the game to the server

    PATCH does not include indications for making an installer. Or a tool to upload to the server via FTPS. Can be in the future with further updates. At the moment the installer feature is ready and will add it in next release.

    What we can do is to Upload the folder “0.0.0.0” to the server with a different name. All you need for sending it to a friend or a player is: copy the folder “0.0.0.0”, rename it and zip it. The first version of your game will be there in that zip. You can upload to the server but remember that in this example, it will not work until we have the first patch. Do not change the name of the original folder “0.0.0.0” inside PATCH\builds. Make a copy of it instead.

    • I suggest first to copy the folder “0.0.0.0” to a new location in your PC. For example into: C:\Unity\PATCH_Example\File To Upload\0.0.0.0 Fitting into PATCH_Example you do not need to make configurations to your firewall or antivirus
    • Then change it name from “0.0.0.0” to “MyGameName
    • Zip it or make an installer using same tool as for example winrar, wix, etc.
    • Upload the file to the server and make a download link to it.
    We need to make and upload the path before downloading and playing the game in this example. There is always a better way to do all this but this is the way it works for me. So lets make the patch!



    Making a modification of the game

    Now return back to the Unity where is open the game. We minimize it in the background. If you close it, open a new Unity editor in administrator mode. In it make the modifications of the game as you wish. I will go faster because now you know where to click.

    • Go to Unity “test” game for making same modifications and open the scene "test 0" if was close.
    • Create for example a 3D object cube.
    • Now "Save Scene as" if you want “test1” or “Scene1”. this is not necessary but is nice to be organize
    • Save the project
    • Build the game by clicking in Build Settings
    • Remove the old scene “test 0” and add the new scene “test1”.
      • To remove the old scene “test 0” select it and press delete.
      • Press “Add current” to include the scene “test1”.
    • Click “Build”
    • A window will pop up and choose the same “GameBuild” folder. The build will be made in the same position. The name must be the same “test”. or if you wish you can build it directly in "current". I will save it here in Game in this example.
    • Press “Save” button
    • After the build is done, a new explorer window will open. Select the test.exe file and the “test_Data” folder.
    • With the two selected, right click and choose copy. We are coping the files to the “current” folder
    • Open the other explorer window that was minimized. It will probably be in the folder “0.0.0.0” and go to PATCH/current folder. In "current" folder that was empty now we are going to pass the new version of the game.We are going to copy or move it as you wish.
    • Past into this “current” folder the game. Or make the drag and drop. You are ready for making the patch

    Making the patch
    If you started reading from here for making a patch, please follow or read the steps before: “Making a modification of the game”.

    Using the patches builder you can quickly and easily create a patch between two build versions. If you want the external version you will find it in
    Assets/MHLab/PATCH/Source/PatchBuilder/PatchBuilderWinForms/PatchBuilderWinForms.zip.
    In case you want to use the external one, extract it where you want it . I recommend out of Unity project!

    In this case we are working in Unity with a Unity game so we are going to make a patch there.

    • Open or return to Unity “Launcher” where there is the NewPATCH project. Remember to open Unity in administrator mode if you have close it previously.
    • Close the Build settings tab window if is still open.
    • The “PATCH” tab patch builder tool probably is open if not go to “Windows” -> ”PATCH” -> ”Patch Builder”. Now you are ready to make the patch.
    • You can choose the New version number but we will live it as it is for now. Probably will be 1. It updates automatically each time we press the New version button
    • Click in “New version”.
    • In my case i found this error but no customers reported the same error yet. Is probably my PC or my particular configuration. If you find this error:
    NullReferenceException: Object reference not set to an instance of an object
    PatchBuilderWindow.OnPatchBuildingContext () (at Assets/MHLab/PATCH/Source/PatchBuilder/Editor/PatchBuilderWindow.cs:298)
    PatchBuilderWindow.OnGUI () (at Assets/MHLab/PATCH/Source/PatchBuilder/Editor/PatchBuilderWindow.cs:224)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222

    Then you need to… Save the project and the scene. Restart Unity or reset the interface to default and reopen "Patch builder". Remember if you restart the Unity application, open it in admin mode. Now retry one more time pressing “New version”. All must work fine.
    • If all works fine a blue line rendered with a message in it “Build completed!”. You have created a build but not the patch yet. The build will be in the folder “PATCH/build” name “0.0.0.1”. Now we need to create the patch.
    • You can see now that there are more options in the patch builder. Just hit “Build patch”. P.A.T.C.H. will create a new different patch between those builds, it will inform you on what it is doing and, finally, it will create or update the versions list. A blue line will show you the progress and a text “Patch completed” will appear.
    • If we go to the PATCH folder containing the 3 folders “builds”, “current” and “patches” now we understand for what they are for.
    builds: this directory will contain our processed builds

    current: in this directory we will place our current build. We can directly build our project in this directory from Unity3D without problems.

    patches: in this directory we will find computed patch archives and versions list, with archives hash. this are the files that we will upload to the server.

    logs: if some error occurs, patches builder will create a log directory with a log file to store information about errors.


    • Save the Project. This is important.

    Uploading to the server


    The folder “patches” contain all what we need to upload to the server. Open the folder “patches” and in it we will find 3 files. In particular the file “version.txt” contains instructions: 0.0.0.0>0.0.0.1>yGcR9m0ox6bYbZIIdmlv4LFzvX0>ZIP that tells the launcher what to update, the hash and the compression mode of the patch itself. We can now upload all this files or the folder “patches” to our server in the same location as we add into the inspector URL.

    http://yourserver.com/...path.../yourgame/patches/



    Testing the Launcher


    Downloading and playing the game

    Now you can download the zip game, extract it into a folder you wish and execute it by running first the launcher in admin mode. The application must run as before. Remember to include instructions on how to run it next to the download button in your website.

    • Now we open the launcher that is in: C:\Unity\PATCH_Example\File To Upload\MyGameName buy right click in "launcher.exe" and choosing open as administrator mode.
    If you are having problems at this point the only thing I can imagine is that the firewall, the antivirus is not letting you to run it correctly. So make the application trust worthy. This is sometimes needed because same antivirus does not allow an application to call and run other application.

    If all has been done correctly and if I was good enough to make this step by step guide, now when you start the launcher, it will check the server patch version number, it will compare it to the game version number and make the download.



    Adding Launcher to your game

    You can modify the step by step guide making a new Launcher for your game. I recommend to name the launcher as the name of your game. And the game as the name of the scene or level. In this way the user is not confused. Better if you put the final game in a child folder so the user can find first the launcher with the game name.exe.


    Examples ideas

    Other modifications can be done. As for example make silent updates. Or you can modify the launcher to work when the application is closing. In this way the player can play without waiting. You can include a turn my PC off when done option. Other example is to download the update at start and start the game. When the download is finished it can make the installation of it at the next start.
     
    Last edited: Jan 28, 2016
    Shawn67 likes this.
  17. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Thank you for your beginner step to step guide, I think someone unskilled with Unity can use it for his first approach. At the moment, all my customers managed P.A.T.C.H. with current documentation: I invite them to write their suggestions on it to improve current doc.

    As I said, it can be useful, but we need to make some corrections, because it is wrong in some points. I will mark wrong words or sentences in red, so I will add a comment to explain it.

    As you can see, the name is wrong.

    I'm sorry you found the process so complex, please let me know what you can't manage in it. I think patches generation and patches application is really smooth at the moment (no customers since today found it so hard), but never say never: we can improve it.

    You don't really need it. P.A.T.C.H. already manages this. With the first run (when you click on Window > P.A.T.C.H. > Patch Builder), it will create a folder in your project's root folder (in other words, directory that contains your Assets folder) called "PATCH"; it contains all directories and files that P.A.T.C.H. needs. I suggest to use that folder for all your operations regarding that particular Unity project.

    Run Unity as administrator is a good advice. If you plan to create your project in a special OS directory or your current user doesn't own read/write permissions on that folder, you have to run Unity as administrator.

    This is wrong. You can add P.A.T.C.H. in your game project with no problems and use it (or build it) from that location. Definitively, you don't need to create new project for P.A.T.C.H. because it is integrated as simple Unity plugin, but you can if you want.

    And now just a little correction: if you press "New version" button, P.A.T.C.H. will give you "There are no current builds!" to inform that you need to fill your "current" directory with your game build.

    To be precise, the installer feature is ready. I didn't include it in current draft just because this would reset Asset Store queue. I will add it in next release. At the moment, it supports local or arbitrary installation folder, desktop shortcut creation, game repair.

    Regarding automatic upload to FTP servers, I have no problems to add this feature. This thread is here to collect customers' advices!

    I can't reproduce this error and no customers reported me this. As I said last time, probably it is about Windows 10 that you are using: I need to test it on a fresh copy of Win10. I will do it soon. Thank you! :)

    Nice ideas, I will log them on my logbook! There are a lot of new features to add on it! :p



    I commented each part that requires an edit! Please modify your post accordingly with new information, so users will not be confused!

    Thank you again!


    Little update:
    I fixed an issue on Mac systems. It requires a DLL update, I will include this fix in next release. If you are a Mac user and you purchased P.A.T.C.H., feel free to mail me and send me your invoice number! I will send back a new DLL with new fix!

    Thank you,
    Emanuele - MHLab
     
  18. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    v2.0.2 (Pending Review on Asset Store):
    • I/O fix: workspace cleaning up during patches application

    v2.0.1:

    • Solved ZIP compression bug on Mac and Linux systems

    • Solved linear patches application loop

    • Added missing localization files

    • Solved three pending warnings
     
  19. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    New version (v2.0.3) is now on Asset Store!
    Changelogs:
    • One-click-deploy introduced
    • Deploy folder structure created and relative settings added
    • Solved a weird path-relative bug on Mac systems
    • Solved LaunchArg parameter override bug
    • FatalError is now called when archive download fails or archive hash checking fails
    • FatalError is now called after a rollback
    • Cleaning up of single archive file when download fails or hash checking fails
    • Detection of OS related files like “.DS_Store” or “desktop.ini”
    • Important: solved OS reliant patch indexer bug, regenerate your patches!
    • Added “Roadmap” in this document
    • Changed CommandLine script to fit with new Unity 5.3 API (about SceneManager)
    • Improved download manager, now it works also on “file://” protocol (so on file system)
      • It offers new information about current download
      • Download progress is now available
      • Download speed is now available
    • Added package with Unity 4.6.9 and Unity 5.3.1 to improve compatibility

    Also, I added a roadmap with all future developments:
    • Test and fix on Android and iOS
    • Test and fix on Mac
    • Improve current download manager(introduced in v2.0.3)
      • Add download progress (introduced in v2.0.3)
      • Add download speed (introduced in v2.0.3)
      • Add download restore after patcher closes
    • File blacklisting or something like .gitignore
    • Create self-update feature
    • Create documentation for installer and create examples for it
    • Create documentation for installation repairer and create examples for it
    • Create in-game integrated patch process
    • Create automatic patches/builds FTP uploader

    New full source code package is available on Asset Store! It contains all P.A.T.C.H.'s core source codes!
    P.A.T.C.H. - Ultimate Patching System: https://www.assetstore.unity3d.com/en/#!/content/41417
    P.A.T.C.H. - Ultimate Patching System [FULL]: https://www.assetstore.unity3d.com/en/#!/content/46639
     
  20. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Submitted new 2.0.4 version!
    This will solve a bug over new Downloader, under Unity version patcher!
    I added new compression methods (and uncompressed one too, for quick debug purposes).
    I also added an FTP uploader to upload your builds and patches more quickly!

    In next release probably I will unlock installer and repairer features! I lock them since 2.0.1 version, but unfortunately I had no time to create documentation for them and to test them properly!

    I also want to thank my customers for their nice work, they suggested me bugfixes and features to add!

    Stay tuned,
    Emanuele - MHLab
     
  21. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    This Asset is improving well. And is stable since start.

    Thx for this new second asset!

    Is a must! Keep updating and improving it. Nice work
     
    Last edited: Jan 28, 2016
    ManHunterITA likes this.
  22. alteregogi

    alteregogi

    Joined:
    Apr 13, 2015
    Posts:
    8
    any ETA for android and iOS ?
    can't wait for it!

    awesome and interesting plugin!
     
    ManHunterITA likes this.
  23. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I tried P.A.T.C.H.'s workflow on Android some days ago: I'm not satisfied of how P.A.T.C.H. fits with mobile devices, so I have to improve it. The target is to have a mobile patching system like the one for PCs. :)
     
  24. Silent8Strike

    Silent8Strike

    Joined:
    Mar 10, 2014
    Posts:
    29
    I've just got P.A.T.C.H. set up and working, and so for I'm pretty happy with it. However I do have a question and a few suggestions.

    First, how secure is this method of patching, especially from a web server point of view? This is far from my area of expertise, but there seems to be no way to ensure a secure connection between the Launcher and the patch server. Right now anyone can access the patch files on the server which would be a serious security issue.

    One of my suggestions is regarding access to more functionality from the LauncherManager class when making a Launcher in Unity. Right now there appears to be only one call that can be made that performs the entire patching process. Having the ability to check for an update first, and have a separate button to start patching would be helpful.

    Essentially I'd like to be able to have full control over what the LauncherManager is doing with functions like CheckFor NewVersion, DownloadPatch, ApplyPatch, Cancel, etc. Also having the ability to pause the update process if requested or if the application closes and resume it next time would be a very good feature. This is standard on most every game launcher out there.

    I'm not sure if this is possible due to licensing, but adding support for 7zip compression would be great. Its an overall superior compression method compared to zip. I'm using this for a very large project with builds well over 8GB uncompressed so making compressed files smaller is extremely important.

    Finally, I agree with AlanMattano in regards to the need for more documentation. His expanded guide was extremely helpful while getting this working.
     
    ManHunterITA likes this.
  25. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    First, thank you in advance for all! :)

    I think it isn't a big security issue. If your users can download patch files with patcher, they have these files on their hard drive. :)
    Anyway, you can try to protect your remote folder with credentials. In your Launcher just fill credentials fields and enable FTP (you don't need FTP URLs, enable FTP just provide to set credentials).

    This could be a nice idea, I will probably provide it soon. When I worked on P.A.T.C.H. APIs I coded them to be more user-friendly as possible, so a single call to perform in your logics was perfect to my eyes. With callbacks and settings you can monitor and tune your patching process, so I thought it was enough for customers!

    The main trouble I have about exposing more methods is regarding additional complexity. A single method that performs all operations in a correct sequence versus more methods to mix together to obtain the same result.
    For a casual user the last one can be tricky and could introduce a new margin of error.

    Patch Pause is already scheduled on Roadmap, I was thinking to it some weeks ago: it can be useful.

    In latest release (2.0.4) I already added additional compression methods, so now P.A.T.C.H. offers: ZIP, TAR (uncompressed) and GZIP.
    I should add more methods in next releases, like LZ4, LZMA, brotli, LZO.

    This is true, I noticed how customers have a lot of questions about documentation. I'm working on a new doc format and I want to create a video to show the workflow.

    I also added a Discord server to provide real-time support: https://discord.gg/0ndGBjvogdY5SnIw
    Last thing: you can check Roadmap on documentation to see future improvements I planned!

    Thank you again for advices, I really appreciate when users help me to improve my softwares!
     
    Last edited: Feb 1, 2016
  26. Silent8Strike

    Silent8Strike

    Joined:
    Mar 10, 2014
    Posts:
    29
    Its great to hear you have more support and documentation planned, I'm sure that will help people get started. Also great to hear about the addition of more compression methods.

    I think you're correct that the simplicity of a single function to update is good for most people. It would just be nice to have the expanded control if you need it. I also might not be understanding all the callback system lets me do, (probably another good place for some documentation).

    Regarding security, you're right that once the user has downloaded the files they have them anyway. I know it will always be possible for people to get the files, I'd just like to make it a bit more difficult. The patch files don't worry me too much, but once the Install option is available and the full game can be on the server I would be a bit more worried. Maybe the option to encrypt the builds would be possible? At least for now I'll take advantage of the FTP support for a bit more security.

    Anyway it looks like there are lots of good additions planned, I'm looking forward to all the future updates!
     
    ManHunterITA likes this.
  27. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Yeah, I can provide for a single file encrypter when you upload a build.
    Uploaded build will be useful for install feature but also for repair feature, so I need unpacked builds on server.

    Anyway, you can use something like .htpasswd to protect your remote folder. I didn't tried it, but it should work well with FTP credentials included in P.A.T.C.H.! :)
     
    Silent8Strike likes this.
  28. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    A suggestion If it is posible:
    Can you move PATCH and Localizatron from "Window" top menu to "Tools". Same custom assets are using this assets "Tools" menu since they are tools and Window menu is too long almost use by Unity permanent windows stuff. Is a good idea since is faster to find custom imported assets from the asset store in a separate specific tool menu.


    Tools -> MHLab -> P.A.T.C.H.
    Tools -> MHLab -> Localizatron


    So they fit nicely with other utilities and is more compact. (and match Assets "MHLab" path)

    https://unity3d.com/learn/tutorials/modules/intermediate/editor/menu-items
     
    Last edited: Feb 3, 2016
  29. Silent8Strike

    Silent8Strike

    Joined:
    Mar 10, 2014
    Posts:
    29
    ManHunterITA can confirm, but to my knowledge Unity requires all assets to put any toolbar additions under existing toolbar categories. See here: https://unity3d.com/asset-store/sell-assets/submission-guidelines
     
  30. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Yes, it is exactly what Unity requires. Due to their submission rules I have to put Editor Extension in an existing top menu (like "Window").

    I like advices, feel free to write here all your suggestions! :)
     
  31. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    OK,

    But "Tools" is often use and is already there... so is "not add unnecessarily items at the top" and is "the most relevant category" as is part of:
    https://unity3d.com/learn/tutorials/modules/intermediate/editor/menu-items
    Also windows is full of staff and too long, it will be longer in the future and compressing in one menu the 2 items (PATCH and Localizatron) "Avoid chaos".
    An example of free assets using Tools: XT Utilities and a lot others more, the list is long.

    In any way Silent8Strike if you do not like it is ok for me like it is. I was suggesting.
     
    Last edited: Feb 3, 2016
  32. Silent8Strike

    Silent8Strike

    Joined:
    Mar 10, 2014
    Posts:
    29
    No, don't get me wrong, I think your suggestion makes sense. Unfortunately Unity doesn't allow it, and there is a chance of the asset getting rejected from the store because of that. The Tools category doesn't exist in a clean Unity install.

    Obviously you can do whatever you want with your own personal editor scripts, which is what that tutorial shows. Several of my scripts are in the Tools category, but only because I created it first.
     
  33. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    Last edited: Feb 4, 2016
  34. xnooztvfr

    xnooztvfr

    Joined:
    Jul 31, 2013
    Posts:
    7
    How to get source code for MHLab.PATCH.dll ? I need translation for the launcher..
     
  35. dementedAngst

    dementedAngst

    Joined:
    Sep 26, 2015
    Posts:
    2
    just started using p.a.t.c.h. and i have a problem.

    im using the integrated launcher, and storing the patch files on my web server

    when i start my application from the deployed launcher, the top bar reads "Downloading patch 0.0.0.0._0.0.0.1indexer from remote server" and shows the bar at 100% the second bar just says "downloading file..." and hangs half way.

    any idea what the problem could be?
     

    Attached Files:

  36. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I will be happy to move P.A.T.C.H. in Tool menu if this will be allowed (and my customers are comfortable with)!

    You can obtain a Full Source Code License here: https://www.assetstore.unity3d.com/en/#!/content/46639

    Based on your issue, you need to set ".NET 2.0" instead of ".NET 2.0 Subset" in your API Compatibility Level, located in your Player Settings!
     
    Last edited: Feb 8, 2016
  37. dementedAngst

    dementedAngst

    Joined:
    Sep 26, 2015
    Posts:
    2
    works perfectly now thank you =)
     
    ManHunterITA likes this.
  38. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Thank you too to trust in my softwares! :)

    I need to add this tip in documentation, to allow users to switch correctly between API Compatibility Level!
     
  39. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,096
    Suggestion: Do put only at the end in FQA. Try to put it also close to the beginning.
     
  40. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Yes, I wrote it in the first paragraph, as tip for users!
     
  41. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I'm working on next release (v2.0.5), this will be an huge release: check changelogs at the bottom of this post!
    I heard from your suggestions (thank you, my customers!) to create something you can appreciate!

    And this is a gift for all of you: I'm also working on a completely in-game integrated patching process. What does it means? You will be able to create a single build of your game that will integrate as first scene my patcher!

    After this, I also want to add a new example skin!

    I want to come out with it in this week! Make your suggestions now! :)

    • Solved pending warnings in FULL version

    • Added MHLab.PATCH.Settings namespace to Localizatron settings files, to avoid naming collisions

    • Added button in Unity Menu to quickly open workspace folder

    • Added flag to close Launcher on game start

    • Adjustments to Launcher script inspector
      • All fields are divided by categories

      • Added tooltips to help users to better understand what each field can do
    • IMPORTANT: greatly improved downloader code and its performances
      • Greatly improved download bandwidth usage

      • Greatly improved disk usage
    • Added build installer feature

    • Added build repairer feature
     
    Last edited: Feb 19, 2016
    Ashamen and Ultroman like this.
  42. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    I added those fixes:
    • Solved missing Mono certificates validation for HTTPS download URLs
    • Added multiple flags to activate/deactivate features
    I also started to work on new documentation! First chapters are already covered!
     
  43. skalev

    skalev

    Joined:
    Feb 16, 2012
    Posts:
    264
    Hi! I'm intereseted in this asset. I wanted to ask if this can be used to create patches for current gen consoles (PS4 / XBOone) as well?
     
    ManHunterITA likes this.
  44. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Hi @skalev
    I never tested it for PS4 or XBoxOne. Also, I have no possibilities to test it on consoles.
    If games on consoles have the same structure of PC, Linux or Mac: yes, it is possible.

    If you can discover it I will be glad to work also on console integration/testing!

    Best regards,
    Emanuele
     
  45. skalev

    skalev

    Joined:
    Feb 16, 2012
    Posts:
    264
    @ManHunterITA , I went to check, and I see now that unity added support for patching a PS4 build internally, so this won't be needed. Is there an evaluation asset available to test how well this works with our project for our windows release?
     
    ManHunterITA likes this.
  46. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Unluckily, I have no evaluation version. But you can ask me all questions you need! I also can show you the workflow on some screen sharing software!
     
  47. ManHunterITA

    ManHunterITA

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

    attached to this post you can find the new draft of new documentation! Please, let me know what to add, remove or edit!

    Thank you,
    Emanuele - MHLab
     

    Attached Files:

  48. cl9

    cl9

    Joined:
    May 31, 2013
    Posts:
    417
    I've been looking for a mobile ready patching system. Would you be able to elaborate on the type of issues that you've had with trying to introduce mobile support? When do you think you'll have a working (alpha or beta) version available?

    Thanks!
     
    ManHunterITA likes this.
  49. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    Hi @cl.9
    I tried P.A.T.C.H. on Android, in example. With its current architecture, I have some troubles:
    • APK content cannot be indexed by PatchBuilder, so P.A.T.C.H. at the moment can patch only APK: this is wrong. The APK is the "installer"/"container" of your app
    • If I decompress the APK, I have to rebuild the file signature: how? (not sure of this)
    • Android installs the APK content in various directories, spreaded over system: this is the opposite of the current workflow. P.A.T.C.H. can't locate these files because it expects to find all of them in its root folder.
    • Some of these directory are not writeable, so the patcher can't patch them with user's privileges
    • You have to root your phone to make them writeable

    Do you have any idea?
     
  50. ManHunterITA

    ManHunterITA

    Joined:
    Sep 3, 2013
    Posts:
    268
    And here we are with a lot of new features for v2.0.5!

    v2.0.5:

    • CORE: Solved pending warnings in FULL version

    • CORE: Added MHLab.PATCH.Settings namespace to Localizatron settings files, to avoid naming collisions

    • GUI: Added button in Unity Menu to quickly open workspace folder

    • GUI: Added flag to close Launcher on game start

    • GUI: Added multiple flags to activate/deactivate features

    • GUI: Adjustments to Launcher script inspector
      • All fields are divided by categories

      • Added tooltips to help users to better understand what each field can do
    • CORE - IMPORTANT: greatly improved downloader code and its performances
      • Greatly improved download bandwidth usage

      • Greatly improved disk usage
    • CORE: Solved missing Mono certificates validation for HTTPS download URLs

    • CORE: Added build installer feature

    • CORE: Added build repairer feature

    • DOC: New documentation added
    Finally, installer and repairer are introduced in P.A.T.C.H.'s workflow! They are tested and documented (you can see the new doc attached to this post).
    The last feature I want to add before release it is: ingame integrated patching process.

    Let me know your opinions!

    Best regards,
    Emanuele - MHLab
     

    Attached Files: