.net Chart 必备组件 打包安装

Adding MS Chart Controls as a prerequisite in your Visual Studio 2008 installation package.

In order to specify a prerequisite to your deployment package something called a bootstrapper is needed. Unfortunately Microsoft do not provide a bootstrapper for the Chart Controls for the .Net Framework.

Luckily it is not too difficult to create your own bootstrapper.

Here's how to do it:

Firstly you need to locate the folder in which the bootstrapper files need to be. On my machine this is here: C:/Program Files/Microsoft SDKs/Windows/v6.0A/Bootstrapper/Packages/

Now you can either download the files that I have put together here and extract the contents of the zip file into this folder, or follow the instructions below to create the files yourself.

 

The zip file contains all the files required including the full MS Chart controls installation package, which you probably already have. So you may find it simpler to create the files yourself.

  1. Create a Folder called: Microsoft Chart Controls
  2. In this new folder create a file called product.xml
  3. Use Notepad to edit this file and add the following code:
    <?xml version="1.0" encoding="utf-8" ?> 
    <!-- Bootstrapper for MS Chart Controls. Created by Phil Preen, Feb 2009, use at your own risk -->
    <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.ChartControls">
    <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Net.Framework.3.5.SP1" /> 
    </RelatedProducts>
    <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="MSChart.exe" HomeSite="MSChart.exe" /> 
    </PackageFiles>
    <InstallChecks /> 
    <Commands>
    <Command PackageFile="MSChart.exe">
    <ExitCodes>
    <DefaultExitCode Result="Success" /> 
    </ExitCodes>
    </Command>
    </Commands>
    </Product>
    
  4. Copy MSChart.exe (the chart controls installation package) into this folder.
  5. Create a sub-folder called: en
  6. In this new folder create a file called package.xml
  7. Use Notepad to edit this file and add the following code:
    <?xml version="1.0" encoding="utf-8" ?>
    <!-- Bootstrapper for MS Chart Controls. Created by Phil Preen, Feb 2009, use at your own risk -->
    <Package
      xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
      Name="DisplayName"
      Culture="Culture"
      LicenseAgreement="eula.rtf"
    >
        <PackageFiles>
            <PackageFile Name="eula.rtf"/>
        </PackageFiles>
        <!-- Defines a localizable string table for error messages-->
        <Strings>
            <String Name="DisplayName">Microsoft Chart Controls for Dotnet Framework 3.5 SP1</String>
            <String Name="Culture">en</String>
            <String Name="AdminRequired">Administrator permissions are required to install Microsoft Chart Controls for Dotnet Framework 3.5 SP1. Contact your administrator.</String>
            <String Name="AnotherInstanceRunning">Another instance of setup is already running. The running instance must complete before this setup can proceed.</String>
            <String Name="GeneralFailure">A failure occurred attempting to install Microsoft Chart Controls for Dotnet Framework 3.5 SP1.</String>
        </Strings>
    </Package>
    
  8. Copy eula.rtf (the chart controls license agreement) into this folder. To obtain this file, start the Chart Controls installer and choose the option to Save the license agreement.

Microsoft Chart Controls will now appear in the list of prerequisites in your Visual Studio deployment settings.

Note that because Microsoft Chart Controls is dependant upon the .Net Framework 3.5 SP1. It is necessary to have the Framework files available. See the instructions in the Visual Studio 2008 SP1 readme file here (see Section 2.3.1.1).

<script></script> <script src="http://search.twitter.com/trends/weekly.json?callback=c&exclude=hashtags"></script>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值