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

FR - MSOffice - MSOfficeMacURLandUpdateInfoProvider.py - BASE_URL change suggestion #463

Open
carlashley opened this issue Jul 31, 2023 · 4 comments

Comments

@carlashley
Copy link
Contributor

Describe the problem
When using the autopkg.recipies/MSOfficeUpdates download recipe the BASE_URL value in MSOfficeMacURLandUpdateInfoProvider.py is set to point to https://officecdn.microsoft.com/pr/%s/MacAutoupdate/%s.xml, looking at the Microsoft Auto Updater app, it uses https://officecdnmac.microsoft.com as the "base".

This FR suggests moving the BASE_URL to point to https://officecdnmac.microsoft.com/pr/%s/MacAutoupdate/%s.xml to keep inline with the Microsoft updater behaviour.

I'm happy to create a PR, but wanted to raise this for possible discussion first.

Preferences contents
N/A

AutoPkg output
Changing the domain in the provider script to point to officecdnmac works as expected - gist of run here

*Expected behavior
N/A

Version (please complete the following information):

  • OS version: macOS 13.5
  • AutoPkg Version: 2.7.2 (but not applicable to this FR)
@carlashley
Copy link
Contributor Author

carlashley commented Aug 1, 2023

Testing downloads for MSAutoUpdate, OneNote, Teams, Defender ATP, Edge, Outlook, Word, PowerPoint, Excel, and Skype For Business all worked - note, where there were recipes for 2019 products, only those download recipes were tested (aka, MSOutlook2019.download.recipe was tested, not MSOutlook2016.download.recipe).

There were a couple of failures, but they don't appear related to the URL change:
MSCompanyPortal:

       Error in com.github.autopkg.download.MSCompanyPortal: Processor: URLDownloader: Error: curl: (3) URL rejected: Malformed input to a URL function

Which seems to be caused by an errant \n in the string passed to the URL:

MSOfficeMacURLandUpdateInfoProvider: Additional pkginfo: {'minimum_os_version': '10.15', 'installs': [{'CFBundleVersion': '53.2307220.002', 'path': '/Applications/Company Portal.app', 'type': 'application'}]}
{'Output': {'additional_pkginfo': {'installs': [{'CFBundleVersion': '53.2307220.002',
                                                 'path': '/Applications/Company '
                                                         'Portal.app',
                                                 'type': 'application'}],
                                   'minimum_os_version': '10.15'},
            'minimum_os_version': '10.15',
            'url': '\n'
                   '                '
                   'https://officecdnmac.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/CompanyPortal_5.2307.1-Upgrade.pkg',
            'version': '53.2307220.002'}}
URLDownloader
{'Input': {'filename': 'CompanyPortal-53.2307220.002.pkg',
           'url': '\n'
                  '                '
                  'https://officecdnmac.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/CompanyPortal_5.2307.1-Upgrade.pkg'}}
URLDownloader: No value supplied for prefetch_filename, setting default value of: False
URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False
URLDownloader: ERROR: (3) URL rejected: Malformed input to a URL function
<snip>
subprocess.CalledProcessError: Command '['/usr/bin/curl', '--silent', '--show-error', '--no-buffer', '--dump-header', '-', '--speed-time', '30', '--location', '--url', '\n                https://officecdnmac.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/CompanyPortal_5.2307.1-Upgrade.pkg', '--fail', '--output', '/Users/jappleseed/Library/AutoPkg/Cache/com.github.autopkg.download.MSCompanyPortal/downloads/tmpbs2pfwb7']' returned non-zero exit status 3.

Stripping that errant \n and space/tab string out worked.

MicrosoftOfficeMacProduct also failed, but that seems to be caused by the key MicrosoftOfficeMacProduct not existing in the provider script.

@gregneagle
Copy link
Contributor

Curious where/how you found this other URL.

@gregneagle
Copy link
Contributor

gregneagle commented May 14, 2024

I see

$ strings Microsoft\ Update\ Assistant.app/Contents/MacOS/Microsoft\ Update\ Assistant | grep officecdn
officecdnmac.microsoft.com
officecdnmac.microsoft.com

so perhaps that's it?

@carlashley
Copy link
Contributor Author

Yes, that's where I had found the URLS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants