-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:[email protected]/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:[email protected]/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:[email protected]/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.

6
  • download the file and then call process.start Commented Jan 6, 2017 at 19:41
  • @Steve Sorry, but what do you mean by download??? I am trying to make the client download the file THROUGH the process.start. Commented Jan 6, 2017 at 19:45
  • Why you call Application.Exit before you create and start the process? Commented Jan 6, 2017 at 19:47
  • download the thing.exe using DownloadFile method or something.And then process.start("thing.exe") Commented Jan 6, 2017 at 19:48
  • These are two separate tasks (download and run/install). Ask them separately. Commented Jan 6, 2017 at 19:50

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Can you point me into a post that says how to do that? I can't find one.
Really ? Searching for ".net ftp client download file" didn't pull up hundreds of hits like this one ? schiffhauer.com/… And searching ".net execute external program" didn't give you a zillion hits much like this one ? stackoverflow.com/questions/3173775/… You need to hone your googling skills a little my friend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.