Wix# create shortcut in common startup folder using C# not XML
<p>I am trying to create a shortcut in the common startup folder so when any user logs on my application is run. I am using the nuget package WinSharp version 1.0.36.2 to create an MSI installer.</p>

<p>Below is my Main from the WinSharp project. The idea is to install the app to program files and create a shortcut in the startup folder (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp). The commented out line that creates a shortcut on the desktop works fine. Building the current version gives the error: </p>

<blockquote>
  <p>Error     ICE38: Component StartupFolder.EmptyDirectory installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.</p>
</blockquote>

<p>Is there a different directory Id like Desktop that will work for the startup folder?</p>

<pre><code>var project = new ManagedProject("Plate Synthesis Listener Setup",
new Dir(@"%ProgramFiles%\myCompany/myApp",
    new File(@"..\myApp\bin\Debug\myApp.exe")
    {
        //Shortcuts = new[] {new FileShortcut("myApp", "%Desktop%")}
        Shortcuts = new[] {new FileShortcut("myApp", "StartupFolder")}
    },
    new Files(@"..\myApp\bin\Debug\*.dll"),
    new File(@"..\myApp\bin\Debug\myApp.exe.config")
    {
        GUID = new Guid("My new GUID"),
        ManagedUI = ManagedUI.Empty,
        Version = new Version(1, 0, 1)
    };

    project.ManagedUI.InstallDialogs.Add(Dialogs.Welcome)
           .Add(Dialogs.Progress)
           .Add(Dialogs.Exit);

    project.BuildMsi();
</code></pre>

<p>Other threads I have seen but are for XML not C#:</p>

<p><a href="https://stackoverflow.com/questions/37034783/wix-create-shortcut-in-user-startup-folder">Wix create shortcut in user startup folder</a></p>

<p><a href="https://stackoverflow.com/questions/28305179/how-to-making-a-program-start-on-windows-startup-with-wix-toolset">How to : Making a program start on Windows startup with wix toolset?</a></p>