[AutoPatcher]

07/19/2010 02:56 Fish*#1
I was trying to make an autopatcher, but im kinda stucked with reading from host.

I tried: (changed IPHERE to ip)
Code:
            Ini Configg = new Ini(System.Windows.Forms.Application.StartupPath + @"\IPHERE\autopatcher\Config.ini");
            string ThePath = Configg.ReadValue("Config", "Patch");
didnt work, anybody got a solution how i can read it from the host?

The autopatcher folder is in AppServ\www folder

any solutions?
07/19/2010 05:28 Arcо#2
Quote:
Originally Posted by grillmad View Post
I was trying to make an autopatcher, but im kinda stucked with reading from host.

I tried: (changed IPHERE to ip)
Code:
            Ini Configg = new Ini(System.Windows.Forms.Application.StartupPath + @"\IPHERE\autopatcher\Config.ini");
            string ThePath = Configg.ReadValue("Config", "Patch");
didnt work, anybody got a solution how i can read it from the host?

The autopatcher folder is in AppServ\www folder

any solutions?
Read kinshi's src.
07/19/2010 05:38 Fish*#3
Okay thanks :)
07/20/2010 20:03 MonstersAbroad#4
Why use an ini? Check the version.dat against the .exe's on the site ex:
Code:
  private void Form1_Load(object sender, EventArgs e)
        {
            label1.Text = ("Checking for updates...");
            string s = File.ReadAllText("version.dat");
            label2.Text = ("Version: " + s);
            WebClient client = new WebClient();
            client.DownloadFileCompleted += new AsyncCompletedEventHandler(this.client_DownloadFileCompleted);
            client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(this.client_DownloadProgressChanged);
            try
            {
                int num = int.Parse(s) + 1;
                client.DownloadFileAsync(new Uri("http://localhost/updates/" + num.ToString() + ".exe"), "what.exe", null);
                webBrowser1.Navigate("http://localhost/updates/" + num.ToString() + ".html");
            }
            catch (Exception)
            {
                label1.Text = ("Client upto date.");
            }
        }
        private void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            if (e.Error != null)
            {
            }
            else
            {
                this.Startupdate();
            }
        }
        private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
        {
            this.label1.Text = "Updating...."
            this.progressBar1.Value = e.ProgressPercentage;
        }
        private void StartConquer()
        {
//however you wonna start co.
        }
        private void Startupdate()
        {
            Process process = new Process();
            ProcessStartInfo info = new ProcessStartInfo();
            info.FileName = "Temp.exe";
            info.UseShellExecute = true;
            process.StartInfo = info;
            process.Start();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
95% Credits to Ultimati0n. the %5 is to me for putting it into a .cs and editing it, and removing a fair bit from that autopatcher (including how to start a 5180+ co.exe) so. yeah.