[PR #10242] Avoid restart manager #39063

Open
opened 2026-04-22 23:42:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10242
Author: @dhiltgen
Created: 4/11/2025
Status: 🔄 Open

Base: mainHead: win_app_taskkill


📝 Commits (1)

📊 Changes

2 files changed (+13 additions, -6 deletions)

View changed files

📝 app/ollama.iss (+12 -5)
📝 scripts/build_windows.ps1 (+1 -1)

📄 Description

When installing in a different terminal session (e.g. over ssh) CloseApplications isn't functional so this switches to using taskkill instead.

Without this change, running the installer to upgrade over an ssh session while ollama is running, causes the install to fail.

> start-process ".\OllamaSetup.exe" -wait -argumentlist "/VERYSILENT /LOG=install.log /SUPPRESSMSGBOXES"

Looking at install.log the offending error is

...
2025-04-11 16:37:24.162   RestartManager found an application using one of our files: Ollama
2025-04-11 16:37:24.162   RestartManager found an application using one of our files: ollama
2025-04-11 16:37:24.162   Can use RestartManager to avoid reboot? No (2: Session Mismatch)
...
2025-04-11 16:37:24.373   Dest filename: C:\Users\daniel\AppData\Local\Programs\Ollama\ollama app.exe
2025-04-11 16:37:24.373   Time stamp of our file: 2025-04-07 05:25:14.000
2025-04-11 16:37:24.373   Dest file exists.
2025-04-11 16:37:24.373   Time stamp of existing file: 2025-04-11 15:48:14.000
2025-04-11 16:37:24.373   Installing the file.
2025-04-11 16:37:24.510   DeleteFile: The existing file appears to be in use (5). Retrying.
2025-04-11 16:37:25.519   DeleteFile: The existing file appears to be in use (5). Retrying.
2025-04-11 16:37:26.525   DeleteFile: The existing file appears to be in use (5). Retrying.
2025-04-11 16:37:27.531   DeleteFile: The existing file appears to be in use (5). Retrying.
2025-04-11 16:37:28.538   Defaulting to Abort for suppressed message box (Abort/Retry/Ignore):
                          C:\Users\daniel\AppData\Local\Programs\Ollama\ollama app.exe

                          An error occurred while trying to replace the existing file:
                          DeleteFile failed; code 5.
                          Access is denied.

Looking at https://learn.microsoft.com/nl-nl/windows/win32/api/restartmanager/ne-restartmanager-rm_reboot_reason session mismatch indicates One or more processes are running in another Terminal Services session. which makes sense when the app was started on console, but the installer is running over ssh.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/10242 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 4/11/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `win_app_taskkill` --- ### 📝 Commits (1) - [`6e3a312`](https://github.com/ollama/ollama/commit/6e3a3121546eb89b955365aea347e39ec916d741) Avoid restart manager ### 📊 Changes **2 files changed** (+13 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `app/ollama.iss` (+12 -5) 📝 `scripts/build_windows.ps1` (+1 -1) </details> ### 📄 Description When installing in a different terminal session (e.g. over ssh) CloseApplications isn't functional so this switches to using taskkill instead. Without this change, running the installer to upgrade over an ssh session while ollama is running, causes the install to fail. ```powershell > start-process ".\OllamaSetup.exe" -wait -argumentlist "/VERYSILENT /LOG=install.log /SUPPRESSMSGBOXES" ``` Looking at install.log the offending error is ``` ... 2025-04-11 16:37:24.162 RestartManager found an application using one of our files: Ollama 2025-04-11 16:37:24.162 RestartManager found an application using one of our files: ollama 2025-04-11 16:37:24.162 Can use RestartManager to avoid reboot? No (2: Session Mismatch) ... 2025-04-11 16:37:24.373 Dest filename: C:\Users\daniel\AppData\Local\Programs\Ollama\ollama app.exe 2025-04-11 16:37:24.373 Time stamp of our file: 2025-04-07 05:25:14.000 2025-04-11 16:37:24.373 Dest file exists. 2025-04-11 16:37:24.373 Time stamp of existing file: 2025-04-11 15:48:14.000 2025-04-11 16:37:24.373 Installing the file. 2025-04-11 16:37:24.510 DeleteFile: The existing file appears to be in use (5). Retrying. 2025-04-11 16:37:25.519 DeleteFile: The existing file appears to be in use (5). Retrying. 2025-04-11 16:37:26.525 DeleteFile: The existing file appears to be in use (5). Retrying. 2025-04-11 16:37:27.531 DeleteFile: The existing file appears to be in use (5). Retrying. 2025-04-11 16:37:28.538 Defaulting to Abort for suppressed message box (Abort/Retry/Ignore): C:\Users\daniel\AppData\Local\Programs\Ollama\ollama app.exe An error occurred while trying to replace the existing file: DeleteFile failed; code 5. Access is denied. ``` Looking at https://learn.microsoft.com/nl-nl/windows/win32/api/restartmanager/ne-restartmanager-rm_reboot_reason session mismatch indicates `One or more processes are running in another Terminal Services session.` which makes sense when the app was started on console, but the installer is running over ssh. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-22 23:42:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#39063