安装驱动程序时,阻止WIX安装程序创建安装文件夹

时间:2017-01-12 18:56:53

标签: visual-studio-2015 wix installer driver

我在WIX 3.10内使用DIFxVisual Studio来安装UMDF驱动程序。我的驱动程序已成功安装。困扰我的是WIX需要一个TARGETDIR目录。我的文件将被复制到此目录。

我不需要这些文件在安装后留在那里。如何配置WIX不创建此类文件夹,而只是运行DIFx并安装驱动程序?

如果无法做到这一点,我怎么能在安装后至少告诉WIX删除TARGETDIR目录?

这是我wxs文件的内容:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:difx="http://schemas.microsoft.com/wix/DifxAppExtension">
    <Product Id="B50DE2AF-BCA4-4B82-B859-F3A3C380985D" Name="MyDriver_Installer" Language="1033" Version="1.0.0.0" Manufacturer="MeInc" UpgradeCode="73E6F899-CB1E-4BA6-B282-73ADCF69FB03">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate EmbedCab="yes" />

        <Feature Id="ProductFeature" Title="MyDriver_Installer" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="MyDriver_Installer" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="MyDriver.dll">
                <File Id="MyDriver.dll" Source="..\x64\Debug\MyDriver Package\MyDriver.dll" KeyPath="yes" />
                <difx:Driver AddRemovePrograms="yes" Legacy="yes" PlugAndPlayPrompt="no" DeleteFiles="yes" />
            </Component>
            <Component Id="MyDriver.inf">
              <File Id="MyDriver.inf" Source="..\x64\Debug\MyDriver Package\MyDriver.inf" KeyPath="yes" />
            </Component>
            <Component Id="mydriver.cat">
              <File Id="mydriver.cat" Source="..\x64\Debug\MyDriver Package\mydriver.cat" KeyPath="yes" />
            </Component>
            <Component Id="WudfUpdate_01011.dll">
              <File Id="WudfUpdate_01011.dll" Source="..\x64\Debug\MyDriver Package\WudfUpdate_01011.dll" KeyPath="yes" />
            </Component>
            <Component Id="WdfCoInstaller01011.dll">
              <File Id="WdfCoInstaller01011.dll" Source="..\x64\Debug\MyDriver Package\WdfCoInstaller01011.dll" KeyPath="yes" />
            </Component>
            <Component Id="winusbcoinstaller2.dll">
              <File Id="winusbcoinstaller2.dll" Source="..\x64\Debug\MyDriver Package\winusbcoinstaller2.dll" KeyPath="yes" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

0 个答案:

没有答案