Posted on 10-08-2024 06:00 AM
Hey guys, I need to deploy VSCode & Jetbrain Snyk extension via Jamf. VScode is in format .vsix and Jetbrain is looking like a simple folder with one Library and .jar files inside this folder.
Have any of you had to deal with such an installation?
Thank you in advance.
Regards
Posted on 10-08-2024 06:22 AM
I'm not able to edit my post, so .vsix can be skipped.
Regards
10-08-2024 08:16 AM - edited 10-08-2024 11:33 AM
@MatP This is pretty straightforward in Composer:
This does presume you've got some experience with Composer, but if not https://learn.jamf.com/en-US/bundle/composer-user-guide-current/page/Composer_Overview.html is a good place to start.
3 weeks ago
Hey @sdagley thank you for your help. I created this pkg via Composer with PostInstall script. This pkg work on my computer but when I upload all the setup into Jamf it does not work on other computers even though the status is completed. I.e. the folder does not appear in the indicated location. I discovered that if someone didn't run PyCharm any plugin then they are missing this folder and my script should handle this. Can I ask you to verify what I have prepared?
Here is the sript:
"
#!/bin/bash
# Define the source and target directories
SOURCE_DIR="/private/var/tmp/plugins"
TARGET_DIR="$HOME/Library/Application Support/JetBrains/PyCharm2024.2/plugins"
# Check if the source directory exists
if [ ! -d "$SOURCE_DIR" ]; then
echo "Source directory does not exist: $SOURCE_DIR"
exit 1
fi
# Create the target directory if it doesn't exist
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p "$TARGET_DIR"
echo "Created directory: $TARGET_DIR"
else
echo "Directory already exists: $TARGET_DIR"
fi
# Copy the files from the source directory to the target directory
cp -R "$SOURCE_DIR/." "$TARGET_DIR/"
echo "All files from $SOURCE_DIR have been copied to $TARGET_DIR." "
Regards
@MatP wrote:
Hey guys, I need to deploy VSCode & Jetbrain Snyk extension via Jamf. VScode is in format .vsix and Jetbrain is looking like a simple folder with one Library and .jar files inside this folder.
Have any of you had to deal with such an installation?
Thank you in advance.
Regards
3 weeks ago - last edited 3 weeks ago
You can't use $HOME in a postinstall script. You need to do something like this:
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
TARGET_DIR="/Users/$currentUser/Library/Application Support/JetBrains/PyCharm2024.2/plugins"
You'll also want to use chown and chmod to set the owner and permissions for the field after they're copied.