Replacing the LinkOSX file
-
I am using the below Bash Script format to copy the
LinkOSX
file to the user library. It works well if there is no Plugin folder in the AppData folder.But if there is already a LinkOSX file, it doesn't replace. Does anyone has a fix for this?
#!/bin/sh sudo -u $USER mkdir -p $HOME/Library/Application\ Support/MyCompany/TestPlugin/ /usr/bin/rsync -avurpE --remove-source-files /Library/Application\ Support/MyCompany/TestPlugin/ $HOME/Library/Application\ Support/MyCompany/TestPlugin/ sudo find $HOME/Library/Application\ Support/MyCompany/ -type d -user root -exec sudo chown -R $USER: {} + rm -rf /Library/Application\ Support/MyCompany exit 0
-
Why not do it from within your plugin?
-
@orange pretty sure you can use that last rm line to remove it. Let me check my bash scripts tomorrow as I've done similar recently
-
@orange Since you're using the -v (verbose) flag, have you tired to drag/drop the script in Terminal to see if you get an error? I would think it should tell you if there was an issue.
-
@d-healey said in Replacing the LinkOSX file:
Why not do it from within your plugin?
Because I've updated the samples and since the Sample size is very low (200MB), I want to make a straight-forward installation for the user.
@DanH said in Replacing the LinkOSX file:
@orange pretty sure you can use that last rm line to remove it. Let me check my bash scripts tomorrow as I've done similar recently
The script removes the temporary folder, but doesn't replace the LinkOSX file.
@Dan-Korneff said in Replacing the LinkOSX file:
@orange Since you're using the -v (verbose) flag, have you tired to drag/drop the script in Terminal to see if you get an error? I would think it should tell you if there was an issue.
I get "Permission Denied" error.
-
@orange ok! That's where we need to look. Check the permissions of the file that was previously installed. Who has what permissions when you right click on the file and hit "get info"?
-
@orange gonna pm you now
-
@Dan-Korneff I use a pre-install script to remove any files / folders before installing new ones
#!/bin/sh rm -rf $HOME/Library/Application\ Support/MYCOMPANY/PLUGIN/LinkOSX exit 0
-
@Dan-Korneff said in Replacing the LinkOSX file:
@orange ok! That's where we need to look. Check the permissions of the file that was previously installed. Who has what permissions when you right click on the file and hit "get info"?
This happen even on an admin account. I think since there is a file, Whitebox doesn't overwrite it.
@DanH said in Replacing the LinkOSX file:
@Dan-Korneff I use a pre-install script to remove any files / folders before installing new ones
That did the trick, Thank you! So for this purpose, first a Pre-Install script to remove the file:
#!/bin/sh rm -rf $HOME/Library/Application\ Support/MYCOMPANY/PLUGIN/LinkOSX exit 0
Then the Post-Install script to replace it:
#!/bin/sh sudo -u $USER mkdir -p $HOME/Library/Application\ Support/MyCompany/TestPlugin/ /usr/bin/rsync -avurpE --remove-source-files /Library/Application\ Support/MyCompany/TestPlugin/ $HOME/Library/Application\ Support/MyCompany/TestPlugin/ sudo find $HOME/Library/Application\ Support/MyCompany/ -type d -user root -exec sudo chown -R $USER: {} + rm -rf /Library/Application\ Support/MyCompany exit 0