Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a548ca

Browse files
authored
Fix # 5514 (#5516)
1 parent77e6267 commit6a548ca

File tree

2 files changed

+10
-45
lines changed

2 files changed

+10
-45
lines changed

‎src/utils/CompilerLocationUtils.fs‎

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -217,31 +217,13 @@ module internal FSharpEnvironment =
217217
match probePointwith
218218
| Some pwhen safeExists(Path.Combine(p,"FSharp.Core.dll"))-> Some p
219219
|_->
220-
221-
// On windows the location of the compiler is via a registry key
222-
223-
// Note: If the keys below change, be sure to update code in:
224-
// Property pages (ApplicationPropPage.vb)
225-
letkeys=
226-
[|
227-
@"Software\Microsoft\FSharp\10.1\Runtime\v4.0";
228-
@"Software\Microsoft\FSharp\4.1\Runtime\v4.0";
229-
@"Software\Microsoft\FSharp\4.0\Runtime\v4.0"
230-
|]
231-
letpath= keys|> Seq.tryPick(fun k-> tryRegKey k)
232-
match pathwith
233-
| Some_-> path
234-
| None->
235-
// On Unix we let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions.
236-
letresult=
237-
letvar= System.Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN")
238-
if String.IsNullOrEmpty(var)then None
239-
else Some(var)
240-
match resultwith
241-
| Some_-> result
242-
| None->
243-
// For the prototype compiler, we can just use the current domain
244-
tryCurrentDomain()
220+
// We let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions.
221+
letresult= System.Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN")
222+
ifnot(String.IsNullOrEmpty(result))then
223+
Some result
224+
else
225+
// For the prototype compiler, we can just use the current domain
226+
tryCurrentDomain()
245227
with e->
246228
System.Diagnostics.Debug.Assert(false,"Error while determining default location of F# compiler")
247229
None

‎vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb‎

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages
4949
ProtectedConstINDEX_WINDOWSCLASSLIBAsInteger=2
5050
ProtectedConstINDEX_LASTAsInteger=INDEX_WINDOWSCLASSLIB
5151
PublicConstConst_TargetFrameworkMonikerAsString="TargetFrameworkMoniker"
52-
Privatem_v20FSharpRedistInstalledAsBoolean=False
53-
Privatem_v40FSharpRedistInstalledAsBoolean=False
5452

5553
FriendWithEventsTargetFrameworkAsSystem.Windows.Forms.ComboBox
5654
FriendWithEventsTargetFrameworkLabelAsSystem.Windows.Forms.Label
@@ -75,12 +73,6 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages
7573
m_OutputTypeStringKeys(INDEX_COMMANDLINEAPP)=SR.GetString(SR.PPG_CommandLineApp)
7674
m_OutputTypeStringKeys(INDEX_WINDOWSCLASSLIB)=SR.GetString(SR.PPG_WindowsClassLib)
7775

78-
Dimv20FSharpRedistKeyAsString="HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v2.0"
79-
Dimv40FSharpRedistKeyAsString="HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v4.0"
80-
81-
m_v20FSharpRedistInstalled=Not(IsNothing(Microsoft.Win32.Registry.GetValue(v20FSharpRedistKey,Nothing,Nothing)))
82-
m_v40FSharpRedistInstalled=Not(IsNothing(Microsoft.Win32.Registry.GetValue(v40FSharpRedistKey,Nothing,Nothing)))
83-
8476
'Add any initialization after the InitializeComponent() call
8577
AddChangeHandlers()
8678

@@ -587,18 +579,9 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages
587579
Ifmoniker.StartsWith(".NETCoreApp")OrElsemoniker.StartsWith(".NETStandard")Then
588580
ReturnTrue
589581
EndIf
590-
Ifmoniker.Contains("v2")Then
591-
ReturnMe.m_v20FSharpRedistInstalled
592-
EndIf
593-
Ifmoniker.Contains("v3.0")Then
594-
ReturnMe.m_v20FSharpRedistInstalled
595-
EndIf
596-
Ifmoniker.Contains("v3.5")Then
597-
ReturnMe.m_v20FSharpRedistInstalled
598-
EndIf
599-
'' Is this cheating?
600-
Ifmoniker.Contains("v4")Then
601-
ReturnMe.m_v40FSharpRedistInstalled
582+
' With the latest tooling, if we have editors the redist is installed by definition
583+
Ifmoniker.Contains("v2")Ormoniker.Contains("v3.0")Ormoniker.Contains("v3.5")Ormoniker.Contains("v4")Then
584+
ReturnTrue
602585
EndIf
603586
ReturnFalse
604587
EndFunction

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp