Why patcher is not working?
<p>I tried to do an application, that can do auto updates. But it's not working.</p>

<p>Code of the main "Patched" app:</p>

<pre><code>private void Patch()
{
        using (WebClient client = new WebClient())
        {
            string name = "asd681648.txt";
            client.DownloadFile("http://mypage/patches/" + "Graph" + ".txt", @"C:\" + name);
            string text = File.ReadAllText(@"C:\" + name);
            File.Delete(@"C:\" + name);
            string[] version = text.Split('.');
            string[] sVersion = set.ver.Split('.');
            for (int i = 0; i &lt; version.Length; i++)
            {
                if (int.Parse(version[i]) &gt; int.Parse(sVersion[i]))
                {
                    MessageBox.Show("New version will be downloaded!");
                    Process.Start(Environment.CurrentDirectory + "\\Patcher.exe", "Graph "+set.ver+" "+Environment.CurrentDirectory+"\\");
                    Application.Exit();
                    break;
                }
            }
        }
}
</code></pre>

<p>And the code of "Patcher":</p>

<pre><code>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Deployment.Compression.Cab;

namespace Patcher
{
    class Program
    {
        static void Main(string[] args)
        {
            WebClient client=new WebClient();
            string name = "asd2341648.txt";
            client.DownloadFile("http://mypage/patches/"+args[0]+".txt", @"C:\"+name);
            string text = File.ReadAllText(@"C:\" + name);
            File.Delete(@"C:\"+name);
            string[] version = text.Split('.');
            string[] sVersion = args[1].Split('.');
            for (int i = 0; i &lt; version.Length; i++)
            {
                if(int.Parse(version[i])&gt;int.Parse(sVersion[i]))
                {
                    break;
                }
                if(i==version.Length-1)
                {
                    return;
                }
            }
            Console.WriteLine("New version is avaliable. Downloading...");
            client.DownloadFile("http://mypage/patches/patches/" + args[0]+".cab",       @"C:\"+args[0]+".cab");
            CabInfo cab=new CabInfo(@"C:\"+args[0]+".cab");
            cab.Unpack(args[2]);
            File.Delete( @"C:\"+args[0]+".cab");
        }
    }
}
</code></pre>
