Downloader Script menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    Hellgawd's Avatar Member
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Downloader Script

    Hey there VB Experts,
    I am wondering how you can make a downloader script. Like something that will read a text based file on the web, and based on what is found there, download an updated file. Somewhat like an Auto Updater.
    I would like a download progress bar as well
    Thanks for helping

    Downloader Script
  2. #2
    EmiloZ's Avatar Flying Piggy Back
    CoreCoins Purchaser
    Reputation
    538
    Join Date
    Jun 2007
    Posts
    1,393
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hope the source i gave you worked well
    - EmiloZ
    Why fill up a signature?

  3. #3
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look into using ClickOnce(intergrated into Microsoft VS.NET compilers) for an auto updating tool.

  4. #4
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Clain View Post
    Look into using ClickOnce(intergrated into Microsoft VS.NET compilers) for an auto updating tool.
    The only problem with ClickOnce is using obfuscated applications with it. It requires some really annoying build options and post-build commands prior to publishing it.

    What I do in STS, is simply check a file (version.txt) on my web server that has the most up-to-date version of the program. (You can get the program version fairly easily at runtime, just google for it.)

    If it sees that the number in version.txt doesn't match the current app version it displays the update available dialog.

    I personally store all versions of STS on my webserver with a common name.

    Scam.Tools.Suite.v<major>.<minor>.<revision>.<build>.exe

    So simply using

    Code:
    myWebClient.DownloadFile("http://www.apocdev.com/downloads/scamtoolssuite/Scam.Tools.Suite.Setup.v"+AppVersion+".exe", Path.GetTempPath() + "\\tempSTSInstall.exe");
    Process.Start(Path.GetTempPath()+"\\tempSTSInstall.exe");
    Environment.Exit(0);
    Will download the new installer, run it, and finally close the current STS. (The installer also asks you to close any running STS's open as well)

    On STS startup, I just do some quick cleaning of the install file.

    Code:
    if (File.Exists(Path.GetTempPath() + "\\tempSTSInstall.exe")
    {
    File.Delete(Path.GetTempPath()+"\\tempSTSInstall.exe");
    }
    It's a simple, but effective way of doing updates. And of course, you're free to do as you please with it. (Even writing a simple PHP script to handle giving out the absolute latest download.)

    The following is my Updater class, and the form that goes along with it. (Just check STS when updating to see how the form actually looks.)

    Code:
    using System;
    using System.Net;
    using System.Reflection;
    using System.Windows.Forms;
    using Scam_Tools_Suite.Forms;
    using Scam_Tools_Suite.Properties;
    
    namespace Scam_Tools_Suite
    {
        internal class Updater
        {
            private static string availableVersion;
    
            public static bool UpdateAvailable()
            {
                Assembly asm = Assembly.GetExecutingAssembly();
                string version = asm.GetName().Version.ToString();
                availableVersion = (new WebClient()).DownloadString("http://www.apocdev.com/sts/version.txt");
                return version != availableVersion;
            }
    
            public static void Update()
            {
                FormUpdate f = new FormUpdate(availableVersion);
                f.Show();
            }
    
            public static void CheckForUpdateBypass()
            {
                if (UpdateAvailable())
                {
                    DialogResult x =
                        MessageBox.Show(
                            "There is an update available!" + Environment.NewLine + "Would you like to update now?",
                            "STS - Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (x == DialogResult.Yes)
                    {
                        Update();
                    }
                }
                else
                {
                    MessageBox.Show("Scam Tools Suite is up to date!", "STS - Update", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
            }
    
            public static void CheckForUpdate()
            {
                if (Settings.Default.CheckForUpdatesOnStartup)
                {
                    if (UpdateAvailable())
                    {
                        DialogResult x =
                            MessageBox.Show(
                                "There is an update available!" + Environment.NewLine + "Would you like to update now?",
                                "STS - Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                        if (x == DialogResult.Yes)
                        {
                            Update();
                        }
                    }
                }
            }
        }
    }
    Code:
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.IO;
    using System.Net;
    using System.Windows.Forms;
    using Scam_Tools_Suite.Properties;
    
    namespace Scam_Tools_Suite.Forms
    {
        public partial class FormUpdate : Form
        {
            private readonly string version;
            private readonly WebClient wc = new WebClient();
    
            public FormUpdate()
            {
                InitializeComponent();
                MdiParent = Program.FormMain;
            }
    
            public FormUpdate(string ver) : this()
            {
                version = ver;
            }
    
            private void FormUpdate_Load(object sender, EventArgs e)
            {
                if (Settings.Default.DisableSkin)
                {
                    timer1.Enabled = false;
                }
                else
                {
                    progressBar1.Style = ProgressBarStyle.Continuous;
                }
                UpdateSTS();
            }
    
            public void UpdateSTS()
            {
                wc.DownloadFileAsync(
                    new Uri(@"http://www.apocdev.com/downloads/scamtoolssuite/Scam.Tools.Suite.Setup.v" + version + ".exe"),
                    Path.GetTempPath() + "\\tempSTSInstall.exe");
                wc.DownloadFileCompleted += wc_DownloadFileCompleted;
            }
    
            private void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
            {
                Process.Start(Path.GetTempPath() + "\\tempSTSInstall.exe");
                Environment.Exit(0);
            }
    
            private void timer1_Tick(object sender, EventArgs e)
            {
                if (progressBar1.Value == progressBar1.Maximum)
                {
                    progressBar1.Value = 0;
                }
                progressBar1.Increment(1);
            }
        }
    }

  5. #5
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, haven't tried it personally with obfuscated applications. Nice method you have there for doing it though.

  6. #6
    Hellgawd's Avatar Member
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks alot both EmiloZ and Apoc, I have combined a variety of the codes youv'e both given me and come to a solution. I just need one more spot of help for another part of the launcher, and that is if the web browser cannot access the remote target (network connection or w/e) the browser either removes itself or hides itself, revealing the image below.

  7. #7
    EmiloZ's Avatar Flying Piggy Back
    CoreCoins Purchaser
    Reputation
    538
    Join Date
    Jun 2007
    Posts
    1,393
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your welcome !
    Why fill up a signature?

  8. #8
    JoeBiden's Avatar Contributor
    Reputation
    153
    Join Date
    Aug 2007
    Posts
    498
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your awesome Apoc thanks.

    Here's the VB code:

    Code:
                    Net.WebClient.DownloadFile("http://www.apocdev.com/downloads/scamtoolssuite/Scam.Tools.Suite.Setup.v" & AppVersion & ".exe", Path.GetTempPath() & "\tempSTSInstall.exe")
            Process.Start(Path.GetTempPath() & "\tempSTSInstall.exe")
    Import system IO.


    Hmm im gonna go figure out how to DL a textfile and show it in textbox

  9. #9
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read the file over a web stream and send it to the textbox.

  10. #10
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dim textFileContents As String = myWebClient.DownloadString("http://url.to.your.file.com/file.txt")
    textBox1.Text = textFileContents

Similar Threads

  1. [Share] Download Youtube Videos Script
    By latruwski in forum Programming
    Replies: 0
    Last Post: 03-14-2008, 06:53 PM
  2. [Program] WoW Jumper AntiAFK Script
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 5
    Last Post: 06-23-2006, 10:38 PM
  3. Faster Patch Download! *See Here*
    By Amedis in forum World of Warcraft General
    Replies: 5
    Last Post: 06-21-2006, 01:10 PM
  4. HTTP download of Joana's Power Leveling 1-60 Videos
    By Matt in forum World of Warcraft General
    Replies: 32
    Last Post: 06-10-2006, 11:10 PM
  5. [Rapidshare.de Download] WoWMastery Guides
    By Matt in forum World of Warcraft Guides
    Replies: 0
    Last Post: 04-02-2006, 09:19 AM
All times are GMT -5. The time now is 09:12 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search