Question

I added a project reference to my WiX project and everything seemed to be working, until I went to check on the installed files.

They no longer have their extension! And therefore cannot be opened automatically opened with whatever application is registered for that extension.

Here's the relevant code:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="My WiX Test">
            <Component Id="ExeCom" Guid="PUT-GUID-HERE" Directory="INSTALLDIR">
                <File Id="ExeFile" Name="ExeFile" Source="$(var.MyForm.TargetPath)" KeyPath="yes"/>
            </Component>
            <Component Id="TxtCom" Guid="PUT-GUID-HERE" Directory="INSTALLDIR">
                <File Id="TxtFile" Name="TxtFile" Source="sometextfile.txt" KeyPath="yes"/>
            </Component>
        </Directory>
    </Directory>
</Directory>

<Feature Id="Complete" Title="Complete" Level="1">
    <ComponentRef Id="ExeCom"/>
    <ComponentRef Id="TxtCom"/>
</Feature>

Once it's installed, I go into the installation folder (Program Files\My WiX Test) and expect to click on the exe file to start up the app. But none of the files in the folder have an extension. I have to manually rename the file to add the .exe or .txt, or go through the open with dialog.

Is there a way to force WiX to add the extension, or am I doing something wrong?

Was it helpful?

Solution

As already stated in the comments, the easyest ( to much .wxs files in our project to find the tiny places we used auto-detection ) is to specify the extension within the name= property.

After some struggle we went to the style that we even name the id the way the extension is to not have to lookup what ID belongs to what name and what file from the build.

Example:

<Component Id="ImplantCopyRight">
<File Id="Copyright.txt" Name="Copyright.txt" 
Source="$(var.SourceRoot)/08-Impl/img/license/Implants/Copyright.txt" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top