|
7 | 7 |
|
8 | 8 | namespace pyRevitLabs.Common { |
9 | 9 | public class PyRevitLabsConsts { |
| 10 | + public const string PyRevitPathOverrideEnvVar = "PYREVIT_PATH_OVERRIDE"; |
| 11 | + public const string PyRevitProgramDataPathOverrideEnvVar = "PYREVIT_PROGRAMDATA_PATH_OVERRIDE"; |
10 | 12 | // product |
11 | 13 | public const string ProductName = "pyRevit"; |
12 | 14 |
|
@@ -50,13 +52,31 @@ public class PyRevitLabsConsts { |
50 | 52 | public const string AppdataCacheDirName = "Cache"; |
51 | 53 | public const string AppdataLogsDirName = "Logs"; |
52 | 54 |
|
| 55 | + // install scope marker (all-users installer creates this under %ProgramData%\pyRevit\) |
| 56 | + public const string InstallAllUsersMarkerFileName = "install_all_users"; |
| 57 | + public const string DefaultConfigsFileName = "pyRevit_config.ini"; |
| 58 | + |
53 | 59 | // pyRevit %appdata% path |
54 | 60 | // @reviewed |
55 | | - public static string PyRevitPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), AppdataDirName); |
| 61 | + public static string PyRevitPath { |
| 62 | + get { |
| 63 | + string pathOverride = Environment.GetEnvironmentVariable(PyRevitPathOverrideEnvVar); |
| 64 | + if (!string.IsNullOrWhiteSpace(pathOverride)) |
| 65 | + return pathOverride; |
| 66 | + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), AppdataDirName); |
| 67 | + } |
| 68 | + } |
56 | 69 |
|
57 | 70 | // pyRevit %programdata% path |
58 | 71 | // @reviewed |
59 | | - public static string PyRevitProgramDataPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), AppdataDirName); |
| 72 | + public static string PyRevitProgramDataPath { |
| 73 | + get { |
| 74 | + string pathOverride = Environment.GetEnvironmentVariable(PyRevitProgramDataPathOverrideEnvVar); |
| 75 | + if (!string.IsNullOrWhiteSpace(pathOverride)) |
| 76 | + return pathOverride; |
| 77 | + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), AppdataDirName); |
| 78 | + } |
| 79 | + } |
60 | 80 |
|
61 | 81 | // pyrevit general cache folder |
62 | 82 | public static string CacheDirectory => Path.Combine(PyRevitPath, AppdataCacheDirName); |
|
0 commit comments