none
How do I use progress bars? RRS feed

  • Question

  • Ok so I am trying to make a custom installer but the problem is I need a progress bar(That starts when the files start downloading and end when they finish.)

    Thx :P


    I am not tasty

    Monday, November 13, 2017 4:53 PM

All replies

  • Monday, November 13, 2017 5:03 PM
  • Ok so I am trying to make a custom installer but the problem is I need a progress bar(That starts when the files start downloading and end when they finish.)

    Thx :P


    I am not tasty

    It sounds to me that this thread is more about an installer than a progress bar?

    What steps are involved? Are you running the process(es) on a different thread than the UI thread?

    Showing a progress bar is easy -- provided that the UI is responsive.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Monday, November 13, 2017 6:34 PM
  • More details are needed. Here is a model to work from where it's a desktop app while if it was a web app then the same applies (but perhaps the installation is web based), details are important

    I’m creating a custom installation for my VB.NET desktop application using a VB.NET Forms project where the installation is  zip file is first downloaded, user clicks on the zip file, extracts files, clicks the executable and a folder is first created then files are copied to that folder along with a desktop shortcut is created.

    My question is, how do I show progress while the installation is in progress?

    Note I never used the word ProgressBar which leaves your options open. Going with a progressbar of course is an option yet there are other methods too and that includes the option to use asynchronies methods to keep things responsive. 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, November 13, 2017 8:17 PM
    Moderator
  • Ok so I am trying to make a custom installer but the problem is I need a progress bar(That starts when the files start downloading and end when they finish.)

    Thx :P


    I am not tasty

    Downloading can be done using the WebClient. You might specifically want to look at the async methods -- in particular the .DownloadFileAsync method. That will allow you to subscribe to two events:

    .DownloadProgressChanged Event

    and

    .DownloadFileCompleted Event

    You can also use the .CancelAsync method while the download is ongoing which gives you more control over everything.

    If you have problems with the progress changed event, let me know and I'll explain an alternate.

    Beyond that, explain what the other processes are and do. An installer isn't a cakewalk; most developers relegate that to third-party installers.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Monday, November 13, 2017 9:16 PM
  • Ok so I am trying to make a custom installer but the problem is I need a progress bar(That starts when the files start downloading and end when they finish.)

    Thx :P


    I am not tasty

    Hi Snowcone_65,

    About using progress bar to display progress and speed when downloading, you can take a look the following example.

    https://www.codeproject.com/Articles/17979/Downloading-Files-in-NET-With-All-Information-Prog

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Stanly Fan Monday, November 20, 2017 12:56 AM
    Tuesday, November 14, 2017 8:37 AM
    Moderator
  • You may need more than just a progress bar since it is entirely possible something could interrupt the download and the installation would never complete.

    La vida loca

    Tuesday, November 14, 2017 6:00 PM