我的ClickOnce应用程序使用需要Visual C ++ 2005可再发行组件的第三方工具。如果仅安装VC ++ 2008可再发行组件,则第三方工具将不起作用。但是,在Visual Studio 2008中,ClickOnce先决条件不允许为VC ++可再发行组件指定版本;它将添加一个VC ++ 2008先决条件,这在大多数时候都是有意义的。但是,在这种情况下,需要早期版本。 ClickOnce是必需的,因此合并模块是不可能的。有关如何指定版本的任何想法吗?

有帮助吗?

解决方案

如果您能找到安装了VS 2005的计算机,解决方案应该不会太难。您可以自定义项目“发布”选项卡上“先决条件”对话框中显示的内容。

  1. 在安装了VS 2005的计算机上,转到 \ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ BootStrapper \ Packages 并复制 vsredist_x86 文件夹到你要发布的机器。
  2. 重命名该文件夹,将其命名为 vsredist _ x86 <String Name="DisplayName"> 2005 或类似名称。
  3. 在文件夹中,编辑 \ en \ package.xml 文件。将 <=> 标记更改为有意义的内容( Visual C ++ 2005 运行时库(x86)),以区别于现有的2008包
  4. 将文件夹复制到 C:\ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Bootstrapper \ Packages
  5. 如果Visual Studio已打开,请重新启动它。
  6. 现在,当您打开Prerequisites对话框时,您应该会看到2005包的新条目。我没有完全测试这个解决方案,所以我可能错过了一些细节,但希望这能让你开始。

其他提示

我相信您可以打开应用的清单文件,并修改应用应链接的红色版本。清单中的列表应与C:\ Windows \ WinSxS目录中的列表相匹配。有一个 CodeProject页面,它提供了使用不同可再发行组件的良好描述。 / p>

我刚刚安装了Visual Studio 2005.这是一个原始的bootstrapper:

C:\ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ BootStrapper \ Packages \ vcredist_x86 \

\ EN \ package.xml中

<?xml version="1.0" encoding="utf-8" ?>

<Package
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  Name="DisplayName"
  Culture="Culture"
>

    <!-- Defines a localizable string table for error messages-->
    <Strings>
        <String Name="DisplayName">Visual C++ Runtime Libraries (x86)</String>
        <String Name="Culture">en</String>
        <String Name="AdminRequired">You do not have the permissions required to install Visual C++ Runtime Libraries (x86). Please contact your administrator.</String>
        <String Name="InvalidPlatformWin9x">Installation of Visual C++ Runtime Libraries (x86) is not supported on Windows 95. Contact your application vendor.</String>
        <String Name="InvalidPlatformWinNT">Installation of Visual C++ Runtime Libraries (x86) is not supported on Windows NT 4.0. Contact your application vendor.</String>
        <String Name="GeneralFailure">A failure occurred attempting to install Visual C++ Runtime Libraries (x86).</String>
    </Strings>

</Package>

\ product.xml

<?xml version="1.0" encoding="utf-8" ?> 

<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.Visual.C++.8.0.x86"
>

  <!-- Defines list of files to be copied on build -->
  <PackageFiles>
    <PackageFile Name="vcredist_x86.exe"/>
  </PackageFiles>

  <InstallChecks>
    <MsiProductCheck Property="VCRedistInstalled" Product="{A49F249F-0C91-497F-86DF-B2585E8E76B7}"/>
  </InstallChecks>

  <!-- Defines how to invoke the setup for the Visual C++ 8.0 redist -->
  <!-- TODO: Needs EstrimatedTempSpace, LogFile, and an update of EstimatedDiskSpace -->
  <Commands Reboot="Defer">
    <Command PackageFile="vcredist_x86.exe" 
         Arguments=' /q:a ' 
         >

      <!-- These checks determine whether the package is to be installed -->
      <InstallConditions>
        <BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>
        <!-- Block install if user does not have admin privileges -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>

        <!-- Block install on Win95 -->
        <FailIf Property="Version9X" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>

        <!-- Block install on NT 4 or less -->
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>

      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>

    </Command>
  </Commands>
</Product>

\选择vcredist_x64.exe

SHA1: 95040f80b0d203e1abaec4e06e0ec0e01c507d03
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top