是否有一个打包的运行时可重新分发FSharp.Core 4.3.0.0?

时间:2014-12-31 19:35:59

标签: f# f#-3.0

在我们的环境中,我们有一个服务器场,每个服务器都运行许多任务。使用内部调度系统部署任务二进制包(并运行任务)。

当引入对Microsoft库或运行时的新公共依赖项时,通常将该依赖项推送为服务器范围的升级(例如,Microsoft Visual C ++可再发行组件包)。目前,服务器安装了一个名为Microsoft Visual F#2.0 Runtime的软件包,并且在GAC中也有FSharp.Core版本4.0.0.0,我不知道从哪里来,但FSharp.Core 4.3.0.0通常不可用。

Visual F#3.0是否有可再发行的软件包可以将FSharp.Core 4.3.0.0部署到GAC中,还是应该包含每个任务二进制文件的FSharp.Core.dll副本?实际上,如果可能的话,我会避免拥有数百份通用DLL。

3 个答案:

答案 0 :(得分:2)

仅有FSharp.Core NuGet Packagea redistributable package也包含编译器工具。

答案 1 :(得分:2)

Joel Mueller的答案(也是here)中链接的下载是Microsoft的官方安装程序。它包含编译器,交互式,运行时的多个版本以及Visual Studio集成二进制文件。

仅在安装了VS(开发方案)时才部署VS集成位。否则,它将只安装编译器/交互/运行时(服务器方案)。

安装程序仅对最新版本的运行时(此时为4.3.1.0)进行了GAC,但也部署了各种其他版本,包括4.3.0.0。

向GAC添加程序集非常简单。只需以管理员身份运行gacutil /I "C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"

答案 2 :(得分:1)

可能回答

我很高兴出错,很乐意删除这个答案,但我必须得出结论,没有可再发行的软件包可以将系统范围的FSharp.Core版本4.3.0.0安装到GAC中

解决问题

以下WIX脚本创建了.MSI包,用于安装程序集和NGen。当然,测试是有限的,所以只有在你真的需要一个MSI软件包来推出组件时才使用它。为了明确地分散任何可能的版权问题,我将代码发布到公共领域。

<?xml version="1.0" encoding="UTF-8"?>
<!--
  This installs FSharp.Core.dll 4.3.0.0 (that comes with Visual Studio
  2012) into the GAC and then NGens it for both 32 and 64 bits.

  Component ID 61F15BE3-6844-46F3-8E8E-3C81A8DBBFCB and keypath
  FSharp_Core_Dll_GAC_File were obtained from VS2012 RTM install DVD,
  file \packages\professionalcore\Setup\vs_professionalcore.msi.
  Other IDs here match those in the Microsoft file for easier reference.
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx ="http://schemas.microsoft.com/wix/NetFxExtension">
  <Product Id="*" Name="Microsoft F# 3.0 Core Redistributable (4.3.0.0)" Language="1033" Version="4.3.0.0"
           Manufacturer="YOUR COMPANY HERE" UpgradeCode="5271a7ee-8baa-4348-aff7-edb114090cee">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
    <Feature Id="FsCore" Title="Microsoft F# Core Libraries" Level="1">
      <ComponentRef Id="Redist4.0_GAC_FSharp.Core.dll" />
    </Feature>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="GAC" Name="GAC">
        <Component Id="Redist4.0_GAC_FSharp.Core.dll" Guid="61F15BE3-6844-46F3-8E8E-3C81A8DBBFCB">
          <File Id="FSharp_Core_Dll_GAC_File" Name="FSharp.Core.dll" KeyPath="yes" Assembly=".net"
                Source="C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll">
            <netfx:NativeImage Id="FSharp_Core_Dll_GAC_File_32" Platform="32bit" Priority="1" Debug="no" Dependencies="no" />
            <netfx:NativeImage Id="FSharp_Core_Dll_GAC_File_64" Platform="64bit" Priority="1" Debug="no" Dependencies="no" />
          </File>
        </Component>
      </Directory>
    </Directory>
  </Product>
</Wix>

将此脚本复制到文件fscore.wxs,验证已安装的参考程序集的路径,并生成MSI文件(也调整WIX安装的路径)

candle -ext "C:\Program Files (x86)\WiX Toolset v3.9\bin\WixNetFxExtension.dll" fscore.wxs
light.exe -ext "C:\Program Files (x86)\WiX Toolset v3.9\bin\\WixNetFxExtension.dll" -out FSCoreRedist4300.msi -spdb -sval fscore.wixobj