-2

I am trying to create a program that when a button is pressed, it goes into my FTP server and auto installs another program into the client's computer.

The program is deleting the old file on the client's computer. And installing in the new one.

    if (!new WebClient().DownloadString("ftp://username:password@asdf.bplaced.net/version.txt").Contains("1.0.0.0"))

                        {

                        }
                        else
                        {
                            if (MessageBox.Show("New Update! Would you like to update?", "Yay!",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Information) ==
                                System.Windows.Forms.DialogResult.Yes)
                            {
Process.Start("ftp://username:password@asdf.bplaced.net/place/thing.exe");
                                Application.Exit();
                                ProcessStartInfo Info = new ProcessStartInfo();
                                Info.Arguments = "/C choice /C Y /N /D Y /T 3 & Del " +
                                               Application.ExecutablePath;
                                Info.WindowStyle = ProcessWindowStyle.Hidden;
                                Info.CreateNoWindow = true;
                                Info.FileName = "cmd.exe";
                                Process.Start(Info);

Process.Start("ftp://username:password@asdf.bplaced.net/place/thing.exe");

This is the new file that I want installed into the client's computer. So far it leads the client to a web browser which opens a browser at a download link. I want it to auto install into their computer.

RockyBoa
  • 89
  • 9

1 Answers1

1

FTP is a file copy protocol, and it is not a remote file system. Consequently you wont get windows to execute a file hosted on an FTP server. You should download the file using the FTP protocol to a local Temp folder, then execute the file you downloaded.

PhillipH
  • 6,182
  • 1
  • 15
  • 25
  • Can you point me into a post that says how to do that? I can't find one. – RockyBoa Jan 06 '17 at 20:01
  • Really ? Searching for ".net ftp client download file" didn't pull up hundreds of hits like this one ? http://www.schiffhauer.com/downloading-a-file-from-ftp-with-system-net-ftpclient/ And searching ".net execute external program" didn't give you a zillion hits much like this one ? http://stackoverflow.com/questions/3173775/how-to-run-external-program-via-a-c-sharp-program You need to hone your googling skills a little my friend. – PhillipH Jan 07 '17 at 13:29