Simple way to add file to a specific location?

JAMFNoob
New Contributor III

Hey everyone - total beginner here with very little scripting knowledge. I am currently in the middle of trying to remove Symantec from all our macs and have the script file to do it, however I need to install this file to a specific location on each mac and then run it. How would I do this? I tried to use composer and create a before and after image and then make that into a pkg but it didn't work and it did not add the file to my test machine in the location I wanted. I know there is a simple way to do it but cannot find a step by step guide online

1 ACCEPTED SOLUTION

JAMFNoob
New Contributor III

Thanks so much I will try this! Sounds simple enough! I need to try installing it locally first because I get the same error as the poster in this thread when just adding it in as a script to run from a policy - 

https://community.jamf.com/t5/jamf-pro/help-with-uninstall-of-symantec-endpoint-protection/m-p/22575...

The first suggestion was to try to place it locally and run it so wanted to see if that may work for me before trying his final solution (also though would be a great way to learn how to place files locally on macs)

View solution in original post

5 REPLIES 5

mm2270
Legendary Contributor III

Just curious, but do you have an idea of why the script needs to be added to a specific location? Not that it's all that hard to do mind you. I'm just curious. I don't use Symantec, so I don't know much about why a removal script would need to necessarily be run from a specific path. Or maybe it's not the script but some "config" file for Symantec to use?

Anyway, how you can do this in Composer is by following these simple steps.

  1. Make a new folder (if needed) for where the file or script must go on your Mac that you're building the package on.
  2. Copy the script or file to that location.
  3. Open Composer. If prompted to create a snapshot, click Cancel. From the Finder, grab the file/script you placed in step 2 and drag it into the sidebar of Composer. This is the section labeled "Sources" It should create a new source by coping that file in and creating the same folder paths to where it is on the Mac.
  4. If necessary, check and adjust any permissions on that file or folder in Composer. (bottom middle/right area of the UI)
  5. Build as a package (or DMG) When it installs, it should place that file into that location and also make any folders necessary if they don't already exist.

In short, you don't need to run a before/after snapshot for something like this, since you know specifically what you want to capture. Snapshots are really only good for when you don't know what it is that needs to be captured, so you let the application figure it out (more or less) for you.

Hope that helps.

JAMFNoob
New Contributor III

Thanks so much I will try this! Sounds simple enough! I need to try installing it locally first because I get the same error as the poster in this thread when just adding it in as a script to run from a policy - 

https://community.jamf.com/t5/jamf-pro/help-with-uninstall-of-symantec-endpoint-protection/m-p/22575...

The first suggestion was to try to place it locally and run it so wanted to see if that may work for me before trying his final solution (also though would be a great way to learn how to place files locally on macs)

JAMFNoob
New Contributor III

This worked great for me, however I am having an issue now dragging it into JAMF admin from Composer - whenever I drag it in, it just bounces back to composer...it looks to be happening to all my packages in composer. Any idea what could cause this?

mm2270
Legendary Contributor III

Yeah, the problem is you don’t drag things directly from Composer into Jamf Admin. You have to build out packages or disk images from Composer, and then drag those files into Jamf Admin.

JAMFNoob
New Contributor III

Ah yes that makes sense, thanks a lot for all your help I really appreciate it!