Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ src/fsharp/FSharp.LanguageService.Compiler/pplex.fs
src/fsharp/FSharp.LanguageService.Compiler/pppars.fs
src/fsharp/FSharp.LanguageService.Compiler/pppars.fsi
vsintegration/src/unittests/Unittests.fsi
tests/*FSharp_Failures.env
tests/*FSharp_Failures.lst
tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll
tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb
tests/XFSharpQA_Failures.log.*
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi
vsintegration/src/vs/FsPkgs/FSharp.Project/FS/ctofiles/
tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll
tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll
tests/fsharpqa/Source/*FSharpQA_Failures.env
tests/fsharpqa/Source/*FSharpQA_Failures.lst
*.csproj.user
*.sln.DotSettings.user
*.ide
Expand Down
2 changes: 1 addition & 1 deletion DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Restart Visual Studio, it should now be running your freshly-built Visual F# IDE

### Notes on the build

1. The `update.cmd` script adds the built `FSharp.Core` to the GAC, adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
1. The `update.cmd` script adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
1. The compiler binaries produced are "private" and strong-named signed with a test key.
1. Some additional tools are required to build the compiler, notably `fslex.exe`, `fsyacc.exe`, `FSharp.PowerPack.Build.Tasks.dll`, `FsSrGen.exe`, `FSharp.SRGen.Build.Tasks.dll`, and the other tools found in the `lkg` directory.
1. The overall bootstrapping process executes as follows
Expand Down
2 changes: 1 addition & 1 deletion TESTGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In order to run all of the tests, you will need to install

* [Perl](http://www.perl.org/get.html) (ActiveState Perl 5.16.3 is known to work fine)

Perl must be included in the `%PATH%` for the below steps to work. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which modify the GAC, and this requires administrative privileges.
Perl must be included in the `%PATH%` for the below steps to work. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which require administrative privileges.

Before running tests, make sure you have successfully built all required projects as specified in the 'Prepare For Tests' section of the [DEVGUIDE](DEVGUIDE.md).

Expand Down
2 changes: 1 addition & 1 deletion src/assemblyinfo/assemblyinfo.FSharp.Core.dll.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ open System.Runtime.InteropServices

#if PORTABLE
[<assembly:AssemblyProduct("Microsoft\174 F#")>]
[<assembly:AssemblyFlags(System.Reflection.AssemblyNameFlags.Retargetable)>] // ensure we replace any 4.0.30319.* or 4.0.31105.* versions in the GAC. These are the FileVersions for RTM VS2010 and SP1 VS2010
[<assembly:AssemblyFlags(System.Reflection.AssemblyNameFlags.Retargetable)>]
#endif

do()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ do()
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests")>]
#else
[<assembly:AssemblyFileVersion("4.0.40401.666")>] // ensure we replace any 4.0.30319.* or 4.0.31105.* versions in the GAC. These are the FileVersions for RTM VS2010 and SP1 VS2010
[<assembly:AssemblyFileVersion("4.0.40401.9055")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,10 @@ type TcConfigBuilder =
mutable emitDebugInfoInQuotations : bool

mutable exename : string option

// If true - the compiler will copy FSharp.Core.dll along the produced binaries
mutable copyFSharpCore : bool

/// When false FSI will lock referenced assemblies requiring process restart, false = disable Shadow Copy false (*default*)
mutable shadowCopyReferences : bool
}
Expand Down Expand Up @@ -2172,6 +2176,7 @@ type TcConfigBuilder =
sqmSessionStartedTime = System.DateTime.Now.Ticks
emitDebugInfoInQuotations = false
exename = None
copyFSharpCore = true
shadowCopyReferences = false
}

Expand Down Expand Up @@ -2638,6 +2643,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
member x.sqmSessionGuid = data.sqmSessionGuid
member x.sqmNumOfSourceFiles = data.sqmNumOfSourceFiles
member x.sqmSessionStartedTime = data.sqmSessionStartedTime
member x.copyFSharpCore = data.copyFSharpCore
member x.shadowCopyReferences = data.shadowCopyReferences

static member Create(builder,validate) =
Expand Down
2 changes: 2 additions & 0 deletions src/fsharp/CompileOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ type TcConfigBuilder =
sqmSessionStartedTime : int64
mutable emitDebugInfoInQuotations : bool
mutable exename : string option
mutable copyFSharpCore : bool
mutable shadowCopyReferences : bool }


Expand Down Expand Up @@ -508,6 +509,7 @@ type TcConfig =
member sqmSessionGuid : System.Guid option
member sqmNumOfSourceFiles : int
member sqmSessionStartedTime : int64
member copyFSharpCore : bool
member shadowCopyReferences : bool

static member Create : TcConfigBuilder * validate: bool -> TcConfig
Expand Down
3 changes: 3 additions & 0 deletions src/fsharp/CompileOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ let PrintOptionInfo (tcConfigB:TcConfigBuilder) =
printfn " debuginfo . . . . . . : %+A" tcConfigB.debuginfo
printfn " resolutionEnvironment : %+A" tcConfigB.resolutionEnvironment
printfn " product . . . . . . . : %+A" tcConfigB.productNameForBannerText
printfn " copyFSharpCore . . . . : %+A" tcConfigB.copyFSharpCore
tcConfigB.includes |> List.sort
|> List.iter (printfn " include . . . . . . . : %A")

Expand Down Expand Up @@ -611,6 +612,8 @@ let outputFileFlagsFsc (tcConfigB : TcConfigBuilder) =

CompilerOption("sig", tagFile, OptionString (setSignatureFile tcConfigB), None,
Some (FSComp.SR.optsSig()));

CompilerOption("nocopyfsharpcore", tagNone, OptionUnit (fun () -> tcConfigB.copyFSharpCore <- false), None, Some (FSComp.SR.optsNoCopyFsharpCore()));
]


Expand Down
2 changes: 2 additions & 0 deletions src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ optsUseHighEntropyVA,"Enable high-entropy ASLR"
optsSubSystemVersion,"Specify subsystem version of this assembly"
optsTargetProfile,"Specify target framework profile of this assembly. Valid values are mscorlib or netcore. Default - mscorlib"
optsEmitDebugInfoInQuotations,"Emit debug information in quotations"
optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries"
1051,optsInvalidSubSystemVersion,"Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater."
1052,optsInvalidTargetProfile,"Invalid value '%s' for '--targetprofile', valid values are 'mscorlib' or 'netcore'."
typeInfoFullName,"Full name"
Expand Down Expand Up @@ -1269,3 +1270,4 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
3193,optsInvalidResponseFile,"Invalid response file '%s' ( '%s' )"
3194,optsResponseFileNotFound,"Response file '%s' not found in '%s'"
3195,optsResponseFileNameInvalid,"Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long"
3196,fsharpCoreNotFoundToBeCopied,"Cannot find FSharp.Core.dll in compiler's directory"
4 changes: 2 additions & 2 deletions src/fsharp/ReferenceResolution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ module internal MSBuildResolver =
// These are search paths for runtime-like or scripting resolution. GAC searching is present.
yield! rawFileNamePath // Quick-resolve straight to filename first
yield! explicitIncludeDirs // From -I, #I
yield implicitIncludeDir // Usually the project directory
yield fsharpCoreExplicitDirOrFSharpBinariesDir // Location of explicit reference to FSharp.Core, otherwise location of fsc.exe
yield implicitIncludeDir // Usually the project directory
yield "{TargetFrameworkDirectory}"
yield registry
yield "{AssemblyFolders}"
Expand All @@ -290,8 +290,8 @@ module internal MSBuildResolver =
yield "{TargetFrameworkDirectory}"
yield! rawFileNamePath // Quick-resolve straight to filename first
yield! explicitIncludeDirs // From -I, #I
yield implicitIncludeDir // Usually the project directory
yield fsharpCoreExplicitDirOrFSharpBinariesDir // Location of explicit reference to FSharp.Core, otherwise location of fsc.exe
yield implicitIncludeDir // Usually the project directory
yield registry
yield "{AssemblyFolders}"
yield outputDirectory
Expand Down
26 changes: 25 additions & 1 deletion src/fsharp/fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,27 @@ let ValidateKeySigningAttributes (tcConfig : TcConfig, tcGlobals, topAttrs) =
| None -> tcConfig.container

SigningInfo (delaysign,signer,container)


// If the --nocopyfsharpcore switch is not specified, this will:
// 1) Look into the referenced assemblies, if FSharp.Core.dll is specified, it will copy it to output directory.
// 2) If not, but FSharp.Core.dll exists beside the compiler binaries, it will copy it to output directory.
// 3) If not, it will produce an error.
let copyFSharpCore(outFile: string, referencedDlls: AssemblyReference list) =
let outDir = Path.GetDirectoryName(outFile)
let fsharpCoreAssemblyName = GetFSharpCoreLibraryName() + ".dll"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Path.Combine to concatenate file path bits in product code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a path. This function just has the string "FSharp.Core". Path.Combine() is used in line 1792

let fsharpCoreDestinationPath = Path.Combine(outDir, fsharpCoreAssemblyName)

if not (File.Exists(fsharpCoreDestinationPath)) then
match referencedDlls |> Seq.tryFind (fun dll -> String.Equals(Path.GetFileName(dll.Text), fsharpCoreAssemblyName, StringComparison.CurrentCultureIgnoreCase)) with
| Some referencedFsharpCoreDll -> File.Copy(referencedFsharpCoreDll.Text, fsharpCoreDestinationPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSBuild has a an option to enable or disable file copying for referenced dll's. Should we add --nocopyfsharpcore to the shipping project templates, to allow the ide options to work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per investigation, msbuild will take care of that (copying FSharp.Core.dll out of GAC) if the user specified CopyLocal=True in his project file.

| None ->
let compilerLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
let compilerFsharpCoreDllPath = Path.Combine(compilerLocation, fsharpCoreAssemblyName)
if File.Exists(compilerFsharpCoreDllPath) then
File.Copy(compilerFsharpCoreDllPath, fsharpCoreDestinationPath)
else
errorR(Error(FSComp.SR.fsharpCoreNotFoundToBeCopied(), rangeCmdArgs))

//----------------------------------------------------------------------------
// main - split up to make sure that we can GC the
// dead data at the end of each phase. We explicitly communicate arguments
Expand Down Expand Up @@ -2001,10 +2021,14 @@ let main4 (Args (tcConfig, errorLogger: ErrorLogger, ilGlobals, ilxMainModule, o
FileWriter.EmitIL (tcConfig, ilGlobals, errorLogger, outfile, pdbfile, ilxMainModule, signingInfo, exiter)

AbortOnError(errorLogger, tcConfig, exiter)

if tcConfig.showLoadedAssemblies then
for a in System.AppDomain.CurrentDomain.GetAssemblies() do
dprintfn "%s" a.FullName

if tcConfig.copyFSharpCore then
copyFSharpCore(outfile, tcConfig.referencedDLLs)

SqmLoggerWithConfig tcConfig errorLogger.ErrorNumbers errorLogger.WarningNumbers

ReportTime tcConfig "Exiting"
Expand Down
6 changes: 1 addition & 5 deletions src/update.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if /i "%1" == "release" goto :ok
if /i "%1" == "vsdebug" goto :ok
if /i "%1" == "vsrelease" goto :ok

echo GACs built binaries, adds required strong name verification skipping, and optionally NGens built binaries
echo adding required strong name verification skipping, and NGening built binaries
echo Usage:
echo update.cmd debug [-ngen]
echo update.cmd release [-ngen]
Expand All @@ -35,7 +35,6 @@ if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT%
if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS=%%B
if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS=%%B

set GACUTIL="%WINSDKNETFXTOOLS%gacutil.exe"
set SN32="%WINSDKNETFXTOOLS%sn.exe"
set SN64="%WINSDKNETFXTOOLS%x64\sn.exe"
set NGEN32=%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe
Expand Down Expand Up @@ -80,9 +79,6 @@ if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
%SN64% -Vr Salsa,b03f5f7f11d50a3a
)

rem Only GACing FSharp.Core for now
%GACUTIL% /if %BINDIR%\FSharp.Core.dll

rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll
if /i not "%2"=="-ngen" goto :donengen

Expand Down
9 changes: 1 addition & 8 deletions src/update.fs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let updateCmd envVars args = processor {
// if /i "%1" == "release" goto :ok
ignore "already validated input"

// echo GACs built binaries, adds required strong name verification skipping, and optionally NGens built binaries
// echo adding required strong name verification skipping, and NGening built binaries
// echo Usage:
// echo update.cmd debug [-ngen]
// echo update.cmd release [-ngen]
Expand Down Expand Up @@ -82,8 +82,6 @@ let updateCmd envVars args = processor {

let WINSDKNETFXTOOLS = match allWINSDKNETFXTOOLS |> Seq.tryPick id with Some sdk -> sdk | None -> ""

// set GACUTIL="%WINSDKNETFXTOOLS%gacutil.exe"
let GACUTIL = WINSDKNETFXTOOLS/"gacutil.exe"
// set SN32="%WINSDKNETFXTOOLS%sn.exe"
let SN32 = WINSDKNETFXTOOLS/"sn.exe"
// set SN64="%WINSDKNETFXTOOLS%x64\sn.exe"
Expand All @@ -95,7 +93,6 @@ let updateCmd envVars args = processor {

let checkResult = function CmdResult.ErrorLevel err -> Failure (sprintf "ERRORLEVEL %d" err) | CmdResult.Success -> Success ()

let gacutil flags = Commands.gacutil exec GACUTIL flags >> checkResult
let ngen32 = Commands.ngen exec NGEN32 >> checkResult
let ngen64 = Commands.ngen exec NGEN64 >> checkResult
let sn32 = exec SN32 >> checkResult
Expand Down Expand Up @@ -160,10 +157,6 @@ let updateCmd envVars args = processor {
(fun () -> Success ())
//)

// rem Only GACing FSharp.Core for now
// %GACUTIL% /if %BINDIR%\FSharp.Core.dll
do! gacutil "/if" (binDir/"FSharp.Core.dll")

// rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll
// if /i not "%2"=="-ngen" goto :donengen

Expand Down
2 changes: 0 additions & 2 deletions tests/RunTests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ set PATH=%PATH%;%WINSDKNETFXTOOLS%

IF NOT DEFINED SNEXE32 IF EXIST "%WINSDKNETFXTOOLS%sn.exe" set SNEXE32=%WINSDKNETFXTOOLS%sn.exe
IF NOT DEFINED SNEXE64 IF EXIST "%WINSDKNETFXTOOLS%x64\sn.exe" set SNEXE64=%WINSDKNETFXTOOLS%x64\sn.exe
IF NOT DEFINED GACUTILEXE32 IF EXIST "%WINSDKNETFXTOOLS%gacutil.exe" set GACUTILEXE32=%WINSDKNETFXTOOLS%gacutil.exe
IF NOT DEFINED GACUTILEXE64 IF EXIST "%WINSDKNETFXTOOLS%x64\gacutil.exe" set GACUTILEXE64=%WINSDKNETFXTOOLS%x64\gacutil.exe

set FSC=%FSCBINPATH%\fsc.exe
set PATH=%FSCBINPATH%;%PATH%
Expand Down
4 changes: 0 additions & 4 deletions tests/config.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if not defined CSC set CSC=csc.exe %csc_flags%

REM SDK Dependencires.
if not defined ILDASM set ILDASM=ildasm.exe
if not defined GACUTIL set GACUTIL=gacutil.exe
if not defined PEVERIFY set PEVERIFY=peverify.exe
if not defined RESGEN set RESGEN=resgen.exe

Expand Down Expand Up @@ -75,7 +74,6 @@ set fsc_flags=%fsc_flags%

set CLR_SUPPORTS_GENERICS=true
set ILDASM=%ILDASM%
set GACUTIL=%GACUTIL%
set CLR_SUPPORTS_WINFORMS=true
set CLR_SUPPORTS_SYSTEM_WEB=true

Expand Down Expand Up @@ -148,7 +146,6 @@ REM == The logic here is: pick the latest msbuild
REM == If we are testing against NDP4.0, then don't try msbuild 3.5
REM ==
IF NOT "%CORSDK%"=="" IF EXIST "%CORSDK%\ildasm.exe" SET ILDASM=%CORSDK%\ildasm.exe
IF NOT "%CORSDK%"=="" IF EXIST "%CORSDK%\gacutil.exe" SET GACUTIL=%CORSDK%\gacutil.exe
IF NOT "%CORSDK%"=="" IF EXIST "%CORSDK%\peverify.exe" SET PEVERIFY=%CORSDK%\peverify.exe
IF NOT "%CORSDK%"=="" IF EXIST "%CORSDK%\resgen.exe" SET RESGEN=%CORSDK%\resgen.exe
IF NOT "%CORSDK%"=="" IF NOT EXIST "%RESGEN%" IF EXIST "%CORSDK%\..\resgen.exe" SET RESGEN=%CORSDK%\..\resgen.exe
Expand Down Expand Up @@ -218,7 +215,6 @@ echo FSDATATPPATH =%FSDATATPPATH%
echo FSDIFF =%FSDIFF%
echo FSI =%FSI%
echo fsi_flags =%fsi_flags%
echo GACUTIL =%GACUTIL%
echo ILDASM =%ILDASM%
echo INSTALL_SKU =%INSTALL_SKU%
echo MSBUILDTOOLSPATH =%MSBuildToolsPath%
Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg46.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ neg46.fs(48,8,48,34): typecheck error FS0912: This declaration element is not pe

neg46.fs(52,8,52,39): typecheck error FS0912: This declaration element is not permitted in an augmentation

neg46.fs(56,8,56,11): typecheck error FS3191: Constructors are not permitted as extension members - they must be defined as part of the original definition of the type
neg46.fs(56,8,56,11): typecheck error FS3192: Constructors are not permitted as extension members - they must be defined as part of the original definition of the type

neg46.fs(56,8,56,11): typecheck error FS0871: Constructors cannot be defined for this type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Copyright (c) Microsoft Corporation. All Rights Reserved.
containing F#-specific metadata
--sig:<file> Print the inferred interface of the assembly to
a file
--nocopyfsharpcore Don't copy FSharp.Core.dll along the produced
binaries


- INPUT FILES -
Expand Down
11 changes: 8 additions & 3 deletions vsintegration/update-vsintegration.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT%
if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS=%%B
if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS=%%B

set GACUTIL="%WINSDKNETFXTOOLS%gacutil.exe"
set SN32="%WINSDKNETFXTOOLS%sn.exe"
set SN64="%WINSDKNETFXTOOLS%x64\sn.exe"
set NGEN32=%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe
Expand Down Expand Up @@ -140,8 +139,14 @@ if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
%SN64% -Vr Salsa,b03f5f7f11d50a3a
)

%GACUTIL% /if %BINDIR%\FSharp.Compiler.Interactive.Settings.dll
%GACUTIL% /if %BINDIR%\FSharp.Compiler.Server.Shared.dll
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio %VisualStudioVersion%\Common7\IDE\PrivateAssemblies" (
copy /y %BINDIR%\FSharp.Compiler.Server.Shared.dll "%ProgramFiles(x86)%\Microsoft Visual Studio %VisualStudioVersion%\Common7\IDE\PrivateAssemblies\FSharp.Compiler.Server.Shared.dll"
copy /y %BINDIR%\FSharp.Compiler.Interactive.Settings.dll "%ProgramFiles(x86)%\Microsoft Visual Studio %VisualStudioVersion%\Common7\IDE\PrivateAssemblies\FSharp.Compiler.Interactive.Settings.dll"
)
if exist "%ProgramFiles%\Microsoft Visual Studio %VisualStudioVersion%\Common7\IDE\PrivateAssemblies" (
copy /y %BINDIR%\FSharp.Compiler.Server.Shared.dll "%ProgramFiles%\Microsoft Visual Studio %VisualStudioVersion%\Common7\IDE\PrivateAssemblies\FSharp.Compiler.Server.Shared.dll"
copy /y %BINDIR%\FSharp.Compiler.Interactive.Settings.dll "%ProgramFiles%\Microsoft Visual Studio %VisualStudioVersion%\Common7\IDE\PrivateAssemblies\FSharp.Compiler.Interactive.Settings.dll"
)

rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll

Expand Down