title: Use Wix installer to add shortcut to subfolder in startmenu programs
body: <p>I am trying to add my program shortcut to an existing folder in the start menu shortcuts. For example <code>All Programs -&gt; AppNameFolder -&gt; AppNameVersionFolder -&gt; AppShortcut</code></p>
  
  <p>In order to achieve this I added the extra lines:</p>
  
  <pre><code>          &lt;Directory Id="ProgramMenuFolderApp" Name="App"&gt;
                  &lt;Directory Id="ProgramMenuDir" Name="APP 6.3.0"&gt;
  </code></pre>
  
  <p>to the following code in my .wxs file:</p>
  
  <pre><code>    &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
          &lt;Directory Id="ProgramFilesFolder" Name="Program Files"&gt;
              &lt;Directory Id="CompanyName" Name="CompanyName"&gt;
                  &lt;Directory Id="App" Name="App"&gt;
                      &lt;Directory Id="INSTALLDIR" Name="App 6.3.0"&gt;
                          &lt;Component Id="MainExecutable" Guid="23FFE6FD-2BEA-4946-9875-8DBEEA5AAF55"&gt;
                              &lt;File Id="AppEXE" Name="App.exe" Source="App.exe" KeyPath="yes"&gt;
                                  &lt;Shortcut Id="startmenu" Directory="ProgramMenuDir" Name="App 6.3.0" WorkingDirectory='INSTALLDIR' Icon="App.exe" IconIndex="0" Advertise="yes" /&gt;
                                  &lt;Shortcut Id="desktopApp" Directory="DesktopFolder" Name="App 6.3.0" WorkingDirectory='INSTALLDIR' Icon="App.exe" IconIndex="0" Advertise="yes" /&gt;
                              &lt;/File&gt;
                          &lt;/Component&gt;
                      &lt;/Directory&gt;
                  &lt;/Directory&gt;
              &lt;/Directory&gt;
          &lt;/Directory&gt;
          &lt;Directory Id="ProgramMenuFolder" Name="Programs"&gt;
              &lt;Directory Id="ProgramMenuFolderApp" Name="App"&gt;
                  &lt;Directory Id="ProgramMenuDir" Name="App6.3.0"&gt;
                      &lt;Component Id="ProgramMenuDir" Guid="BF266F76-192A-493E-B5C7-C54660E61D7D"&gt;
                          &lt;RemoveFolder Id="ProgramMenuDir" On="uninstall" /&gt;
                          &lt;RegistryValue Root="HKCU" Key="Software\CompanyName\App6.3.0" Type="string" Value="" KeyPath="yes" /&gt;
                      &lt;/Component&gt;
                  &lt;/Directory&gt;
              &lt;/Directory&gt;            
          &lt;/Directory&gt;
          &lt;Directory Id="DesktopFolder" Name="Desktop" /&gt;
      &lt;/Directory&gt;
  </code></pre>
  
  <p>I get the following error when I try and build:</p>
  
  <p><code>The directory ProgramMenuFolderApp is in the user profile but is not listed in the RemoveFile table</code>.</p>
  
  <p>However, I do not want to remove the higher level folders when I uninstall, I only want to remove the App 6.3.0 folder and below.</p>
  
  <p>How can I add the shortcut to a program subfolder in the start menu?</p>