Results 1 to 9 of 9

Thread: Questions on when program launches, update available & downloading

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2014
    Posts
    4

    Questions on when program launches, update available & downloading

    1.) When the program has an update, I would like it to do something along the lines of popping up a msgbox and it saying "A new Update is available, please click OK to download"
    2.) When that msgbox or whatever pops up, I would like a custom downloader to pop up and direct it to a folder (C:\Program Files\Folder_Name) that does delete the old version before installing the new one.

    Would anyone have the ideas on how this works? I have been looking up youtube videos for hours, not a single one of them worked properly without errors. I also did make sure I had all of their progress bars, textboxes, buttons ect. labeled correctly.

    If you know of a good way and would like to list it down below (Code inserted preferred) I would be highly greatful of your help.

    Thank you for the ones who reply, I hope you all have a great day.


    -Pandaz

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Questions on when program launches, update available & downloading

    Hello and welcome to the forum. I am sure you would prefer code but this is not how this site works. You show us what you have tried and we build on that. We do not write your applications. Lets see what you have tried.

    Break your project into steps. Step One how are you going to check a update is ready?

  3. #3
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Questions on when program launches, update available & downloading

    I agree with Ident. But OP I doubt you googled this cause I just did and found tons of result. It's pretty straight forward. It's better if you learn yourself than have us spoon feed you. But I'll point you into the right direct.

    When you load your application, you would want to check the ProductVersion of your application to one which is hosted on a webserver.
    E.g. you program's ProductVersion is 1.0.0.0 and the one hosted on the webserver is 1.0.0.1

    You compare the two, if they're different then you assume there is an update available. Then using the webclient class, you should then download the file. Use an SaveFileDialog too.

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,538

    Re: Questions on when program launches, update available & downloading

    You can also look into ClickOnce ... All you'd have to do is set it up, no coding needed.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2014
    Posts
    4

    Re: Questions on when program launches, update available & downloading

    Well, you wouldn't be 'spoonfeeding' me. But I do have a question, I would like a 'startup' function, that it does the function on startup. Because I do have it where you can go to 'File>Check For updates' and it will say if you are up to date or not.

    My main question was, when the program starts, when a new update is available, for it to tell you and give you the option to update.

    I appreciate your replies, but finding that certain function was something I was not able to find. If you have found that in some sort of video, I would be greatful if you may share it.

  6. #6
    Hyperactive Member stepdragon's Avatar
    Join Date
    Aug 2011
    Location
    Cincinnati
    Posts
    288

    Re: Questions on when program launches, update available & downloading

    A simple version of this shouldn't be too hard to implement. I would try creating a Class for your project containing a Sub Main(). In this sub, you should run any pre-launch code that you need to check versions. You could even show a splash while its doing its work. At this point your application is almost like a classic console app going line by line, just... no console.

    Next you can use the information gathered in that code to either launch a form specific to updating, or launch the main program. Form.Show() should work.

    There is still a lot of leg-work to get this going, so I wouldn't consider this being spoon fed. This just gives you an idea of the logic behind the flow of events. Most programs don't just launch a window when you start them anymore. Using a Main sub as the startup object gives you more control over how and what your program does right at the beginning.

    Disclaimer: I haven't done this in any of my projects, I generally just launch a specific form, and I may be wrong on how the Sub Main implementation works. I've seen a few code snippets that use it, and I assume it would work well in your situation. I trust that some more seasoned developers will correct me if I'm wrong.

    If you're wrong, you'll learn. If I'm wrong, I'll learn. Try something new and go from there. That's how we improve.

    CodeBank: VB.Net - Simple Proper Image Scaling in Correct Aspect Ratio - Star Rating Control
    Useful Links: HOW TO USE CODE TAGS

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,538

    Re: Questions on when program launches, update available & downloading

    You'll need a bootstrapper program. Its job will be to check "something" (web site, web service ,what ever) and compare the version to somehting on the client side... if they match it then launches the application proper. If it doesn't, then it asks the user to upgrade. If they don't want to, it simply starts the app. If the user does want the upgrade, then it downloads the files, copies them, and when it's done, starts the app.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Questions on when program launches, update available & downloading

    OP here's what I've just coded for you. It works great infact. Only way for improvement in my opinion is to use the async methods so your UI form doesn't become unresponse whilst downloading the string and data. Apart from that this would work a treat. Just make sure on each release of your program to change the Application.ProductVersion. Increment it by one.

    http://pastebin.com/zakLv4Ze

  9. #9

    Thread Starter
    New Member
    Join Date
    Dec 2014
    Posts
    4

    Re: Questions on when program launches, update available & downloading

    Thank you three for the replies! I appreciate them all.

    Troh's code worked flawlessly, I'm going to save it down and try to break it down to learn it myself! Thank you very much for taking your time to write that. Worked how I wanted it to.

    I appreciate everyone's reply, on this forum. +1 to you all.

    | Thread Resolved |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width