Packages - deleting older files on newer installation
Packages - deleting older files on newer installation
- Subject: Packages - deleting older files on newer installation
- From: Stephen Kay <email@hidden>
- Date: Thu, 30 Mar 2017 13:09:29 -0700
- Thread-topic: Packages - deleting older files on newer installation
My installation puts a folder inside /Applications that holds the .app and
some other support files (sorry, it's old). Within that folder, there is
another folder that holds a pdf Help File.
The structure is like this (note spaces in names):
/Applications/My App Folder/My App.app
/Applications/My App Folder/Help Folder/Help File 3.3.pdf
So if you install the new version on top of an older version, all files
having the same names get replaced except for the Help File which has a
version number at the end of it. So the user can end up with several older
help files.
So I wanted to have the post-install script that is attached to my .app
bundle delete any older Help Files.
In testing this, this WORKS to delete an older file (if it exists, and if
not, who cares):
rm -rf "$2/../Help Folder/Help 3.2.pdf"
But I had gotten the impression that you should use sudo and the current
user for everything, as shown in most of the examples I've seen here.
If I try this, it doesn't work:
/usr/bin/su $USER -c "/usr/bin/rm -rf \"$2/../Help Folder/Help 3.2.pdf\""
I must have something wrong with the quoting, I tried it without quotes,
numerous variations of quoting and escaping etc., but I can't see it. Or
there's something I'm misunderstanding about the examples I've seen.
Thanks,
- Stephen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden