. Introduction This code enables an application to update itself when there is a new version available. The auto update is transparent to the user and checks for new updates every time the user launches the program.
This code was written to be used in a controlled environment (intranet) and is not intended to be used through the internet due to security issues. Background I've been developing client/server systems for a long time, and the worst part of the software life cycle is to update it in all users' machine. The worst scenario is when you need to make a database change, and all the users are required have the latest version, otherwise the system will crash. Today a lot of systems offer the ability to auto update, what makes the programmer's and the user's life easier. Looking through the internet, I couldn't find any code that I could use in my projects in a simple way, so I decided to write my own code.
Some points that I'd like to have in an auto update program are:. Easy to implement and use. Transparent to the user. Ability to upgrade the system and also the auto update program. A code that doesn't need change when used by different systems and could be compiled in a library. How it works In the program that you want to be auto updateable, you just need to call the AutoUpdate function in the Main procedure.
The AutoUpdate function will check the version with the one read from a file located in a web site. If the program version is lower than the one read the program downloads the auto update program and launches it and the function returns True, which means that an auto update will run and the current program should be closed. The auto update program receives several parameters from the program to be updated and performs the auto update necessary and after that launches the updated system. The code The auto update program This is the code for the auto update program. The program is a windowless application with only one Main procedure. Lolkereltje 26-Dec-07 7:38 26-Dec-07 7:38 Hey, I get this error: There was a problem running the Auto Update.
Hello, I have just migrated form Windows Xp to Windows 7 but unfortunately I'm not abel to correctly configure my USB keyboard: Lenovo Keyboard. Lenovo sk 8815.
Please Contact us at (my contact info) The external server has returned an error: ( 404) Not found But I really did change the RemotePath to my file root in my website. The changes I made in the files: AutoUpdate.dll Contact info AutoUpdate.exe Contact info AutoUpdateTest.exe The RemotePath (http: // mywebsite.com/updates/) update.dat From 1.1 test.txt to 1.2 test.txt I want to update the file test.txt, so my web folder looks like this: +updates.
If you don't go the ClickOnce option, then you'll probably end up tooling it yourself. One of the considerations will be that the calling client has access to the update server - undoubtedly over the web. HTTP calls on port 80 or HTTPS on port 443 are typically allowed through firewalls. That's probably a good place to start for your medium. I've deployed a project which does this sort of thing by performing a call to a web service to determine if an update is available. The web service looks at a directory on our web server and examines a convention we have for a named zip file. The calling client makes a determination based on the versioning of whether an update is available.
Basic Auto Sales Richmond Va
If an update is available, the app spawns an executable that does the downloading (in my case it unzips as well), then re-launches the main entry point to the app and exits the updater. Using a separate executable in a spawing/shelling manner allows you to update the main trunk of the app, but you get into trickiness where it's cumbersome to update the update executable. It's not as graceful as ClickOnce, but it's worked well for me.
I haven't used ClickOnce, so I'm not aware of whether it has shortcomings in terms of user profile isolation.
This application allows you to check for an updated version of a file or a program via FTP, then download that update if it is available. It works by reading a file called update.inf that must be installed on the remote server and comparing information in that file to information about the current version of the file or program. The author has set up a remote FTP site with such an update.inf file on it for testing purposes so you can see how it works. Information about this remote FTP site (IP address and remote directory) is contained in a file called update.ini In the example, as it is written, the program compares the version of the application itself to information in the update.inf file on the remote machine.
However, this is for testing purposes only and the program does not actually update itself. To use the program in a production setting, you have to set up an FTP site, put the appropriate information in the update.inf and update.ini files, and change the code to refer to the file or program that you would actually want to update. Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the.zip file from your local drive using WinZip or a comparable program to view the contents.
OK, the latest thing is to provide 'automatic' update capability for software (everyoen seems to do it from Firefox to Adobe to MSFT to. Well, virtually everyone). This is a feature that is easy to implement in my VB6 applications- I've been asked to look into it and I'm wondering about several points. How often should one check for an automatic update? If the automatic check fails, does/should one notify the user?
How many times should the user be notified? (The user would have a choice of declining the update, and turning off the automatic update checks too.) Sun, 26 Sep 2010 09:11:28 GMT.
Looking for a tablet for OSU? If you’re looking for a professional-quality drawing tablet that’s a great value, the is worthy of consideration. See the on Amazon. Huion h610 pro drivers. If you’re into playing the rhythm game OSU, Huion makes a tablet for it.
1) My programs offer an automatic check for updates at startup, plus gives the user an option to manually check whenever the mood strikes them. 2A) Depends on the failure. If the website is down it ignores this and says something to the effect of 'data unavailable.try again later' if checked manually.
Automatic checks don't display anything. Otherwise standard error trapping applies. 2B) Notified of what specifically?
Once should be sufficent. That an update is available? At each check would be enough.
While it's wise to give the user the option to opt out of auotmatic checking for new versions, giving them the ability to shut off being notified of a new version when checking is enabled would be pointless. If they want to decline the update, that's fine, but declining should not turn off the feature unless you specify this.
The point is to get them to update. There are two ways to go about this: Check at startup and download the update at that time. My component will end the program and install the new version and restart it making it fairly seamless. The other way is to check for an update and download it silently and then let the user know an update is available and can be installed immediately, or installed at shut down. Pick whichever works best for you. Kev OK, the latest thing is to provide 'automatic' update capability for software (everyoen seems to do it from Firefox to Adobe to MSFT to.
well, virtually everyone). This is a feature that is easy to implement in my VB6 applications- I've been asked to look into it and I'm wondering about several points. 1. How often should one check for an automatic update? 2A. If the automatic check fails, does/should one notify the user? 2B.
How many times should the user be notified? (The user would have a choice of declining the update, and turning off the automatic update checks too.) Sun, 26 Sep 2010 09:55:48 GMT. 1) My programs offer an automatic check for updates at startup, plus gives the user an option to manually check whenever the mood strikes them. 2A) Depends on the failure. If the website is down it ignores this and says something to the effect of 'data unavailable.try again later' if checked manually. Automatic checks don't display anything.
Otherwise standard error trapping applies. 2B) Notified of what specifically? Once should be sufficent. That an update is available? At each check would be enough. While it's wise to give the user the option to opt out of auotmatic checking for new versions, giving them the ability to shut off being notified of a new version when checking is enabled would be pointless. If they want to decline the update, that's fine, but declining should not turn off the feature unless you specify this.
The point is to get them to update. There are two ways to go about this: Check at startup and download the update at that time.
My component will end the program and install the new version and restart it making it fairly seamless. The other way is to check for an update and download it silently and then let the user know an update is available and can be installed immediately, or installed at shut down. Pick whichever works best for you. Kev Thanks Kev, that's almost exactly how I've got it setup right now. (Our automatic check, when turned on, checks weekly, though I'd like to change it to just check on startup.) Sun, 26 Sep 2010 20:44:16 GMT.
If I am understanding your question properly, I don't keep the check at startup in the main thread of execution. Obviously doing so would cause what would appear to be a freeze upon failure. I put the call to check for an update in a timer which is ticked on after the program has loaded, does the check and then ticks itself off. Yeah, that's not a bad idea.
Most examples I've seen use a Loader program to do the check, so if an update is required, the Loader program can do it, prior to starting the main App. However, you really notice the delay caused by Net access when it's done that way. The way you suggest, I assume there would then be code to do the download, and run the Update (while immediately exiting the application), so it's all together. Sounds pretty good. Regards, Rick Raisley Mon, 27 Sep 2010 02:40:22 GMT. Since a firewall can prevent reading the file, do you pop up a message saying this, and allowing the user to cancel auto update checks or anything?
I don't do any firewall checking. Since most firewalls I've encountered usually popup a choice to allow or block the program from accessing the Internet, blockage would return no data, which is interpreted as no Internet connection. Then a message is displayed that the program was unable to retrieve data, yada yada yada. I've never really dealt with any support requests over this. Most of my users, when they use this feature, understand that the program needs to phone home and allow the connection. Yeah, that's not a bad idea.
Most examples I've seen use a Loader program to do the check, so if an update is required, the Loader program can do itprior to starting the main App. However, you really notice the delay caused by Net access when it's done that way.
The way you suggest, I assume there would then be code to do the download, and run the Update (while immediately exiting the application), so it's all together. Sounds pretty good. The version check is done from within the program.if a new version is found, it downloads a script file for my 'phoenix' launcher (location of the file to download, and other data to be interpreted by 'phoenix'). The downloading and updating is done from a separate EXE (phoenix.exe) which of course can shut down my app and launch the downloaded installed update and then quietly end itself.
That is one thing I do differently from other I suppose. I don't just download the app's.exe, but rather a setup (Inno specifically) and launch it with the 'quiet' command line. All the user sees is a progress bar. The nice thing about Inno is that it can be scripted to auto-launch the updated app and only do it when silently installed. It's worked out quite well. I didn't just sit down one day and code this at once.it's been a culmination of bits and pieces over the years that has evolved into what it is now. You don't have to do all the fancy loading scripting I do.I added that with the intention of making it a full fledged web installer at some point so specific files could be updated.
However, it's not a top priority. Kev Mon, 27 Sep 2010 03:37:52 GMT.
Well.what specifically would you like to know?:) My program reads a file on my website that contains the latest version of number of the program, compares it to it's own version and displays a message if necessary. If I am understanding your question properly, I don't keep the check at startup in the main thread of execution. Obviously doing so would cause what would appear to be a freeze upon failure. I put the call to check for an update in a timer which is ticked on after the program has loaded, does the check and then ticks itself off. It looks something like this. Sub Timer1Timer If IsConnected Then Timer1.Enabled = False CheckForUpdate End if End Sub Thats basically it.:) Kevin, what are you using for IsConnected?
Visual Basic Auto Update
Mon, 27 Sep 2010 07:18:04 GMT. Yeah.finding a reliable way to do that is a chore unto itself, isn't it?:-) I don't trust any of the traditional IsConnected methods provided with the WinINET API because they are unreliable, especially in a network situation. I use a ping routine to test for an active internet connection.especically my own web site with a single character. If I get a return on it, then I know I have a connection.anything else would typically indicate no conection (or my site is down, and then I use an alternative site to ping to verify the connection).
Kind of a slimey hack, but it's worked out well for some years now. I used Randy Birch's ping code at a starting point: - Kev On Wed, 9 Apr 2008 12:49:08 -0400, 'Kevin Provance' Well.what specifically would you like to know?:) My program reads a file on my website that contains the latest version of number of the program, compares it to it's own version and displays a message if necessary. If I am understanding your question properly, I don't keep the check at startup in the main thread of execution.
Obviously doing so would cause what would appear to be a freeze upon failure. I put the call to check for an update in a timer which is ticked on after the program has loaded, does the check and then ticks itself off. It looks something like this.
Basic Auto Sales
Sub Timer1Timer If IsConnected Then Timer1.Enabled = False CheckForUpdate End if End Sub Thats basically it.:) Kevin, what are you using for IsConnected? Mon, 27 Sep 2010 09:35:36 GMT. In Windows 2000+, and perhaps NT4, 'Power Users' and higher can write to the sub folders under 'Program Files' and most of HKLM in the registry. The 'Users' group has only read access to these places. Many companies make their employees members of the 'Users' group, so they will be the first to notice that there is something wrong with the update.
Home users are mostly administrators, so these won't have issues. Finally, most VB6 developers are either 'Power Users' or 'Administrators', so they don't notice these permission problems during testing. Below is a link that shows 5 methods to auto update your software from a limited 'Users' environment: Tue, 28 Sep 2010 09:07:50 GMT. In Windows 2000+, and perhaps NT4, 'Power Users' and higher can write to the sub folders under 'Program Files' and most of HKLM in the registry.
The 'Users' group has only read access to these places. Many companies make their employees members of the 'Users' group, so they will be the first to notice that there is something wrong with the update. Home users are mostly administrators, so these won't have issues. Finally, most VB6 developers are either 'Power Users' or 'Administrators', so they don't notice these permission problems during testing. Below is a link that shows 5 methods to auto update your software from a limited 'Users' environment: Good points.
The issues regarding registry permissions are important, but fortunately most isntallers are setup to run as an administrator process (and Windows will prompt for an administrator ID, too.) Tue, 28 Sep 2010 21:27:28 GMT. On Tue, 8 Apr 2008 21:55:48 -0400, 'Kevin Provance' 1) My programs offer an automatic check for updates at startup, plus gives the user an option to manually check whenever the mood strikes them. 2A) Depends on the failure. If the website is down it ignores this and says something to the effect of 'data unavailable.try again later' if checked manually. Automatic checks don't display anything.
Otherwise standard error trapping applies. 2B) Notified of what specifically? Once should be sufficent. That an update is available? At each check would be enough.
While it's wise to give the user the option to opt out of auotmatic checking for new versions, giving them the ability to shut off being notified of a new version when checking is enabled would be pointless. If they want to decline the update, that's fine, but declining should not turn off the feature unless you specify this. The point is to get them to update. There are two ways to go about this: Check at startup and download the update at that time. My component will end the program and install the new version and restart it making it fairly seamless. The other way is to check for an update and download it silently and then let the user know an update is available and can be installed immediately, or installed at shut down. Pick whichever works best for you.
Kev Thanks Kev, that's almost exactly how I've got it setup right now. (Our automatic check, when turned on, checks weekly, though I'd like to change it to just check on startup.) My users were running Citrix workstations, i.e. Windows via a Citrix server. My main VB program was launched by a small trigger program that checked periodically (timer) whether there was an updated version available. If there was an update pending and no users detected, then the update happened silently.
The trigger could overwrite the main prog's.exe no problem. In most cases the update did not affect the users' method of working and so they were not informed. (I found the less arrogance users pereceived from the computer 'boffins', the better it was all round.) If a user had forgotten to log out at the end of the previous day, thus keeping the.exe open, then the user would receive an internal email-type message. This was when email was still in its infancy, so the message may have got to them via UDP; I can't remember the details now. Generally the system worked very well, and all done with classic VB! (VB5 in those days) MM Wed, 29 Sep 2010 16:49:44 GMT Page 1 of 1 12 post.