Starting a process from a Windows Service
-
Hi, I am trying to update a Windows Service as follows: * the service uses the Updater Application Block to check for updates to itself. * if updates are found the service should launch a console application and then stop itself * the console application will download the updated files and copy them to the right location and then restart the service My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to. I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application. Is there anything different when starting a process from a service? The code I use is as follows:
Dim p As New Process p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe") p.StartInfo.Arguments = My.Application.Info.AssemblyName p.Start() Me.Stop()
Thanks very much, dhartigan -
Hi, I am trying to update a Windows Service as follows: * the service uses the Updater Application Block to check for updates to itself. * if updates are found the service should launch a console application and then stop itself * the console application will download the updated files and copy them to the right location and then restart the service My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to. I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application. Is there anything different when starting a process from a service? The code I use is as follows:
Dim p As New Process p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe") p.StartInfo.Arguments = My.Application.Info.AssemblyName p.Start() Me.Stop()
Thanks very much, dhartigan -
Hi, I am trying to update a Windows Service as follows: * the service uses the Updater Application Block to check for updates to itself. * if updates are found the service should launch a console application and then stop itself * the console application will download the updated files and copy them to the right location and then restart the service My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to. I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application. Is there anything different when starting a process from a service? The code I use is as follows:
Dim p As New Process p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe") p.StartInfo.Arguments = My.Application.Info.AssemblyName p.Start() Me.Stop()
Thanks very much, dhartigan