繁体   English   中英

如何让我的程序显示在应用程序和功能中?

[英]How do I make my program show up in apps and features?

我是 ac# 开发人员,我想知道如何让我的应用程序显示在 Windows 设置的应用程序和功能部分。

使用约翰吴所说的,我已经解决了这个问题。

此代码将一个程序条目添加到注册表中的“HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall”。

库: using Microsoft.Win32

主要代码:

RegistryKey software = Registry.LocalMachine.OpenSubKey("SOFTWARE");
RegistryKey microsoft = software.OpenSubKey("Microsoft");
RegistryKey windows = microsoft.OpenSubKey("Windows");
RegistryKey currentversion = windows.OpenSubKey("CurrentVersion");
RegistryKey uninstall = currentversion.OpenSubKey("Uninstall", true);
RegistryKey newappkey = uninstall.CreateSubKey("Enter the name of the program here");

newappkey.SetValue("DisplayIcon", "Path to the program or icon");
newappkey.SetValue("DisplayName", "Enter the name of the program here");
newappkey.SetValue("DisplayVersion", "1.0");
newappkey.SetValue("Publisher", "Leo"); 
newappkey.SetValue("UninstallString", "Path to the uninstaller");

//I don't know if this part is necessary but I included it anyway
newappkey.Close();  

我在其他程序中还发现了一些其他属性,您可以添加这些属性:

  • InstallLocation(字符串)- 主程序目录的路径。
  • ModifyPath(字符串)- 修饰符的路径(通常是带参数的卸载程序)。

阻止用户做他们所说的十六进制

  • NoModify - 0 或 1
  • NoRemove - 0 或 1
  • NoRepair - 0 或 1

估计尺寸

  • EstimatedSize(十六进制) - 转换为十六进制的程序目录的估计大小(以 KB 为单位)。 因此,例如,如果程序是 500 MB,那么这将是 500,000 KB,然后应将其转换为 0x0007a120,这将是注册表项的最终值。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM