使用 WIX 安装 Microsoft KB951608

发布于 2024-08-17 19:22:13 字数 443 浏览 4 评论 0原文

在我们的服务器(win 2008 r2)上,我们启用了“强制网络身份验证”设置,以强制客户端必须支持 NLA,因为端口 3389 可以从 Internet 直接访问。但在 Windows XP SP3 上,NLA 似乎默认被禁用。当我使用 WIX 编写一个安装程序来分发 rdp 文件时,我还想安装这两个注册表项(一个是 REG_SZ 类型的逗号分隔列表,一个是 REG_MULTI_SZ 类型的列表),如 http://support.microsoft.com/kb/951608

我已经尝试过使用RegistrySearch和RegistryValue,但还没有成功。主要困难是我应该如何处理这些 REG_SZ 类型的逗号分隔列表。

谁能给我提示吗?提前致谢。

On our server (win 2008 r2) we enabled the setting "force network authentication" to enforce that the client must support the NLA, because the port 3389 is directly reachable from the internet. But on Windows XP SP3 the NLA seems to be disabled per default. As I wrote an installer with WIX to distribute the rdp files, I'd also like to install these two registry-entries (one is a comma separated list of type REG_SZ and one is a list of type REG_MULTI_SZ) as descriped in http://support.microsoft.com/kb/951608.

I've already tried it with RegistrySearch and RegistryValue, but I haven't succeded. The main difficulty is how I should handle these comma separated list of type REG_SZ.

Can anyone give me a hint? Thanks in advance.

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

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

发布评论

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

评论(1

雨落星ぅ辰 2024-08-24 19:22:13

解决此问题的标准方法是使用引导程序机制安装修补程序,即使用单独的“setup.exe”文件,首先安装修补程序,然后启动 WiX/MSI 安装程序。

Visual Studio 引导程序提供了这样的机制。此引导程序可以安装的包需要由名为 package.xml 的 XML 清单进行描述。此文件需要位于 C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages (Visual Studio 2008) 的子文件夹中。

以下两页介绍了如何为 KB951608 编写/创建您自己的程序包清单:

创作自定义引导程序包 (本文适用于 VS 2005,但基本上也应该适用于 VS 2008)

将您自己的(自定义)先决条件添加到“ClickOnce”应用程序< /p>

用于创建清单的生成器可以从 MSDN 下载:

引导程序清单生成器

您可以使用此工具创建一个简单的清单,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<Package Name="KB952155" Culture="en-US" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="windowsxp-kb952155-x86-enu.exe" PublicKey="3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001" />
  </PackageFiles>
  <Commands Reboot="Defer">
    <Command PackageFile="windowsxp-kb952155-x86-enu.exe">
      <ExitCodes>
        <DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
      </ExitCodes>
    </Command>
  </Commands>
  <Strings>
    <String Name="Culture">en</String>
    <String Name="DisplayName">KB952155</String>
    <String Name="Anunexpectedexitcodewasr">An unexpected exit code was returned from the installer. The installation failed.</String>
  </Strings>
</Package>

使用引导程序是不幸的是 WiX 不直接支持,但您可以使用一个简单的 MSBuild 脚本来生成一个(但这需要安装 Visual Studio):

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WindowsSDKPath>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\3.5@Path)</WindowsSDKPath>
  </PropertyGroup>

    <ItemGroup>
        <BootstrapperFile Include="KB952155">
            <ProductName>KB952155</ProductName>
        </BootstrapperFile>
    </ItemGroup>

    <Target Name="Bootstrapper">
        <GenerateBootstrapper ApplicationFile="mySetup.msi" Culture="en-US" ApplicationName="My RDP Setup" OutputPath="C:\myoutputfolder\en-US" BootstrapperItems="@(BootstrapperFile)" Path="$(WindowsSDKPath)" />
    </Target>
</Project>

该脚本可以作为构建后步骤调用:

%WINDIR%\Microsoft.NET\Framework\v3.5\msbuild.exe GenerateBootstrapper.msbuild

The standard way to solve this is by installing the hotfix using a bootstrapper mechanism, i.e. a separate "setup.exe" file that first installs the hotfix and then launches your WiX/MSI installer.

The Visual Studio bootstrapper provides such a mechanism. The packages that can be installed by this bootstrapper need to be described by an XML manifest called package.xml. This file needs to be located in a subfolder of C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages (Visual Studio 2008).

The following two pages describe how to author/create your own package manifest for KB951608:

Authoring a Custom Bootstrapper Package (article is for VS 2005, but basically should work with VS 2008 as well)

Add your own (custom) prerequisite to "ClickOnce" application

A generator for creating the manifest can be downloaded from MSDN:

Bootstrapper Manifest Generator

You can use this tool to create a simple manifest like this:

<?xml version="1.0" encoding="utf-8"?>
<Package Name="KB952155" Culture="en-US" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="windowsxp-kb952155-x86-enu.exe" PublicKey="3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001" />
  </PackageFiles>
  <Commands Reboot="Defer">
    <Command PackageFile="windowsxp-kb952155-x86-enu.exe">
      <ExitCodes>
        <DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
      </ExitCodes>
    </Command>
  </Commands>
  <Strings>
    <String Name="Culture">en</String>
    <String Name="DisplayName">KB952155</String>
    <String Name="Anunexpectedexitcodewasr">An unexpected exit code was returned from the installer. The installation failed.</String>
  </Strings>
</Package>

Using a bootstrapper is unfortunately not directly supported by WiX, but you can use a simple MSBuild script to generate one (this requires Visual Studio to be installed though):

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WindowsSDKPath>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\3.5@Path)</WindowsSDKPath>
  </PropertyGroup>

    <ItemGroup>
        <BootstrapperFile Include="KB952155">
            <ProductName>KB952155</ProductName>
        </BootstrapperFile>
    </ItemGroup>

    <Target Name="Bootstrapper">
        <GenerateBootstrapper ApplicationFile="mySetup.msi" Culture="en-US" ApplicationName="My RDP Setup" OutputPath="C:\myoutputfolder\en-US" BootstrapperItems="@(BootstrapperFile)" Path="$(WindowsSDKPath)" />
    </Target>
</Project>

This script can be called as a post-build step:

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