Important alert: (current site time 7/16/2013 2:27:58 AM EDT)
 

winzip icon

ultimate auto update(no self depencies required)

Email
Submitted on: 5/13/2007 8:48:44 AM
By: Puddy Davidson  
Level: Intermediate
User Rating: By 36 Users
Compatibility: VB 6.0
Views: 24541
author picture
 
     This code if added to your project will enable you to release updates to your end users with no fuss at all. This code is fully contained in a single form. You can add the form to any project that you want to have this feature and with a few simple server side chores your end users will get your updates when you release them. The updater form has a very simple process, it tells the user what has been updated or added in the new version, and gives them an option to update or not. The end user can cancel the update at any stage also. The update interface comes with a fully working progress bar, aswell as a percentage downloaded in the form caption. Also I have included a developer option to disable the program from being used (optional, novalty realy), meaning that you can stop your end users from using your program if you wish. If you like this example then please vote and comment. If you would like to see this access a database instead of txt docs/html then say so in the comments section and i will include it... if you like it vote it. Makes perfect use of a batch file to complete the update process, completely removing the need of any dependency in that area.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :ultimate auto update(no self depencies required)
'**************************************
None.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/1/2007 4:22:01 PMvampyr

This uses msinet.ocx
(If this comment was disrespectful, please report it.)

 
5/1/2007 6:16:25 PMPuddy Davidson

It has some vb dependencies, msinet for 1, mscomctl for another ... msinet is a common vb file included in any vb runtime pack as well as any vb edition.
This code requires no outside standard dependencies.
(If this comment was disrespectful, please report it.)

 
5/2/2007 8:00:04 AMNoName

IF there is an update to main exe, will this delete that and restart the new exe?
(If this comment was disrespectful, please report it.)

 
5/2/2007 9:38:50 PMPuddy Davidson

This will delete the old version and start the new version, yes
(If this comment was disrespectful, please report it.)

 
5/3/2007 8:41:41 PMSpace Cowboy

Hey Pudding you rock bro I'm going to use this all the time thank you !
(If this comment was disrespectful, please report it.)

 
5/4/2007 6:19:01 AMDavor

Nice work, You could put in a boolean so that the programer can choose to delete the exe, or rename it to Main20070504_12_13_54.exe (exe name & date and time), so that in every moment can be moved back to previous version if there are some problems with new version on the client machine.

Greetings from Croatia, davor
(If this comment was disrespectful, please report it.)

 
5/4/2007 6:41:18 AMDavor

Or exe name & version number.

Greetings from Croatia, davor
(If this comment was disrespectful, please report it.)

 
5/5/2007 9:29:10 PMPuddy Davidson

Davor I wrote this for the intermediate level. I could add a whole bunch of nice and user freindly options, but with all i have in mind it would be in the advanced section.
I want as many ppl as possible to learn and add to this in there own way :) this is a what i think a fairly complete start to what any half interested developer can make into a superior customized add on to any project.
Thanks for the votes so far guys, keep em commin and i will release an advanced options version.
(If this comment was disrespectful, please report it.)

 
5/6/2007 1:22:25 PMSpodii

The usage of "no API and no ocx/dll's" is very misleading. If you make no references to any other than the default controls and libraries used in the IDE, then I wouldn't have a problem, but you clearly include not only MSINET but MSCOMCTL. When I saw the words "update" and "no ocx/dlls", I figured it was done with some sort of custom socket, making it sound like a lot more than what it really is, which is just downloading a file from the internet OpenURL function. "Ultimate"? No. "No OCX/DLLs"? No.
(If this comment was disrespectful, please report it.)

 
5/7/2007 4:08:04 AMPuddy Davidson

ok so i'll change the name ... no big deal
(If this comment was disrespectful, please report it.)

 
5/8/2007 5:32:43 PMFoundations Software

msinet.ocx is not part of the vb runtime. it needs to be included and registered for clients who do not have vb installed
(If this comment was disrespectful, please report it.)

 
5/8/2007 9:14:43 PMPuddy Davidson

Visual Studio Installer 1.1
http://msdn2.microsoft.com/en-us/vstudio/aa718352.aspx for vb6 enterprize edition. Package and deployment wizard is not very good in my opinion ppl so try vsi instead.
(If this comment was disrespectful, please report it.)

 
5/11/2007 9:32:21 PMMultiple Technologies

you know for a guy with one application on this site 'Spodii', why are you being so negative? Why don't you let him call it whatever he wants, and use whatever he wants. You can make you opinion known with your vote, but no you have to negative and run your mouth.
(If this comment was disrespectful, please report it.)

 
5/12/2007 9:02:54 AMOption Explicit

Multiple Technologies, that has to be the most imbecilic comment I've seen in a long time. As long as Spodii follows site rules he can post any feedback he wants. That includes negative feedback. If everyone followed your ridiculous logic, the comment sections of submissions would be nothing but praise and the vote logs would be filled with mediocre votes with no supporting feedback as to why people voted the way they did. Get a clue spud-brain.
(If this comment was disrespectful, please report it.)

 
5/12/2007 2:16:39 PMMultiple Technologies

You know for a site that takes many hours to post feedback its interesting that you would allow someone to outright act like a 8 years olds in the school yard. Thank you for the quality service. IF logic were in play here then saying something constructive would be the point of adding feedback other than voting, yet again a complete failure of the system. If this gentleman wants to call it the coolest, greatest, never before seen, and so on, then let him. There is no need for anyone to lash out at him, maybe it is to him. BUT I will keep my spud brain, and I will go buy CLUE, it makes more sence then posting code here so someone can rip you over its name and not it function. Hence the reason I continue to use and not include works on this site.
(If this comment was disrespectful, please report it.)

 
5/13/2007 6:39:17 AMPuddy Davidson

I think i will stick with MT from now on and just not share anything with you ppl.
Spodii this code requires NO self dependencies to delete, rename and execute its new version. With raw dos through the batch this code is ultimate to update to a new version with no user process required. All ppl need to do is open the program, if there is an update available its downloaded and hey presto its open.
You might not think it Ultimate, you might not think it very good even, but this is a complete application in its own right, you can add to it if you like but I dont think you have the capacity to, so in your mind its lame.
Anyways enjoy the code guys, it will be my last.
(If this comment was disrespectful, please report it.)

 
5/13/2007 10:41:39 AMFel

my friend, excellent code. and to whoever who does not like it, just don't get it. contonue with the access db pls.
(If this comment was disrespectful, please report it.)

 
5/13/2007 11:15:11 AMMaster_Coder

Children - Children.
If you find it offensive for someone to say something negative about your code then maybe you shouldn't publish it here. "Spodii" is simply pointing out the obvious, "Puddy" says right in the title of his application that there are "NO dependencies, NO dll/ocx's", which is quite misleading. It's one thing to post a project that has dependencies and not to mention it, than to specifically say it doesn't when it does. “Puddy” said something that wasn’t entirely accurate, “Spodii” called him on it, in my humble opinion this is as it should be. “Puddy” has changed the name, updated the code (for the better) and reposted it. This is the spirit of PSC, he received a negative post, he updated the code making it better and reposted it due to the negative comment, now everyone has benefited.
If people can’t handle anything negative, then pull the covers back over your head, turn out the lights and only post your code on www.PleaseDontSayAnythingNegative.com

(If this comment was disrespectful, please report it.)

 
5/14/2007 9:58:19 PMdaviskp

Puddy, don't get discouraged by any of these people. Your work is appreciated by those who matter. Keep it up and don't stop releasing code just because of these people who are poorly representing the site. 5 globes!
(If this comment was disrespectful, please report it.)

 
5/18/2007 4:31:40 PMAlan

Wow! simple bout efective. five stars!
(If this comment was disrespectful, please report it.)

 
5/20/2007 7:08:52 PMPuddy Davidson

I would like to warn you all now that my server is down permanently.
This means that you wont be able to properly test this example without implementing your own server in the process. I am sry but its out of my hands.
(If this comment was disrespectful, please report it.)

 
5/29/2007 4:46:31 AMmeindert

Thanks for the great example code!
I'm using winhhtp to be able to connect via a proxy. And changed your example so it is not using MSINET/MSCOMCTL. But instead is using WinHttp 5.1, the WinHttp dll is included with IE. Can I email you the changed source code?
(If this comment was disrespectful, please report it.)

 
6/23/2007 9:46:05 AMWilliam

I must say your comment is pathetic Multiple Technologies, you use the site to get code but you will not post any. If you have the experience to post, you should share. I don't post any code because I don't have enough experience to do so, but as Option Explicit says, feedback is important and necessary as a guide to others and to keep the site's users expectations high. I has certainly help me through the years and several projects.
(If this comment was disrespectful, please report it.)

 
7/16/2007 2:57:34 PMMr. Underhill

Puddy keep the great work up it is appreciated by most of us unfortunately in this big ugly world of people just have to be nasty ignore them as they are the ignorant ones... This is not to say that someone above did not give good constructive (valid) criticism because they did and you responded by changing the name which is a bit more descriptive and is why I stopped by. Keep in mind us programmers (heads mostly stuck in code) don't get to practice our social skills enough so the critics criticism can be a bit sharp in how they say what they say... So congrats on your win in the contest as well and how about the Db you mention in your blurb... Oh and another note Five Bells and whistles from me as well! Keep up the great work!
(If this comment was disrespectful, please report it.)

 
8/21/2007 5:13:58 PMAlejandro Seimandi Cervantes

i think its a bit late... but form those could still download... there a small minor error.... on the "current version check" it only checks from mayor to minor... and not revision...

so i just addded this code:

b = Split(updateString, ".")
d = Split(curVer, ".")

If Val(b(0)) > Val(d(0)) Then newVer = 1: curVer = 0: GoTo upd
If Val(b(1)) > Val(d(1)) Then newVer = 1: curVer = 0: GoTo upd
If Val(b(2)) > Val(d(2)) Then newVer = 1: curVer = 0

upd:
If newVer > curVer Then
newVer = updateString
(If this comment was disrespectful, please report it.)

 
8/23/2007 12:51:15 PMPuddy Davidson

the version check is not an error .. thats the way i wanted it to be.
I made comment on it that it doesnt check for revision ... if ppl want to include revision they know how to.
(If this comment was disrespectful, please report it.)

 
12/2/2007 10:13:30 AMpietro ing. cecchi

WOW Puddy! this is CODE...)
5 stars from me
(If this comment was disrespectful, please report it.)

 
12/3/2007 4:33:34 PMThraka

Decent submission :) I do agree with the misrepresentation of the code though with the no dependancies :) But not the biggest thing in the world.

I guess if you do or don't feel it should be there, just ask, what about the project really calls that out? Is it normal to have a project like this that IS dependant on external stuff? Perhaps a better title would be:

Sample auto update utility for use in your own projects.

Any way, good sumbission, decent code, great jumping point for anyone wishing to do it. Keep expanding on it puddy. 3 globes.

4 globes would be for some better code, for example:
Dim FileName As String, updateText As String, contentsOf As String
Is actually declaring FileName as string and all the other variables as Variant

5 Globes would be a more complete solution (making it ultimate :) ) that pulled down a manifest checking file versions for all files and doing the appropriate actions.

Looking forward to more...
(If this comment was disrespectful, please report it.)

 
10/4/2008 5:14:23 PMPatrick Sawyer (aka MyStiCaL)

I must say, transfering this and deleteing the msinet control and adding a winsock 'class' would not the winsock control to and this application wouldn't have to worry about ne out side dependinces at all huh?
(If this comment was disrespectful, please report it.)

 
6/12/2010 4:53:20 PMBenjamin Grant

Jeez some people.

In my opinion, you would usually bundle the msinet.ocx file with the installer for your program anyway if you were to have it installed. Also I am sure somewhere along the line most people would have the said depindancies as another app they may have installed would have most likely installed it too.

Top stuff from me Puddy, it's a good clean system that works, and also allows the user to choose yes/no. As you say, if you need more features the end developer can simply add it. This is a solid base, thanks for sharing. All the best.
(If this comment was disrespectful, please report it.)

 
7/6/2010 7:04:05 PMAdam Sak

this code is very good. i did run into a few things though.

1. when newVer=curVer or user clicks no to update the program errors. my solution was to put a timer that is activated in the form load, instead of the actual code, error handler didn't work right.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.