简体   繁体   English

Winforms 应用程序(.NET 框架)的 C# 安装项目不创建开始菜单公司目录

[英]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.我有两个版本的使用 VS2019 构建的 Winforms 项目。 "AppNetCore" is written using the Windows Forms App template, "AppNetFramework" with the Windows Forms App (.NET Framework) template. “AppNetCore”是使用 Windows Forms App 模板编写的,“AppNetFramework”是使用 Windows Forms App (.NET Framework) 模板编写的。 Other than .NET framework v4.8 vs .NET Core 5.0, they are the same.除了 .NET framework v4.8 与 .NET Core 5.0 之外,它们是相同的。

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.当我为每个应用程序创建一个安装项目时,我将一个名为 AppFirm 的文件夹添加到目标机器上文件系统的“用户程序菜单”中。 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.然后,我创建主输出(.NET Framework 4.8 版本)或发布项(.NET Core 版本)的快捷方式,并将其移动到 AppFirm 文件夹并构建安装项目。

I build the .NET Framework version first and run the Install from the IDE.我首先构建 .NET Framework 版本并从 IDE 运行安装。 It creates an AppNetFramework Icon in the start menu under the 'A' section.它在“A”部分下的开始菜单中创建一个 AppNetFramework 图标。 It does not create an AppFirm folder!它不会创建 AppFirm 文件夹!

Next, I build "AppNetCore" and run its Install from the IDE.接下来,我构建“AppNetCore”并从 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!它在“A”部分下的开始菜单中创建一个 AppFirm 文件夹,该文件夹包含“AppNetCore”程序图标和“AppNetFramework”图标! The "AppNetFramework" icon is no longer at the start menu level. “AppNetFramework”图标不再位于开始菜单级别。

I want the company folder, but I don't want to rewrite my app for .NETCore (the preceding was just a test vehicle).我想要公司文件夹,但我不想为 .NETCore 重写我的应用程序(前面只是一个测试工具)。 Anybody know how to get the company folder when installing a .NET framework app?有人知道在安装 .NET 框架应用程序时如何获取公司文件夹吗?

Thanks, Lee谢谢,李

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.经过大量的网络搜索,我发现有人提到在Windows11(这是我碰巧正在使用的)中,微软正在努力变得聪明。 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)现在我在开始菜单和两个应用程序中都得到了文件夹(但不是第二个快捷方式或 doc 文件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用数据库项目创建 c# 应用程序设置 - Create c# app setup with database project 修复 WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version C# Setup Project - Fix the WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version C# Setup Project Windows安装项目问题(C#,Winforms) - Problem with windows setup project (c#, winforms) 使用安装项目安装后,C#Winforms应用程序无法启动 - C# Winforms application fails to start up after installing it using Setup Project 在VS2013 Professional for C#WinForms应用程序上使用Visual Studio Installer。 使用.NET Framework安装创建安装 - Using Visual Studio Installer on VS2013 Professional for C# WinForms app. create Installation with .NET Framework installation included C#Winforms .NET框架数据处理 - C# Winforms .NET framework Data Processing 在c#winforms应用程序中显示窗口(文件/目录)上下文菜单 - Showing windows (file/directory) context menu in c# winforms application .NET / C#库项目实体框架app.config - .NET/C# library project entity framework app.config C#MVVM WPF创建安装项目 - C# MVVM WPF Create setup project 如何在 WinForms 和 C# 中创建下拉菜单 - How to create a drop down menu in WinForms and C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM