File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ let getBackgroundCheckResultsForScriptText (input) =
3838
3939let sysLib nm =
4040 if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
41- @" C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\" + nm + " .dll"
41+ let programFilesx86Folder = System.Environment.GetEnvironmentVariable( " PROGRAMFILES(X86)" )
42+ programFilesx86Folder + @" \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\" + nm + " .dll"
4243 else
4344 let sysDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
4445 let (++) a b = System.IO.Path.Combine( a, b)
@@ -53,7 +54,8 @@ module Helpers =
5354let fsCoreDefaultReference () =
5455 PathRelativeToTestAssembly " FSharp.Core.dll"
5556 // if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
56- // @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"
57+ // let programFilesx86Folder = System.Environment.GetEnvironmentVariable("PROGRAMFILES(X86)")
58+ // programFilesx86Folder + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"
5759 //else
5860 // sysLib "FSharp.Core"
5961
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ let UseMyFileSystem() =
7575let ``FileSystem compilation test`` () =
7676 if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
7777 use myFileSystem = UseMyFileSystem()
78+ let programFilesx86Folder = System.Environment.GetEnvironmentVariable( " PROGRAMFILES(X86)" )
7879
7980 let projectOptions =
8081 let allFlags =
@@ -88,9 +89,9 @@ let ``FileSystem compilation test``() =
8889 yield " --fullpaths" ;
8990 yield " --flaterrors" ;
9091 yield " --target:library" ;
91- for r in [ @" C:\Program Files (x86) \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" ;
92- @" C:\Program Files (x86) \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" ;
93- @" C:\Program Files (x86) \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" ] do
92+ for r in [ programFilesx86Folder + @" \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" ;
93+ programFilesx86Folder + @" \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" ;
94+ programFilesx86Folder + @" \Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" ] do
9495 yield " -r:" + r |]
9596
9697 { ProjectFileName = @" c:\mycode\compilation.fsproj" // Make a name that is unique in this directory.
Original file line number Diff line number Diff line change @@ -412,10 +412,11 @@ let ``Project file parsing -- space in file name``() =
412412
413413[<Test>]
414414let ``Project file parsing -- report files`` () =
415+ let programFilesx86Folder = System.Environment.GetEnvironmentVariable( " PROGRAMFILES(X86)" )
415416 if not runningOnMono then
416- for f in Directory.EnumerateFiles( @" C:\Program Files (x86) \Reference Assemblies\Microsoft\FSharp\" , " *" , SearchOption.AllDirectories) do
417+ for f in Directory.EnumerateFiles( programFilesx86Folder + @" \Reference Assemblies\Microsoft\FSharp\" , " *" , SearchOption.AllDirectories) do
417418 printfn " File: %s " f
418- for f in Directory.EnumerateFiles( @" C:\Program Files (x86)\ Microsoft SDKs\F#\4.0 \" , " *" , SearchOption.AllDirectories) do
419+ for f in Directory.EnumerateFiles( programFilesx86Folder + @" \ Microsoft SDKs\F#\4.1 \" , " *" , SearchOption.AllDirectories) do
419420 printfn " File: %s " f
420421
421422#endif
You can’t perform that action at this time.
0 commit comments