Permalink
Browse files

Merge pull request #44 from mausch/develop

Removed hardcoded C:
  • Loading branch information...
2 parents 1360118 + 68ae806 commit d27d4b44d60bf09d9d436ffe9f011643011bf97d @forki forki committed Mar 7, 2012
@@ -30,6 +30,10 @@ let environVarOrDefault name defaultValue =
let var = environVar name
if isNullOrEmpty var then defaultValue else var
+let environVarOrNone name =
+ let var = environVar name
+ if isNullOrEmpty var then None else Some var
+
/// Retrieves a ApplicationSettings variable
let appSetting (name:string) = ConfigurationManager.AppSettings.[name]
@@ -53,7 +57,15 @@ let ProgramFilesX86 =
else
environVar "ProgramFiles"
-let mutable TargetPlatformPrefix = @"C:\Windows\Microsoft.NET\Framework"
+let SystemRoot = environVar "SystemRoot"
+
+let mutable TargetPlatformPrefix =
+ let (<|>) a b = match a with None -> b | _ -> a
+ environVarOrNone "FrameworkDir32"
+ <|> Some (SystemRoot @@ @"Microsoft.NET\Framework")
+ <|> Some @"C:\Windows\Microsoft.NET\Framework"
+ |> Option.get
+
/// Gets the local directory for the given target platform
let getTargetPlatformDir platformVersion =
@@ -137,6 +137,7 @@ let tryFindFile dirs file =
path
|> replace "[ProgramFiles]" ProgramFiles
|> replace "[ProgramFilesX86]" ProgramFilesX86
+ |> replace "[SystemRoot]" SystemRoot
|> directoryInfo
if not dir.Exists then "" else
let fi = dir.FullName @@ file |> fileInfo
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
- <add key="MSBuildPath" value="c:\Windows\Microsoft.NET\Framework\v4.0.30319\;c:\Windows\Microsoft.NET\Framework\v4.0.30128\;c:\Windows\Microsoft.NET\Framework\v3.5\" />
+ <add key="MSBuildPath" value="[SystemRoot]\Microsoft.NET\Framework\v4.0.30319\;[SystemRoot]\Microsoft.NET\Framework\v4.0.30128\;[SystemRoot]\Microsoft.NET\Framework\v3.5\" />
<add key="FSIPath" value=".\tools\FSharp\;.\lib\FSharp\;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\" />
<add key="GitPath" value="[ProgramFilesX86]\Git\bin\;[ProgramFiles]\Git\bin\" />
</appSettings>
Oops, something went wrong.

0 comments on commit d27d4b4

Please sign in to comment.