Mac Installer that can do patches?
by Blake Drolson · in Torque Game Builder · 08/10/2012 (4:30 pm) · 8 replies
Hi there,
we are looking at what method to use to handle the installation of our game "Drip Drip" to the users machine on Mac OSX. Specifically, we want the user to be able to apply patches later, and are wondering what the best tool for the job is?
We were thinking of using DMG files, I have already made a version and it looks fine and works simply enough, but I am unsure if it is straightforward to apply patches using a DMG system. The other option we thought about was using PackageMaker, it seems to be able to apply patches, but were not sure if it was necessary. Are there other installers to consider?
Anyone else have experience creating an install for the mac, one that had the ability to be patched easily?
we are looking at what method to use to handle the installation of our game "Drip Drip" to the users machine on Mac OSX. Specifically, we want the user to be able to apply patches later, and are wondering what the best tool for the job is?
We were thinking of using DMG files, I have already made a version and it looks fine and works simply enough, but I am unsure if it is straightforward to apply patches using a DMG system. The other option we thought about was using PackageMaker, it seems to be able to apply patches, but were not sure if it was necessary. Are there other installers to consider?
Anyone else have experience creating an install for the mac, one that had the ability to be patched easily?
#2
Also, does anyone know if apple's packagemaker can do patches? Any auto check functionality with it ( I am guessing know, but cant hurt to ask)??
08/16/2012 (7:53 pm)
Thanks for the link to Sparkle, can it do automatic checks at game startup to see if new patches are available?Also, does anyone know if apple's packagemaker can do patches? Any auto check functionality with it ( I am guessing know, but cant hurt to ask)??
#3
If you're using the package maker for anything, I'm assuming it's the MAS. If not, stop it. Just stop. Don't use package makers if you're distributing your own stuff. Use disk images :)
(As mentioned above, the MAS does delta patching.)
Other than using Sparkle's delta updates, I don't know of any good solutions. The best algorithm is in bsdiff, but you'd have to cobble together your own app based on that to patch. Might be worth investing a few days/weeks investigating if it matters enough.
08/16/2012 (8:19 pm)
Sure, just make a function available to call its update check directly, or call it in the engine setup before setting up the game window. You can read the docs (use latest repo version) for info on plist entries to adjust for frequency of the checks.If you're using the package maker for anything, I'm assuming it's the MAS. If not, stop it. Just stop. Don't use package makers if you're distributing your own stuff. Use disk images :)
(As mentioned above, the MAS does delta patching.)
Other than using Sparkle's delta updates, I don't know of any good solutions. The best algorithm is in bsdiff, but you'd have to cobble together your own app based on that to patch. Might be worth investing a few days/weeks investigating if it matters enough.
#4
08/16/2012 (9:05 pm)
Ronny thank you for the good info! Really appreciated.
#5
Did you find it was necessary to call a update function in C++ code for Sparkle? I have been trying to do it without C++ code changes, and was following the instructions here
https://github.com/andymatuschak/Sparkle/wiki
and here
http://guimkie.com/tutorials/adding-the-sparkle-framework/
but I cant get any updates to happen. Trying to figure out if there is a log or error messages.
Is the way Torque sets up int game window make it so the step 2 from the first link does not work (drag NSObject to mainMenu.nib, name it SUUpdater) ? Do I need to write code to call for an update when using Torque?
I am a bit confused here and would love any feedback on getting updates to actually happen. I have done the other steps, including generating the keys, and sticking them in the XML file, linking in the sparkle framework etc. Made sure my game is an app bundle too.
Anyway, if you have gotten Sparkle to successfully update a TGB game (or any torque game heh), would love to hear your details and peek at any sample Sparkle C++ code.
Thanks again !
09/27/2012 (6:59 pm)
Hi Ronny,Did you find it was necessary to call a update function in C++ code for Sparkle? I have been trying to do it without C++ code changes, and was following the instructions here
https://github.com/andymatuschak/Sparkle/wiki
and here
http://guimkie.com/tutorials/adding-the-sparkle-framework/
but I cant get any updates to happen. Trying to figure out if there is a log or error messages.
Is the way Torque sets up int game window make it so the step 2 from the first link does not work (drag NSObject to mainMenu.nib, name it SUUpdater) ? Do I need to write code to call for an update when using Torque?
I am a bit confused here and would love any feedback on getting updates to actually happen. I have done the other steps, including generating the keys, and sticking them in the XML file, linking in the sparkle framework etc. Made sure my game is an app bundle too.
Anyway, if you have gotten Sparkle to successfully update a TGB game (or any torque game heh), would love to hear your details and peek at any sample Sparkle C++ code.
Thanks again !
#6
I don't think I have the source where I did all this, though, so it would mean actual work to figure out again ;)
09/27/2012 (8:58 pm)
It's been a while since I experimented with it, but I had it working like any regular Mac app (for somebody else's game). The "mainMenu.nib" file in TGB should be working just fine for the SUUpdater object - anything in that file is created and initialised, and the init routine in the Sparkle updater object sets up any timers, does initial checking etc. Latest repo version of Sparkle tends to work best with anything.I don't think I have the source where I did all this, though, so it would mean actual work to figure out again ;)
#7
09/27/2012 (9:12 pm)
Ok thanks Ronny, I will keep banging on it! Good to know you did it thru the mainmenu.nib.
#8
First, I didn't have to write any code, it was all handled thru editing the info plist for the target, the main sparkle install docs were the best. I did have to add the SUUpdater object to the mainmenu.nib. I did make a menu item and drag the checkforUpdates action from the SUUpdater connection inspector to it to allow the menu item to work and make updates get checked for.
The most important thing was to get the latest code from the GitHub repository, and get a version that compiles clean. Then using the "sparkle.framework" that got built , and use it as the framework in your code, and this is the only way to get delta updates to work and get the binaryDelta tool necessary to make them. Also to use the binaryDelta tool you have to put it in a folder called "Frameworks" along with the sparkle.framework folder. they dont tell you that either.
Important Plist settings for your target...
SUFeedURL : the http address of your XML file with update info, do not put any spaces in the path or name.
Bundle version : this is how sparkle knows what version you have currently built.
SUEnableAutomaticChecks : set to YES to have your game check for an update at startup.
SUPublicDSAKeyFile : the public version of the DSA security keys you made, by default I think its dsa_pub.pem.
Oh and lastly, you need to bundle all your resources into your app, so that its a single file. To do that you need to drag main.cs and all the folders into Xcode resources. I found that I wanted multiple versions of the game resources, one for my demo, one for full game etc. To organize this, I pre-copied my different resources them into the engine/compilers/xcode folder, where I created a sub folder for each version of my resources (full game , demo). Then when I dragged the contents into xcode itself from finder, I turned off the copy resources if necessary checkbox.
Anyway, hope that helps anyone else trying to do this.
10/18/2012 (8:56 pm)
Ok just wanted to follow up post that I did get this working, took me a while to figure out but I got it. I am going to leave a few helpful tips for anyone else working with Sparkle.First, I didn't have to write any code, it was all handled thru editing the info plist for the target, the main sparkle install docs were the best. I did have to add the SUUpdater object to the mainmenu.nib. I did make a menu item and drag the checkforUpdates action from the SUUpdater connection inspector to it to allow the menu item to work and make updates get checked for.
The most important thing was to get the latest code from the GitHub repository, and get a version that compiles clean. Then using the "sparkle.framework" that got built , and use it as the framework in your code, and this is the only way to get delta updates to work and get the binaryDelta tool necessary to make them. Also to use the binaryDelta tool you have to put it in a folder called "Frameworks" along with the sparkle.framework folder. they dont tell you that either.
Important Plist settings for your target...
SUFeedURL : the http address of your XML file with update info, do not put any spaces in the path or name.
Bundle version : this is how sparkle knows what version you have currently built.
SUEnableAutomaticChecks : set to YES to have your game check for an update at startup.
SUPublicDSAKeyFile : the public version of the DSA security keys you made, by default I think its dsa_pub.pem.
Oh and lastly, you need to bundle all your resources into your app, so that its a single file. To do that you need to drag main.cs and all the folders into Xcode resources. I found that I wanted multiple versions of the game resources, one for my demo, one for full game etc. To organize this, I pre-copied my different resources them into the engine/compilers/xcode folder, where I created a sub folder for each version of my resources (full game , demo). Then when I dragged the contents into xcode itself from finder, I turned off the copy resources if necessary checkbox.
Anyway, hope that helps anyone else trying to do this.
Torque 3D Owner Ronny Bangsund
Torque Cheerleaders
Steam seems to have a weird way to calculate changes (I can't update The Witcher without downloading 12GB+), but a game consisting of many files fares better with any patching system.