Posted on 03-18-2016 10:23 AM
Hi Chaps,
Trying to create a DMG file to deploy that will install a safari shortcut to everyones desktop. Or possibly in the Applications folder, when I open composer and drag the Icon from my desktop in, it creates the folder
Users>Simon>Desktop>GreyConnect.webloc
Obviously not everyone will have a "Simon" user folder and I want it to go to theres, is there something like $username or something that will work and edit the folder named Simon?
Thanks
Posted on 03-18-2016 10:26 AM
Would this work?
Posted on 03-18-2016 11:41 AM
If you create a DMG as shown with Users>Simon>Desktop>GreyConnect.webloc and:
Deploy without FEU/FUT checked, you will get this on the target computer:
"/Users/Simon/Desktop/GreyConnect.webloc"
Deploy with FEU (Fill Existing Users) checked, you will get this on the target computer:
"/Users/*/Desktop/GreyConnect.webloc"
(installed in the Desktop folder for every user)
Deploy with FUT (Fill User Templates) checked, you will get this on the target computer:
"/System/Library/User Template/*/Desktop/GreyConnect.webloc"
(installed in all of the User templates, so any new user that logs in to the machine will get it)
So the username in the composer package doesn't really matter, though when I do those packages I like to use a generic "packaging" account. You can use FEU and FUT simultaneously if you want.
There is another option, using a package (PKG) that contains the file and a script to copy the files where they need to go in the user's directories.
Posted on 03-18-2016 12:22 PM
There's also going the completely scripted way, though this would only work for the logged in user and not on a global level for any future accounts.
#!/bin/bash
loggedInUser=$(stat -f%Su /dev/console)
loggedInUID=$(id -u "$loggedInUser")
/bin/launchctl asuser "$loggedInUID" sudo -iu "$loggedInUser" "/usr/bin/osascript << EOF
tell application "Finder"
set mySource to POSIX file "/Applications/Safari.app" as alias
make new alias to mySource at desktop
set name of result to "Safari"
end tell
EOF"
Posted on 03-19-2016 02:51 AM
@betty02 Create the DMG under an account that exists in the Macs, something like ladmin.
Casper will ASR to that location, then copy out to the other users homes.
Posted on 03-19-2016 12:10 PM
We chose to put specific school related sites in their Dock instead of the Desktop.
You can use an AppleScript for this, export it as an app, put in your Applications folder, package, then push to users' Dock.
Posted on 01-30-2017 07:31 AM
With FEU/FUT, do you need to run a package at reboot, when including it during imaging? I noticed that with FEU/FUT, it was still putting /user/pmcgurn/Desktop/file in the imaged Mac.
Posted on 01-30-2017 08:35 AM
Like @mm2270 I would consider doing this with a script. A script makes it easy to make changes or remove the shortcut in the future.
The following as a login script should accomplish the task.
#!/bin/bash
echo [InternetShortcut] > /Users/$3/Desktop/Test.url
echo URL=http://somewebsite.com >> /Users/$3/Desktop/Test.url
chown $3 /Users/$3/Desktop/Test.url
Posted on 05-25-2018 02:58 AM
Hi,
The script works great, I was wondering if there was a way to change the icon as well in the script?
Thanks,
Jon
Posted on 08-30-2020 08:27 PM
Just wondering if anyone did figure out how to change the icon on the desktop to a specific image? Trying to get our new 1:1 students set up with a desktop link.
Tried the config profile and with web clips, but they can trash it and be done.
Posted on 08-31-2020 06:36 AM
We are using this to adda Icon to URL Files. https://github.com/mklement0/fileicon
Posted on 09-02-2020 06:00 AM
@swallace We save the applescript as an application and then just swap out the .icns file (located in the resources folder).