unable to install database using Wix - wix

i have tried lot of times but in sql server mgmt studio db is not created
sa user is already created i have changed the user name but that does not work
Please refer the following files:
Product.wxs :`
<?xml version="1.0" encoding="UTF-8"?>
<!--For [DBStep:1] Sql Database Add Reffrence 1] xmlns:util 2]xmlns:sql-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">
<Product Id="680B2B06-567E-4BDB-9C37-63830049B51F"
Name="MyApp" Language="1033" Version="1.0.0.0" Manufacturer="My System Pvt Ltd"
UpgradeCode="A25F60C4-4037-4DA8-BA2F-6C482EF7D05A">
<Package Id="*" InstallerVersion="100" Compressed="yes" InstallScope="perMachine"
InstallPrivileges="elevated" ReadOnly="yes"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<!--Add Cab1.cab File inside the Package-->
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
<!--For [DBStep:2] Create User and add *.sql File-->
<util:User Id="SQLUser" Name="[SQLUSER]" Password="[SQLPASSWORD]" />
<!--Create Database User-->
<Binary Id="CreateTable" SourceFile="CreateTable.sql" />
<!--Add your script File-->
<Property Id="SQLUSER">sa</Property>
<Property Id="SQLPASSWORD">amit#123</Property>
<Property Id="SQLSERVER">LOCAL</Property>
<!--Here We Install Our Main App-->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MY System Pvt Ltd"/>
</Directory>
<!-- Step 1: For the Program Menu -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="My System Pvt Ltd"/>
</Directory>
<!--Step 2:For Desktop Folder-->
<Directory Id="DesktopFolder"/>
<!--Step 3:For StartUp Folder-->
<Directory Id="StartupFolder"/>
</Directory>
<!--Step 4 :Add Main App exe-->
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="myapplication.exe" Guid="854D88DA-D213-4805-B3DC-51F43837B124">
<File Source="$(var.WixDemoWPFAppVS2012.UI.TargetPath)" Name="MYApp.exe"
Id="MyAppEXE" KeyPath="yes"/>
</Component>
<!--[DBStep:3]Componant for Database-->
<Component Id="SqlComponent" Guid="1B3F5D84-D1A0-409D-9ADC-71C562344FEE" KeyPath="yes">
<sql:SqlDatabase Id="SqlDatabase" Database="Foobar" User="SQLUser" Instance="SQLEXPRESS"
Server="[SQLSERVER]" CreateOnInstall="yes" DropOnUninstall="yes"
ContinueOnError="yes" >
<sql:SqlScript Id="CreateTable" BinaryKey="CreateTable" ExecuteOnInstall="yes" />
</sql:SqlDatabase>
</Component>
</DirectoryRef>
<!-- Step 1.1: Add the shortcut to your installer package Program Menu or Start Menu-->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="8C4AC870-043C-4D36-A868-35354F2A0D9A">
<!--Add Shortcut of the Application in start Menu-->
<Shortcut Id="ApplicationStartMenuShortcut" Name="MyApp" Description="My Application Description"
Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER">
<!--Add Icon to the ShortCut-->
<Icon Id="MYPMenuIcon" SourceFile=".\Desktop.ico" />
</Shortcut>
<Shortcut Id="UninstallShortcut"
Name="Uninstall My Software"
Description="Uninstalls My Software data"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]" />
<!--Remove the Folder At time of Uninstall-->
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- Step 2.1: Add the shortcut to your installer package For DeskTop-->
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDeskShortcutComp" Guid="29B9A804-9B2B-4E57-8803-E13C702FE100">
<Shortcut Id="ApplicationDeskShortcut" Name="MYAppDesk"
Description="My Application Description" Target="[INSTALLFOLDER]MyApp.exe"
WorkingDirectory="INSTALLFOLDER">
<Icon Id="MYDeskIcon" SourceFile=".\Desktop.ico" />
</Shortcut>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!--Step 3.1: add Shortcut to StartUp Folder to run application when you login-->
<DirectoryRef Id="StartupFolder">
<Component Id="ApplicationStartUpShortcutComp" Guid="C4340A05-0D11-4F54-9DD7-7A058A35DE43">
<Shortcut Id="ApplicationStartUpDeskShortcut" Name="MYAppDesk" Description="My Application Description"
Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER">
<Icon Id="MyIconStartUp" SourceFile=".\Desktop.ico" />
</Shortcut>
<RemoveFolder Id="StartupFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!--Add Component-->
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
<!--Step 1.2:Add Start menu or program Shortcut-->
<ComponentRef Id="ApplicationShortcut" />
<!--step 2.2Add DeskTop Shortcut-->
<ComponentRef Id="ApplicationDeskShortcutComp" />
<!--step 3.2Add DeskTop Shortcut-->
<ComponentRef Id="ApplicationStartUpShortcutComp"/>
<!--[DBStep:4]Add Database Componant to the WXS file-->
<ComponentRef Id="SqlComponent" />
</Feature>
</Product>
</Wix>
`
CreateTable.sql :`
CREATE TABLE Test (Value1 CHAR(50), Value2 INTEGER)
CREATE INDEX TestIndex ON Test (Value1)
`

Related

32/64 bit WiX Combined Installer-Copying files only

I have an msi that copies files (PLC Code) to a directory(C:\Product\3.1\Boot), and modifies one key.
My visual studio project generates different PLC Code for the different architectures, but the destination is the same on both platforms. They key is in a different spot.
I have looked at using the arch-switch and conditional statements, but these look to only detect the architecture on which it is compiled, and not where the msi is run.
I know that you cant have 32/64 in the same MSI, but I'm not doing anything other than copying files and changing registries. I'm not putting anything in the windows directories/program files.
Though I would like it to appear with a version in the list of programs.
Is it possible in this case to have one installer?
Code
'''
<Product Id="*"
Name="Company"
Language="1033"
Version="4.09"
Manufacturer="CompanyInc."
UpgradeCode="YOUR_GUID"
>
<Package Id ="*"
InstallerVersion="200"
InstallPrivileges="elevated"
Compressed="yes"
InstallScope="perMachine"
Description="Company PLC Code"
Manufacturer="CompanyInc."
Keywords="PLC"
Comments="F"
/>
<!--Upgrade/install control-->
<MajorUpgrade
AllowDowngrades="yes"
/>
<!--GUI for install display-->
<UI>
<UIRef Id="WixUI_Minimal" /> <!--Define type of UI -->
</UI>
<Upgrade Id="GUID_HERE">
<UpgradeVersion OnlyDetect="no"
Property="SELFFOUND"
Minimum="1.0"
/>
</Upgrade>
<MediaTemplate EmbedCab="yes" />
<!-- Set the icon used in the programs and features list-->
<Icon Id='ProductIcon' SourceFile='Company.ico' />
<Property Id='ARPPRODUCTICON' Value='ProductIcon' />
<!-- Things to install-->
<Feature Id="Default" Title="PLC Code" Level="1">
<ComponentGroupRef Id="ProductComponentsx64" />
</Feature>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Company PLC" />
<Directory Id="BOOTDIR" />
<Directory Id="PLCDIR" />
</Directory>
</Directory>
<SetDirectory Id="BOOTDIR" Value="C:\CompanySoftware\3.1\Boot" />
<SetDirectory Id="PLCDIR" Value="C:\CompanySoftware\3.1\Boot\Plc" />
<!--Specify when actions occur actions during install-->
<InstallExecuteSequence>
<Custom Action="ARCHIVEBOOTDIR" After ="CostFinalize" />
<!--ToDo: copy files-->
</InstallExecuteSequence>
</Product>
<Fragment>
<!--64 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
<ComponentGroup Id="ProductComponentsx64">
<Component Id="BootComponents" Guid="" Directory="BOOTDIR">
<File Id="CurrentConfig.xml" Source="..\_Boot\CompanySoftware RT (x64)\CurrentConfig.xml" KeyPath="no" />
</Component>
<Component Id="PLCComponent" Guid="" Directory="PLCDIR">
<File Id="Port_851.app" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.app" KeyPath="no" />
<File Id="Port_851.autostart" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.autostart" KeyPath="no" />
<File Id="Port_851.cid" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.cid" KeyPath="no" />
<File Id="Port_851.crc" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.crc" KeyPath="no" />
<File Id="Port_851.occ" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.occ" KeyPath="no" />
<File Id="Port_851.ocm" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.ocm" KeyPath="no" />
<File Id="Port_851_boot.tizip" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851_boot.tizip" KeyPath="no" />
</Component>
<Component Id="StartupReg" Guid="" Directory="TARGETDIR">
<RegistryKey Root="HKLM"
Key="Software\WOW6432Node\Company\CompanySoftware3\System">
<RegistryValue Name="SysStartupState"
Type="integer"
Value ="5"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<!--32 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
<ComponentGroup Id="ProductComponentsx86">
<Component Id="BootComponents" Guid="" Directory="BOOTDIR">
<File Id="CurrentConfig.xml" Source="..\_Boot\CompanySoftware RT (x86)\CurrentConfig.xml" KeyPath="no" />
<File Id="Company.ico" Source="Company.ico" KeyPath="no" />
</Component>
<Component Id="PLCComponent" Guid="" Directory="PLCDIR">
<File Id="Port_851.app" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.app" KeyPath="no" />
<File Id="Port_851.autostart" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.autostart" KeyPath="no" />
<File Id="Port_851.cid" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.cid" KeyPath="no" />
<File Id="Port_851.crc" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.crc" KeyPath="no" />
<File Id="Port_851.occ" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.occ" KeyPath="no" />
<File Id="Port_851.ocm" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.ocm" KeyPath="no" />
<File Id="Port_851_boot.tizip" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851_boot.tizip" KeyPath="no" />
</Component>
<Component Id="StartupReg" Guid="" Directory="TARGETDIR">
<RegistryKey Root="HKLM"
Key="Software\Company\CompanySoftware3\System">
<RegistryValue Name="SysStartupState"
Type="integer"
Value ="5"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
'''
I was able to figure out how to get this to work. By using the Condition and ![CDATA[NOT(VersionNT64)]] to detect the version I was able to perform different actions!
<Product Id="*"
Name="Company PLC"
Language="1033"
Version="4.09"
Manufacturer="Company Inc."
UpgradeCode="Code"
>
<Package Id ="*"
InstallerVersion="200"
InstallPrivileges="elevated"
Compressed="yes"
InstallScope="perMachine"
Description="Company CompanySoftware PLC Code"
Manufacturer="Company Inc."
Keywords="PLC"
Comments="Company "
/>
<!--Upgrade/install control-->
<MajorUpgrade
AllowDowngrades="yes"
/>
<!--GUI for install display-->
<!-- future use for custom graphics on the MSI pages
<WixVariable Id="WixUIBannerBmp" Value="CompanyWixUIBanner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="CompanyWixUIBanner.bmp" />
-->
<UI>
<UIRef Id="WixUI_Minimal" />
<!--Define type of UI -->
</UI>
<Upgrade Id="CODE">
<UpgradeVersion OnlyDetect="no"
Property="SELFFOUND"
Minimum="1.0"
/>
</Upgrade>
<MediaTemplate EmbedCab="yes" />
<!-- Set the icon used in the Windows programs and features list-->
<Icon Id='ProductIcon' SourceFile='Company.ico' />
<Property Id='ARPPRODUCTICON' Value='ProductIcon' />
<!-- Things to install- This would normally appear as the selectable list of items to install in a regular installer-->
<Feature Id="Default_x64" Title="PLC Code x64" Level="1">
<Condition Level ="1">
<![CDATA[(VersionNT64)]]>
</Condition>
<ComponentGroupRef Id="ProductComponentsx64" />
</Feature>
<Feature Id="Default_x86" Title="PLC Code x86" Level="1">
<Condition Level ="1">
<![CDATA[NOT(VersionNT64)]]>
</Condition>
<ComponentGroupRef Id="ProductComponentsx86" />
</Feature>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Company PLC" />
<Directory Id="BOOTDIR" />
<Directory Id="PLCDIR" />
</Directory>
</Directory>
<SetDirectory Id="BOOTDIR" Value="C:\CompanySoftware\3.1\Boot" />
<SetDirectory Id="PLCDIR" Value="C:\CompanySoftware\3.1\Boot\Plc" />
</Product>
<Fragment>
<!--64 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
<ComponentGroup Id="ProductComponentsx64">
<Component Id="BootComponentsx64" Guid="" Directory="BOOTDIR">
<Condition>
<![CDATA[(VersionNT64)]]>
</Condition>
<File Id="CurrentConfig.xml.x64" Source="..\_Boot\CompanySoftware RT (x64)\CurrentConfig.xml" KeyPath="no" />
</Component>
<Component Id="PLCComponent.x64" Guid="" Directory="PLCDIR">
<Condition>
<![CDATA[(VersionNT64)]]>
</Condition>
<File Id="Port_851.app.x64" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.app" KeyPath="no" />
</Component>
<Component Id="StartupReg.x64" Guid="" Directory="TARGETDIR">
<Condition>
<![CDATA[(VersionNT64)]]>
</Condition>
<RegistryKey Root="HKLM"
Key="Software\WOW6432Node\Company\CompanySoftware\System">
<RegistryValue Name="SysStartupState"
Type="integer"
Value ="5"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<!--32 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
<ComponentGroup Id="ProductComponentsx86">
<Component Id="BootComponentsx86" Guid="" Directory="BOOTDIR">
<Condition>
<![CDATA[NOT(VersionNT64)]]>
</Condition>
<File Id="CurrentConfig.xml.x86" Source="..\_Boot\CompanySoftware RT (x86)\CurrentConfig.xml" KeyPath="no" />
</Component>
<Component Id="PLCComponentx86" Guid="" Directory="PLCDIR">
<Condition>
<![CDATA[NOT(VersionNT64)]]>
</Condition>
<File Id="Port_851.app.x86" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.app" KeyPath="no" />
</Component>
<Component Id="StartupReg.x86" Guid="" Directory="TARGETDIR">
<Condition>
<![CDATA[NOT(VersionNT64)]]>
</Condition>
<RegistryKey Root="HKLM"
Key="Software\Company\CompanySoftware\System">
<RegistryValue Name="SysStartupState"
Type="integer"
Value ="5"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>

Wix : adding my heat harvested files

I have been struggling with Wix for the last couple of days, probably read 15 guides around the web so far trying to make it working on my real application, but no luck.
I used a small and simple other project to practice and make sure I understand and do every thing right.
Following this guide I managed to got it to work, the next stage was trying to add the content of the directory to the installation since it holds many files that I dont want to add by hand.
So following this guide I used heat.exe to harvest the content of the folder, I got the heat to create the .wxs that I needed but next is trying to add its content to my Product.wxs file.
Problem is that it says I should add this:
<!-- Add ComponentGroupRef to existing Feature, or create new one -->
<!-- Notice the IDs & what we used in heat -->
<Feature Id="ProductFeature" Title="Main product" Level="1">
<ComponentGroupRef Id="ConfigurationUtilityComponents"/>
</Feature>
<Fragment>
<Directory Id="INSTALLDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ConfigurationUtilityDir" Name="ConfigurationUtility" />
</Directory>
</Directory>
</Fragment>
to my Product.wxs file , but I cant seem to figure out how to do it.
Can any one please help?
Here is my Product.wxs file:
<Product Id="8748CF04-E8D3-4A2B-B3F5-22E50B3A8E49"
Name="MyApp" Language="1033" Version="1.0.0.0" Manufacturer="My System Pvt Ltd"
UpgradeCode="8748CF04-E8D3-4A2B-B3F5-22E50B3A8E49">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
InstallPrivileges="elevated" ReadOnly="yes"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<!--Add Cab1.cab File inside the Package-->
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
<!--Here We Install Our Main App-->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MY System Pvt Ltd"/>
</Directory>
<!-- Step 1: For the Program Menu -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="My System Pvt Ltd"/>
</Directory>
<!--Step 2:For Desktop Folder-->
<Directory Id="DesktopFolder"/>
<!--Step 3:For StartUp Folder-->
<Directory Id="StartupFolder"/>
</Directory>
<!--Step 4 :Add Main App exe-->
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="myapplication.exe" Guid="84C5B9E8-FD90-4EA8-A502-B08AC9B38D39">
<File Source="$(var.WpfApplication2.TargetPath)" Name="MYApp.exe"
Id="MyAppEXE" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- Step 1.1: Add the shortcut to your installer package Program Menu or Start Menu-->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="1A437020-D5C9-450C-9B3D-33957994780A">
<!--Add Shortcut of the Application in start Menu-->
<Shortcut Id="ApplicationStartMenuShortcut" Name="MyApp" Description="My Application Description"
Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER">
<!--Add Icon to the ShortCut-->
<Icon Id="MYPMenuIcon" SourceFile=".\Desktop.ico" />
</Shortcut>
<!--Remove the Folder At time of Uninstall-->
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!-- Step 2.1: Add the shortcut to your installer package For DeskTop-->
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDeskShortcutComp" Guid="40127963-856D-460D-9E1B-4C10EB65835B">
<Shortcut Id="ApplicationDeskShortcut" Name="MYAppDesk"
Description="My Application Description" Target="[INSTALLFOLDER]MyApp.exe"
WorkingDirectory="INSTALLFOLDER">
<Icon Id="MYDeskIcon" SourceFile=".\Desktop.ico" />
</Shortcut>
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!--Step 3.1: add Shortcut to StartUp Folder to run application when you login-->
<DirectoryRef Id="StartupFolder">
<Component Id="ApplicationStartUpShortcutComp" Guid="843B6A2E-AB61-40C7-BE49-FBCD7F81E35D">
<Shortcut Id="ApplicationStartUpDeskShortcut" Name="MYAppDesk" Description="My Application Description"
Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER">
<Icon Id="MyIconStartUp" SourceFile=".\Desktop.ico" />
</Shortcut>
<RemoveFolder Id="StartupFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]'
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<!--Add Component-->
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
<!--Step 1.2:Add Start menu or program Shortcut-->
<ComponentRef Id="ApplicationShortcut" />
<!--step 2.2Add DeskTop Shortcut-->
<ComponentRef Id="ApplicationDeskShortcutComp" />
<!--step 3.2Add DeskTop Shortcut-->
<ComponentRef Id="ApplicationStartUpShortcutComp"/>
<ComponentRef Id="dotNetClass.Output" />
<!--<ComponentRef Id="AU" />-->
</Feature>
</Product>
I kind of get where your coming from, I tried to link my Heat produced code to the product .wxs file.. What I did is, add the heat source code (.wxs) file to your project..
on the first Component group, Note down the name e.g
<ComponentGroup Id="SampleGroup">
Then in this section
<Feature Id="ProductFeature" Title="Random Desktop" Level="1">
<ComponentGroupRef Id="SampleGroup" />
</Feature>
</Product>
Make sure both names match, where it says "SampleGroup"

WiX 3.8; Desktop shortcut depending on chosen feature

I'm struggling on creating a desktop-shortcut depending on the chosen feature(s) within the WiX-Installer. If I run the installer, no shortcut is appearing. Is doesn't matter if only one feature is chosen or both. Are there any ideas out there?
<?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="XXX" Name="MyProduct" Language="1031" Codepage="1252" Version="4.4.0" Manufacturer="MyCompany" UpgradeCode="XXX">
<Package Description="MyProductDescription" Comments="someText" InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Languages="1031"/>
<Media Id="1" Cabinet="application.cab" EmbedCab="yes" CompressionLevel="high"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Name="LfF" Id="INSTALLDIR">
<Directory Id="BIN" Name="bin"/>
<Component Id="App1.exe" Directory="BIN" Guid="XXX">
<File Id="App1.exe" KeyPath="yes" Source="$(var.src)\App1.exe" />
</Component>
<wix:Component Id="DesktopShortcutApp1" Directory="DesktopFolder" Guid="" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:Shortcut Id="desktopShortcutApp1" Directory="DesktopFolder" Name="App1.exe" Target="[App1.exe]" WorkingDirectory="BIN" Icon="DesktopIconApp1.exe" IconIndex="0" />
<wix:RegistryValue Root="HKCU" Key="Software\[Manufacturer]\App1_Desktop_Shortcut" Name="installed" Type="integer" Value="1" />
</wix:Component>
<Component Id="App2.exe" Directory="BIN" Guid="XXX">
<File Id="App2.exe" KeyPath="yes" Source="$(var.src)\App2.exe" />
</Component>
<wix:Component Id="DesktopShortcutApp2" Directory="DesktopFolder" Guid="" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<wix:Shortcut Id="desktopShortcutApp2" Directory="DesktopFolder" Name="App2.exe" Target="[App2.exe]" WorkingDirectory="BIN" Icon="DesktopIconApp2.exe" IconIndex="0" />
<wix:RegistryValue Root="HKCU" Key="Software\[Manufacturer]\App2_Desktop_Shortcut" Name="installed" Type="integer" Value="1" />
</wix:Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder"/>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="MyProductName">
<Component Id="StartMenuShortcuts" Guid="XXX">
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value=""/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="App1" Level="1" Title="App1" TypicalDefault="advertise">
<ComponentRef Id="App1.exe" />
<ComponentRef Id="DesktopShortcutApp1" />
</Feature>
<Feature Id="App2" Level="1" Title="App2" TypicalDefault="advertise">
<ComponentRef Id="App2.exe" />
<ComponentRef Id="DesktopShortcutApp2"/>
</Feature>
<UI>
</UI>
<WixVariable Id="WixUIBannerBmp" Value="..\src\bannerapp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="..\src\dialogapp.bmp"/>
<UIRef Id="WixUI_FeatureTree_NoLicense"/>
<Icon Id="DesktopIconApp1.exe" SourceFile="$(var.src)\App1.exe"/>
<Icon Id="DesktopIconApp2.exe" SourceFile=".$(var.src)\App2.exe"/>
</Product>
The script is a shortened version of the original one. Content of the Directory Id="BIN" is generated through heat.exe and modified with xslt.
After a lot of try and error I've found a solution.
make the shortcut element to a child of the component containig the file element
make the icon element to a child of the shortcut element
set the Level="32767" and TypicalDefault="install" in each feature (which means: Do not install that feature)
During the setup process choose the feature(s) you want to install and only for this/these the desktopshortcut will be created.
And here is the code:
<?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="XXX" Name="MyProduct" Language="1031" Codepage="1252" Version="4.4.0" Manufacturer="MyCompany" UpgradeCode="XXX">
<Package Description="MyProductDescription" Comments="someText" InstallerVersion="400" Compressed="yes" InstallScope="perMachine" Languages="1031"/>
<Media Id="1" Cabinet="application.cab" EmbedCab="yes" CompressionLevel="high"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Name="LfF" Id="INSTALLDIR">
<Directory Id="BIN" Name="bin"/>
<Component Id="App1.exe" Directory="BIN" Guid="XXX">
<File Id="App1.exe" KeyPath="yes" Source="$(var.src)\App1.exe" />
<Shortcut Id="desktopShortcutApp1" Directory="DesktopFolder" Name="App1.exe" WorkingDirectory="BIN" Advertise="yes">
<Icon Id="DesktopApp1.ico" SourceFile="$(var.src)/App1.ico" />
</Shortcut>
</Component>
<Component Id="App2.exe" Directory="BIN" Guid="XXX">
<File Id="App2.exe" KeyPath="yes" Source="$(var.src)\App2.exe" />
<Shortcut Id="desktopShortcutApp2" Directory="DesktopFolder" Name="App2.exe" WorkingDirectory="BIN" Advertise="yes">
<Icon Id="DesktopApp2.ico" SourceFile="$(var.src)/App2.ico" />
</Shortcut>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder"/>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="MyProductName">
<Component Id="StartMenuShortcuts" Guid="XXX">
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value=""/>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="App1" Level="32767" Title="App1" TypicalDefault="install">
<ComponentRef Id="App1.exe" />
</Feature>
<Feature Id="App2" Level="32767" Title="App2" TypicalDefault="install">
<ComponentRef Id="App2.exe" />
</Feature>
<UI>
</UI>
<WixVariable Id="WixUIBannerBmp" Value="$(var.src)/bannerapp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="$(var.src)/dialogapp.bmp"/>
<UIRef Id="WixUI_FeatureTree_NoLicense"/>
</Product>
</Wix>

Wix will not touch AppData Folder During Install

So i've been working on this problem for days. My installer simply will not add anything into, or remove anything from, the roaming AppData folder in windows. I'm new to Wix and this is my first installer. The program is also shipped with a Bootstrapper which installs various prequisitaries and the .NET Framework. The code I have used is below.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="USBackup" Language="1033" Version="!(bind.fileVersion.USBackup.exe)" Manufacturer="Ed Rose" UpgradeCode="795ea019-054a-4f34-8c9a-cb4e607897c0">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Icon Id="icon.ico" SourceFile="..\USBackup\resources\usb.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<UIRef Id="WixUI_Minimal" />
<UIRef Id="WixUI_ErrorProgressText" />
<PropertyRef Id="NETFRAMEWORK45"/>
<Condition Message='This setup requires the .NET Framework 4.5 installed.'>
<![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>
<Feature Id="ProductFeature" Title="Setup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id='ProgramMenuDir' />
<ComponentRef Id='AppDataDir'/>
<ComponentRef Id='DevicesDir'/>
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="USBackup" />
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="USBackup">
<Component Id="ProgramMenuDir" Guid="{B01A59A5-ADA0-43FD-B14F-D479CD002E72}">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
<Directory Id="AppDataDir" Name="USBackup">
<Component Id="AppDataDir" Guid="{573BF504-1F52-40FE-A78A-96F43924379E}">
<RemoveFolder Id="AppDataDir" On="uninstall"/>
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
<Directory Id="DevicesDir" Name="Devices">
<Component Id="DevicesDir" Guid="{E145EA47-109F-42E7-ABAB-4E9A87FEC464}">
<RemoveFolder Id="DevicesDir" On="uninstall"/>
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Guid="{9D9BA12C-0859-46F0-B5E1-2A59BE96F83D}">
<File Source="$(var.USBackup.TargetPath)" KeyPath="yes">
<Shortcut Id="start" Directory="ProgramMenuDir" Name="USBackup" WorkingDirectory='INSTALLDIR' Icon="icon.ico" IconIndex="0" Advertise="yes" />
</File>
</Component>
<Component Guid="{6B473C52-6901-4FAC-A48B-20FC13A49C21}">
<File Source="..\USBackup\bin\Release\AutoUpdater.NET.dll" KeyPath="yes"/>
</Component>
<Component Guid="{6191F8CC-98A8-4424-A846-44DC1EB2A22C}">
<File Source="..\USBackup\bin\Release\USBackup.exe.config" KeyPath="yes"/>
</Component>
<Component Guid="{4E183A88-69DE-49D1-9142-13A2346443AF}">
<File Source="..\USBackup\bin\Release\USBackup.exe.manifest" KeyPath="yes"/>
</Component>
<!--Set to open on startup-->
<Component Id="RegistryKey" Guid="{8DBAB7DD-D9CD-4EC4-97F9-9A6131B40108}" Shared="yes">
<RegistryKey Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Run">
<RegistryValue Id="startupValue" Action="write" Name="USBackup" Value="[INSTALLFOLDER]USBackup.exe" Type="string"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
It builds with no errors or warnings. Why won't it touch the AppData Directory?
You have not given any reason for it to create it.
Include <CreateFolder/>, as such
<Component Id="AppDataDir" Guid="{573BF504-1F52-40FE-A78A-96F43924379E}">
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
<CreateFolder />
</Component>

A complete WiX 3.6 bundle example bootstrapping a .NET 4 Client Profile

I tried to construct a working example of a WiX 3.6 installation script. We currently use WiX 3.5 and now we would like to begin installing the .NET 4 Client Profile framework as a pre-requisite for our MSI file that our product.wxs script creates. WiX 3.6 seems like the best way forward.
Is there a functional example of how to do this with WiX 3.6?
Here is our 3.5 script we use today:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<!-- Version change handling -->
<?define UpgradeCode="###############################"?>
<?ifdef env.BUILD_NUMBER ?>
<?define ProductVersion="2.6.$(env.BUILD_NUMBER).0"?>
<?else ?>
<?define ProductVersion="2.6.0.0"?>
<?endif ?>
<Product Id="*" Name="###############################" Language="1033" Version="$(var.ProductVersion)" Manufacturer="###############################" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" />
<!-- Custom actions for this installer -->
<Binary Id="###############################.dll" SourceFile="..\..\Libraries\###############################.CA.dll" />
<!-- Kill ##### before installation begins -->
<CustomAction Id="Kill#####ActionId" BinaryKey="###############################.dll" DllEntry="Kill#####Action" Execute="immediate" Impersonate="yes" Return="check" />
<InstallExecuteSequence>
<Custom Action="Kill#####ActionId" Before="InstallInitialize" />
</InstallExecuteSequence>
<!-- ADD/REMOVE Programs icon -->
<Icon Id="##############.ico" SourceFile="D:\##############\Input_WIX\NonHeat\##############.exe" />
<Property Id="ARPPRODUCTICON" Value="##############.ico" />
<Property Id="ARPHELPLINK" Value="http://##############" />
<!-- EULA agreement -->
<WixVariable Id="WixUILicenseRtf" Value="D:\##############\Input_WIX\Heat\License.rtf" />
<!-- Installer images -->
<WixVariable Id="WixUIBannerBmp" Value="InstallerTopImage.rle" />
<WixVariable Id="WixUIDialogBmp" Value="InstallerSideImage.rle" />
<UIRef Id="WixUI_Minimal" />
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="1.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>
<!-- Require ##### to be installed -->
<Property Id="#####4.INSTALLPATH">
<RegistrySearch Id="RegistryFoundInstallPath" Key="SOFTWARE\McNeel\#####ceros\4.0" Root="HKLM" Name="InstallPath" Type="directory" />
</Property>
<Property Id="#####4.RECENT">
<RegistrySearch Id="RegistryFoundMostRecent" Key="SOFTWARE\McNeel\#####ceros\4.0" Root="HKLM" Name="MostRecent" Type="raw" />
</Property>
<Property Id="VRAYCOMMONDIR">
<RegistrySearch Id="ReigstryVRayCommon" Key="Software\ASGvis" Root="HKLM" Name="Common_dir" Type="raw" />
</Property>
<Condition Message="##### 4 required before install">
#####4.RECENT
</Condition>
<!-- Require administrator priveleges -->
<Condition Message="You need to be an administrator to install this product.">
Privileged</Condition>
<!-- Require .NET 3.5 SP1 to install -->
<PropertyRef Id="NETFRAMEWORK35_SP_LEVEL" />
<Condition Message='This setup requires the .NET Framework 3.5 with Service Pack 1 be installed.'>
<![CDATA[Installed OR (NETFRAMEWORK35_SP_LEVEL AND NETFRAMEWORK35_SP_LEVEL = "#1")]]>
</Condition>
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="#####4.INSTALLPATH">
<Directory Id="#####4.SYSTEM" Name="System"></Directory>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="##############"></Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="##############" />
</Directory>
</Directory>
<!-- Set FULL permissions to our shared folders -->
<Directory Id="CommonAppDataFolder">
<Directory Id="CommonApp##############" Name="##############">
<Directory Id="MODELLIBPATH" Name="##############">
<Component Id="##############UserPermissions" Guid="##############">
<CreateFolder>
<util:PermissionEx GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" User="Users" Domain="[MachineName]" />
</CreateFolder>
</Component>
</Directory>
<Directory Id="APPDATAPATH" Name="#####">
<Component Id="##############UserPermissions" Guid="FC4BF85F-E7A4-45DE-B25C-8F9419E75307">
<CreateFolder>
<util:PermissionEx GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" User="Users" Domain="[MachineName]" />
</CreateFolder>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="FontsFolder"></Directory>
<Component Id="##############RegistryKeys" Guid="17A55BEA-605D-425a-AAEE-F35EC8C1061E" DiskId="1" KeyPath="yes">
<RegistryValue Id="##############RegInstallDir" Root="HKLM" Key="Software\##############\##############" Name="InstallPath" Action="write" Type="string" Value="[INSTALLLOCATION]" />
<RegistryValue Id="##############RegLibraryPath" Root="HKLM" Key="Software\##############\##############" Name="LibraryPath" Action="write" Type="string" Value="[INSTALLLOCATION]Library" />
<RegistryValue Id="##############RegModelLibraryPath" Root="HKLM" Key="Software\##############\##############" Name="ModelLibraryPath" Action="write" Type="string" Value="[MODELLIBPATH]" />
<RegistryKey Id="##############Reg#####PluginKey" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\[#####4.RECENT]\Plug-ins\FCAF502A-1572-42a9-A2C3-F25D7953B1A5\PlugIn" Action="create" />
<RegistryValue Id="##############RegName#####4" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\[#####4.RECENT]\Plug-ins\FCAF502A-1572-42a9-A2C3-F25D7953B1A5" Name="Name" Action="write" Type="string" Value="##############Server" />
<RegistryValue Id="##############Reg#####4" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\[#####4.RECENT]\Plug-ins\FCAF502A-1572-42a9-A2C3-F25D7953B1A5" Name="FileName" Action="write" Type="string" Value="[INSTALLLOCATION]##############\##############Server.rhp" />
<RemoveRegistryKey Id="##############Skin" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\Scheme: ##############" Action="removeOnInstall" />
</Component>
<Component Id="VRayKeys" Guid="{96E9EBAC-48B4-4517-9409-F921BE92B3AA}" DiskId="1" KeyPath="yes" NeverOverwrite="yes">
<RegistryValue Id="VRayKey" Root="HKLM" Key="Software\##############\Data" Name="Data" Action="write" Type="string" Value="FFFAAA" />
</Component>
<Component Id="VRayRegistryKeys" Guid="{4D8815FA-85E2-421f-8BF9-F7F5A4133E96}" DiskId="1" KeyPath="yes" NeverOverwrite="yes" Permanent="yes">
<Condition>
NOT VRAYCOMMONDIR
</Condition>
<RegistryValue Root="HKLM" Key="Software\ASGvis" Name="common_dir" Action="write" Type="string" Value="[INSTALLLOCATION]VRay\ASGVIS" />
</Component>
</Directory>
<Feature Id="##############Features" Title="#####" Level="1">
<ComponentGroupRef Id="##############" />
<ComponentRef Id="##############LibraryUserPermissions" />
<ComponentRef Id="##############SharedUserPermissions" />
<ComponentRef Id="##############RegistryKeys" />
<ComponentRef Id="VRayRegistryKeys" />
<ComponentRef Id="VRayKeys" />
<ComponentRef Id="ProgramMenuShortcuts" />
<ComponentRef Id="#####App" />
<ComponentRef Id="WixShortCut" />
<ComponentRef Id="##############ShortCut" />
<ComponentRef Id="TroubleShortCut" />
<ComponentRef Id="DesktopShortcut" />
<ComponentRef Id="VRayAuth" />
<ComponentRef Id="Fonts" />
</Feature>
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
</InstallExecuteSequence>
<UI />
</Product>
<Fragment>
<Icon Id="ShortCutIcon" SourceFile="D:\##############Stage\Input_WIX\NonHeat\##############.exe" />
<Icon Id="TroubleShooterIcon" SourceFile="D:\##############Stage\Input_WIX\Heat\TroubleShooter\TroubleShooter.exe" />
<Icon Id="TeamViewerIcon" SourceFile="D:\##############Stage\Input_WIX\Heat\support.exe" />
<DirectoryRef Id="ProgramFilesFolder">
<Component Id="ProgramMenuShortcuts" Guid="881BD571-4FAF-4aa4-AB6E-15BB1629BE06">
<CreateFolder Directory="ProgramMenuDir" />
<RemoveFolder Id="RemoveMenuShortcuts" Directory="ProgramMenuDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\##############\##############ShortCut" Name="InstalledStartMenuShortcuts" Type="integer" Value="1" />
</Component>
</DirectoryRef>
<!-- This file is not Heat'ed, so we need this to install the executable -->
<DirectoryRef Id="INSTALLLOCATION" FileSource="Files">
<Component Id="##############App" Guid="FA41A015-7D80-4e50-A909-94BBA4D7546A">
<File Id="#####_Executable" Vital="yes" Source="D:\##############Stage\Input_WIX\NonHeat\##############.exe" />
</Component>
</DirectoryRef>
<DirectoryRef Id="INSTALLLOCATION" FileSource="Files">
<Component Id="WixShortCut" Guid="{8F2596B8-B7EC-4f40-AD64-DFC182A9353A}">
<RegistryKey Root="HKCU" Key="Software\##############\##############ShortCut" Action="create">
<RegistryValue Name="ShortCut" Value="1" Type="integer" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="ProgramMenuApplicationShortcut" Name="##############" Target="[###############_Executable]" Directory="ProgramMenuDir" Show="normal" Icon="ShortCutIcon" />
</Component>
</DirectoryRef>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="TroubleShortCut" Guid="{9E960528-8798-41DD-8DEE-9C3336CD3C88}">
<RegistryKey Root="HKCU" Key="Software\#####\#####ShortCut" Action="create">
<RegistryValue Name="ShortCut2" Value="1" Type="integer" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="TroubleshooterStartmenuShortcut" Name="Troubleshooter" Target="[INSTALLLOCATION]TroubleShooter\TroubleShooter.exe" Directory="ProgramMenuDir" Icon="TroubleShooterIcon" Show="normal"></Shortcut>
</Component>
</DirectoryRef>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="TeamViewerShortCut" Guid="{AD99CAC6-E485-444B-B075-2FD8BE4C87A8}">
<RegistryKey Root="HKCU" Key="Software\#####\#####ShortCut" Action="create">
<RegistryValue Name="ShortCut3" Value="1" Type="integer" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="TeamviewerStartmenuShortcut" Name="Remote Assistance" Target="[INSTALLLOCATION]support.exe" Directory="ProgramMenuDir" Icon="TeamViewerIcon" />
</Component>
</DirectoryRef>
<DirectoryRef Id="INSTALLLOCATION" FileSource="Files">
<Component Id="DesktopShortcut" Guid="{EA9632D1-08ED-4257-A78F-B2373A65A5CF}">
<RegistryKey Root="HKCU" Key="Software\#####\##############ShortCut" Action="createAndRemoveOnUninstall">
<RegistryValue Name="desktopShortcut" Value="1" Type="integer" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="#####" Icon="ShortCutIcon" Target="[######_Executable]" />
</Component>
</DirectoryRef>
<DirectoryRef Id="FontsFolder">
<Component Id="Fonts" Guid="{8C8EE16C-92B6-4926-A41C-55B79429071C}" NeverOverwrite="yes">
<File Id="bradley" Source="Fonts\bradhitc.ttf" TrueType="yes" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="#####4.SYSTEM">
<Component Id="VRayAuth" Guid="{ABED80D1-6EBA-48db-83E0-7CF48B0A55E8}">
<File Id="VRayAuthFile" KeyPath="yes" Source="..\..\Libraries\VRayAuth.dll" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
Heath Stewart's Introducing Managed Bootstrapper Applications provides a basic example in his blog.
You need to create a separate WiX bootstrapper project. See Building Installation Package Bundles in the WiX 3.6 documentation.
Once you have your bootstrapper, all you need to do is:
Add a reference to the file WixNetFxExtension.dll into your bootstrapper / managed bootstrapper application project.
Add the following as the first item in your chain.
<PackageGroupRef Id="NetFx40Web"/>
That's it. Further information and options are in the WixNetfxExtension documentation.