dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.68k stars 1.06k forks source link

Installer kills software without asking #41815

Open miloush opened 3 months ago

miloush commented 3 months ago

I have run a daily build .NET runtime Windows x64 installer (9.0.0-preview.7.24322.1). Apps that were using msbuild were killed without asking and I lost work.

Could we have a prompt before doing that?

joeloff commented 2 months ago

Can you grab the log files from %temp%. the files should look something like Microsoft_.NET_SDK_9.0.100-preview.6.24328.19_(x64)_20240716140756.log and there will be a primary log and separate logs for each MSI.

If you performed a quiet install you won't get prompt. If you performed a UI based install you may get prompted, but it depends on a number of factors

  1. Whether the install and the application are running under different SIDs
  2. Whether you modified the Restart Manager Policies - this determines how the installer service determines if any files are being used. If the policies disable RM, the OS will switch to using an older method. See https://learn.microsoft.com/en-us/windows/win32/msi/disableautomaticapplicationshutdown
  3. Whether the application registered itself with Restart Manager
  4. Whether the application is windowed. Normally, for windows applications, the installer service will trigger a callback that will show UI that lists applications/processes holding on to files that need to be modified. However, sending that message is entirely under the control of the installer and restart manager services in the OS.

The MSI logs should at least show some information about what the installer service decided to do.

You can also look at RM events. From Powershell, you can run Get-EventLog -LogName Application -Source Microsoft-Windows-RestartManager | Select-Object -Property * > rm.txt

Unlike the rest of the install process, the .NET host MSI is an inplace update, so the MSI immediately removes its older version. The rest of .NET is SxS and the older versions get removed when the older bundle is removed, after installing the new version.