autopkg / gerardkok-recipes

Autopkg recipes
Apache License 2.0
11 stars 33 forks source link

Enpass recipe - Munki Update version detection #210

Closed reneski closed 2 years ago

reneski commented 2 years ago

Hi,

could you please look into the Enpass recipe? It looks like, munki can't detect the installed version and will never update with the latest available one.

Here an example run while an older Version (I think 6.7.4) was installed.

sudo managedsoftwareupdate -vv
Processing manifest item Enpass for install
Looking for detail for: Enpass, version latest...
Considering 1 items with name Enpass from catalog produktion-deploy
Considering item Enpass, version 6.8.1 with minimum os version required 10.5.0
Our OS version is 11.5
Found Enpass, version 6.8.1 in catalog produktion-deploy
Looking for package in.sinew.Enpass-Desktop.App, version 6.8.1
Enpass version 6.8.1 (or newer) is already installed.
Looking for updates for: Enpass
Looking for updates for: Enpass-949
Looking for updates for: Enpass--949

If any further informations are required, let me know. Thanks for providing this autopkg 👍

gerardkok commented 2 years ago

I think I understand the issue, the application has version 6.8.1, but in the receipt, the version is listed as '1063'. I assume this has been working like this for some time, so in your case you have (say) 6.5.0 installed, which has receipts-version 1000, but version 1000 is bigger than version 6.8.1 from Munki, so Munki thinks Enpass is up-to-date, despite the version on your system actually being lower.

To fix it I think I'll need to overhaul the recipe, I'll try to do that in the coming days.

reneski commented 2 years ago

Did some try and error to resolve the issue and created a pull request #212 Was the first time creating a pull request and editing an autopkg recipe.

Using the modified recipe I successfully detected and updated Enpass 6.8.1 to 6.8.2

sudo managedsoftwareupdate -vv

    * Processing manifest item Enpass for install
    Looking for detail for: Enpass, version latest...
    Considering 1 items with name Enpass from catalog testing
    Considering item Enpass, version 6.8.2 with minimum os version required 10.5.0
    Our OS version is 12.4
    Found Enpass, version 6.8.2 in catalog testing
        Found Info.plist at /Applications/Enpass.app/Contents/Info.plist
        Checking /Applications/Enpass.app/Contents/Info.plist for CFBundleShortVersionString 6.8.2...
        Using version_comparison_key CFBundleShortVersionString
        Installed item has version 6.8.1
        Installed item is older.
    Need to install Enpass
gerardkok commented 2 years ago

Thanks! That is indeed a lot easier than I had in mind.