Hopefully this has a straightforward answer, but I haven't been able to find it as yet.
I'm writing an R package, and when installed on Windows I want it to execute a script that searches for a system file i.e. list.files(path = "C:/Program Files/, ...)
and then saves that path to the package directory as a text file for later reference.
I tried saving the script as src/install.libs.R
but that stopped my package from building.
In case there is an alternative solution, I'm trying to save the path to the javaw.exe file that resides in the Program files directory (somewhere!), so that I can quickly call it in functions via system2()
.
.onLoad
hook cannot make up for the lack of a post-install hook, as far as I know (my package needs to install a command line tool that is not itself part of the package). – Crimple