Tôi đang cố gắng tạo trình cài đặt WiX cho dịch vụ cửa sổ và tôi đã đọc rằng tôi đã đặt keyPath thành "không" cho tất cả các tệp của mình, với ngoại trừ .exe trong tập lệnh WiX của tôi. Tôi hiện đang tạo Directory và tập tin cấu trúc của tôi sử dụng Heat.exe đây là lệnh của tôi:Trình cài đặt WiX: sử dụng xslt với heat.exe để cập nhật các thuộc tính
"$(WIX)bin\heat.exe" dir $(SolutionDir)EmailGenerationService\bin\PROD
-cg EmailGenFiles -gg -scom -sreg -sfrag -srd -suid
-dr INSTALLLOCATION -var var.FileSource
-t $(Projectdir)KeyPathTransform.xslt
-out $(ProjectDir)DirectoryAndFileComponents.wxs
Đó là ý định của tôi để cập nhật tất cả các yếu tố tập tin với Keypath =”no” trong tập tin DirectoryAndFileComponents.wxs tôi. Một ví dụ về sản lượng từ nhiệt là:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="Dollar.Common.dll" Guid="{2BCD0767-2383-47CF-B1BF-325FA4A3264F}">
<File Id="Dollar.Common.dll" KeyPath="yes" Source="$(var.FileSource)\Dollar.Common.dll" />
</Component>
<Component Id="Dollar.Common.Exceptions.dll" Guid="{B7238091-76D1-42F5-A3B4-A539DFF3BD92}">
<File Id="Dollar.Common.Exceptions.dll" KeyPath="yes" Source="$(var.FileSource)\Dollar.Common.Exceptions.dll" />
</Component>
<Component Id="Dollar.Common.Exceptions.pdb" Guid="{43711979-747D-49C9-BAE4-ECD44FAF5E67}">
<File Id="Dollar.Common.Exceptions.pdb" KeyPath="yes" Source="$(var.FileSource)\Dollar.Common.Exceptions.pdb" />
</Component>
<Component Id="Dollar.Common.Logging.dll" Guid="{59F9ABF3-5F68-410C-BC96-0556282F1E04}">
<File Id="Dollar.Common.Logging.dll" KeyPath="yes" Source="$(var.FileSource)\Dollar.Common.Logging.dll" />
</Component>
Đây là XSLT tôi đi qua để làm nóng để thực hiện việc chuyển đổi:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wix"
xmlns:my="my:my">
<xsl:output method="xml" indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match='/wix:Wix/wix:Fragment/wix:DirectoryRef/wix:Component/wix:File[@Id and not (@Id="EmailGenerationService.exe")]'>
<xsl:attribute name="KeyPath">
<xsl:value-of select="no"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Tôi đã thử khá một vài biến thể của việc này dựa trên khác các bài đăng trên trang này và những nơi khác, nhưng vẫn chưa thể nhận được tệp được tạo bởi heat.exe để có KeyPath = "không".
Tôi có thiếu thứ gì đó hiển nhiên không?
Cảm ơn bạn đã phản hồi, nhưng điều này cũng không hoạt động. Nhiệt chạy ok với lỗi ra, nhưng tập tin kết quả vẫn có KeyPath = "có" trên tất cả các nút. –
@MarkJones, tôi đã cập nhật câu trả lời của mình. –
hoàn hảo, cảm ơn bạn rất nhiều –