Code: Select all
using System.Diagnostics;
...
//Declare and instantiate a new process component.
System.Diagnostics.Process process;
process = new System.Diagnostics.Process();
System.Diagnostics.Process.Start("updater.exe", "/checknow");
process.Close();
Code: Select all
// check for updates on the website
// The updater.exe program must be in the APPDIR sitting next to main.exe
//Declare and instantiate a new process component.
string path = "updater.exe";
if (File.Exists (path)) {
System.Diagnostics.Process process;
process = new System.Diagnostics.Process ();
System.Diagnostics.Process.Start (path, "/checknow /silent");
process.Close ();
}
else {
MessageBox.Show ("Can't see the updater.exe program");
}
Code: Select all
System.Diagnostics.Process.Start (path, "/silent");
Hi,What does code look like when you want to check for "/justcheck"? The documentation says it returns 0. How would you check that in C#?
Code: Select all
private void button2_Click(object sender, EventArgs e)
{
Process process = Process.Start(updaterModulePath, "/justcheck");
process.WaitForExit();
if (process.ExitCode == 0)
{
MessageBox.Show("Update found!");
process.Close();
}
}