User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 30

Thread: Creating Auto-Update program.

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Creating Auto-Update program.

    So I'm trying to create a generic auto-updating program that I can use in any future game/app.

    An auto-update program must use 5 main steps. I've already completed the first 3, just need help with number 4.

    1. Check a server for version information.
    2. Determine if version on server is more recent.
    3. If more recent, download software update file.
    4. Install update file to replace current version.
    5. Close and re-open the application to run new version.

    So, my application has the version check and download working just fine... I'm just not sure how to actually install the new update to overwrite the current application.

    Currently, the program is stored in a ZIP archive on my server. The application downloads this ZIP to the app-path. Now I'm trying to use the ZIP object to unzip it, but I can't figure out how it works at all.

    I know there has got to be a better method as well. Is there any way that I could create a patch file that would be downloaded instead? (So that a user doesn't have to download the whole program every time)

    What are some other methods of software updating. I want the process to be fairly automatic.

    Oh one more question.
    Currently the application checks for new software automatically at the start of the application. But I was wondering if there is a way to make it only run these events every 48 hours or so. I don't want it making requests to my server every time the user closes and opens the program.

    I need something that will not allow the actions to repeat until 48 hours have passed, even when the program has been closed and opened dozens of times. I'd probably use an INI file for the time storage. But is there a way to convert dates to an integer that can be easily compared mathematically?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Apr 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    I created a similar update system into one of my old applications.

    Unfortunately I found that when the updater unzipped and replaced the main program .exe, my virus software would identify this as suspicious activity and would block the program from executing.

    The solution I though of (but never tried) could be to have the program download a patcher and to invoke administrator rights when it's run.

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export Module
    xhedgehogx's Avatar
    Join Date
    Nov 2007
    Location
    NY, USA
    Posts
    738
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    That 48 hours thing had me thinking of, you should just have the program tell you about an update maybe once a week if there's one available.

    Similar to how iTunes does it. "Will check for update on X/X/XXXX"

    Of course, there's never a guarantee that the user will have the program open on that specific day. Maybe a couple checks a week? Or you can always opt-out of auto update, then just put a "Check for Update" button somewhere on it?

  4. #4
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    Yeah, thats basically what I had in mind. My idea was to have an option to "Check for updates every X hours" with the minimum value being 48. Or maybe even just set it to days, with the minimum as 2.

    But it won't check on a specific date that would require you to be on. It'd just compare the last update to the current date (as an integer) and if x > 2, it would run a single update routine.

    This way it runs only AT LEAST once every 2 days, only when you start the program.

  5. #5
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    Rather than checking for a specific date, in which case the application must be run on that date, why not check to see if a specific date has passed.

    In other words, if I check for an update today, then the application would set the update flag to tomorrow's date. If that date has been passed the next time the application is run, then the updates will be checked again.

  6. #6
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    That sounds like a good idea. I'm guessing I could do this with the Calander object.

    But doing the update check isn't really my issue at the moment. I'm trying to figure out how exactly to run the installation process -- How to actually make App v1.0 turn into App v2.0 automatically.

    Right now it works like this:
    • There are 3 files on my server: App_v1.zip, App_v2.zip, and version.ini.
    • For the purpose of the Auto-Update test, it is assumed that the user has App_v1.zip unzipped onto their hard disk somewhere.
    • User unzips App_v1.zip, and runs App.exe contained within (the full version 1 build of an MMF2 application).
    • App.exe (v1) looks for update in file "version.ini" on sever via the GET object, and finds v2 text available.
    • App.exe downloads App_v2.zip from a string contained within "version.ini".
    • App_v2.zip is downloaded to the AppPath$ of App.exe -- saved as "NEW_VER.zip"
    • ???

    I don't know what to do next.
    App_v2.zip (AKA "NEW_VER.zip") contains a new full version of App.exe, with more features. It seems kind of redundant to have to re-install the whole application though. I want to use some sort of patch file but don't know how to do this within MMF2.

    Also, I can't seem to get the ZIP object to work at all. So currently it downloads the ZIP to the application path, and the user has to extract the App.exe from within and replace it manually. Not very intuitive.

    I want my App to be able to do this all automatically.

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    Usually a "patch" is just the updated exe... Actually I can't really recall a time when the "patch" was a separate file that somehow merged itself into the old exe. Games that uses patches usually have smaller exes and store most all of the content stuff in external folders... this way if there is a change to just a few graphics or new additional graphics, those are just copied over into the game folder and replace old files. This keeps the exe smaller and quicker to download new versions and replace it.

    I don't have any experience with any unzipping in MMF, but I would imagine it is pretty straightforward.

    Also, I don't know if you set it up like this, but you're gonna need to have the patcher/auto updater be a separate program from your main app... Otherwise it won't be able to replace the app with a new version since it is currently running. This is why so many games have "launchers" because the player runs the launcher, it checks for updates, patches the main exe, and then either lets the user click "launch game" or just launches the game instantly and closes the launcher.

    Because yeah... an app can't replace itself while it is running. :p

  8. #8
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    Quote Originally Posted by Konidias
    Usually a "patch" is just the updated exe... Actually I can't really recall a time when the "patch" was a separate file that somehow merged itself into the old exe.
    Patches are usually only small data files that tell the program to replace/add certain binary data within the EXE, as opposed to downloading the entire EXE again. This is a method to save bandwidth for large programs needing only minor fixes.

    Here's an example I can think of: Imagine if a program like Photoshop released a new version in which they made a typo. The menu bar said "flies" instead of "File" just under the title. Oops!

    Instead of sending you a new 800mb EXE file to fix a single typo, they can just send a patch file.

    The patch will only be a few bytes containing this information:
    1. The memory address to be changed (at the location where the text "flies" is stored).
    2. The data to be replaced/inserted at that address (replace "flies" with "File")

    The updater application will search the memory address of the Photoshop EXE where "flies" is stored and change it to "File".

    A simple 4kb fix for an 800mb program. But of course with large changes the files will be larger. The Patch file should only contain NEW binary data to be changed for the EXE, and the locations of where to change it. This is why patch files themselves can not be run as executables, because they don't contain all of the commands to run as such!

    But in our modern auto-updating age, you usually don't get the privilege to patch EXEs manually like we used to. The patch files are usually downloaded automatically to a local folder, then patched to program, then deleted from your hard drive for you. You never actually touch the file yourself.

    ...but you're gonna need to have the patcher/auto updater be a separate program from your main app...

    Because yeah... an app can't replace itself while it is running. :p
    I could have the same EXE overwrite itself within the application. Then just have a screen that says, "The changes of the update patch won't take effect until you close/restart the application. Would you like to exit now?"

    While the application is open, Windows should be able to keep it in memory. This is how Firefox works, I believe. I don't know how this works exactly, but I may just make a separate installer like you said. It would probably be easier.

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Mar 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    Can you have the updater as a separate program?
    Main App runs updater utility to check for new version
    If Updater utility detects an update, it closes Main App and downloads the update
    Updater utility then replaces the needed files
    Updater utility runs updated Main App, and closes itself.

    That's how I have mine set up, and gets around the issue of updating a file already in use.

    If you want to check for updates for the updater itself, set that check in the Main App.

    Alternatively, If you have Install Creator (Pro?), you can make an installer for the update, and then your steps would be:
    1) Check for update, if found download
    2) run update & close app
    3) update installer does its thing, and runs Main App at the end

  10. #10
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Creating Auto-Update program.

    I'm not sure if I understand...

    You're saying to have the user open the Main Application, which will call the Updater application to open. Then it will determine if it needs to do any updating... Instead of having the user open the Updater app which simply calls the Main Application when its done.

    Yeah, I could actually do that pretty easy with sup-apps. That's a good idea.

    I think I've got most of this figured out. Everything is working now, including the unzipping part. But the ZIP object isn't responding properly. I'm having problems checking its state. The event condition "File Unzipped Successfully" never triggers!

    My events are like this:
    Code:
    User presses "Update Button"
     = Open "test.zip"
     = unzip to "some file path"
    This event work just fine.
    The files unzip in the proper location, but the event that tells me its complete never triggers.

    Code:
    File is unzipped Sucessfully
     = End Application.
    What should happen is, when the files are done being unzipped, the application closes... But it never does! The files have absolutely been unzipped, so its not possible that the condition isn't met. I've been trying for a while now, and this event will not trigger no matter what I do. Whats wrong with it?

    I also noticed that the ZIP object conditions "Is Zip Open" and any of the error conditions also seem to just be ignored. They never trigger, even if an error is found or the ZIP is indeed open.

    I need to know when the zip is done unzipping so that I can have it finish the updating process.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Android-App Auto Update (Q)
    By SMASHINGmedia in forum Android Export Module Version 2.0
    Replies: 5
    Last Post: 3rd April 2013, 10:12 AM
  2. Instal Creator Auto Update Problem
    By Realfree in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 22nd November 2008, 06:03 PM
  3. Creating Install Program
    By Jaffob in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th May 2008, 12:02 PM
  4. Auto - Update System
    By Spike in forum Multimedia Fusion 2 - Technical Support
    Replies: 21
    Last Post: 18th April 2008, 02:17 PM
  5. Implementing auto update feature.
    By somebody in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 13th April 2007, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •