microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.76k stars 4.58k forks source link

[Package Issue]: Gitlab.Runner cannot update / uninstall if running #165601

Open versionbayjc opened 4 months ago

versionbayjc commented 4 months ago

Please confirm these before moving forward

Category of the issue

Other

Brief description of your issue

Updating or uninstalling Gitlab.Runner when it is running is failing and if I stop it manually it works. Should the updating take care of this?

PS> Get-Service gitlab-runner

Status   Name               DisplayName
------   ----               -----------
Running  gitlab-runner      gitlab-runner

PS C:\Users\JorikCaljouw> winget update --id Gitlab.Runner
Found GitLab Runner [Gitlab.Runner] Version 17.4.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://gitlab-runner-downloads.s3.amazonaws.com/v17.4.0/binaries/gitlab-runner-windows-amd64.exe
  ██████████████████████████████  88.6 MB / 88.6 MB
Successfully verified installer hash
Starting package install...
An unexpected error occurred while executing the command:
remove: Access is denied.: "C:\Users\JorikCaljouw\AppData\Local\Microsoft\WinGet\Packages\Gitlab.Runner_Microsoft.Winget.Source_8wekyb3d8bbwe\gitlab-runner.exe"
Installer failed with exit code: 0x8a150003 : Executing command failed

Steps to reproduce

See steps above:

Ensure GitLab Runner is installed and an update is available:

  1. Make sure the Gitlab Runner service is running, e.g. Start-Service gitlab-runner
  2. Try to update with winget update --id Gitlab.Runner

Actual behavior

Unable to update Gitlab.Runner when the Service is running

Expected behavior

The Service should be stopped and restarted automatically

Environment

PS C:\Users\JorikCaljouw> winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.4169
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

Screenshots and Logs

WinGet-2024-08-01-11-35-12.333.log WinGet-2024-08-01-11-44-08.829.log

Dragon1573 commented 4 months ago

Could you please split them into 2 issues?


For issue 1, it might caused by difference between PackageVersion and AppsAndFeaturesEntries.[*].DisplayVersion.

PackageIdentifier: Gitlab.Runner
PackageVersion: 17.2.1
AppsAndFeaturesEntries:
- DisplayVersion: 17.2.1 (9882d9c7)

For issue 2, seems winget.exe have no ability to check if a portable executable is running.

versionbayjc commented 1 month ago

Could you please split them into 2 issues?

For issue 1, it might caused by difference between PackageVersion and AppsAndFeaturesEntries.[*].DisplayVersion.

PackageIdentifier: Gitlab.Runner
PackageVersion: 17.2.1
AppsAndFeaturesEntries:
- DisplayVersion: 17.2.1 (9882d9c7)

For issue 2, seems winget.exe have no ability to check if a portable executable is running.

Thanks for the quick reply, and I'm sorry I didn't react sooner. I see that right now I cannot reproduce the first issue anymore with Gitlab.Runner version 17.4.0. So I'll update this issue to refer to the second issue only