mjishnu/alt-app-installer

Feature Request! Updates montioring or checking!

naxl opened this issue · 5 comments

naxl commented

Hello! Its been quite a while I solely rely on Alt App Installer, as I have removed the store from my laptop! A feature which halves the effort of finding the app on store and then checking the version already installed on the pc and the latest version available on store-guard/store can be added! as I think it much adds the great insight and an all-in-one store replacement solution for those who update apps regularly! Maybe not always active but in the portable package you can add a flag/menu-feature which let know the users about the apps installed and current version available! Please share your thoughts on this!

Few flows which I can come up with but too noob to build package myself are! :

  1. Manual mode

Where a menu of updates can be introduced and user has to enter the product-id or list of product-ids from the url of teh app to check in future which app updates they want to monitor!

2)Automatic mode

Where the Alt app installer takes permission to read 'C:\Program Files\WindowsApps' and sub folders in it to collect all the unique 'AppxManifest.xml' of all the packages installed, and read Display name and Publisher name of the apps using RegEx Maybe! and search and provide the necessary information!

Please share your thoughts on this, and let know, can we expect something like this in future updates!

Hey thanks for the suggestion, however this feature requires some work to implement. for updating each uwp app installed in the pc we need to first fetch all installed uwp apps details and compare their version with that available on ms server and download and install them if a new version is available. this for implementing 2nd (automatic option) for implementing the 1st (manual option) we would require to filter installed apps and only select apps which are given using their product id and do the same as 2nd method.

for implementing the 2nd option (automatic mode) here are some of my thoughts instead of trying to read AppxManifest and get version we can use a powershell command Get-AppxPackage | Select-Object Name, Version, PackageFamilyName to get the info needed. this will give all names of the currently installed uwp apps , their version and their package family name, package family name is a unique value similar to product id using which we can retrieve info about the app from ms server using the api. then using this info we need to compare the version of currently installed apps and one available in ms server, if there is a new version download and install them, download and install part should be easy since we can just re-use the function that are already present in the app. we just need to figure out the first part.

I currently don't have time to implement this myself but in future i might implement it or if someone is willing to do it feel free to make a PR.

Here the api for generating the download link using PackageFamilyName, this will produce the cat_id . Use this to produce the download link via replacing cat_id of uwp_gen() inside of url_generator in `modules/url_gen.py'

import requests
import json

# using dolby access as a test app

PackageFamilyName = 'DolbyLaboratories.DolbyAccess_rz1tebttyb220'
details_api = f"https://displaycatalog.mp.microsoft.com/v7.0/products/lookup?alternateId=PackageFamilyName&Value={PackageFamilyName}&market=US&languages=en-US&fieldsTemplate=Details"


r = requests.get(details_api, timeout=20)
response = json.loads(r.text)
cat_id = response["Products"][0]["DisplaySkuAvailabilities"][0]["Sku"]["Properties"]["FulfillmentData"]["WuCategoryId"]

print(cat_id)
naxl commented

For now this code is working for few apps, let's see how I can make it more accurate with different PackageFullNames

PackageFamilyName = '38833FF26BA1D.UnigramPreview_g9c9v27vpyspw'
details_api = f"https://displaycatalog.mp.microsoft.com/v7.0/products/lookup?alternateId=PackageFamilyName&Value={PackageFamilyName}&market=US&languages=en-US&fieldsTemplate=Details"

r = requests.get(details_api, timeout=20)
response = json.loads(r.text)
cat_id = response["Products"][0]["DisplaySkuAvailabilities"][0]["Sku"]["Properties"]["FulfillmentData"]["WuCategoryId"]

PackageFullName = response["Products"][0]["DisplaySkuAvailabilities"][0]["Sku"]["Properties"]['Packages'][0]['PackageFullName']

def extract_version(tuple_data):
    # Extract the first string from the tuple
    version_string = tuple_data[0]
    
    # Split the version string using underscores
    parts = version_string.split('_')
    
    # Find the index of the first and second underscores
    first_underscore_index = version_string.index('_')
    second_underscore_index = version_string.index('_', first_underscore_index + 1)
    
    # Extract the version substring between the first and second underscores
    version_number = version_string[first_underscore_index + 1:second_underscore_index]
    
    return version_number

# Given tuple
tuple_data = (PackageFullName, PackageFamilyName)

# Extract version using the logic
version = extract_version(tuple_data)

print("Extracted Version:", version)
naxl commented

There are several issues I am facing right now! PackageFullNames might not be similar to PackageFamilyNames or may not have correct versions mentioned in the names of the powershell reads Get-AppxPackage | Select-Object Name, Version, PackageFamilyName, another one is for few inbuilt windows packages or redistributables the list shows out of range for PackageFullName = response["Products"][0], another one is for certain apps it grabs arm64 and for some neutral packages which maybe lead to conflict if for certain devices the apps isn't updated!

There are several issues I am facing right now! PackageFullNames might not be similar to PackageFamilyNames or may not have correct versions mentioned in the names of the powershell reads Get-AppxPackage | Select-Object Name, Version, PackageFamilyName, another one is for few inbuilt windows packages or redistributables the list shows out of range for PackageFullName = response["Products"][0], another one is for certain apps it grabs arm64 and for some neutral packages which maybe lead to conflict if for certain devices the apps isn't updated!

you can directly extract the version from the Get-AppxPackage | Select-Object Name, Version, PackageFamilyName using pythonnet and System.Management.Automation.dll, also the code you provided earlier only fetches the first data from the response you need to find the latest available version among the response then compare it with the currently installed version (using version data we extract using pythonnet and System.Management.Automation.dll ) also the filtering should be done according to system arch for that you can use the uwp_gen() func parse func

can you tell me which is the name of the app that you faced issue where it downloads arm64 instead of neutral also which all apps showed out of index error