Function install.URL: should warn if R is installed in a different directory
Opened this issue · 2 comments
discoleo commented
Warn if R is installed in a different directory
A bug can appear if:
- previous version of R is installed in a different directory than the standard one, and the user forgets to change the directory during the setup of the new R version;
- the new R version will be installed in the standard location: but the previous packages are in a different location;
- updateR() will not detect the newly installed R version and will exit (even though the installation was succesful, but in the standard directory now);
Solution
The function install.URL should check if R is installed in a non-standard directory and warn the user to change the direcory during the R setup. The code could be inserted in the block of code at line 223:
# Note: this is the existing installr code:
if(is.windows()) {
shell_output <- shell(install_cmd, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
} else {
shell_output <- system(install_cmd, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
}
talgalili commented
Thanks!
Could you please write the PR in github?
I'll be happy to review it.
T
…On Sun, 19 Nov 2023, 23:34 discoleo, ***@***.***> wrote:
Warn if R is installed in a different directory
A bug can appear if:
- R is installed in a different directory than the standard one, and
the user forgets to change the directory during the setup of the new R
version;
- updateR() will not detect the newly installed R version and will
exit, even if the installation is succesful (but in the standard directory
now);
Solution
The function install.URL should check if R is installed in a non-standard
directory and warn the user to change the direcory during the R setup. The
code could be inserted in the block of code at line 223:
if(is.windows()) {
shell_output <- shell(install_cmd, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
} else {
shell_output <- system(install_cmd, wait = wait,...) # system(exe_filename) # I suspect shell works better than system
}
—
Reply to this email directly, view it on GitHub
<#187>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHOJBWVITD375QLZWCAX33YFJ3OPAVCNFSM6AAAAAA7SALHISVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDCMBUG43DIMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
discoleo commented
Note:
- the code mentioned above is the original code from installr;
- unfortunately, I am not very familiar with the installr code; however, I suspect that any new code will have to be inserted "inside/around" those lines of code;
- I presume that it is possible to pre-check if the old R is installed in a standard location; if it is not installed in the standard location, then issue a warning about it - but I am unfamiliar with these details;
- the issue may be also Windows specific;