'C# Setup Project for winforms app (.NET Framework) does not create start menu company directory

I have two versions of a Winforms project built using VS2019. "AppNetCore" is written using the Windows Forms App template, "AppNetFramework" with the Windows Forms App (.NET Framework) template. Other than .NET framework v4.8 vs .NET Core 5.0, they are the same.

When I create a setup project for each of the apps, I add a folder called AppFirm to the "User's Programs Menu" of the File System on Target Machine. I then create a shortcut to the Primary Output (.NET Framework 4.8 version) or Publish Items (the .NET Core version) and move it to the the AppFirm folder and build the setup project.

I build the .NET Framework version first and run the Install from the IDE. It creates an AppNetFramework Icon in the start menu under the 'A' section. It does not create an AppFirm folder!

Next, I build "AppNetCore" and run its Install from the IDE. It creates an AppFirm folder in the start menu under the 'A' section, and the folder contains the "AppNetCore" program icon AND the "AppNetFramework" icon! The "AppNetFramework" icon is no longer at the start menu level.

I want the company folder, but I don't want to rewrite my app for .NETCore (the preceding was just a test vehicle). Anybody know how to get the company folder when installing a .NET framework app?

Thanks, Lee



Solution 1:[1]

Wow. After much net searching, I found someone who mentioned that in Windows11 (which is what I happen to be using), Microsoft is trying to be clever. If only one app is installed in a single 'company' directory (actually just one level down) on the start menu, it doesn't bother displaying the folder, and places the app directly on the menu (alphabetically, of course). The folder still exists, it just isn't shown in the start menu.

Trying to be clever myself, I made two copies of the app shortcut and placed them both in the company folder. No go. Not only is the folder not displayed, but only one app is added to the start menu! It also seems that it won't let me add a document file to the folder to force a folder display. The folder is still not displayed.

Finally, I created a second dummy project and included it in the setup. Now I get the folder in the start menu and both apps (but NOT the second shortcut or the doc file)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Digilee