Posted on 04-13-2014 11:44 PM
Hi All,
Not strictly Casper related but I am attempting to uninstall TeamViewer 6 from all our machines and install TV8 in the same policy. My scripting skills are distinctly subpar. I am concocting a script and the only thing I'm stuck on is the removal of a plist in each of the users Home folder namely /Volumes/Users/User/Preferences/com.TeamViewer6.Settings.plist. Is the wildcard /$User or /*User or neither?
Appreciate any advice.
Cheers
T
Posted on 04-13-2014 11:57 PM
Did you deploy it via a DMG?
If so, you can uninstall via a policy (if you index the DMG).
Else, you could use composer to create a DMG (with the plist).
Then upload to Casper admin, index & tick FEU/FUT's.
Then via a policy uninstall that DMG, this will remove whatever's in the DMG. So the app bundle & plist.
Posted on 04-14-2014 12:14 AM
Hey Bentoms
Thanks for that. Forgot about that method which I used a long time ago on a pesky file I needed deleting, I might look into it. I have been meaning to get to grips with the wildcard option as it would work well for me in a variety of situations so am hoping someone might be able to guide me.
Cheers
Posted on 04-14-2014 12:14 AM
Oh yeah, forgot to mention, I didn't index the package.
Posted on 04-14-2014 10:01 AM
Normally if you are doing something as a user you can use ~/Library to get to their library.
However in your case if you are trying to delete this plist in *Each* users folder then it gets a lot more difficult. There is no wildcard for every user on the machine, you have to create a list, and then a loop function to get through the list. I consider myself to be a fair scripter and this task would require some significant effort for me to write.
Also you will run into issues with permissions and may have to SU as each user to access their files.
The other option would be to make a login script and then when each user logs in they will run the script for you if you set frequency to once per user.
Posted on 04-14-2014 12:27 PM
I am not a scripter either, but this should do the trick. I also assumed you meant /Library/Preferences? TEST!!!
#!/bin/sh
for username in `ls /Volumes/Users/`
do
/bin/rm /Volumes/Users/$username/Library/Preferences/com.TeamViewer6.Settings.plist
done
Indexed DMGs if ever possible...work nice though for uninstalls for user templates. =D
Posted on 04-14-2014 06:48 PM
@nortonpc thanks for that, yes I will have to loop through each of the users home folders to make sure as some machine do get shared.
@ernstcs thats's awesome I will definitely give that a whirl and yes in my haste I left out /Library/
I have indexed .dmg's in the past and not all files were removed, seemed to be a bit hit and miss so haven't revisited it. Should do as that was a few versions ago.
Thanks guys
Cheers
Posted on 04-15-2014 01:07 AM
If your still going the script root then:
#!/bin/sh
rm /Users/*/Library/Preferences/com.TeamViewer6.Settings.plist
I think that will go through all the Users folders.