我正在为我的应用程序创建一些自定义设置,并在VB.NET中编写它。我没有使用安装程序创建者(例如InnoSetup或其他东西),因为我需要从云中下载应用程序文件,老实说,我不喜欢默认安装程序的布局。
我的问题是:如何注册应用程序,以便使其在“控制面板”中显示?我尝试在以下文件夹中创建一个子项:HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall {FA82A5DD-E444-430F-9D60-10D20F5A8E4B},但没有任何显示。我的代码是这样的:
Dim Key As RegistryKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FA82A5DD-E444-430F-9D60-10D20F5A8E4B}")
Key.SetValue("AuthorizedCDFPrefix", "", RegistryValueKind.String)
Key.SetValue("Comments", "", RegistryValueKind.String)
Key.SetValue("Contact", "http://www.hssc.com/jump", RegistryValueKind.String)
Key.SetValue("DisplayName", "Jump 2015 Edition", RegistryValueKind.String)
Key.SetValue("DisplayVersion", "5.0.0.0", RegistryValueKind.String)
Key.SetValue("EstimatedSize", 10485760, RegistryValueKind.DWord)
Key.SetValue("HelpLink", "http://www.hssc.com/jump")
Key.SetValue("HelpTelephone", "", RegistryValueKind.String)
Key.SetValue("InstallDate", String.Format("{0:yyyyddMM}", Now.Date), RegistryValueKind.String)
Key.SetValue("InstallLocation", "", RegistryValueKind.String)
Key.SetValue("InstallSource", "", RegistryValueKind.String)
Key.SetValue("Language", 1044, RegistryValueKind.DWord)
Key.SetValue("ModifyPath", "MsiExec.exe /I{FA82A5DD-E444-430F-9D60-10D20F5A8E4B}", RegistryValueKind.String)
Key.SetValue("Publisher", "HSSC", RegistryValueKind.String)
Key.SetValue("Readme", "", RegistryValueKind.String)
Key.SetValue("Size", "", RegistryValueKind.String)
Key.SetValue("SystemComponent", 1, RegistryValueKind.DWord)
Key.SetValue("UninstallString", "MsiExec.exe /I{FA82A5DD-E444-430F-9D60-10D20F5A8E4B}")
Key.SetValue("URLInfoAbout", "http://www.hssc.com/jump", RegistryValueKind.String)
Key.SetValue("URLUpdateInfo", "", RegistryValueKind.String)
Key.SetValue("VersionMajor", 5, RegistryValueKind.DWord)
Key.SetValue("VersionMinor", 0, RegistryValueKind.DWord)
我也尝试过这个:
Dim KeyApp As RegistryKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\jump.exe")
KeyApp.SetValue("", Path.Combine(InstallLocation, "jump.exe"), RegistryValueKind.String)
KeyApp.SetValue("Path", InstallLocation, RegistryValueKind.String)
但是它们都不起作用。该应用程序已下载到“程序文件夹”中,但未显示在CP中。我的应用程序具有管理权限,并且正在WinForms,Visual Studio 2013中工作。
谢谢,
F怀特
您已将软件标记为系统组件("SystemComponent" = dword:00000001"
),这意味着它应显示在“添加/删除Windows组件”中。因此,只需将SystemComponent设置为0或将其删除即可。那应该做。:)
您缺少“ DisplayIcon”值。如果需要,这是WinRar子项的示例:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinRar archiver]
"DisplayName"="WinRar 5.10 (64-bit)"
"DisplayVersion"="5.10.0"
"VersionMajor"=dword:00000005
"VersionMinor"=dword:0000000a
"UninstallString"="G:\\Program Files\\WinRAR\\uninstall.exe"
"DisplayIcon"="G:\\Program Files\\WinRAR\\WinRAR.exe"
"InstallLocation"="G:\\Program Files\\WinRAR\\"
"NoModify"=dword:00000001
"NoRepair"=dword:00000001
"Language"=dword:00000000
"Publisher"="win.rar GmbH"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句