@@ -153,6 +153,8 @@ if "%WINSDKNETFXTOOLS%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT%
153153if " %WINSDKNETFXTOOLS% " == " " FOR /F" tokens=2* delims=" %%A IN ('%REGEXE32BIT% QUERY " HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDK-NetFx40Tools" /v InstallationFolder 2^ > NUL ')DO SET WINSDKNETFXTOOLS = %%B
154154if " %WINSDKNETFXTOOLS% " == " " FOR /F" tokens=2* delims=" %%A IN ('%REGEXE32BIT% QUERY " HKLM\Software\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools" /v InstallationFolder 2^ > NUL ')DO SET WINSDKNETFXTOOLS = %%B
155155
156+ set SN32 = " %WINSDKNETFXTOOLS% sn.exe"
157+ set SN64 = " %WINSDKNETFXTOOLS% x64\sn.exe"
156158set NGEN32 = %windir% \Microsoft.NET\Framework\v4.0.30319\ngen.exe
157159set NGEN64 = %windir% \Microsoft.NET\Framework64\v4.0.30319\ngen.exe
158160
@@ -326,6 +328,46 @@ if "%DEPLOY%" == "yes" if "!ISADMIN!" == "yes" (
326328REG ADD" HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\F#!FSHARPVERSION! Core Assemblies (Open Source)" /ve /t REG_SZ /f /d" !X86_PROGRAMFILES! \Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.!FSHARPVERSION! .0\
327329REG ADD" HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.50709\AssemblyFoldersEx\F#!FSHARPVERSION! Core Assemblies (Open Source)" /ve /t REG_SZ /f /d" !X86_PROGRAMFILES! \Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.!FSHARPVERSION! .0\
328330
331+ rem Disable strong-name validation for F# binaries built from open source that are signed with the microsoft key
332+ echo .
333+ CALL :colorEcho 02 " [!ACTION! ] Removing strong-name validation of F# binaries" & echo .
334+ !SN32! -Vr FSharp.Core,b03f5f7f11d50a3a1 > NUL 2 > NUL
335+ !SN32! -Vr FSharp.Build,b03f5f7f11d50a3a1 > NUL 2 > NUL
336+ !SN32! -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a1 > NUL 2 > NUL
337+ !SN32! -Vr HostedCompilerServer,b03f5f7f11d50a3a1 > NUL 2 > NUL
338+
339+ !SN32! -Vr FSharp.Compiler,b03f5f7f11d50a3a1 > NUL 2 > NUL
340+ !SN32! -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a1 > NUL 2 > NUL
341+ !SN32! -Vr FSharp.Editor,b03f5f7f11d50a3a1 > NUL 2 > NUL
342+ !SN32! -Vr FSharp.LanguageService,b03f5f7f11d50a3a1 > NUL 2 > NUL
343+ !SN32! -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a1 > NUL 2 > NUL
344+ !SN32! -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a1 > NUL 2 > NUL
345+ !SN32! -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a1 > NUL 2 > NUL
346+ !SN32! -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a1 > NUL 2 > NUL
347+ !SN32! -Vr FSharp.VS.FSI,b03f5f7f11d50a3a1 > NUL 2 > NUL
348+ !SN32! -Vr VisualFSharp.Unittests,b03f5f7f11d50a3a1 > NUL 2 > NUL
349+ !SN32! -Vr VisualFSharp.Salsa,b03f5f7f11d50a3a1 > NUL 2 > NUL
350+
351+ REM Do this *in addition* to the above for x64 systems
352+ if /i" !PROCESSOR_ARCHITECTURE! " == " AMD64" (
353+ !SN64! -Vr FSharp.Core,b03f5f7f11d50a3a1 > NUL 2 > NUL
354+ !SN64! -Vr FSharp.Build,b03f5f7f11d50a3a1 > NUL 2 > NUL
355+ !SN64! -Vr FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a1 > NUL 2 > NUL
356+ !SN64! -Vr HostedCompilerServer,b03f5f7f11d50a3a1 > NUL 2 > NUL
357+
358+ !SN64! -Vr FSharp.Compiler,b03f5f7f11d50a3a1 > NUL 2 > NUL
359+ !SN64! -Vr FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a1 > NUL 2 > NUL
360+ !SN64! -Vr FSharp.Editor,b03f5f7f11d50a3a1 > NUL 2 > NUL
361+ !SN64! -Vr FSharp.LanguageService,b03f5f7f11d50a3a1 > NUL 2 > NUL
362+ !SN64! -Vr FSharp.LanguageService.Base,b03f5f7f11d50a3a1 > NUL 2 > NUL
363+ !SN64! -Vr FSharp.ProjectSystem.Base,b03f5f7f11d50a3a1 > NUL 2 > NUL
364+ !SN64! -Vr FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a1 > NUL 2 > NUL
365+ !SN64! -Vr FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a1 > NUL 2 > NUL
366+ !SN64! -Vr FSharp.VS.FSI,b03f5f7f11d50a3a1 > NUL 2 > NUL
367+ !SN64! -Vr VisualFSharp.Unittests,b03f5f7f11d50a3a1 > NUL 2 > NUL
368+ !SN64! -Vr VisualFSharp.Salsa,b03f5f7f11d50a3a1 > NUL 2 > NUL
369+ )
370+
329371rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll
330372
331373echo .
@@ -358,6 +400,46 @@ if "%DEPLOY%" == "yes" if "!ISADMIN!" == "no" (
358400rem Re-enable certain settings when restoring, NGEN the original files again, requires admin rights
359401if " %ACTION% " == " restore" if " !ISADMIN! " == " yes" (
360402
403+ rem Re-enable strong-name validation for F# binaries that were previously installed
404+ echo .
405+ CALL :colorEcho 02 " [!ACTION! ] Re-enabling strong-name validation of original F# binaries" & echo .
406+ !SN32! -Vu FSharp.Core,b03f5f7f11d50a3a2 > NUL 1 > NUL
407+ !SN32! -Vu FSharp.Build,b03f5f7f11d50a3a2 > NUL 1 > NUL
408+ !SN32! -Vu FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a2 > NUL 1 > NUL
409+ !SN32! -Vu HostedCompilerServer,b03f5f7f11d50a3a2 > NUL 1 > NUL
410+
411+ !SN32! -Vu FSharp.Compiler,b03f5f7f11d50a3a2 > NUL 1 > NUL
412+ !SN32! -Vu FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a2 > NUL 1 > NUL
413+ !SN32! -Vu FSharp.Editor,b03f5f7f11d50a3a2 > NUL 1 > NUL
414+ !SN32! -Vu FSharp.LanguageService,b03f5f7f11d50a3a2 > NUL 1 > NUL
415+ !SN32! -Vu FSharp.LanguageService.Base,b03f5f7f11d50a3a2 > NUL 1 > NUL
416+ !SN32! -Vu FSharp.ProjectSystem.Base,b03f5f7f11d50a3a2 > NUL 1 > NUL
417+ !SN32! -Vu FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a2 > NUL 1 > NUL
418+ !SN32! -Vu FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a2 > NUL 1 > NUL
419+ !SN32! -Vu FSharp.VS.FSI,b03f5f7f11d50a3a2 > NUL 1 > NUL
420+ !SN32! -Vu VisualFSharp.Unittests,b03f5f7f11d50a3a2 > NUL 1 > NUL
421+ !SN32! -Vu VisualFSharp.Salsa,b03f5f7f11d50a3a2 > NUL 1 > NUL
422+
423+ REM Do this *in addition* to the above for x64 systems
424+ if /i" !PROCESSOR_ARCHITECTURE! " == " AMD64" (
425+ !SN64! -Vu FSharp.Core,b03f5f7f11d50a3a2 > NUL 1 > NUL
426+ !SN64! -Vu FSharp.Build,b03f5f7f11d50a3a2 > NUL 1 > NUL
427+ !SN64! -Vu FSharp.Compiler.Interactive.Settings,b03f5f7f11d50a3a2 > NUL 1 > NUL
428+ !SN64! -Vu HostedCompilerServer,b03f5f7f11d50a3a2 > NUL 1 > NUL
429+
430+ !SN64! -Vu FSharp.Compiler,b03f5f7f11d50a3a2 > NUL 1 > NUL
431+ !SN64! -Vu FSharp.Compiler.Server.Shared,b03f5f7f11d50a3a2 > NUL 1 > NUL
432+ !SN64! -Vu FSharp.Editor,b03f5f7f11d50a3a2 > NUL 1 > NUL
433+ !SN64! -Vu FSharp.LanguageService,b03f5f7f11d50a3a2 > NUL 1 > NUL
434+ !SN64! -Vu FSharp.LanguageService.Base,b03f5f7f11d50a3a2 > NUL 1 > NUL
435+ !SN64! -Vu FSharp.ProjectSystem.Base,b03f5f7f11d50a3a2 > NUL 1 > NUL
436+ !SN64! -Vu FSharp.ProjectSystem.FSharp,b03f5f7f11d50a3a2 > NUL 1 > NUL
437+ !SN64! -Vu FSharp.ProjectSystem.PropertyPages,b03f5f7f11d50a3a2 > NUL 1 > NUL
438+ !SN64! -Vu FSharp.VS.FSI,b03f5f7f11d50a3a2 > NUL 1 > NUL
439+ !SN64! -Vu VisualFSharp.Unittests,b03f5f7f11d50a3a2 > NUL 1 > NUL
440+ !SN64! -Vu VisualFSharp.Salsa,b03f5f7f11d50a3a2 > NUL 1 > NUL
441+ )
442+
361443rem NGen fsc, fsi, fsiAnyCpu, and FSharp.Build.dll
362444
363445echo .