Msi not waiting for service to completely stop before returning










1















I built a Msi using InstallShield.



The Msi is for one single Windows Service. Installer's service event is set to wait for event to complete for



[Install Start, Install Stop, Install Delete, Uninstall Stop, Uninstall Delete]



However during upgrade (REINSTALL=ALL REINSTALLMODE=vomus) I keep getting prompt for restart at the end on one of the low power test VM.



So I went ahead and enabled verbose logging to figure out whats going on.



Some of the key log entries are as follows:



MSI (s) (8C:E0) [15:20:59:264]: RESTART MANAGER: Detected that the service my service will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager
MSI (s) (8C:E0) [15:20:59:264]: Note: 1: 2727 2:


Kind of expected since the service is running and everything should be unlocked once service is stopped



MSI (s) (8C:E0) [15:21:00:483]: Doing action: StopServices
Action 15:21:00: StopServices. Stopping services
Action start 15:21:00: StopServices.
StopServices: Service: Stopping services
Action ended 15:21:00: StopServices. Return value 1.
MSI (s) (8C:E0) [15:21:00:483]: Doing action: DeleteServices
Action 15:21:00: DeleteServices. Deleting services
Action start 15:21:00: DeleteServices.
DeleteServices: Service: Deleting services
Action ended 15:21:00: DeleteServices. Return value 1.


Service stopped and removed at 15:21:00 (The time stamp suggests that the service was stopped within 1s. However that slow VM takes as long as 10s to fully stop it when its done thru the Service Management Console)



MSI (s) (8C:E0) [15:21:02:232]: Executing op: FileCopy(SourceName=removed,SourceCabKey=removed,DestName=removed,Attributes=16384,FileSize=17488,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=3.6.12.442,Language=0,InstallMode=126091264,,,,,,,)
MSI (s) (8C:E0) [15:21:02:232]: File: C:Program Files (x86)my exe; Overwrite; Won't patch; Existing file is a lower version
MSI (s) (8C:E0) [15:21:02:232]: Source for file 'removed' is compressed
InstallFiles: File: my exe, Directory: C:Program Files (x86)removed, Size: 17488
MSI (s) (8C:E0) [15:21:02:232]: Re-applying security from existing file.
Info 1603. The file C:Program Files (x86)my exe is being held in use. Close that application and retry.
MSI (s) (8C:E0) [15:21:07:700]: Verifying accessibility of file: my exe
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:


File copy operation failed at 15:21:07 because the service process is running.



So I decided that I will attempt to stop the service before hand to make sure its fully stopped before it reaches copy file operation



I added a custom event before InstallValidate action which calls



sc stop service name


And make it run synchronously but ignores exit code



MSI (s) (0C:40) [15:30:53:066]: Doing action: AttemptStopService
Action 15:30:53: AttemptStopService.
Action start 15:30:53: AttemptStopService.
Action ended 15:30:53: AttemptStopService. Return value 1.
MSI (s) (0C:40) [15:30:53:113]: Doing action: InstallValidate
Action 15:30:53: InstallValidate. Validating install
Action start 15:30:53: InstallValidate.


however this resulted in the "the setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required ...." popup. When the popup is shown I checked task manager and the process is gone, service is stopped.



Again this kinda implies that sc.exe is not waiting for the process to fully terminated before returning to the caller.



Did I miss something or is it by design? And is there anything I can do on the installer side or service.exe side to prevent this?



Update:

I added another custom action which will pop a cmd window that lists the process currently running associated with my service to see if it is indeed the action did not wait for process to stop.



cmd.exe /k tasklist /FI "Services eq my service name"


The action is placed right before RemoveFiles (which is a little bit before InstallFiles) and heres the new log



MSI (s) (A8:F8) [10:56:42:725]: Doing action: StopServices
Action 10:56:42: StopServices. Stopping services
Action start 10:56:42: StopServices.
Action ended 10:56:42: StopServices. Return value 1.
MSI (s) (A8:F8) [10:56:42:725]: Doing action: DeleteServices
Action 10:56:42: DeleteServices. Deleting services
Action start 10:56:42: DeleteServices.
Action ended 10:56:42: DeleteServices. Return value 1.


...



MSI (s) (A8:F8) [10:56:42:757]: Doing action: Test
Action 10:56:42: Test.
Action start 10:56:42: Test.
CustomAction Test returned actual error code -1073741510 but will be translated to success due to continue marking


In the CMD window i can clearly see that the process is still running even though the previous stop service action should have stopped and deleted it.



Also gave it more than 1 min on the CMD window and the service is still running, process still alive. so basically the stop service action did not do its job at all.










share|improve this question
























  • Is this just on one virtual? Is the service itself well-tested? What security software exists on that virtual? What does the service do? Is it a .NET service? Does it use COM? Is there service logging available? Maybe in the event viewer? (sorry, trifles, but have to ask). A deployment mnemonic: what is locking (in use), what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states (disk space, time & date & language settings, licensing, windows patch state, path too long, etc...), what are incompatible products?

    – Stein Åsmul
    Nov 14 '18 at 8:33












  • I might resort to procmon.exe to monitor what the service does when shutting down.

    – Stein Åsmul
    Nov 14 '18 at 8:35











  • @SteinÅsmul looks like the person which made the service is not a windows service expert. Its a .NET service. We dont know if it uses COM but likely no. Took a closer look in the log it seems like the OnStop function is not getting called during msi's stop service action but it is when I do it in management console and net stop

    – Steve
    Nov 16 '18 at 16:11











  • @SteinÅsmul also confirmed that the process is still running after the stop service action with cmd /k action. Whats the difference between stop service action and stop service button in management console?

    – Steve
    Nov 16 '18 at 16:12











  • I recall Chris Painter mentioning something about the management console being open affecting service start and stop, but I can't find it right now. I am out of time, maybe you can check this FAQ for information. And maybe a sweep of Chris's old blog posts.

    – Stein Åsmul
    Nov 16 '18 at 17:29
















1















I built a Msi using InstallShield.



The Msi is for one single Windows Service. Installer's service event is set to wait for event to complete for



[Install Start, Install Stop, Install Delete, Uninstall Stop, Uninstall Delete]



However during upgrade (REINSTALL=ALL REINSTALLMODE=vomus) I keep getting prompt for restart at the end on one of the low power test VM.



So I went ahead and enabled verbose logging to figure out whats going on.



Some of the key log entries are as follows:



MSI (s) (8C:E0) [15:20:59:264]: RESTART MANAGER: Detected that the service my service will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager
MSI (s) (8C:E0) [15:20:59:264]: Note: 1: 2727 2:


Kind of expected since the service is running and everything should be unlocked once service is stopped



MSI (s) (8C:E0) [15:21:00:483]: Doing action: StopServices
Action 15:21:00: StopServices. Stopping services
Action start 15:21:00: StopServices.
StopServices: Service: Stopping services
Action ended 15:21:00: StopServices. Return value 1.
MSI (s) (8C:E0) [15:21:00:483]: Doing action: DeleteServices
Action 15:21:00: DeleteServices. Deleting services
Action start 15:21:00: DeleteServices.
DeleteServices: Service: Deleting services
Action ended 15:21:00: DeleteServices. Return value 1.


Service stopped and removed at 15:21:00 (The time stamp suggests that the service was stopped within 1s. However that slow VM takes as long as 10s to fully stop it when its done thru the Service Management Console)



MSI (s) (8C:E0) [15:21:02:232]: Executing op: FileCopy(SourceName=removed,SourceCabKey=removed,DestName=removed,Attributes=16384,FileSize=17488,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=3.6.12.442,Language=0,InstallMode=126091264,,,,,,,)
MSI (s) (8C:E0) [15:21:02:232]: File: C:Program Files (x86)my exe; Overwrite; Won't patch; Existing file is a lower version
MSI (s) (8C:E0) [15:21:02:232]: Source for file 'removed' is compressed
InstallFiles: File: my exe, Directory: C:Program Files (x86)removed, Size: 17488
MSI (s) (8C:E0) [15:21:02:232]: Re-applying security from existing file.
Info 1603. The file C:Program Files (x86)my exe is being held in use. Close that application and retry.
MSI (s) (8C:E0) [15:21:07:700]: Verifying accessibility of file: my exe
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:


File copy operation failed at 15:21:07 because the service process is running.



So I decided that I will attempt to stop the service before hand to make sure its fully stopped before it reaches copy file operation



I added a custom event before InstallValidate action which calls



sc stop service name


And make it run synchronously but ignores exit code



MSI (s) (0C:40) [15:30:53:066]: Doing action: AttemptStopService
Action 15:30:53: AttemptStopService.
Action start 15:30:53: AttemptStopService.
Action ended 15:30:53: AttemptStopService. Return value 1.
MSI (s) (0C:40) [15:30:53:113]: Doing action: InstallValidate
Action 15:30:53: InstallValidate. Validating install
Action start 15:30:53: InstallValidate.


however this resulted in the "the setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required ...." popup. When the popup is shown I checked task manager and the process is gone, service is stopped.



Again this kinda implies that sc.exe is not waiting for the process to fully terminated before returning to the caller.



Did I miss something or is it by design? And is there anything I can do on the installer side or service.exe side to prevent this?



Update:

I added another custom action which will pop a cmd window that lists the process currently running associated with my service to see if it is indeed the action did not wait for process to stop.



cmd.exe /k tasklist /FI "Services eq my service name"


The action is placed right before RemoveFiles (which is a little bit before InstallFiles) and heres the new log



MSI (s) (A8:F8) [10:56:42:725]: Doing action: StopServices
Action 10:56:42: StopServices. Stopping services
Action start 10:56:42: StopServices.
Action ended 10:56:42: StopServices. Return value 1.
MSI (s) (A8:F8) [10:56:42:725]: Doing action: DeleteServices
Action 10:56:42: DeleteServices. Deleting services
Action start 10:56:42: DeleteServices.
Action ended 10:56:42: DeleteServices. Return value 1.


...



MSI (s) (A8:F8) [10:56:42:757]: Doing action: Test
Action 10:56:42: Test.
Action start 10:56:42: Test.
CustomAction Test returned actual error code -1073741510 but will be translated to success due to continue marking


In the CMD window i can clearly see that the process is still running even though the previous stop service action should have stopped and deleted it.



Also gave it more than 1 min on the CMD window and the service is still running, process still alive. so basically the stop service action did not do its job at all.










share|improve this question
























  • Is this just on one virtual? Is the service itself well-tested? What security software exists on that virtual? What does the service do? Is it a .NET service? Does it use COM? Is there service logging available? Maybe in the event viewer? (sorry, trifles, but have to ask). A deployment mnemonic: what is locking (in use), what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states (disk space, time & date & language settings, licensing, windows patch state, path too long, etc...), what are incompatible products?

    – Stein Åsmul
    Nov 14 '18 at 8:33












  • I might resort to procmon.exe to monitor what the service does when shutting down.

    – Stein Åsmul
    Nov 14 '18 at 8:35











  • @SteinÅsmul looks like the person which made the service is not a windows service expert. Its a .NET service. We dont know if it uses COM but likely no. Took a closer look in the log it seems like the OnStop function is not getting called during msi's stop service action but it is when I do it in management console and net stop

    – Steve
    Nov 16 '18 at 16:11











  • @SteinÅsmul also confirmed that the process is still running after the stop service action with cmd /k action. Whats the difference between stop service action and stop service button in management console?

    – Steve
    Nov 16 '18 at 16:12











  • I recall Chris Painter mentioning something about the management console being open affecting service start and stop, but I can't find it right now. I am out of time, maybe you can check this FAQ for information. And maybe a sweep of Chris's old blog posts.

    – Stein Åsmul
    Nov 16 '18 at 17:29














1












1








1








I built a Msi using InstallShield.



The Msi is for one single Windows Service. Installer's service event is set to wait for event to complete for



[Install Start, Install Stop, Install Delete, Uninstall Stop, Uninstall Delete]



However during upgrade (REINSTALL=ALL REINSTALLMODE=vomus) I keep getting prompt for restart at the end on one of the low power test VM.



So I went ahead and enabled verbose logging to figure out whats going on.



Some of the key log entries are as follows:



MSI (s) (8C:E0) [15:20:59:264]: RESTART MANAGER: Detected that the service my service will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager
MSI (s) (8C:E0) [15:20:59:264]: Note: 1: 2727 2:


Kind of expected since the service is running and everything should be unlocked once service is stopped



MSI (s) (8C:E0) [15:21:00:483]: Doing action: StopServices
Action 15:21:00: StopServices. Stopping services
Action start 15:21:00: StopServices.
StopServices: Service: Stopping services
Action ended 15:21:00: StopServices. Return value 1.
MSI (s) (8C:E0) [15:21:00:483]: Doing action: DeleteServices
Action 15:21:00: DeleteServices. Deleting services
Action start 15:21:00: DeleteServices.
DeleteServices: Service: Deleting services
Action ended 15:21:00: DeleteServices. Return value 1.


Service stopped and removed at 15:21:00 (The time stamp suggests that the service was stopped within 1s. However that slow VM takes as long as 10s to fully stop it when its done thru the Service Management Console)



MSI (s) (8C:E0) [15:21:02:232]: Executing op: FileCopy(SourceName=removed,SourceCabKey=removed,DestName=removed,Attributes=16384,FileSize=17488,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=3.6.12.442,Language=0,InstallMode=126091264,,,,,,,)
MSI (s) (8C:E0) [15:21:02:232]: File: C:Program Files (x86)my exe; Overwrite; Won't patch; Existing file is a lower version
MSI (s) (8C:E0) [15:21:02:232]: Source for file 'removed' is compressed
InstallFiles: File: my exe, Directory: C:Program Files (x86)removed, Size: 17488
MSI (s) (8C:E0) [15:21:02:232]: Re-applying security from existing file.
Info 1603. The file C:Program Files (x86)my exe is being held in use. Close that application and retry.
MSI (s) (8C:E0) [15:21:07:700]: Verifying accessibility of file: my exe
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:


File copy operation failed at 15:21:07 because the service process is running.



So I decided that I will attempt to stop the service before hand to make sure its fully stopped before it reaches copy file operation



I added a custom event before InstallValidate action which calls



sc stop service name


And make it run synchronously but ignores exit code



MSI (s) (0C:40) [15:30:53:066]: Doing action: AttemptStopService
Action 15:30:53: AttemptStopService.
Action start 15:30:53: AttemptStopService.
Action ended 15:30:53: AttemptStopService. Return value 1.
MSI (s) (0C:40) [15:30:53:113]: Doing action: InstallValidate
Action 15:30:53: InstallValidate. Validating install
Action start 15:30:53: InstallValidate.


however this resulted in the "the setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required ...." popup. When the popup is shown I checked task manager and the process is gone, service is stopped.



Again this kinda implies that sc.exe is not waiting for the process to fully terminated before returning to the caller.



Did I miss something or is it by design? And is there anything I can do on the installer side or service.exe side to prevent this?



Update:

I added another custom action which will pop a cmd window that lists the process currently running associated with my service to see if it is indeed the action did not wait for process to stop.



cmd.exe /k tasklist /FI "Services eq my service name"


The action is placed right before RemoveFiles (which is a little bit before InstallFiles) and heres the new log



MSI (s) (A8:F8) [10:56:42:725]: Doing action: StopServices
Action 10:56:42: StopServices. Stopping services
Action start 10:56:42: StopServices.
Action ended 10:56:42: StopServices. Return value 1.
MSI (s) (A8:F8) [10:56:42:725]: Doing action: DeleteServices
Action 10:56:42: DeleteServices. Deleting services
Action start 10:56:42: DeleteServices.
Action ended 10:56:42: DeleteServices. Return value 1.


...



MSI (s) (A8:F8) [10:56:42:757]: Doing action: Test
Action 10:56:42: Test.
Action start 10:56:42: Test.
CustomAction Test returned actual error code -1073741510 but will be translated to success due to continue marking


In the CMD window i can clearly see that the process is still running even though the previous stop service action should have stopped and deleted it.



Also gave it more than 1 min on the CMD window and the service is still running, process still alive. so basically the stop service action did not do its job at all.










share|improve this question
















I built a Msi using InstallShield.



The Msi is for one single Windows Service. Installer's service event is set to wait for event to complete for



[Install Start, Install Stop, Install Delete, Uninstall Stop, Uninstall Delete]



However during upgrade (REINSTALL=ALL REINSTALLMODE=vomus) I keep getting prompt for restart at the end on one of the low power test VM.



So I went ahead and enabled verbose logging to figure out whats going on.



Some of the key log entries are as follows:



MSI (s) (8C:E0) [15:20:59:264]: RESTART MANAGER: Detected that the service my service will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager
MSI (s) (8C:E0) [15:20:59:264]: Note: 1: 2727 2:


Kind of expected since the service is running and everything should be unlocked once service is stopped



MSI (s) (8C:E0) [15:21:00:483]: Doing action: StopServices
Action 15:21:00: StopServices. Stopping services
Action start 15:21:00: StopServices.
StopServices: Service: Stopping services
Action ended 15:21:00: StopServices. Return value 1.
MSI (s) (8C:E0) [15:21:00:483]: Doing action: DeleteServices
Action 15:21:00: DeleteServices. Deleting services
Action start 15:21:00: DeleteServices.
DeleteServices: Service: Deleting services
Action ended 15:21:00: DeleteServices. Return value 1.


Service stopped and removed at 15:21:00 (The time stamp suggests that the service was stopped within 1s. However that slow VM takes as long as 10s to fully stop it when its done thru the Service Management Console)



MSI (s) (8C:E0) [15:21:02:232]: Executing op: FileCopy(SourceName=removed,SourceCabKey=removed,DestName=removed,Attributes=16384,FileSize=17488,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=3.6.12.442,Language=0,InstallMode=126091264,,,,,,,)
MSI (s) (8C:E0) [15:21:02:232]: File: C:Program Files (x86)my exe; Overwrite; Won't patch; Existing file is a lower version
MSI (s) (8C:E0) [15:21:02:232]: Source for file 'removed' is compressed
InstallFiles: File: my exe, Directory: C:Program Files (x86)removed, Size: 17488
MSI (s) (8C:E0) [15:21:02:232]: Re-applying security from existing file.
Info 1603. The file C:Program Files (x86)my exe is being held in use. Close that application and retry.
MSI (s) (8C:E0) [15:21:07:700]: Verifying accessibility of file: my exe
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:
MSI (s) (8C:E0) [15:21:07:700]: Note: 1: 2318 2:


File copy operation failed at 15:21:07 because the service process is running.



So I decided that I will attempt to stop the service before hand to make sure its fully stopped before it reaches copy file operation



I added a custom event before InstallValidate action which calls



sc stop service name


And make it run synchronously but ignores exit code



MSI (s) (0C:40) [15:30:53:066]: Doing action: AttemptStopService
Action 15:30:53: AttemptStopService.
Action start 15:30:53: AttemptStopService.
Action ended 15:30:53: AttemptStopService. Return value 1.
MSI (s) (0C:40) [15:30:53:113]: Doing action: InstallValidate
Action 15:30:53: InstallValidate. Validating install
Action start 15:30:53: InstallValidate.


however this resulted in the "the setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required ...." popup. When the popup is shown I checked task manager and the process is gone, service is stopped.



Again this kinda implies that sc.exe is not waiting for the process to fully terminated before returning to the caller.



Did I miss something or is it by design? And is there anything I can do on the installer side or service.exe side to prevent this?



Update:

I added another custom action which will pop a cmd window that lists the process currently running associated with my service to see if it is indeed the action did not wait for process to stop.



cmd.exe /k tasklist /FI "Services eq my service name"


The action is placed right before RemoveFiles (which is a little bit before InstallFiles) and heres the new log



MSI (s) (A8:F8) [10:56:42:725]: Doing action: StopServices
Action 10:56:42: StopServices. Stopping services
Action start 10:56:42: StopServices.
Action ended 10:56:42: StopServices. Return value 1.
MSI (s) (A8:F8) [10:56:42:725]: Doing action: DeleteServices
Action 10:56:42: DeleteServices. Deleting services
Action start 10:56:42: DeleteServices.
Action ended 10:56:42: DeleteServices. Return value 1.


...



MSI (s) (A8:F8) [10:56:42:757]: Doing action: Test
Action 10:56:42: Test.
Action start 10:56:42: Test.
CustomAction Test returned actual error code -1073741510 but will be translated to success due to continue marking


In the CMD window i can clearly see that the process is still running even though the previous stop service action should have stopped and deleted it.



Also gave it more than 1 min on the CMD window and the service is still running, process still alive. so basically the stop service action did not do its job at all.







windows-installer installshield






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 16:50







Steve

















asked Nov 13 '18 at 21:59









SteveSteve

7,45161542




7,45161542












  • Is this just on one virtual? Is the service itself well-tested? What security software exists on that virtual? What does the service do? Is it a .NET service? Does it use COM? Is there service logging available? Maybe in the event viewer? (sorry, trifles, but have to ask). A deployment mnemonic: what is locking (in use), what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states (disk space, time & date & language settings, licensing, windows patch state, path too long, etc...), what are incompatible products?

    – Stein Åsmul
    Nov 14 '18 at 8:33












  • I might resort to procmon.exe to monitor what the service does when shutting down.

    – Stein Åsmul
    Nov 14 '18 at 8:35











  • @SteinÅsmul looks like the person which made the service is not a windows service expert. Its a .NET service. We dont know if it uses COM but likely no. Took a closer look in the log it seems like the OnStop function is not getting called during msi's stop service action but it is when I do it in management console and net stop

    – Steve
    Nov 16 '18 at 16:11











  • @SteinÅsmul also confirmed that the process is still running after the stop service action with cmd /k action. Whats the difference between stop service action and stop service button in management console?

    – Steve
    Nov 16 '18 at 16:12











  • I recall Chris Painter mentioning something about the management console being open affecting service start and stop, but I can't find it right now. I am out of time, maybe you can check this FAQ for information. And maybe a sweep of Chris's old blog posts.

    – Stein Åsmul
    Nov 16 '18 at 17:29


















  • Is this just on one virtual? Is the service itself well-tested? What security software exists on that virtual? What does the service do? Is it a .NET service? Does it use COM? Is there service logging available? Maybe in the event viewer? (sorry, trifles, but have to ask). A deployment mnemonic: what is locking (in use), what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states (disk space, time & date & language settings, licensing, windows patch state, path too long, etc...), what are incompatible products?

    – Stein Åsmul
    Nov 14 '18 at 8:33












  • I might resort to procmon.exe to monitor what the service does when shutting down.

    – Stein Åsmul
    Nov 14 '18 at 8:35











  • @SteinÅsmul looks like the person which made the service is not a windows service expert. Its a .NET service. We dont know if it uses COM but likely no. Took a closer look in the log it seems like the OnStop function is not getting called during msi's stop service action but it is when I do it in management console and net stop

    – Steve
    Nov 16 '18 at 16:11











  • @SteinÅsmul also confirmed that the process is still running after the stop service action with cmd /k action. Whats the difference between stop service action and stop service button in management console?

    – Steve
    Nov 16 '18 at 16:12











  • I recall Chris Painter mentioning something about the management console being open affecting service start and stop, but I can't find it right now. I am out of time, maybe you can check this FAQ for information. And maybe a sweep of Chris's old blog posts.

    – Stein Åsmul
    Nov 16 '18 at 17:29

















Is this just on one virtual? Is the service itself well-tested? What security software exists on that virtual? What does the service do? Is it a .NET service? Does it use COM? Is there service logging available? Maybe in the event viewer? (sorry, trifles, but have to ask). A deployment mnemonic: what is locking (in use), what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states (disk space, time & date & language settings, licensing, windows patch state, path too long, etc...), what are incompatible products?

– Stein Åsmul
Nov 14 '18 at 8:33






Is this just on one virtual? Is the service itself well-tested? What security software exists on that virtual? What does the service do? Is it a .NET service? Does it use COM? Is there service logging available? Maybe in the event viewer? (sorry, trifles, but have to ask). A deployment mnemonic: what is locking (in use), what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states (disk space, time & date & language settings, licensing, windows patch state, path too long, etc...), what are incompatible products?

– Stein Åsmul
Nov 14 '18 at 8:33














I might resort to procmon.exe to monitor what the service does when shutting down.

– Stein Åsmul
Nov 14 '18 at 8:35





I might resort to procmon.exe to monitor what the service does when shutting down.

– Stein Åsmul
Nov 14 '18 at 8:35













@SteinÅsmul looks like the person which made the service is not a windows service expert. Its a .NET service. We dont know if it uses COM but likely no. Took a closer look in the log it seems like the OnStop function is not getting called during msi's stop service action but it is when I do it in management console and net stop

– Steve
Nov 16 '18 at 16:11





@SteinÅsmul looks like the person which made the service is not a windows service expert. Its a .NET service. We dont know if it uses COM but likely no. Took a closer look in the log it seems like the OnStop function is not getting called during msi's stop service action but it is when I do it in management console and net stop

– Steve
Nov 16 '18 at 16:11













@SteinÅsmul also confirmed that the process is still running after the stop service action with cmd /k action. Whats the difference between stop service action and stop service button in management console?

– Steve
Nov 16 '18 at 16:12





@SteinÅsmul also confirmed that the process is still running after the stop service action with cmd /k action. Whats the difference between stop service action and stop service button in management console?

– Steve
Nov 16 '18 at 16:12













I recall Chris Painter mentioning something about the management console being open affecting service start and stop, but I can't find it right now. I am out of time, maybe you can check this FAQ for information. And maybe a sweep of Chris's old blog posts.

– Stein Åsmul
Nov 16 '18 at 17:29






I recall Chris Painter mentioning something about the management console being open affecting service start and stop, but I can't find it right now. I am out of time, maybe you can check this FAQ for information. And maybe a sweep of Chris's old blog posts.

– Stein Åsmul
Nov 16 '18 at 17:29













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290148%2fmsi-not-waiting-for-service-to-completely-stop-before-returning%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290148%2fmsi-not-waiting-for-service-to-completely-stop-before-returning%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto