指定 VC++ ClickOnce 先决条件的可再发行版本

发布于 2024-07-05 14:09:29 字数 262 浏览 8 评论 0原文

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

My ClickOnce application uses a third party tool that requires the Visual C++ 2005 redistributable. The third party tool will not work if only the VC++ 2008 redistributable is installed. However, in Visual Studio 2008, the ClickOnce prerequisites do not allow a version to be specified for the VC++ redistributable; it will add a VC++ 2008 prerequisite, which makes sense most of the time. However, in this situation, an earlier version is required. ClickOnce is required, so merge modules are out of the question. Any ideas of how to specify the version?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

独木成林 2024-07-12 14:09:29

我刚刚安装了 Visual Studio 2005。这是一个原始引导程序:

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_x86.exe

SHA1: 95040f80b0d203e1abaec4e06e0ec0e01c507d03

I just installed Visual Studio 2005. Here is an original 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_x86.exe

SHA1: 95040f80b0d203e1abaec4e06e0ec0e01c507d03
合约呢 2024-07-12 14:09:29

我相信您可以打开您的应用程序的清单文件并修改您的应用程序应链接的重新发布的版本。 清单中的列表应与 C:\Windows\WinSxS 目录中的列表相匹配。 有一个 CodeProject 页面,它很好地描述了如何使用不同的可再发行组件。

I believe you can open the manifest file for your app and modify the versions of the redists your app should be linking against. The listings in the manifest should match what you have in your C:\Windows\WinSxS dirs. There is a CodeProject page that gives a good description of using different redistributables.

星星的轨迹 2024-07-12 14:09:29

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

  1. 在安装了 VS 2005 的计算机上,转到 \Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages 并将 vsredist_x86 文件夹复制到计算机您正在发布。
  2. 重命名该文件夹,将其命名为 vsredist_x86_2005 或类似名称。
  3. 在该文件夹内,编辑 \en\package.xml 文件。 将 标记更改为有意义的内容(Visual C++ 2005 运行时库 (x86) )) 以区别于现有的 2008 年软件包。
  4. 将文件夹复制到C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
  5. 如果 Visual Studio 打开,请重新启动它。

现在,当您打开先决条件对话框时,您应该会看到 2005 包的新条目。 我没有完全测试这个解决方案,所以我可能错过了一些细节,但希望这能让您开始。

If you can find a machine with VS 2005 installed, the solution shouldn't be too hard. You have the ability to customize what appears in the Prerequisites dialog on the Publish tab of your project.

  1. On a machine with VS 2005 installed, go to \Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages and copy the vsredist_x86 folder to the machine you are publishing from.
  2. Rename the folder, call it vsredist_x86_2005 or something similar.
  3. Inside the folder, edit the \en\package.xml file. Change the <String Name="DisplayName"> tag to something that makes sense (Visual C++ 2005 Runtime Libraries (x86)) to differentiate it from the existing 2008 package.
  4. Copy the folder to C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages.
  5. Restart Visual Studio if it is open.

Now, when you open the Prerequisites dialog you should see a new entry for the 2005 package. I didn't completely test this solution so I may have missed a few details but hopefully this gets you started.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文