Is it possible to access the choices global variable in an installation-check script when the package doesn't have choices that the end-user can interact with?
I'm referring to this:
https://developer.apple.com/documentation/installer_js/choice
It seems to imply that you can access the choices global variable, but any attempt to do so fails. For example, take the following:
This results in the following:
Thanks in advance!
I'm referring to this:
https://developer.apple.com/documentation/installer_js/choice
It seems to imply that you can access the choices global variable, but any attempt to do so fails. For example, take the following:
Code Block <?xml version="1.0" encoding="utf-8"?> <installer-gui-script minSpecVersion="2"> <title>My Meta Package</title> <pkg-ref id="com.md4.myapp"/> <options customize="never" require-scripts="false" rootVolumeOnly="true" /> <choices-outline> <line choice="default"> <line choice="myapp"/> </line> </choices-outline> <choice id="default"/> <choice id="myapp" visible="false" title="this is a test" description="testing one" start_selected="true"> <pkg-ref id="com.md4.myapp"/> </choice> <pkg-ref id="com.md4.myapp" version="1" onConclusion="none">mypackage.pkg</pkg-ref> <installation-check script="version_check()" /> <script> <![CDATA[ function version_check() { title = choices.['myapp'].title; system.log("Performing custom installation check against version " + system.version.ProductVersion); system.log("Title " + title); return true; } ]]> </script> </installer-gui-script>
This results in the following:
Is it possible to access the choices global variable in this manner? If so, what is the correct way/syntax to do it?Sep 8 15:32:56 THY-01-0236-LT Installer[85217]: IFJS: *** exception: SyntaxError: Unexpected token '['. Expected a property name after '.'.
Thanks in advance!