What went wrong with the following code? I like to start a process and update UI when the comprssion is done.
The error is The specified executable is not a valid application for this OS platform.
string sArgs = "a all.zip a.txt b.txt c.txt";
ProcessStartInfo psi = new ProcessStartInfo("7z.exe", sArgs);
psi.UseShellExecute = false;
psi.CreateNoWindow = false;
psi.LoadUserProfile = false;
Process proc = new Process();
Task t1 = new Task(() =>
{
proc = Process.Start(psi);
}
);
button13.Enabled = false;
Task t2 = t1.ContinueWith((antecedent) =>
{
button13.Enabled = true;
}, TaskScheduler.FromCurrentSynchronizationContext()
);
t1.Start();
7z.exein the systemPATH?7z.exefile 64-bit whereas your OS is 32-bit ?