Jump to content

Automatic software updater


krikor
 Share

Recommended Posts

Hi,

I was wandering if we can create an autimatic sofware updater with AutoIt, that will check the make of the software then check on a website if there is a newer version then download and install it transparently or just a message saying it's done.

Thanks

Greg

Link to comment
Share on other sites

Do you actually belive its that frekvent update of AutoIt?

Maybe it is... I use the same version for several month. Before i even look for new version. As long as its working, don´t try to fix it :idiot:

Were ever i lay my script is my home...

Link to comment
Share on other sites

An updater could break your scripts, leaving you lost. Better off choosing to upgrade fully when you choose to do so, knowing fully of what can happen, with the change logs to go with it.

CSV updating is perhaps good for some programs, but program languages, recipe for disaster.

My thoughts anyway.

Thanks for the idea, Jon has tried it.

Link to comment
Share on other sites

I think he's asking if it's possible to write an updating function into an AutoIt script.

If a newer version exists, install the new version.

I could flowchart the idea I have, but it involves having the version number in a specific format after the name of the .EXE.

File list on network server:
Prog1-0.exe
prog1-1.exe
prog2-0.exe
prog2-5.exe

Let's say 2.5 is the newest version. The code would get the file name(s) in the network folder and compare the format of the numbers with a

$new = stringsplit(stringtrimleft(getfilename("directory"),4),"-")
or whatever.... with a
$old = stringsplit($version,"-")
variable inside the code.

Test if $new > $old then filecopy the new version, run the new one, and exit the old one.

Pop up a message box to ask the user to hit "OK" and the new version copies itself as the old one's filename....

Ok, maybe it wasn't simple.... but that's what popped in my head.

Was this what you wanted?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

I think he's asking if it's possible to write an updating function into an AutoIt script. 

If a newer version exists, install the new version. 

I could flowchart the idea I have,  but it involves having the version number in a specific format  after the name of the .EXE.

File list on network server:
Prog1-0.exe
prog1-1.exe
prog2-0.exe
prog2-5.exe

Let's say 2.5 is the newest version.  The code would get the file name(s) in the network folder and compare the format of the numbers with a

$new = stringsplit(stringtrimleft(getfilename("directory"),4),"-")
or whatever.... with a
$old = stringsplit($version,"-")
variable inside the code.

Test if $new > $old then filecopy the new version, run the new one, and exit the old one. 

Pop up a message box to ask the user to hit "OK" and the new version copies itself as the old one's filename....

Ok, maybe it wasn't simple.... but that's what popped in my head. 

Was this what you wanted?

<{POST_SNAPBACK}>

Yes it's almost this.

I'm a business application programmer, the apps run on locally on users' computer, the data is on a server in a network or Internet. The apps undergo substantial changes. The data is modified subsequently but the we got to deploy the apps all over before they touch the data in order to make them run transparently and flowlessly, so we gotta check and see if there's a new version, if yes, replace the exe or the dll with the new one from the network or the Internet.

The versions can be checked from an ini file too. even if the ini file is destroyed it will just crash the existing one.

It's all this manipulation and integrating this manipulation in the app that I'm thinking about.

What I would like to do is something like Nortons LiveUpdate or something like that of Microsofs Automatic Updater.

Is it possible with a script or a hard coded program is better? Will the script give a faster and more secure way of dialoging over the Internet with the server?

Thanks

Greg

Link to comment
Share on other sites

If the program you want to update is created by yourself you can place a INI-file on the

webserver with information on the newest version of your program.

Example :

[MYPROG]
DATE=20041231100000
INFO=Fixed some bugs
VERSION=1.32
FILE=http://www.myserver.com/dir/file.exe

The script could check if the INI-date is a higher value then the current running release-date,

and if it is it higher it will prompt the INFO, and ask if the user want to download...

or it could be set to automatically download the file.

Steps :

1. Download INI.

2. Read DATE-value.

3. Check INI-value > CURRENT

4. Download !

If the program isn`t made by yourself (or anyone you know) then it could be pretty hard

to make a stable and working updater... Good luck BTW !

- Helge -

Link to comment
Share on other sites

If the program you want to update is created by yourself you can place a INI-file on the

webserver with information on the newest version of your program.

Example :

[MYPROG]
DATE=20041231100000
INFO=Fixed some bugs
VERSION=1.32
FILE=http://www.myserver.com/dir/file.exe

The script could check if the INI-date is a higher value then the current running release-date,

and if it is it higher it will prompt the INFO, and ask if the user want to download...

or it could be set to automatically download the file.

Steps :

1. Download INI.

2. Read DATE-value.

3. Check INI-value > CURRENT

4. Download !

If the program isn`t made by yourself (or anyone you know) then it could be pretty hard

to make a stable and working updater... Good luck BTW !

- Helge -

<{POST_SNAPBACK}>

Hi Helge,

Yes the program is written by me, however I didn't get the abreviations, I know the steps are exactly as you describe. Being a newbie I thought we could instead of downloading, read the .ini file direct on the server (if it goes faster), what I don't know is the syntax and the steps to follow: to read, download to Temp if ok, close the exe, overwrite it then re-run it.

Thanks

K

Link to comment
Share on other sites

Hi Helge,

Yes the program is written by me, however I didn't get the abreviations, I know the steps are exactly as you describe. Being a newbie I thought we could instead of downloading, read the .ini file direct on the server (if it goes faster), what I don't know is the syntax and the steps to follow: to read, download to Temp if ok, close the exe, overwrite it  then re-run it.

Thanks

K

<{POST_SNAPBACK}>

Also, Where do we get a list of the APIs such as "GetAsyncKeyState"?

Thanks

K

Link to comment
Share on other sites

  • 1 year later...
  • Moderators

it's been done before guys, there are examples on the forum... i'll make another one real quick and post it...

Can you make me a ham sandwich while your at it :P

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Actually if I'm not mistaken, AutoIt has an update example within it folder somewhere. That would probably be the best example. Where mine is: Program Files\AutoIt3\Extras\AutoUpdateIt it's in .au3, so you may be able to get some ideas there.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

...maybe one of you could post (or link to) an example

I had the post/reply window open and was searching in another window for a post that I thought covered this very thing. I never found the post and was called to eat... so I posted the one line that I had written. :-)

(You can see where my priorities are!)

I still cannot find the post that I was searching for (hate when that happens)...

So run with SmOke_N's example.

postcount + 1

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...