File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -133,14 +133,22 @@ module DotNetFwk =
133133 module internal MsImpl =
134134 open registry
135135
136+ let ifNone f arg = function
137+ | None -> f arg
138+ | x -> x
139+ let tryUntil ( f : 't -> 'r option ) ( data : 't seq ) : 'r option =
140+ data |> Seq.fold ( fun state value -> state |> ifNone f value) None
141+
136142 let tryLocateFwk fwk =
137143
138- // TODO drop Wow node lookup
144+ // TODO drop Wow node lookup, lookup depending on fwk
139145 let fscTool =
140- registry.open_ subkey registry.HKLM @" SOFTWARE\Wow6432Node\Microsoft\FSharp\3.0\Runtime\v4.0"
146+ [ " 4.0" ; " 3.1" ; " 3.0" ] |> tryUntil (
147+ sprintf @" SOFTWARE\Wow6432Node\Microsoft\FSharp\%s\Runtime\v4.0" >> registry.open_ subkey registry.HKLM
148+ )
141149 |> Option.bind ( registry.get_ value_ str " " )
142150 |> Option.map ( fun p -> p </> " fsc.exe" )
143-
151+
144152 let fwkKey = open_ subkey HKLM @" SOFTWARE\Microsoft\.NETFramework"
145153 let installRoot_ = fwkKey |> Option.bind ( get_ value_ str " InstallRoot" )
146154 let installRoot = installRoot_ |> Option.get // TODO gracefully fail
Original file line number Diff line number Diff line change 11NUGET
22 remote: https://www.nuget.org/api/v2
3- specs:
43 FSharp.Core (3.1.2.5)
54 NuGet.CommandLine (2.8.5)
65 NUnit (2.6.3)
You can’t perform that action at this time.
0 commit comments