Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer silently terminates Git Extensions #17055

Open
sharwell opened this issue Jul 24, 2023 · 6 comments
Open

Installer silently terminates Git Extensions #17055

sharwell opened this issue Jul 24, 2023 · 6 comments
Assignees

Comments

@sharwell
Copy link
Member

sharwell commented Jul 24, 2023

Steps to reproduce

  1. Launch Git Extensions 4.1.0.16698 and leave it running
  2. Download and install the .NET SDK 8.0 Preview 4 (also reproduces on Preview 6)

Expected behavior

Either of the following:

  1. The installer prompts me to close Git Extensions before proceeding
  2. The installer runs to completion with Git Extensions also running

Actual behavior

Git Extensions is silently terminated during the installation process.

@joeloff
Copy link
Member

joeloff commented Jul 26, 2023

I double checked and we don't turn of the files-in-use dialog. From the logs though it appears Restart Manager is killing the application. Excerpt below is from the Desktop Runtime installation.

MSI (s) (60:0C) [21:18:29:239]: RESTART MANAGER: Successfully shut down all applications in the service's session that held files in use.
MSI (c) (0C:94) [21:18:29:239]: RESTART MANAGER: Successfully shut down all applications that held files in use.

The default action is always to stop the running application, assuming control went through restart manager and optionally restart it if the application registered itself. However, for applications running under a normal user and the elevated installer, restarting an application won't work (You'll see events from Restart Manager in the Windows Event Viewer).

I have seen the .NET installer trigger files in use. Behavior is different based on whether the application has an active window handle (UI vs. running service, etc.).

We might be able to bypass RM and force the installer service to use the FilesInUse dialog. While the MSI UIs are turned off when running inside a chainer, a handler can be registered to receive these events.

Also, even if we do bypass RM, there are system policies that can be configured that may override disabling RM.

@joeloff
Copy link
Member

joeloff commented Jul 26, 2023

If I disable Restart Manager by changing the OS policies, I can force the OS to use FilesInUse , and then I see this.

image

@joeloff
Copy link
Member

joeloff commented Jul 26, 2023

I should also call out that IF you are being patched by an external process (Automatic Updates/WSUS/etc.), the installer will always run quietly and default to stopping applications that are using files.

@sharwell
Copy link
Member Author

I'm hitting this when running the installer manually, e.g. when I open a project and Visual Studio warns that my SDK is too old.

@joeloff
Copy link
Member

joeloff commented Jul 26, 2023

You then manually download and install a new SDK? Restart Manager is the preferred mechanism starting in Vista, especially for UI based applications.

While it might be possible to try and override RM usage, we would potentially break any application that registered with restart manager. Although it's unlikely those applications can be restarted (it all depends on the SIDs associated with them and the installation process), RM does offer them the change to gracefully shutdown and save data, etc.

With files-in-use, it will simply kill running processes.

@joeloff
Copy link
Member

joeloff commented Aug 15, 2023

I dug into this a bit further. On Win7 SP1, everything behaves as expected. I created a WPF/WinForms app that registered with Restart Manager. During a full UI based upgrade, the RM/Files in use dialog is shown and I have the option to close/restart or defer closing the application.

On Win 8.1, Win10 (TH1, TH2, RS1 through RS6, 21H1, Server 21H2, W2K8, Win11), Restart Manager shuts the UI based application down without prompting, but still pops up the prompt for non-UI based applications. While it's certainly possible to turn off some of the RM functionality and force the dialog to show, doing so has side-effects that will impact applications that registered with the RM service.

I'm going to try and follow up further on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants