Wix set custom installation folder (not default Program Files INSTALLDIR) - wix

I´m using a Wix project to generate an installer MSI file.
My project needs to be installed in a specific folder (like C:\MyProject\Version1), not the default Program Files folder. My folder desired structure:
c:\MyProject\Version1
|
|--- MyProject.exe
|--- Utils.dll
|--- README.txt
|
|--- data
|----- config.ini
Here is my Wix configuration:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"><?define eMyProjectConnectionTest_TargetDir=$(var.eMyProjectConnectionTest.TargetDir)?><?define MyProject_TargetDir=$(var.MyProject.TargetDir)?><?define MyProjectCheckLicenses_TargetDir=$(var.MyProjectCheckLicenses.TargetDir)?>
<Product Id="1609421b-de6a-4285-b190-861ce626ab5e" Name="MyProject" Language="1033" Version="3.3.0" Manufacturer="MyProject Software LLC" UpgradeCode="f1fb7395-ff04-4eb9-942b-5c6ff889808c">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<!-- EmbedCab="yes" adds the CAB file to the instlal file -->
<MediaTemplate EmbedCab="yes"/>
<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"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
<Component Id="MyProject.exe" Guid="cbea4919-c7a7-4264-925f-7c7c58a952b3">
<File Id="MyProject.exe" Name="MyProject.exe" Source="$(var.MyProject_TargetDir)MyProject.exe" />
</Component>
<!-- Added files -->
<Component Id="Utils.dll" Guid="192fee52-79e1-43cb-81c8-b8af9d4d9ecc">
<File Id="Utils.dll" Source="Files/Utils.dll" KeyPath="yes"/>
</Component>
<Component Id="README.txt" Guid="c8c74065-5dd9-44d0-83ab-8838bea143e3">
<File Id="README.txt" Source="Files/README.txt" KeyPath="yes"/>
</Component>
</ComponentGroup>
<!-- Adds a start menu shortcut -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MyProject">
<Directory Id="data" Name="data">
<Component Id="config.ini" Guid="8f9ee1cf-6a8a-4cc7-8d40-47c337dd9ff2">
<File Id="config.ini" Source="Files/config.ini" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="MyProject"/>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
<Directory Id="ApplicationDesktopFolder" Name="MyProject"/>
</Directory>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="33776559-768b-4dbb-a924-984146edf8fb">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="MyProject"
Description="MyProject"
Target="[#MyProject.exe]"
WorkingDirectory="INSTALLFOLDER"/>
<RemoveFolder Id="CleanUpStartMenuShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\MyProject" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="09a53fb1-0447-4849-9bc4-3971f5fdbbad">
<Shortcut Id="ApplicationDesktopShortcut"
Name="MyProject"
Description="MyProject"
Target="[#MyProject.exe]"
WorkingDirectory="INSTALLFOLDER"/>
<RemoveFolder Id="CleanUpDesktopShortCut" Directory="ApplicationDesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\MyProject" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="ProductFeature" Title="MyProjectSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="config.ini"/>
<ComponentRef Id="ApplicationShortcut"/>
<ComponentRef Id="ApplicationShortcutDesktop"/>
</Feature>
</Product>
</Wix>

You need add the tag <Directory Id="INSTALLFOLDER"> outside of ProgramFilesFolder

Related

WIX copying files harvested by heat, but does not create cab file

Fairly new to Wix. I have a working msi, but instead of a cab file next to the msi file, I am just getting a folder. I have spent several days trying to figure out why it is not putting the files in a cab file but I am completely at a loss.
The msi file performs exactly as I expect, but distributing the msi alongside a folder is less desirable than just the msi.
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="[Name]" Language="1033" Manufacturer="[Manufacturer]" Version="2.0.30"
UpgradeCode="af66ae21-61e4-4926-954d-ee89acf95ab3">
<Package InstallerVersion="200"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [Name] is already installed." />
<MediaTemplate/>
<Feature Id="ProductFeature" Title="[Title]" Level="1">
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationShortcutDesktop" />
<ComponentGroupRef Id="WebApp" />
<ComponentGroupRef Id="ControlApp" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="ManufacturerName" Name="[Name]">
<Directory Id="INSTALLLOCATION" Name="[Name]" />
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="[Name]"/>
<Directory Id="DesktopFolder" Name="Desktop"></Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="844b584d-6d5f-4825-9541-c7caf74892fb">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="[Name]"
Description="[Name]"
Target="[INSTALLLOCATION]MyApp.exe"
WorkingDirectory="INSTALLLOCATION" />
<RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Name]" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="629d0ac6-8c63-4309-af33-975925584d1f">
<Shortcut Id="ApplicationDesktopShortcut"
Name="[Name]"
Description="[Name]"
Target="[INSTALLLOCATION]MyApp.exe"
WorkingDirectory="INSTALLLOCATION" />
<RemoveFolder Id="RemoveDesktopFolder" Directory="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Name]" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
Set the Package/#Compressed attribute to yes.

WiX - installer ignoring my "perUser" install scope. Why?

I'm trying to build a very simple installer that just installs the package as a "per-user" application. No dialogs, just always install into the local app data folder. And it's ignoring me. And always installing to C:\Program Files.
I've set the InstallScope to "perUser", but left the installation directory as "ProgramFilesFolder". The documentation seems to suggest that that SHOULD get redirected, but that isn't happening.
Setup file below...
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Name="MyApplication"
Language="1033"
Version="1.0.0"
Manufacturer="MyCompany"
UpgradeCode="19E4E10A-558C-4D4A-BD2A-D6B8060FB917">
<Package
InstallerVersion="500"
Compressed="yes"
InstallPrivileges="limited"
InstallScope="perUser" />
<MajorUpgrade
DowngradeErrorMessage="A newer version of MyApplication is already installed." />
<MediaTemplate
EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="MyCompany MyApplication">
<Directory Id="JreFolder" Name="jre"/>
<Directory Id="LibFolder" Name="lib"/>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="MyCompany MyApplication"/>
</Directory>
</Directory>
<DirectoryRef Id="INSTALLDIR">
<Component Id="CMP_MyApplication.exe">
<File Id="FILE_MyApplication.exe" Source="MyApplication.exe" KeyPath="yes"/>
</Component>
<Component Id="CMP_MyApplication.ini">
<File Id="FILE_MyApplication.l4j.ini" Source="MyApplication.l4j.ini" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="CMP_StartMenuShortcut" Guid="0B96A876-70FB-4E8E-8D27-B9B1E40C9B4D">
<Shortcut Id="ApplicationStartMenuShortcut" Name="MyCompany MyApplication" Description="MyCompany MyApplication"
Target="[#FILE_MyApplication.exe]" WorkingDirectory="INSTALLDIR"/>
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\MyCompany\MyApplication" Name="Installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1" >
<ComponentGroupRef Id="JreGroup"/>
<ComponentGroupRef Id="LibGroup"/>
<ComponentRef Id="CMP_MyApplication.exe"/>
<ComponentRef Id="CMP_MyApplication.ini"/>
<ComponentRef Id="CMP_StartMenuShortcut"/>
</Feature>
</Product>
</Wix>
If you know that you want to install to the app data folder why use the 'ProgramFilesFolder'?
This will only confuse you (or any other person that will maintain your code) - try using the 'AppDataFolder' instead.

Windows installer XML doesn't copy assemblies into the installer

I have trouble with my installer file. The installer does build without any error but when I try to install it on another computer (which obvious doesn't have have the required assemblies) I am getting an error which says that the assembly couldn't be found. Do I miss something obvious?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Recap" Language="1033" Version="1.0.0.0" Manufacturer="Lavahayn Technology" UpgradeCode="6824BC1E-B8AD-4EE0-B3F7-B3E84859B9F9">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_InstallDir" />
<Feature Id="ProductFeature" Title="Recap" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ApplicationShortcuts"/>
<ComponentRef Id="UninstallerShortCut" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="Company" Name="Lavahayn Technology" >
<Directory Id="INSTALLFOLDER" Name="Recap" >
<Component Id="UninstallerShortCut" Guid="3AE87174-A4B1-4887-8D23-5CC651B0CED8">
<Shortcut Id="UninstallProduct2"
Name="Uninstall"
Description="Removes Recap from your computer"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="INSTALLFOLDER" On="uninstall"/>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuSubfolder" Name="Lavahayn Technology">
<Component Id="ApplicationShortcuts" Guid="432BC349-14B9-4224-B226-A0C55B25498A">
<Shortcut Id="RecapShortcut" Name="Recap" Description="Lavahayn Technology Recap"
Target="[INSTALLDIR]LavahaynTechnology.Launcher.exe" WorkingDirectory="INSTALLDIR"/>
<RegistryValue Root="HKCU" Key="Software\LavahaynTechnology\Recap"
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall"
Description="Removes Recap from your computer"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
</Component>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="LavahaynTechnology.CsharpRecap.exe" Guid="1006A341-572D-45D7-9C0E-6F199C1CF0F5">
<File Id="LavahaynTechnology.CsharpRecap.exe" Source="$(var.CsharpRecap.TargetDir)CsharpRecap.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="LavahaynTechnology.Database.dll" Guid="872452AA-7075-450B-A28F-90252E9DBB6F">
<File Id="LavahaynTechnology.Database.dll" Source="$(var.LavahaynTechnology.Database.TargetDir)LavahaynTechnology.Database.dll" KeyPath="yes" Assembly=".net"/>
</Component>
<Component Id="LavahaynTechnology.Launcher.exe" Guid="C0FEB7B4-87BF-4120-A40C-A5849B84F6DA">
<File Id="LavahaynTechnology.Launcher.exe" Source="$(var.LavahaynTechnology.Launcher.TargetDir)LavahaynTechnology.Launcher.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="LavahaynTechnology.SDK.dll" Guid="55A6AEDA-162D-4BB7-9F7E-0BFBCB738402">
<File Id="LavahaynTechnology.SDK.dll" Source="$(var.LavahaynTechnology.SDK.TargetDir)LavahaynTechnology.SDK.dll" KeyPath="yes" Assembly=".net" />
</Component>
<Component Id="LavahaynTechnology.ObjectBase.dll" Guid="259F7357-D000-4B97-BA29-F11A176319CB">
<File Id="LavahaynTechnology.ObjectBase.dll" Source="$(var.LavahaynTechnology.ObjectBase.TargetDir)LavahaynTechnology.ObjectBase.dll" KeyPath="yes" Assembly=".net" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Error Message

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"

Folder within Program Menu Folder for WiX 3

Following some example code on the net, I got my first WiX installer to work. However, it placed my program menu shortcut directly on Program Menus. I really want to create a folder, Sample, in Program Menus for my link.
Original Code:
<Shortcut Id="startmenuSample" Directory="ProgramMenuFolder" Name="Sample 0.5"
WorkingDirectory='INSTALLDIR' Icon="Sample.exe" IconIndex="0" Advertise="yes">
Attempt at modifying code (fails with compiler error):
<Shortcut Id="startmenuSample" Directory="ProgramMenuFolder\Sample" Name="Sample 0.5"
WorkingDirectory='INSTALLDIR' Icon="Sample.exe" IconIndex="0" Advertise="yes">
Note the addition of \Sample.
How do I go about adding that link to a new folder in the Program Menu?
This is a sample test I did, when I was asked to do the same thing
<Package InstallerVersion="200" Compressed="yes" />
<WixVariable Id="Manufacturer" Value="StackOverFlowHelper"/>
<WixVariable Id="ShortProduct" Value="ShortCuts"/>
<Media Id="1" Cabinet="WixShortCut.cab" EmbedCab="yes" />
<Icon Id="ShortCutIcon" SourceFile="YOUR.ico"/>
<!-- The icon that appears in Add & Remove Programs. -->
<Property Id="ARPPRODUCTICON" Value="ShortCutIcon" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ManufacturerFolder" Name="!(wix.Manufacturer)">
<Directory Id="INSTALLLOCATION" Name="!(wix.ShortProduct)">
<Component Id="ProductComponent" Guid="{YOUR_GUID}" KeyPath="yes">
<CreateFolder/>
</Component>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuManufacturer" Name="!(wix.ShortProduct)" />
</Directory>
</Directory>
</Directory>
<DirectoryRef Id="ProgramFilesFolder">
<Component Id="ProgramMenuShortcuts" Guid="{YOUR_GUID}">
<CreateFolder Directory="ProgramMenuManufacturer"/>
<RemoveFolder Id="RemoveMenuShortcuts" Directory="ProgramMenuManufacturer" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\!(wix.Manufacturer)\!(wix.ShortProduct)" Name="InstalledStartMenuShortcuts" Type="integer" Value="1" />
</Component>
</DirectoryRef>
<DirectoryRef Id="INSTALLLOCATION" FileSource="Files">
<Component Id="WixShortCut" Guid="{YOUR_GUID}">
<File Id="Test.ShortCut" Vital="yes" Name="A_DOC.pdf" />
<CreateFolder />
<RegistryKey Root="HKCU" Key="Software\!(wix.Manufacturer)\!(wix.ShortProduct)" Action="createAndRemoveOnUninstall">
<RegistryValue Name="ShortCut" Value="1" Type="integer" KeyPath="yes"/>
</RegistryKey>
<!-- Shortcut in Start menu. -->
<Shortcut Id="ProgramMenuApplicationShortcut" Name="!(wix.ShortProduct)" Target="[#Test.ShortCut]"
Directory="ProgramMenuManufacturer" Show="normal" Icon="ShortCutIcon"/>
</Component>
</DirectoryRef>
<Feature Id="ProductFeature" Title="WixShortCuts" Level="1">
<ComponentRef Id="ProductComponent"/>
<ComponentRef Id="ProgramMenuShortcuts"/>
<ComponentRef Id="WixShortCut"/>
</Feature>
In Windows Installer you need to create a new directory under ProgramMenuFolder and then reference it.
<Directory Id="ProgramMenuFolder" >
<Directory Id="ProgramMenuDir" Name='My Folder'>
</Directory>
</Directory>
<Shortcut Id="startmenuSample" Directory="ProgramMenuFolder" Name="Sample 0.5"
WorkingDirectory='INSTALLDIR' Icon="Sample.exe" IconIndex="0" Advertise="yes">