topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
1.92k stars 124 forks source link

`Feature` | Microsoft Store app update support #912

Open Andreas02-dev opened 12 hours ago

Andreas02-dev commented 12 hours ago

I want to suggest a new step

Currently, topgrade does not have support for updating apps installed through the Microsoft Store. As some apps/components are preinstalled and updated through the Microsoft Store, even if the user doesn't install MS Store apps themselves, they will still need to update the MS Store apps regularly.

More information

The setting to automatically download and install app updates must be turned on for this to work correctly. This setting should be on by default, but perhaps there might be a way to check and warn the user when this is turned off?

MS_Store_setting

SteveLauC commented 10 hours ago

Figuring out if the tool needs to be invoked:

Doesn't seem like it would be possible?

Perhaps one can read the app list, and see if Microsoft Store is installed or not.

Exact command to be run by Topgrade in an administrative powershell session

Can we do that with sudo?


I am not a Windows user and I know almost nothing about Windows, so I could not implement this feature:<

Andreas02-dev commented 9 hours ago

Figuring out if the tool needs to be invoked: Doesn't seem like it would be possible?

Perhaps one can read the app list, and see if Microsoft Store is installed or not.

Exact command to be run by Topgrade in an administrative powershell session

Can we do that with sudo?

I am not a Windows user and I know almost nothing about Windows, so I could not implement this feature:<

Now that I think about it, Microsoft Store should always be installed according to https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/cannot-remove-uninstall-or-reinstall-microsoft-store-app. So it would be logical for the tool to be invoked on every Windows system.

Sudo is unfortunately not available on every Windows machine, but I believe Topgrade already has the ability to run commands in admin mode as other steps also require this, so we should be able to re-use that logic.

1 pain-point of this is that the Microsoft Store still has to be opened at least once for the command to work, and I'm not sure how we could detect this. This is because the command only refreshes the list with available updates, and then relies on the Microsoft Store to automatically download and install these updates.

However, we could let users know by printing in the console and automatically opening the Microsoft Store with start ms-windows-store://downloadsandupdates and then storing that we have opened the Microsoft Store at least once in Topgrade state.

I could try to implement this for Topgrade, however I'm not sure what the best way of using Topgrade-specific state is. Do you have more information about this?

SteveLauC commented 8 hours ago

but I believe Topgrade already has the ability to run commands in admin mode as other steps also require this, so we should be able to re-use that logic.

Ahh, I am aware of this, looking at the code, looks like the System step will be executed in admin mode.

However, we could let users know by printing in the console and automatically opening the Microsoft Store with start ms-windows-store://downloadsandupdates and then storing that we have opened the Microsoft Store at least once in Topgrade state.

Yeah, this looks feasible.

I could try to implement this for Topgrade,

Thanks!

however I'm not sure what the best way of using Topgrade-specific state is. Do you have more information about this?

Here documents how to add a new step for Topgrade. For your state question, you mean the state that we have launched the store app? I guess we can use a variable to do it? I kinda think I didn't understand the question, sorry:<

Andreas02-dev commented 5 hours ago

For your state question, you mean the state that we have launched the store app? I guess we can use a variable to do it? I kinda think I didn't understand the question, sorry:<

No problem. I meant to persist the state that we have launched the store app at least once, as we only need to make sure the store app is launched once instead of having to launch it everytime the step is executed or the machine is rebooted.

Do you know if one of the other steps might also do something like this, or if Topgrade has some helper functions to persist and retrieve some state for a step?

If not, maybe it would be best to see if we or someone could implement that before I start working on this feature, so we have a well thought-out API we could potentially re-use for other steps too if they need to persist data.