Visual studio wix安装程序更改生成目录名
我正在尝试获取一个名为Release的目录,但是在我的安装程序中,我希望将文件安装到“bin”中 这是我在Visual studio 2012中添加到wix3.7中的预构建事件命令行Visual studio wix安装程序更改生成目录名,visual-studio,wix,windows-installer,wix3.7,Visual Studio,Wix,Windows Installer,Wix3.7,我正在尝试获取一个名为Release的目录,但是在我的安装程序中,我希望将文件安装到“bin”中 这是我在Visual studio 2012中添加到wix3.7中的预构建事件命令行 "%WIX%\bin\heat.exe" dir "$(SolutionDir)\Export\Release" -dr INSTALLFOLDER -cg ExportComponentGroup -var var.sourcePath -ag -sreg -suid -out "$(SolutionDir)\S
"%WIX%\bin\heat.exe" dir "$(SolutionDir)\Export\Release" -dr INSTALLFOLDER -cg ExportComponentGroup -var var.sourcePath -ag -sreg -suid -out "$(SolutionDir)\SetupProject\ProjExportDir.wxs"
如何更改此项的输出:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dir813D1F0C17C6517DA1B9A933450C5B91" Name="Release" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="ExportComponentGroup">
<Component Id="cmp6711F65C37F4310E92A3213080231DA6" Directory="dir813D1F0C17C6517DA1B9A933450C5B91" Guid="*">
<File Id="filABBC16CBAD4348690B2250C408181254" KeyPath="yes" Source="$(var.sourcePath)\3AWrapper.dll" />
</Component>
为此:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="bin" Name="bin" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="ExportComponentGroup">
<Component Id="cmp6711F65C37F4310E92A3213080231DA6" Directory="bin" Guid="*">
<File Id="filABBC16CBAD4348690B2250C408181254" KeyPath="yes" Source="$(var.sourcePath)\3AWrapper.dll" />
</Component>
我尝试过使用-directoryid标志,但是这不起作用。有几种方法可以做到这一点 1) XSL transformHeat将在编写输出文件之前为您运行一个转换。您只需提供.xsl文件。这是一个通用的方法,用于任何需要改变的热量输出。如果另一种方法奏效,我会改为这样做 2) -srd开关在另一个wxs文件中手动编写bin目录,并获取heat以将其引用为收获项目的父目录,而无需为根文件夹版本生成另一个目录<代码>加热目录“$(解决方案目录)\Export\Release”-dr bin-srd… Product.wxs中的示例:
<!-- Under Wix/Product -->
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1">
<Directory Id="bin" Name="bin" />
</Directory>
</Directory>
</Directory>
</Fragment>
如果要使用XSL转换,则可以使用以下选项:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="wix:Directory[@Name='Release']/@Id">
<xsl:attribute name="Id">BIN</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
箱子
谢谢,-srd开关的问题是如何将bin目录放入INSTALLFOLDER?您需要将其更改为,但它可以工作,谢谢!!