How to install Start-Menu items in addition to Desktop icon ?

Nov 28, 2016 at 1:00 AM
Hi, I am trying to follow the examples to accomplish a simple setup and am hashing about in confusion over something.

I want the installer to insert into the Start Menu, within the folder for My Company, a simple shortcut to run my program. This is addition to installing also a shortcut onto the Desktop (which is working, thanks).

I see your sample "ShortCut" but I don't want an entry for Samples, nor for un-install. Just a simple program-launcher.

Here is what I have at this moment...
           var project = new Project("DesignForge ImageVUr",
                                      new Dir(@"C:\Program Files\DesignForge\ImageVUr",
                                              //new Dir( @"%ProgramFiles%\My Company\My Product",
                                              new Files(@"Files\Bin\*.*", f => !f.EndsWith(".exe")),
                                              new File(@"Files\Docs\Manual.txt"),
                                              new File(@"Files\Bin\ImageVUr.exe",
                                                       new FileShortcut("ImageVUr", "INSTALLDIR"), //INSTALLDIR is the ID of "%ProgramFiles%\My Company\My Product" 
                                                       new FileShortcut("ImageVUr", @"%Desktop%") {IconFile = @"Files\Bin\App.ico", WorkingDirectory = "%Temp%"})),

                                      new Dir(@"%ProgramMenu%\DesignForge",
                                              new ExeFileShortcut("ImageVUr", "INSTALLDIR", "")));

"DesignForge" is the name for My Company, and "ImageURr" is My Program.

It is creating the folder "DesignForge", however it is empty. No program-shortcut within it.

Q: What is the purpose of project.UI = WUI.WixUI_InstallDir; ?

Q: What is the difference between a FileShortcut and a ExeFileShortcut ?


Thank you for your help!

sincerely,

James W. Hurst
e-mail: JamesH@Designforge.com
Coordinator
Nov 28, 2016 at 10:12 AM
Hi James,

It's hard for me to comment details of your code. I think you can get all your answers from the Samples\Shortcuts sample. It does exactly what you need.

>FileShortcut and a ExeFileShortcut
They are two different beasts.
FileShortcut is a definition of the shortcut associated with the installed file. Thus it can only have WixSharp.File as a parent. But ExeFileShortcut is a stand alone shortcut to any exe file on the system and it should be a child of WixSharp.Dir.
Unfortunately having a Wix# entity with a generic transparent interface for both cases is close to impossible. Despite reserving the same XML element Shortcut both use cases use completely different set of attributes so two different classes serving the use-case.

> project.UI = WUI.WixUI_InstallDir;
Project.UI defines the type of the MSI User Interface. This value is assigned to the UIRef WiX element during the compilation. And WUI is the enum defining supported types of native MSI UI.