autopkg/hjuutilainen-recipes

1Password recipes still pulling down v7 when v8 is out (though v7 updates are still coming)

fseesink opened this issue · 5 comments

Subject line covers it.

Not sure what best approach is, but figured I would mention that 1Password v8 has been out for a short bit now. The current 1Password recipes are still aimed at v7. They did help to pull down the latest v7 patch on 18 May as the history shows.

Unfortunately, it does not look like you can just tweak the current URL in the download recipe from

https://app-updates.agilebits.com/download/OPM7

to

https://app-updates.agilebits.com/download/OPM8

as that doesn't exist.

Best I have found this page where they have a direct link to

https://downloads.1password.com/mac/1Password.zip

if that helps.

Given that 1Password 8 is Electron-based and requires a subscription, whereas 1Password 7 is native code and still supports people who are grandfathered in without subscriptions and with local vaults, it might make sense to have a separate recipe for handling version 8.

We should leave this recipe as it is as there are still might coming some v7 patches and v7 does still have standalone (non-subscription) licenses

AgileBits renamed the App from "1Password 7" to "1Password"

I made new "1Password latest" recipe as we needed to Deploy v8
Take a look at jannheider-recipes

i wrote a little sloppy pre-flight script for the 1Password 7 recipe to prevent overwriting of manual 1Password 8 installations;

#!/bin/zsh

# ONLY FOR 1PW 7 Munki implementations!!
# this script is a must check if there is a 1Password 8 installation, if so, then exit 1.


# Find all 1Password Apps in Applications folders
ITEMPATHS=("${(@f)$(mdfind -onlyin /Applications -name "1Password")}")
echo "$ITEMPATHS"

# now a for loop to loop through the array items
for i in $ITEMPATHS; do
echo $i

# check if this is a zipFile, then its probberly a backup file, the installation must abort before it gets deleted!
filename=$(basename -- "$i")
extension="${filename##*.}"

if [ "$extension" = "zip" ]; then
  echo "found a zip file, this file has no version and will probberly removed with the postinstall script"
  break 2
else
  echo "not a zip, continue in checking versions"
fi

# retrieve App version
APPVERSION=$(defaults read $i/Contents/Info CFBundleShortVersionString)
echo $APPVERSION

# now compare version
# Note: when used in a script, you will probably have to autoload is-at-least before using it. In an interactive shell, it is often already loaded, because many other autoloader functions will have already loaded it.
autoload is-at-least
if is-at-least 8.0 $APPVERSION; then
  echo "This found version is higher than v8.0, abort installation, uninstall this first before installing 1PW 7"
  exit 1
else
  echo "This version is lower than version 8, no problem yet!"
fi

; done

exit 0

I had a PR to update these recipes to work with 1Password 8+, but closed it since others have made recipes that accomplish this. I'd recommend this recipe be updated to specify that it only applies to 1Password 7.

I think keeping it restricted to 1Password 7 is a fine idea; that's what we install here, as we have no policy in place to deal with the version 8 subscription mechanism.