-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
scoop uninstall blocked when app is running #488
Comments
Agreed! But then there should be a way to add services in the first place not ? |
First thing to do when uninstalling should be check for directory is in use. With information about folder is in use and two options: (it would require --force parameter for uninstallation)
I could think only using $procs = Get-Process -FileVersionInfo -ErrorAction SilentlyContinue | ? { $_.FileName -like '$dir`*'}
# or
# Create some hashtable from Get-Process with ID as key and Path as Value Get-Process | Select-Object Path, ID
if ($procs.Count -gt 0 -and !$forceParam) {
abort 'Folder is in use. if you want to let scoop kill all process use unisntall -f'
} else {
#Kill all process, which are running and continue uninstallation
$procs | ForEach-Object { Stop-Process $_ }
} @r15ch13 Do you have better solution? |
Result of get-process for running Steam
|
Good idea 👍 It's a bit faster when the (Get-Process | ? { $_.Path -like 'D:\scoop\apps\*'} )
(Get-Process | ? { $_.Path -like 'D:\scoop\apps\<app>\*'} ) λ (Get-Process | ? { $_.Path -like 'D:\scoop\apps\*'} )
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
2238 176 322672 451496 746,63 3832 8 firefox
1654 198 868320 820768 701,23 17776 8 firefox
1506 150 454816 436532 107,84 19904 8 firefox
823 33 153628 170696 387,61 20420 8 firefox
809 138 390228 475888 79,34 27380 8 firefox
1524 166 481256 425892 300,42 30668 8 firefox
1544 165 553188 494080 229,72 30920 8 firefox
216 15 4828 83404 0,16 32460 8 firefox
448 25 53392 58904 1,31 34272 8 QuickLook
126 9 1320 6180 0,03 18816 8 QuickLook.WoW64HookHelper
355 29 44316 68388 0,92 7316 8 Wavebox
328 32 56140 82212 28,56 13692 8 Wavebox
551 49 87400 117192 2,64 17148 8 Wavebox
361 53 154552 172872 28,86 20368 8 Wavebox
1646 83 128120 166200 74,45 20576 8 Wavebox
738 43 369040 146876 21,42 20764 8 Wavebox
305 24 26568 35984 0,11 22416 8 Wavebox
370 75 252996 286688 52,16 24092 8 Wavebox
357 43 88072 117712 32,67 34092 8 Wavebox
211 14 6776 12616 0,03 34792 8 Wavebox
λ (Get-Process | ? { $_.Path -like 'D:\scoop\apps\wavebox\*'} )
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
355 29 44316 68400 0,92 7316 8 Wavebox
325 32 56116 82576 28,70 13692 8 Wavebox
551 49 87400 117428 2,64 17148 8 Wavebox
361 53 154552 172944 28,86 20368 8 Wavebox
1661 85 128088 165180 74,70 20576 8 Wavebox
738 43 369040 146876 21,42 20764 8 Wavebox
302 24 26144 36320 0,11 22416 8 Wavebox
379 76 246384 281988 52,16 24092 8 Wavebox
359 43 87176 117444 32,81 34092 8 Wavebox
211 14 6776 12616 0,03 34792 8 Wavebox |
Implemented in #3608 |
Example:
I'm thinking that users should be able to uninstall apps regardless of whether it is running or not - which means that we need some way of stopping services before uninstalling, so that the user doesn't need to figure it out themselves.
The text was updated successfully, but these errors were encountered: