Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intune-company-portal: update livecheck, use versioned url #188734

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Casks/i/intune-company-portal.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
cask "intune-company-portal" do
version "5.2409.1"
sha256 :no_check
sha256 "5fc90f74ffd980c0d696a5698a8df6743743b8882e7ad99b58f61eb050476e6c"

url "https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/CompanyPortal-Installer.pkg"
url "https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/CompanyPortal_#{version}-Upgrade.pkg"
name "Company Portal"
desc "App to manage access to corporate apps, data, and resources"
homepage "https://docs.microsoft.com/en-us/mem/intune/user-help/enroll-your-device-in-intune-macos-cp"

livecheck do
url :url
strategy :extract_plist do |items|
items["com.microsoft.CompanyPortalMac"].short_version
url "https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/0409IMCP01.xml"
regex(/^CompanyPortal[._-]v?(\d+(?:\.+\d+)+)[._-]Upgrade\.pkg$/i)
strategy :xml do |xml, regex|
filename = xml.elements["//key[text()='Payload']"]&.next_element&.text&.strip
match = filename&.match(regex)
next if match.blank?

match[1]
end
end

auto_updates true
depends_on cask: "microsoft-auto-update"
depends_on macos: ">= :mojave"

pkg "CompanyPortal-Installer.pkg",
pkg "CompanyPortal_#{version}-Upgrade.pkg",
choices: [
{
"choiceIdentifier" => "com.microsoft.package.Microsoft_AutoUpdate.app", # Office16_autoupdate_updater.pkg
Expand Down
Loading