Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6783319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:50:58+00:00 2026-05-26T16:50:58+00:00

I am trying to create a WiX installer for a Windows service, and I

  • 0

I am trying to create a WiX installer for a Windows service, and I have read that I need to set the KeyPath to “no” for all my files, with the exception of the .exe in my WiX script.
I am currently generating my Directory and file structure using Heat.exe here is my command:

"$(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

It is my intention to update all the file elements with Keypath=”no” in my DirectoryAndFileComponents.wxs file.
A sample of the output from heat is:

<?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>

Here is the XSLT I am passing to heat to perform the transformation:

<?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>

I have tried quite a few variations of this based on other posts on this site and else where, but as yet have been unable to get the file created by heat.exe to have KeyPath=”no”.

Am I missing something obvious?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:50:58+00:00Added an answer on May 26, 2026 at 4:50 pm

    You have two different defined namespaces:

    1. In XML: http://schemas.microsoft.com/wix/2006/wi
    2. In XSLT: http://schemas.microsoft.com/wix/2006/wix

    As far as I know, correct namespace for WiX is http://schemas.microsoft.com/wix/2006/wi. So you should change your XSLT.

    XSLT:

    <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/wi"
                xmlns:my="my:my">
    
        <xsl:output method="xml" indent="yes" />
    
        <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:copy>
                <xsl:apply-templates select="@*"/>
                <xsl:attribute name="KeyPath">
                    <xsl:text>no</xsl:text>
                </xsl:attribute>
            </xsl:copy>
        </xsl:template>
    </xsl:stylesheet>
    

    Input XML:

    <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>
            </DirectoryRef>
        </Fragment>
    </Wix>
    

    Output XML:

    <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" Source="$(var.FileSource)\Dollar.Common.dll" KeyPath="no" />
          </Component>
          <Component Id="Dollar.Common.Exceptions.dll" Guid="{B7238091-76D1-42F5-A3B4-A539DFF3BD92}">
            <File Id="Dollar.Common.Exceptions.dll" Source="$(var.FileSource)\Dollar.Common.Exceptions.dll" KeyPath="no" />
          </Component>
          <Component Id="Dollar.Common.Exceptions.pdb" Guid="{43711979-747D-49C9-BAE4-ECD44FAF5E67}">
            <File Id="Dollar.Common.Exceptions.pdb" Source="$(var.FileSource)\Dollar.Common.Exceptions.pdb" KeyPath="no" />
          </Component>
          <Component Id="Dollar.Common.Logging.dll" Guid="{59F9ABF3-5F68-410C-BC96-0556282F1E04}">
            <File Id="Dollar.Common.Logging.dll" Source="$(var.FileSource)\Dollar.Common.Logging.dll" KeyPath="no" />
          </Component>
        </DirectoryRef>
      </Fragment>
    </Wix>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a wix installer to install and start a Windows
I am new to WiX and I have been trying to create a installer
I'm trying to create a WiX installer dialog that provides a series of textboxes
I'm trying to create a setup project using WIX that will allow me to
I'm trying create a method that returns the sum of all values in an
I am trying create a WCF service that leverages the WPF MediaPlayer on the
I'am new to WIX, trying to create an msi with feature tree. The installer
I'm currently trying create a service that will return results of a OLAP cube
Trying to create my first iPhone app that would play back audio. When I
Trying to create a small monitor application that displays current internet usage as percentage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.