I have a Worker Service which has an auto-update feature. Whenever there is an update available it needs to call an Installer.exe in administrator mode which is a console application (Project Referenced). Whenever I Run Intaller.exe as a standalone console app, it does its work but when it is called from worker service it doesn't even get invoked.
The way I know it doesn't work is the first task of the Installer app is to stop the worker service, but it doesn't stop.
I tried including app.manifest in Installer.exe and Worker Service both, to run them as Administrator but that didn't change a thing.
This is how I am calling the Installer App.
string installerPath = Directory.GetCurrentDirectory() + @"\" + "Installer.exe";
Log.Debug("Installer Path: {0}", installerPath);
var installProcess = new ProcessStartInfo();
installProcess.FileName = installerPath;
installProcess.CreateNoWindow = false;
installProcess.WindowStyle = ProcessWindowStyle.Normal;
installProcess.UseShellExecute = true;
installProcess.Verb = "runas";
Log.Debug("Update process started.This service will shutdown now.");
var process = Process.Start(installProcess);
process.WaitForExit();
process.Close();
What am I doing wrong here? Or is it not possible to do this?