Hi

I have a program that is going to autoupdate itself if there is a new version on a ftp. After the update its supposed to restart itself, here is also the problem.

I have read and tried lots of things but cant really get this to work, any ideas on how to do this would be much appreciated.

Code:

Code:
private void Form1_Load(object sender, EventArgs e)
        {
            // Check if we have internet access
            if (IsConnected())
            {
                // Check FTP for a new version
                if (checkIfWeNeedAUpdate())
                {
                    // Download new version to same folder as startup and named newVikingKundTerminal.exe
                    if (downloadNewVersion())
                    {
                        // Set new modified datetime so we wont download new version again
                        updateModifiedDatetime(remoteFile);
                        // Restart program
                        restartApplication();
                    }
                }
            }
            else
{
// No internet, run in offline mode
}


private void restartApplication()
        {
            try
            {
                if(File.Exists(Application.StartupPath + @"\oldVikingKundTerminal.exe"))
                {
                    File.Delete(Application.StartupPath + @"\oldVikingKundTerminal.exe");
                }
                
                File.Move(Application.StartupPath + @"\VikingKundTerminal.exe", Application.StartupPath + @"\oldVikingKundTerminal.exe");
                
                File.Move(Application.StartupPath + @"\newVikingKundTerminal.exe", Application.StartupPath + @"\VikingKundTerminal.exe");
                
                this.Close();

                Process.Start(Application.ExecutablePath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Omstart av programmet", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Everything works until:
Code:
Process.Start(Application.ExecutablePath);
The error says its trying to start oldVikingKundTerminal.exe....

Suggestions/Ideas on how to accomplish this?