|
29 | 29 | ###############################################################################
|
30 | 30 |
|
31 | 31 | import csv
|
32 |
| -import os |
| 32 | +import os, sys |
33 | 33 | import shutil
|
34 | 34 | import subprocess
|
35 | 35 | import copy
|
@@ -1897,17 +1897,21 @@ def initialize():
|
1897 | 1897 | utils.importOSGEO()
|
1898 | 1898 | utils.createLogger(session_dir, configuration.verbose)
|
1899 | 1899 |
|
1900 |
| - utils.set_r_path(configuration.r_path) |
1901 |
| - if not os.path.exists(utils.get_r_path()) and \ |
1902 |
| - system.systemType in ['Microsoft', 'Windows']: |
1903 |
| - # they don't have a decent R path, let's see if we can pull one from the |
1904 |
| - utils.set_r_path(utils.pull_R_install_from_reg()) |
1905 |
| - configuration.r_path = utils.get_r_path() |
1906 |
| - configuration.set_deep_value('r_path', configuration.r_path) |
| 1900 | + if system.systemType in ['Microsoft', 'Windows']: |
| 1901 | + # we're on a windows box, they probably installed VisTrails, R, and SAHM |
| 1902 | + # using the prebuilt msi, let's make sure they're using the supplied R |
| 1903 | + base_dir = os.path.split(os.path.split(sys.executable)[0])[0] |
| 1904 | + default_r_dname = r"Central_R\R-3.2.0\bin" |
| 1905 | + r_path = os.path.join(base_dir, default_r_dname) |
| 1906 | + if os.path.exists(r_path): |
| 1907 | + configuration.r_path = utils.get_r_path() |
| 1908 | + configuration.set_deep_value('r_path', configuration.r_path) |
1907 | 1909 |
|
1908 |
| - package_manager = get_package_manager() |
1909 |
| - package = package_manager.get_package(identifier) |
1910 |
| - package.persist_configuration() |
| 1910 | + package_manager = get_package_manager() |
| 1911 | + package = package_manager.get_package(identifier) |
| 1912 | + package.persist_configuration() |
| 1913 | + |
| 1914 | + utils.set_r_path(configuration.r_path) |
1911 | 1915 |
|
1912 | 1916 | try:
|
1913 | 1917 | testfname = os.path.join(utils.get_r_path(), "CanSAHMWriteToR.txt")
|
|
0 commit comments