How to add to PATH variable with a WIX for everyone: admin and standard users? - windows

I'm trying to set a global PATH environment variable along with my custom variable using WIX installer. I do the following:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="COMPANYFOLDER" Name="my company">
<Directory Id="INSTALLFOLDER" Name="app name">
<!-- blah blah -->
</Directory>
</Directory>
</Directory>
</Directory>
<DirectoryRef Id="TARGETDIR">
<!-- Add environment variables -->
<Component Id="idPathEnvSys" Guid=".....">
<Environment Id="idEnvPathSys" Name="PATH" Action="set" Part="last" System="yes" Value="[INSTALLFOLDER]" Permanent="no"/>
</Component>
<Component Id="idPathEnvUsr" Guid=".....">
<Environment Id="idEnvPathUsr" Name="PATH" Action="set" Part="last" System="no" Value="[INSTALLFOLDER]" Permanent="no"/>
</Component>
<Component Id="EnvVarsSys" Guid=".....">
<Environment Id="idEnvMyPathSys" Name="MYPATH" Value="[INSTALLFOLDER]" Part="all" System="yes" Action="set" Permanent="no" />
</Component>
<Component Id="EnvVarsUsr" Guid="....">
<Environment Id="idEnvMyPathUsr" Name="MYPATH" Value="[INSTALLFOLDER]" Part="all" System="no" Action="set" Permanent="no" />
</Component>
</DirectoryRef>
<Feature Id="ProductFeature" Title="!(loc.ProductName)" Level="1">
<!-- main components first -->
<ComponentRef Id='idPathEnvSys' />
<ComponentRef Id='idPathEnvUsr' />
<ComponentRef Id='EnvVarsSys' />
<ComponentRef Id='EnvVarsUsr' />
</Feature>
It compiles just fine but when I install it, for some reason it only adds the system variable. So in other words, if I run a command prompt as admin and do set path it shows my PATH addition. But when I do the same from a regular user account, it is not there.
What am I missing?

Related

.wxs only two file not getting deleted on uninstall

I am using wix installer for msi.
i am using default UI
<UIRef Id="WixUI_Minimal"/>
There are somany dll i am using for msi package. on installation all dll will be installed at
C:\Program Files (x86)\MyApp
while on uninstall all dll uninstalled or deleted except two dll
libssl-1_1.dll
libcrypto-1_1.dll
I found that identifier '-' is making problem on uninstalling and not getting deleted.
I tried custom action like this for deleting that folder itself, but it didn't work.
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="ALLUSERSPROFILE" SourceName="All Users" />
<Directory Id='ProgramFilesFolder' SourceName="program files">
<Directory Id="INSTALLDIR" Name="MyApp" >
<Component Id="First.dll" Guid="GUID">
<File Id="first.dll" Name="first.dll" KeyPath="yes" Vital="no" Source="$(var.PATH)\first.dll" />
</Component>
....... All dll component place like above ......
</Directory>
</Directory>
</Directory>
<Property Id="INSTALLDIR">
<RegistrySearch Root="HKLM" Key="SOFTWARE\MyProj\MyApp" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
</Property>
<DirectoryRef Id='INSTALLDIR'>
<Component Id="UninstallFolder" Guid="*">
<CreateFolder Directory="INSTALLDIR"/>
<util:RemoveFolderEx Property="INSTALLDIR" On="uninstall"/>
<RemoveFolder Id="INSTALLDIR" On="uninstall"/>
<RegistryValue Root="HKLM" Key="SOFTWARE\MyProj\MyApp" Name="path" Type="string" Value="[ProgramFilesFolder]MyApp " KeyPath="yes"/>
</Component>
</DirectoryRef>

Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents' in section

I was following the below code which is product.wxs files.But I am facing an error as below:
Error 5 Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents' in section 'Product:{}'
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<Product Id="702881b5-9a64-4ab8-ab47-f3babcd950a2"
Name="WixApplication" Language="1033"
Version="1.0.0.0"
Manufacturer="HexWireless"
UpgradeCode="42b7872b-78c8-4a0b-abcd-28a30c9804ab">
<Package InstallerVersion="200" Compressed="yes" Platform="x64" InstallScope="perMachine"/>
<!--<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />-->
<!--Find the Path to the sqlcmd.exe by performing a registry search. This is hardcoded for SQL 2012.
Change 110 to 100 for 2008. Might need to change the script too.-->
<Property Id="SQLBINDIR">
<RegistrySearch Id="SqlBinDir"
Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\ClientSetup"
Name="Path"
Type="raw"
Win64="yes"/>
</Property>
<Condition Message="Microsoft SQL Server 2012 needs to be installed before this installer can run">
<![CDATA[SQLBINDIR]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="Database">
<Component Id="Database" Guid="a8dc2Fcd-087d-e393-b059-c67877e51b8a">
<File Id="DatabaseScript" Source="SQLScripts\HexWireless.sql"/>
<RemoveFile Id ="RemoveInstall.log" Name="Install.log" On="uninstall" />
</Component>
</Directory>
<Directory Id="INSTALLDIR" Name="PFiles">
<Directory Id="WixService" Name="Service">
<Component Id="WixWindowsServiceComponent" DiskId="1" Guid="6f51c0f3-776c-4aec-a200-1f199352c6c3" Win64="yes">
<File Id="WixService.exe" Name="WixService.exe" Source="$(var.WixService.TargetDir)\WixService.exe"/>
<ServiceInstall Id="InstallWixService" DisplayName="WixService" Name="WixService.exe" Description="WixService" Account="NT Authority\Network Service" ErrorControl="normal" Start="demand" Type="ownProcess" Vital="yes" />
<ServiceControl Id="ControlWixService" Name="WixService.exe" Stop="uninstall" Remove="uninstall" />
</Component>
</Directory>
</Directory>
<Directory Id="INSTALLFOLDER" Name="Publish">
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="WebApplication" Level="1">
<Feature Id="Database" Title="Database" Description="DatabaseScript" Level="1" Display="expand"
AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION" Absent="allow">
<Feature Id="WixWindowsServiceComponent" Title="Service" Description="WixService" Level="1" Display="expand"
AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR" Absent="allow">
<ComponentGroupRef Id="WixWebsiteIssConfiguration" />
<ComponentRef Id="Database"/>
<ComponentRef Id="WixWindowsServiceComponent"/>
<ComponentGroupRef Id="MyWebWebComponents"/>
</Feature>
</Feature>
</Feature>
<Property Id="INSTALLDIR" Value="D:" />
<Media Id="1" Cabinet="WixWindowsServiceComponent.cab" EmbedCab="yes" />
<InstallExecuteSequence>
<!--If the database feature is selected these actions will run to install the DB-->
<Custom Action="Database.cmd" After="InstallFiles" >
<![CDATA[NOT Installed]]>
</Custom>
<!--Ensure this runs after the custom action to set up the properties for its cmd line-->
<Custom Action="Database" After="Database.cmd">
<![CDATA[NOT Installed]]>
</Custom>
</InstallExecuteSequence>
<UI>
<UIRef Id="GUI"/>
<UIRef Id="WixUI_ErrorProgressText" />
</UI>
<!--This is the sequence script. Best way to understand this is by running sqlcmd -?
Use "property" Custom action to get variable substitution working-->
<CustomAction Id="Database.cmd" Property="Database"
Value=""[SQLBINDIR]sqlcmd.exe" -E -S "[SQLSERVER]" -i "[#DatabaseScript]" -o "[INSTALLLOCATION]HexWireless.log""/>
<!-- Note that the cmd line and args will come from a property with the same name as the custom action, this has been set by the custom action above -->
<CustomAction Id="Database" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute="deferred" Impersonate="yes" />
</Product>
</Wix>
Thanks In Advance.
I am not sure if your issue is sorted or not, I just faced the same issue even though i have created a few of these msi files with Wix.
In my case, it wasn't finding the "HeatedComponents" that I am generating automatically within the project. I had to load this file into the project, (these files or folders may be inside your project folder but in most cases VS does not load them automatically).
You have to Right Click on the project -> Add -> Existing Item; and select the file/item that is required.

WiX Windows service install failure

I am trying to use WiX for my service installation.
This tries to install my service but eventually fails. Do you have any idea?
My service should use a local user account. This account was added as "users which can run window services".
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="MySvcSetup" Language="1033" Version="1.0.0.0" Manufacturer="CMPY" UpgradeCode="aae1a2bc-2ae0-409b-adc4-77cc7fc06a87">
<Package InstallerVersion="200" Compressed="yes" AdminImage="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="MySvcSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="SLBFOLDER" Name="CMPY">
<Directory Id="INSTALLFOLDER" Name="My Service" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent" Guid="{15554AD5-F373-453A-88B9-BE1112A6C804}">
<!--TODO: Insert files, registry keys, and other resources here.-->
<File Id="MySvc.exe" Name="MySvc.exe" Source="..\..\..\..\Services\xxx\bin\Release\MySvc.exe" Vital="yes" KeyPath="yes" DiskId="1"/>
<File Id="Encryption.dll" Name="Encryption.dll" Source="..\..\..\..\Services\xxx\bin\Release\Encryption.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<ServiceInstall
Id="MySvc.exe"
Type="ownProcess"
Vital="yes"
Name="MySvc"
DisplayName="My service"
Description="...."
Start="auto"
Account=".\MySvcUser"
Password="CN9P4CvTRo"
ErrorControl="ignore"
Interactive="no">
<util:PermissionEx
ChangePermission="yes"
Delete="yes"
GenericAll="yes"
ReadPermission="yes"
ServiceChangeConfig="yes"
ServiceEnumerateDependents="yes"
ServiceInterrogate="yes"
ServicePauseContinue="yes"
ServiceQueryConfig="yes"
ServiceQueryStatus="yes"
ServiceStart="yes"
ServiceStop="yes"
ServiceUserDefinedControl="yes"
Synchronize="yes"
TakeOwnership="no"
User=".\MySvcUser"
/>
<util:ServiceConfig
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="restart"
RestartServiceDelayInSeconds="60"
ResetPeriodInDays="0" />
</ServiceInstall>
<ServiceControl Id="MySvc.exe" Start="install" Stop="both" Remove="uninstall" Name="GTCollector" Wait="yes" />
</Component>
</ComponentGroup>
</Fragment>
Try
Account="LocalSystem"
instead of
Account=".\MySvcUser"

WiX not embedding binaries

I'm using WiX to create my products installer. For some reason it's no longer embedding the .exes and .dlls inside the installer. So I have this:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="USERSPECIFIEDDIR" Name="My-app-name" />
</Directory>
and it creates a .msi alongside a folder called My-app-name that contains all .exe and dll files required for the application. if i run the installer from there, it's alright, but if i move the msi elsewhere (without the subdirectory), it errors out because it can't find the files. how can i tell WiX to embed all binaries inside the installer??
in case it helps, here are some other snippets from my wxs. let me know if you need any other information. oh, and i'm using wix directly from visual studio 2008.
<DirectoryRef Id="USERSPECIFIEDDIR">
<Component Id="MainExe" Guid="580F8F15-C06C-49A7-ADDC-56C96580DC0D">
<File Id="MainExe" Name="OrderMonkey.exe" KeyPath="yes" />
</Component>
<Component Id="OMEmailerExe" Guid="3B0AECC3-67E5-40B3-83CB-9B84FE965ED8">
<File Id="OMEmailerExe" Name="OMEmailer.exe" />
</Component>
<Component Id="migradomDLL" Guid="37E1BCAE-EB39-4DF5-88C7-AE74CA5EA171">
<File Id="migradom" Name="MigraDoc.DocumentObjectModel.dll" />
</Component>
<Component Id="migrarenderDLL" Guid="C2910B9E-0B06-467A-853C-7651BE7BD9E4">
<File Id="migrarender" Name="MigraDoc.Rendering.dll" />
</Component>
<Component Id="migrartfDLL" Guid="CEBE4DE9-7CA0-4F48-A8B1-1D46E4E48B66">
<File Id="migrartf" Name="MigraDoc.RtfRendering.dll" />
</Component>
<Component Id="mysqldataDLL" Guid="2E474737-474C-4146-8E67-D3837B5DB862">
<File Id="mysqldata" Name="MySql.Data.dll" />
</Component>
<Component Id="pdfchartingDLL" Guid="7467B6C2-BE38-4283-B179-9FA94C4A087F">
<File Id="pdfcharting" Name="PdfSharp.Charting.dll" />
</Component>
<Component Id="pdfsharpDLL" Guid="39F23E36-BF9C-40C1-8190-6A3554B879BC">
<File Id="pdfsharp" Name="PdfSharp.dll" />
</Component>
<Component Id="sqliteDLL" Guid="B043CF20-8DC2-4A10-AE4B-4721263A111E">
<File Id="sqlite" Name="System.Data.SQLite.dll" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="414E91FD-7410-492C-9D48-8125C6ECCF0B">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Order Monkey"
Description="Order Monkey Orders and Quotes"
Target="[USERSPECIFIEDDIR]OrderMonkey.exe"
WorkingDirectory="USERSPECIFIEDDIR" />
<Shortcut Id="ApplicationOfflineStartMenuShortcut"
Name="Order Monkey Offline"
Description="Order Monkey Orders and Quotes"
Target="[USERSPECIFIEDDIR]OrderMonkey.exe"
WorkingDirectory="USERSPECIFIEDDIR"
Arguments="-offline" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\OrderMonkey" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id='Complete' Level='1' Title='Order Monkey Complete' Description='The complete package' ConfigurableDirectory='TARGETDIR' Display='expand'>
<ComponentRef Id='MainExe' />
<ComponentRef Id='OMEmailerExe' />
<ComponentRef Id='migradomDLL' />
<ComponentRef Id='migrarenderDLL' />
<ComponentRef Id='migrartfDLL' />
<ComponentRef Id='mysqldataDLL' />
<ComponentRef Id='pdfchartingDLL' />
<ComponentRef Id='pdfsharpDLL' />
<ComponentRef Id='sqliteDLL' />
<ComponentRef Id='ApplicationShortcut' />
<ComponentRef Id='AppData' />
</Feature>
Use these elements:
<Package Compressed="yes" InstallScope="perMachine" />
<MediaTemplate EmbedCab="yes" />
Package/#Compressed="yes" creates cabinets instead of loose files. MediaTemplate/#EmbedCab="yes" embeds the default cabinets into the .msi.

Wix Directory Problems

I have two questions about the directories with using fragments in Windows Installer XML.
I got this fragment file from the heat.exe:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="dir08A07F5561FBEB6B9772467C730F6445" Name="Test" />
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="InstallationFiles">
<Component Id="cmp071F7F8F6B6027C8D2841272FE526A2B" Directory="dir08A07F5561FBEB6B9772467C730F6445" Guid="{CCCB70AC-29F5-4DAA-B03E-1A2266649AB6}">
<File Id="fil63087E96FFB31F9E39B642CE8914F48B" KeyPath="yes" Source="SourceDir\dmedv.jpg" />
</Component>
<Component Id="cmpAE6CBEDA75641CF25BA9996AEB74A0DE" Directory="dir08A07F5561FBEB6B9772467C730F6445" Guid="{F5DABCAB-95D1-4197-A49F-E5F052A8E7EF}">
<File Id="filD27F2F6B26F5C14563865FE6C2AD5D50" KeyPath="yes" Source="SourceDir\Files.txt" />
</Component>
<Component Id="cmp25C5EADB5C0A9E779D20EC7B77BD42B0" Directory="dir08A07F5561FBEB6B9772467C730F6445" Guid="{E301B04A-6EA5-496B-A58A-8898110BE57C}">
<File Id="fil7C91C48D9AA0F2FE0EB37A21F108037F" KeyPath="yes" Source="SourceDir\readme.txt" />
</Component>
<Component Id="cmpD387AB4B40EDF14BF271ADDA7B71D2B7" Directory="dir08A07F5561FBEB6B9772467C730F6445" Guid="{6AF61DF4-32D0-4E7C-95B8-1DB9E7409029}">
<File Id="fil966691BA382AFC9343430FE162643432" KeyPath="yes" Source="SourceDir\readme1.txt" />
</Component>
<Component Id="cmpB86212407C1BEA12838C8C7B20495E9F" Directory="dir08A07F5561FBEB6B9772467C730F6445" Guid="{921E971E-E224-464C-9FBC-FBC5F78B3E5B}">
<File Id="fil61CD8EF43EA29DF58454E9A19F8C1EF9" KeyPath="yes" Source="SourceDir\readme2.txt" />
</Component>
<Component Id="cmpE4143B48FF854AE84F6054D4636FDE81" Directory="dir0ADF7E89B935DD39670130B4DC1D670E" Guid="{6F248718-93DD-4850-A18E-BD7079F738D5}">
<File Id="fil03847B355B6AADE5E4E04D143C92BC67" KeyPath="yes" Source="SourceDir\Test2\dmedv2.jpg" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<DirectoryRef Id="dir08A07F5561FBEB6B9772467C730F6445" />
</Fragment>
<Fragment>
<DirectoryRef Id="dir0ADF7E89B935DD39670130B4DC1D670E" />
</Fragment>
<Fragment>
<DirectoryRef Id="dir08A07F5561FBEB6B9772467C730F6445">
<Directory Id="dir0ADF7E89B935DD39670130B4DC1D670E" Name="Test2" />
</DirectoryRef>
</Fragment>
</Wix>
and I have this wix installer file:
<?xml version='1.0' encoding='windows-1252'?>
<?define ProductVersion="1.0.0.0"?>
<?define ProductName="DMServices Installer"?>
<?define Manufacturer="DM EDV- und Bürosysteme GmbH"?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>
<Product Name="$(var.ProductName)" Id='BB7FBBE4-0A25-4cc7-A39C-AC916B665220' UpgradeCode='8A5311DE-A125-418f-B0E1-5A30B9C667BD'
Language='1033' Codepage='1252' Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)">
<Package Id='*' Keywords='Installer'
Description="DMService Installer Setup"
Manufacturer='DM EDV- und Bürosysteme GmbH'
InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="the man" />
<PropertyRef Id="NETFRAMEWORK35"/>
<Condition Message='This setup requires the .NET Framework 3.5.'>
<![CDATA[Installed OR (NETFRAMEWORK35)]]>
</Condition>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder'>
<Directory Id='DM' Name='DM EDV'>
<Directory Id='INSTALLDIR' Name='DMServices'>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature Id='InstallationFiles' Title='InstallationFiles' Level='1'>
<ComponentGroupRef Id='InstallationFiles' />
</Feature>
</Product>
</Wix>
So far.
Now when i generate this files to wixobj, the compiler shows errors because the files can't be found. The files are in a directory called "Test". And in the file it's named SourceDir.
For a lil workaround i can copy the test directory and call it SourceDir ;-). So my Setup will be created.
How can I do it without a second directory?
EDIT: Problem is done.
Now i install my package. But whatever i do, the files will be installed to C:\Test.
But I want it to be installed in my Program Files Directory.
In many examples i can do it, like in the file, but i have to know the guids.
But we do wix for getting all files from one directory, without to put our hands on.
So how to install the files into the program files directory?
Take a closer look at -dr switch of heat.exe. You can put the necessary directory reference there. So, define your directory structure in the main file as you do now, and provide correct directory ID to heat.exe.
UPDATE:
Ok, the following works for me. The main directory structure:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="My folder">
<Directory Id="WebsiteFolder" Name="Website">
...
</Directory>
</Directory>
</Directory>
The Feature references the ComponentGroup:
<Feature Id="ProductFeature" Title="!(loc.ProductFeature.Title)" Level="100">
...
<ComponentGroupRef Id="WebsiteFolderComponentGroup"/>
...
</Feature>
The heat.exe generates the following fragment:
<Fragment>
<DirectoryRef Id="WebsiteFolder">
<Component Id="cmp1" Guid="GUID-GOES-HERE">
<File Id="fil1" KeyPath="yes" Source="$(var.WebsiteFolderSource)\Default.aspx" />
</Component>
<Component Id="cmp2" Guid="GUID-GOES-HERE">
<File Id="fil2" KeyPath="yes" Source="$(var.WebsiteFolderSource)\default.css" />
</Component>
<Directory Id="dir1" Name="App_Browsers">
<Component Id="cmp3" Guid="GUID-GOES-HERE">
<File Id="fil3" KeyPath="yes" Source="$(var.WebsiteFolderSource)\App_Browsers\Form.browser" />
</Component>
</Directory>
<Directory Id="App_Config" Name="App_Config">
<Component Id="cmp4" Guid="GUID-GOES-HERE">
<File Id="fil4" KeyPath="yes" Source="$(var.WebsiteFolderSource)\App_Config\ConnectionStrings.config" />
</Component>
</Directory>
<Directory Id="bin" Name="bin">
<Component Id="cmp5" Guid="GUID-GOES-HERE">
<File Id="fil5" KeyPath="yes" Source="$(var.WebsiteFolderSource)\bin\MySystem.Web.UI.dll" />
</Component>
<Component Id="cmp6" Guid="GUID-GOES-HERE">
<File Id="fil6" KeyPath="yes" Source="$(var.WebsiteFolderSource)\bin\Another.dll" />
</Component>
...
</Directory>
...
</Directory>
...
<ComponentGroup Id="WebsiteFolderComponentGroup">
<ComponentRef Id="cmp1" />
<ComponentRef Id="cmp2" />
<ComponentRef Id="cmp3" />
<ComponentRef Id="cmp4" />
...
</ComponentGroup>
And finally, the heat command which generates necessary output looks like this (Nant sample):
<exec program="heat.exe" verbose="true" basedir="${paths.source}">
<arg line='dir "${paths.dist.website}"'/><!-- Notice the quotes inside the attributes -->
<arg line='-srd'/>
<arg line='-dr WebsiteFolder'/>
<arg line='-cg WebsiteFolderComponentGroup'/>
<arg line='-out "${paths.harvest}\website.wxs"'/>
<arg line='-ke -sfrag -scom -sreg -gg'/>
<arg line='-var var.WebsiteFolderSource'/>
</exec>
These snippets contain enough information to understand how it all works. Play with heat.exe switches to find out the combination you need. Good luck!
In case people like me still looking for clarification: The <DirectoryRef Id="WebsiteFolder"> in the heat fragment is important, it is the reference to where the fragment files should be installed. If you have multiple fragments and want to place it in different locations, the DirectoryRef is the key.

Resources