BlueMountainCapital/FSharpRProvider — pull request #30 by geandbe (2013-08-11 18:03:51+00:00)
Title: More graceful processing of absent R install

The proposed change addresses two issues related to collocated R installation.

1. If R is not installed or installed by non-administrator, then conditional expression in line 74 of RInterop.fs is false and lines 75 - 85 are skipped. Exception thrown in line 93 is intercepted by fsc as internal producing quite obscure error message "The type initializer for 'RProvider.RInteropInternal' threw an exception". The proposed change moves R installation discovery code into static constructor within RProvider.fs, which in case of absent R install gives very explicit error message "The type provider constructor has thrown an exception: Reg key Software\R-core does not exist; R is likely not installed on this computer"

2. When R installation on a computer was performed using non-administrative account correspondent registry changes end up in 'CurrentUser' hive. The proposed change extends R installation search to cover both 'LocalMachine' and 'CurrentUser' hives.