I have a PKG that has an associated JSON file that need to be in the same location: /Library/Application Support/TheApp. I know I can create a DMG with Composer by placing the JSON file in the above path. Ideally I would rather not have to create a DMG, just copy the file but there seems no way to do a simple file copy. I then created a new Policy with two packages (the PKG and the DMG). Is there a better way of doing this?
I'm no expert on json but isn't it nothing more than a text file? If so, you could have a script in jamf that contains the json file content that literally writes the file into the location you want it. Just set it up to run in the policy before the package is installed.
#!/bin/sh cat >/Library/Application Support/TheApp/**insert name of json file here** <<'EOL' **insert content of json file here** EOL exit
I actually do this for a few policies for the very reason that I don't want to have to copy files or create packages or disk images when I make or change or anything. I can edit the changes in the script and it writes out the new version.
So I have this working, except for one problem, I need the DMG to be applied before the package. How do I change the order of packages in a policy? I tried adding them in a specific order, but the PKG is always first (I am guessing by alphabetical order). SO I changed the display name and that fixed that problem. Still would like a way without having to do a DMG. Perhaps a script to send it to a file.