microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.31k stars 8.28k forks source link

Why does Windows Terminal lock assets from "YourPhone"? #10057

Closed whorfin closed 3 years ago

whorfin commented 3 years ago

Windows Terminal version (or Windows build number)

10.0.19042.964, 1.7.1033.0

Other Software

O&O AppBuster

Steps to reproduce

Attempt to uninstall, yet again, and over and over, and every damn time windows updates, the ridiculous "YourPhone" which I will never use but consumes 256M and occasionally wakes up and eats my CPU. That's not WindowsTerminal's fault, but the next bit is bizarre. Have Windows Terminal open, launch O&O App Buster https://www.oo-software.com/en/ooappbuster and observe that WindowsTerminal has "NoiseAsset_256X256_PNG.png" from YourPhone open/locked Killing Terminal, the uninstall completes, and Terminal seems unaffected

Expected Behavior

I would expect WindowsTerminal to not be opening/locking files from rando Microsoft apps such as "YourPhone"

Actual Behavior

windowsterminal

whorfin commented 3 years ago

...in case it is relevant, pretty much whenever i have WindowsTerminal open, I am running at least one Ubuntu bash shell

KalleOlaviNiemitalo commented 3 years ago

I wonder if this is caused by Windows deduplicating identical files between apps and "O&O App Buster" not supporting that.

KalleOlaviNiemitalo commented 3 years ago

If you try to uninstall YourPhone using DISM /Online /Remove-ProvisionedAppxPackage and Remove-AppxPackage, does that work even while Windows Terminal is running?

DHowett commented 3 years ago

So, yeah, it's very likely something like that. The application packaging subsystem deduplicates data across different packages. This is one example of how applications that purport to "debloat" or in some other way damage your system don't really know what's going on, and can break things. We don't recommend their use.

whorfin commented 3 years ago

How do you recommend one permanently remove YourPhone, then? Terminal operates perfectly well without it installed Users would not resort to such measures if you did not force unwanted apps on their machines

Aldaviva commented 4 months ago

There is indeed deduplication between assets of AppX packages, as alluded to above. This is documented in dism /Optimize-ProvisionedAppxPackages:

Optimizes the total file size of provisioned packages on the image by replacing identical files with hardlinks. Once an image with provisioned AppX packages is online, /optimize-provisionedappxpackages won't be able to optimize provisioned AppX packages. If you take an image offline and add packages, only the packages that are provisioned after the image was brought back offline will be optimized.

To permanently remove YourPhone, you can try using Remove-AppxPackage as mentioned above, as well as the machine-wide Remove-AppxPackage --AllUsers and Remove-AppxProvisionedPackage.