Skip to content

Commit

Permalink
Handle problems with ProgramFilesX86 on mono - fslaborg/zzarchive-FsL…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Apr 24, 2014
1 parent 70919c5 commit 146945d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.14.13 - 24.04.2014
* Handle problems with ProgramFilesX86 on mono - https://github.com/tpetricek/FsLab/pull/32

#### 2.14.12 - 24.04.2014
* Change the MSBuild 12.0 path settings according to https://github.com/tpetricek/FsLab/pull/32

Expand Down
9 changes: 6 additions & 3 deletions src/app/FakeLib/EnvironmentHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ let ProgramFiles = Environment.GetFolderPath Environment.SpecialFolder.ProgramFi
/// It seems this covers all cases where PROCESSOR\_ARCHITECTURE may misreport and the case where the other variable
/// PROCESSOR\_ARCHITEW6432 can be null
let ProgramFilesX86 =
let wow64 = (environVar "PROCESSOR_ARCHITEW6432")
let globalArch = (environVar "PROCESSOR_ARCHITECTURE")
let wow64 = environVar "PROCESSOR_ARCHITEW6432"
let globalArch = environVar "PROCESSOR_ARCHITECTURE"
match wow64, globalArch with
| "AMD64", "AMD64" | null, "AMD64" | "x86", "AMD64" -> environVar "ProgramFiles(x86)"
| "AMD64", "AMD64"
| null, "AMD64"
| "x86", "AMD64" -> environVar "ProgramFiles(x86)"
| _ -> environVar "ProgramFiles"
|> fun detected -> if detected = null then @"C:\Program Files (x86)\" else detected

/// The system root environment variable. Typically "C:\Windows"
let SystemRoot = environVar "SystemRoot"
Expand Down

0 comments on commit 146945d

Please sign in to comment.