Post: Updater!
08-15-2011, 01:39 AM #1
Jared
Tranquility.
(adsbygoogle = window.adsbygoogle || []).push({}); So I was wondering how you would code a Updater for your program?
(adsbygoogle = window.adsbygoogle || []).push({});
08-15-2011, 05:12 AM #2
Originally posted by Kammmmi View Post
So I was wondering how you would code a Updater for your program?


Kammmmi stare Have you checked youutbe or google ? they might have Tut
08-15-2011, 06:33 AM #3
schnzrs
Do a barrel roll!
What language are you using? The general concept would be to upload your application update to the internet, have a separate program that reads the URL of the application update, compares in the the current application, and replaces the current application if necessary.

Since I don't know what language you are using, I'll put an example in pseudocode.

    
//Updater program concept
NewProgram = ReadFromURL("www.mysite.com/MyProgram.exe")
OldProgram = LoadFile("C:\MyProgram.exe")
if NewProgram != OldProgram then
WriteFile("C:\MyProgram.exe", NewProgram)
RunFile("C:\MyProgram.exe")


Sorry if this is a bad example, but this what the best I could do with limited knowledge :P
08-15-2011, 06:27 PM #4
Epic?
Awe-Inspiring
Originally posted by Kammmmi View Post
So I was wondering how you would code a Updater for your program?


It depends on what you want your updater to be able to do.

If you want to create a simple "version 2" of your program, you can just have people redownload it. If its a "desktop" executable, and when you want to update it, you have a popup message saying "A new version is available. Do X to download the new version.", its a slightly different case; you could either redownload and overwrite the old program, or craft a plugin format for your second program.

I can write you an example if you let me know what language you're attempting to do it in.
08-15-2011, 06:53 PM #5
Jared
Tranquility.
Originally posted by AsianInvasion View Post
It depends on what you want your updater to be able to do.

If you want to create a simple "version 2" of your program, you can just have people redownload it. If its a "desktop" executable, and when you want to update it, you have a popup message saying "A new version is available. Do X to download the new version.", its a slightly different case; you could either redownload and overwrite the old program, or craft a plugin format for your second program.

I can write you an example if you let me know what language you're attempting to do it in.


VB.Net since I am using Visual Basics 2010
08-15-2011, 07:46 PM #6
Epic?
Awe-Inspiring
Originally posted by Kammmmi View Post
VB.Net since I am using Visual Basics 2010


Okay, and what system do you want? Overwrite the existing application with the new one, or create a plugin system?
08-15-2011, 08:05 PM #7
Updaters are very simple.. Here is the concept of an updater in an application:

Main App:
Originally posted by another user

1- Checks a website for the latest version. (Let's say the latest is 5.1)
2- Compares it with the current version. (Let's say the current version is 5.0, so you would do an simple if else math equation (If CurrentVer < NewVer Then ...)
3- If the new version is older set an public boolean called Update as true.
4- Now on Form.Closing do another if and else statement (If GlobalVars.Update = True Then ...).
5- If it is set to true, download an updater, run it, and close. If the updater is all ready on the same folder just run it and close app.


Updater:
Originally posted by another user

1- Once the update runs it will delete the old version.
2- And download the new one.


That's the very basic of an updater. A lot of add-ons can be added into it to make it better, but that would be your base.
08-16-2011, 12:10 AM #8
Jared
Tranquility.
Originally posted by AsianInvasion View Post
Okay, and what system do you want? Overwrite the existing application with the new one, or create a plugin system?


Overwrite so it just updates it.
08-17-2011, 07:10 AM #9
Epic?
Awe-Inspiring
Originally posted by Kammmmi View Post
Overwrite so it just updates it.


Okay, I actually did take some time to build you a program, and it does work (kinda - you'd need webhosting), but I've found a bit more elegant of a solution: You must login or register to view this content.

If it doesn't work for you, let me know, and I'll send you my version (which most definitely works), but that one will probably be easier.
08-18-2011, 08:19 PM #10
Josh_ox3
Treasure hunter
Doesnt it have Update in the properties ?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo