Jump to content

INetUpdater UDF


PartyPooper
 Share

Recommended Posts

A simple UDF that can be used for downloading a program update via the internet. Includes a progress bar and an option to automatically update the currently running program.

Sample usage:

#include <INetUpdater.au3>
   
Global $s_Version = "v1.0.0.6"; current version
Global $s_MyWebSite = "http://members.optusnet.com.au/partypooper"; authors web address
           
OnGetFileUpdate()
           
Func OnGetFileUpdate()
  _INetUpdater ($s_Version, $s_MyWebSite)
EndFunc;==>OnGetFileUpdate

Format for the UDF is as follows:

#include <INetUpdater.au3>
   
Func _INetUpdater( Current Version, Web Site [, Program Title [, Version Control File [, Remote Filename [, Local Filename [, Updating BatchFile [, Auto Install]]]]] )

Parameters

Current Version - currently running program version number

Web Site - website containing version file and the update

Program Title - Title of the update. Default (-1) = currently running program title (must be the same in Updates.ini)

Version Control File - Ini file on website containing version number. Default (-1) = Updates.ini (see format in Remarks below)

Remote Filename - executable to be downloaded. Default (-1) = "Program Title".exe

Local Filename - executable filename to be saved locally. Default (-1) = same as Remote Filename

Updating BatchFile - batch updater filename. Default (-1) = "Program Title" Update.bat

Auto Install - auto install after downloading 0=no, 1=yes. Default (0) = manually install update

Return Value

On Success: Downloads and auto installs (if chosen), the update.

On Failure:

- sets @ERROR = 1 for function parameter errors

- sets @ERROR = 2 if internet problems or version file not found

- sets @ERROR = 3 if updating batch file cannot be created

Remarks

Requires that you have a version control file located on your server that has a section name of '[program title]' and a key of 'Vers='. The Version number can be any format so long as it can be used as a comparision string between program and update. The [program title] must be identical to the one used in the script. Example format for the version ini file:

[My Program]
Vers=v3.0.0.0
[Another Program]
Vers=v1.0

etc...

If "Vers=Manual", this will trigger a message box stating user must visit website to manually update file.

Edit1: Updated UDF source (4 downloads)

Edit2: Clarification of version control file format.

Edit3: Updated UDF source - removed requirement for running exe to use differnet filename (16 downloads)

Edit4: Updated UDF source - many changes (197 downloads)

Edit5: Updated UDF source - fixed small error that may stop an update from occuring (2 downloads)

Edit6: Updated UDF source - fixed potential splash text bug. Code cleanup and added Manually Update File option. Splash/Progress now centers on calling script GUI - useful in multi-monitor scenarios (257 downloads)

Edit7: Updated UDF source - changed number of arguments required (and their order) so it will be a script breaker without some editing. No longer needs program title - now picked up automatically. (2 downloads)

Edit8: Updated UDF source - several bugfixes (8 downloads)

Edit9: Updated UDF source - more bugfixes (1 download)

Edit10: Updated UDF source - reworked the batchfile routine and added a time delay

NO LONGER BEING MAINTAINED - superseded by @InetFileUpdate

Edited by PartyPooper
Link to comment
Share on other sites

:lmao:
Once my friend told me that he had found Jesus. I thought to myself, "Woohoo, we're rich!" It turns out he meant something different.Sometimes I just like to lay in my bed and look up at the stars and wonder..where the hell did my roof go?
Link to comment
Share on other sites

Snipz, does this suit your purpose (seeing as how you're the one who encouraged me to write it ;))

Does it ever :lmao:

Once my friend told me that he had found Jesus. I thought to myself, "Woohoo, we're rich!" It turns out he meant something different.Sometimes I just like to lay in my bed and look up at the stars and wonder..where the hell did my roof go?
Link to comment
Share on other sites

  • 10 months later...

What does the $h_inu_LocalBatchFile - batch updater filename do? Or what do I need there? Is this something generated? Or do I need to have a batch file for updates in addition to an exe on the server?

It is an automatically generated batch file. If you don't specify anything when calling the function, it will use the default filename of "INetUpdater.bat". This filename can be changed to whatever you like by simply specifying it when calling the function.

Link to comment
Share on other sites

Well, I'm not a Dev but my understanding is that even though the EXE includes the source, when you compile it and deselect "Allow decompilation", it encrypts the source with a huge random passphrase effectively making it unreadable unless you use some form of hacked decompilation tool that breaks the passphrase. Someone correct me if this is wrong.

This means, it's reasonably safe to have your program update the EXE so long as you have deselected the "Allow decompilation" field.

Link to comment
Share on other sites

  • 5 months later...

Updated UDF - see first post.

- Added another function option

- Added the ability to use a single control file for multiple programs

- Added "manual update required" ability

- Added some more error checking for when things go wrong

- Changed several options to allow "default" values when calling function

- Added Splashtext showing check in progress

- Fixed two minor errors in InetGetSize and InetGet calls

Edited by PartyPooper
Link to comment
Share on other sites

  • 3 months later...

Have you written a program yet or do you have any code in which I can show you how to insert it?

What I have is a game mod that we release new versions of throughout the year. It already has a game .exe file which we update the version number using reshacker, and then we supply all the newly updated .ini and .dll files to make the changes work for the new mod release. What I need is an updater that will check the version on my website against the installed version, and then if there is a newer one online it will update automatically all the files necessary and/or prompt you to go to the website to get the latest mod. I'd like to be able to do both depending on how this works out.

The SuperFlyChetGuy
Link to comment
Share on other sites

Well, the UDF will do all that if your game mod is written in AutoIt (so it can pass the UDF the required variables), otherwise you will have to rewrite the UDF into a program that checks the properties (version number, date, etc.) of your non-AutoIt game mod.

Link to comment
Share on other sites

Well, the UDF will do all that if your game mod is written in AutoIt (so it can pass the UDF the required variables), otherwise you will have to rewrite the UDF into a program that checks the properties (version number, date, etc.) of your non-AutoIt game mod.

No way that can work this is a .exe that came from a store bought game. What I thought I could do is rename the game .exe to game.exe and then name my .exe to the original name, so when the player runs mine it will check game.exe and compare it with the one hosted on the website, if there is one new then update if not proceed to run the game. This would be a situation where the first .exe runs the second .exe for both instances, update or not.
The SuperFlyChetGuy
Link to comment
Share on other sites

  • 1 month later...

:) you.

I'll try this soon.

Manadar,

I was wondering if you ever gave PartyPooper's UDF a try. It looks very promising to me and I sent PartyPooper a message with my thanks for writing and sharing with the forum. I plan on trying this on the weekend and wanted to see if you had any tips or modifications.

taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

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...