ChoicesXML file is not working for deployment

Asifahmed
New Contributor III

I download the O365 package from https://macadmins.software/ and then by installer command and -showChoicesXML flag I built an XML file and opened the XML file and made the value 0 for OneNote app so that it should not get installed on my mac when installing. Now if I am running the installer command with -applyChoiceChangesXML flag with the path of XML file and office package path, it is telling me below.

 

installer: Package name is Microsoft 365 and Office for Mac installer: choices file '/Users/asif/Desktop/office.xml' either could not be found or was malformed.%

What could be the cause behind it?

My path for XML file and office package is correct as I copied and pasted in terminal.

24 REPLIES 24

dmccluskey
Contributor II

You would want to try the MS office plist to exclude apps.

 
2023-05-05_7-57-08.jpg2023-05-05_7-58-05.jpg

Asifahmed
New Contributor III

I am looking for solution with the installer command, I am not specific to office package here, same is happening for Cisco Anyconnect app also, so something is wrong in my XML file or else, I want to fix that one here.

I wrote this a while back and just now cleaned it up and posted it. This script when edited with the Apple Installer package name and app bundle identifier(s) will deploy a choices.xml file to exlude an installer choice during package installation.

https://gist.github.com/talkingmoose/3926e86332e32eb7d05a161c3f7e8f69

I haven’t tested it with the changes I just made, but it did work for me when I originally wrote it. If you’d like to test and let me know your results, I’d appreciate it.

talkingmoose
Moderator
Moderator

There's an easier way to keep from installing OneNote or any Office for Mac app.

The Office installer you downloaded supports a configuration profile setting called InstallOneNote. You can set this to false, install the profile, and then when you run the installer, it'll be ignored.

I suggest you use the custom manifest here to add the setting to a new profile.

https://github.com/Jamf-Custom-Profile-Schemas/ProfileManifestsMirror/blob/main/manifests/ManagedPre... 

Here are the instructions for how yo use it:

https://github.com/Jamf-Custom-Profile-Schemas/jamf-manifests/wiki

You'll see a long list of configurable options after you add the manifest. Be sure to use the Add/Remove Properties button at the top to remove everything except the Install OneNote setting. Change it to false.

But here what is the wrong I am doing here? It is not working for others app also. 

I used JSON for other app like browsers settings customization, where do I get the JSON for office package to deploy in a customised way? github?

The first link you have provided is not opening. Can you please message me, I will copy it. If I copy it from here it is opening the link already opened in my browser. Thanks

Asifahmed
New Contributor III

It is showing 404 error if I type manually

Something got malformed when I originally posted them. I’ve edited and tested the links. Try them again.

It worked, thanks, do you suggest me to follow this method for Cisco AnyConnect app also instead of ChoiceChnagesXML method by using installer command?

bwoods
Valued Contributor

You are most likely experiencing the changes that Apple made to Gatekeeper in macOS Ventura. I would suggest using configuration profiles as @talkingmoose has suggested above. We've seen issues in which Gatekeeper will deem and modifications to a package as malicious. 

Asifahmed
New Contributor III

Same is valid for Cisco AnyConnect app?

bwoods
Valued Contributor

This would affect any third party app. The article below provides more information on how this mechanism works. Unfortunately, Apple hasn't provided any formal documentation on what admins and vendors "can" or "cannot" do while packaging.

How macOS Ventura App Management works and doesn't work (lapcatsoftware.com)

Asifahmed
New Contributor III

Thanks for the link, but still I am getting how can I get the JSON to exclude app from being installed through a config profile, can you please help me on this? Same is needed for Cisco AnyConnect app

sdagley
Esteemed Contributor II

@Asifahmed Have you tried using the plutil tool with the -lint command to check the .xml file you created? 

Asifahmed
New Contributor III

I did not do anything with plutil  command, you want to me to use plutil command to convert XML into JSON and upload the JSON in custom schema?

sdagley
Esteemed Contributor II

No, I'm suggesting you try the plutil command to verify that the .xml file you created for use as a ChoiceChangesXML is a properly formatted XML file. The error you reference in your original post says either the file couldn't be found or that it was malformed, and you did say you had verified the path.

Asifahmed
New Contributor III

Path is ok and I did copy past in terminal after copying the file.

May I know what exactly I need to check as I need to do it for Cisco Anyconnect also. 

 

XML should be in binary format or XML format?

sdagley
Esteemed Contributor II

The .plist to provide the installer tool should be XML. Use the -lint option for the plutil tool to verify the .plist file you created.

Asifahmed
New Contributor III

plutil -lint /Users/asif/Desktop/office.xml

/Users/asif/Desktop/office.xml: OK

 

Above is the output for that command.

sdagley
Esteemed Contributor II

Good, that verifies your problem isn't the format of the .xml file. I'd agree with @talkingmoose that using a Configuration Profile is the best way to suppress installation of OneNote, so follow the docs he has linked to.

That won't help with the problem you're seeing with customizing a Cisco AnyConnect install though. Can you post the choices .xml file you're trying for that?

Asifahmed
New Contributor III

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>childItems</key>
<array>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Word</string>
<key>choiceIdentifier</key>
<string>com.microsoft.word</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>473509</integer>
<key>choiceTitle</key>
<string>Microsoft Word</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Microsoft_Word_Internal.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Excel</string>
<key>choiceIdentifier</key>
<string>com.microsoft.excel</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>561398</integer>
<key>choiceTitle</key>
<string>Microsoft Excel</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Microsoft_Excel_Internal.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft PowerPoint</string>
<key>choiceIdentifier</key>
<string>com.microsoft.powerpoint</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>280513</integer>
<key>choiceTitle</key>
<string>Microsoft PowerPoint</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Microsoft_PowerPoint_Internal.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft OneNote</string>
<key>choiceIdentifier</key>
<string>com.microsoft.onenote.mac</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>0</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>97228</integer>
<key>choiceTitle</key>
<string>Microsoft OneNote</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Microsoft_OneNote_Internal.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Outlook</string>
<key>choiceIdentifier</key>
<string>com.microsoft.outlook</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>212156</integer>
<key>choiceTitle</key>
<string>Microsoft Outlook</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Microsoft_Outlook_Internal.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft OneDrive</string>
<key>choiceIdentifier</key>
<string>com.microsoft.OneDrive</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>1041321</integer>
<key>choiceTitle</key>
<string>Microsoft OneDrive</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#OneDrive.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Teams</string>
<key>choiceIdentifier</key>
<string>com.microsoft.teams</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>516354</integer>
<key>choiceTitle</key>
<string>Microsoft Teams</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Teams_osx_app.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft AutoUpdate</string>
<key>choiceIdentifier</key>
<string>com.microsoft.autoupdate</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>13160</integer>
<key>choiceTitle</key>
<string>Microsoft AutoUpdate</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Office16_all_autoupdate.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Licensing</string>
<key>choiceIdentifier</key>
<string>com.microsoft.licensing</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<false/>
<key>choiceSizeInKilobytes</key>
<integer>1724</integer>
<key>choiceTitle</key>
<string>Microsoft Licensing</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Office16_all_licensing.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Office Fonts</string>
<key>choiceIdentifier</key>
<string>com.microsoft.office.fonts</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<false/>
<key>choiceSizeInKilobytes</key>
<integer>2048504</integer>
<key>choiceTitle</key>
<string>Microsoft Office Fonts</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Office_fonts.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Office Frameworks</string>
<key>choiceIdentifier</key>
<string>com.microsoft.office.frameworks</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<false/>
<key>choiceSizeInKilobytes</key>
<integer>3852248</integer>
<key>choiceTitle</key>
<string>Microsoft Office Frameworks</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Office_frameworks.pkg</string>
</array>
</dict>
<dict>
<key>childItems</key>
<array/>
<key>choiceDescription</key>
<string>Microsoft Office Proofing Tools</string>
<key>choiceIdentifier</key>
<string>com.microsoft.office.proofing</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<false/>
<key>choiceSizeInKilobytes</key>
<integer>1959728</integer>
<key>choiceTitle</key>
<string>Microsoft Office Proofing Tools</string>
<key>pathsOfActivePackagesInChoice</key>
<array>
<string>file://localhost/Users/asif/Downloads/Microsoft_365_and_Office_16.72.23040900_BusinessPro_Installer.pkg#Office_proofing.pkg</string>
</array>
</dict>
</array>
<key>choiceIdentifier</key>
<string>__ROOT_CHOICE_IDENT_Microsoft 365 and Office for Mac</string>
<key>choiceIsEnabled</key>
<true/>
<key>choiceIsSelected</key>
<integer>1</integer>
<key>choiceIsVisible</key>
<true/>
<key>choiceSizeInKilobytes</key>
<integer>0</integer>
<key>choiceTitle</key>
<string>Microsoft 365 and Office for Mac</string>
<key>pathsOfActivePackagesInChoice</key>
<array/>
</dict>
</array>
</plist>

Asifahmed
New Contributor III

That link worked for me what @talkingmoose  shared after editing it. 

I will give. a try with Cisco AnyConnect app once I get the installer file from my app owner as it asked to add service contract. 

dmccluskey
Contributor II

I did the cisco xml method for a bit.

But found this not to long ago

Cisco VPN AnyConnect 4.10.03104 Apple Silicone M1 ... - Jamf Nation Community - 251046

 

Rebuilding the .pkg has been a better method for my deployment.