You will have to script this unfortunately. Drop your actual payload (the application) into a place like /private/tmp/, bring it into Composer from that loction, then use a postinstall script to move it into the current user's home directory, creating the ~/Applications/ directory in the process if needed. There's no way I know of to tell Composer to do this other than with a script. It just uses whatever path you've copied the application in from as its final destination.
Thanks. That's what I was afraid of. I guess I can live with installing files into every user's folder for now.
Reason #4,912 why JSS needs to recognize "~" for installs and scripts.
Well, technically policies being run by certain triggers captures $3 as the current user, but passing that to a pkg or dmg install to have it drop files in that user's directory without utilizing a script, I don't know of a way to do.
Also, in case I wasn't clear in my explanation above, by "postinstall" script, I actually mean a postinstall script directly within the .pkg install itself, which can be done right in Composer, not a separate script to run from the JSS. In a way this makes the pkg self contained and can be run by anyone or by any process and would not be reliant on some extra script to run in the policy.
Lastly, you may also want to look at Packages.app. It may have some functionality for this, but I have not looked to see.
When you create a package source in Composer, you can change the directory it installs into (add directories or files, etc). You could try changing the directory there before creating the package, then you wouldn't need to script anything.
That's the problem. What do I change it to? Can I substitute cmcintosh with ? would it recognize that I don't want to create a cmcintosh folder? or would it create a folder called "" within /Users?
No, it will not. What's proposed above won't help since you can't build a Composer install to use a path like ~/Applications/ It only understands absolute paths as far as I have ever known.
Yep. Agree with what @mm2270 has said.
Casper will lay down stuff as it appears in the DMG.
So, /Users/admin/Applications/some.app will install in that location.
You'll need to grab the username of the logged in user then copy the app from a temp location to where you want it.
Hello,
Wanted to know if you were able to get pkg's installed into the ~Applications folder? I wanted to try this method so users can autoupdate apps.
Thanks
@user-kMDjUsheqD with how old this thread is its probably best to start a new discussions topic. However, if I am not mistaken if you use composer and build the package as a dmg JAMF Admin gives you some options that may do what you are looking for.
If you build the package as a DMG you have the option to use Fill User Templates (FUT) and Fill Existing user home directories (FEU) in JAMF Admin. FEU would replace any user specific variables, in theory it would change /users/{LabUser}/applications to /users/{whatever}/applications based on whoever was logged in. Me personally I would use a post install script as they recommended in 2015 with this thread, I am not sure if the FUT and FEU features were in JAMF 6 years ago.
FUT and FEU were there 6 years ago, and their behaviour was the same as now. FEU will fill all existing users accounts. FUT will fill all of the templates. You can use Composer to make a package and apply it to all Users and or all Templates. Plus then if as was suggested before is required, to add to a specific user account, you will need to either write a script and add it to the package in Composer. Use Composer to put the file in a Temp location and then the Post install script to copy it to their home location. Or again have Composer place the file in a temp location and then have a script set to run after, and add it to the policy. This will give you access to the parameters like $3 for the logged in username.
Never tried to add to an individuals home location, so I would suggest you test it thoroughly, and then test it again.