简体   繁体   English

如何判断安装程序有卸载程序?

[英]How to tell that the Setup has an uninstaller?

I have made a small application without setup.我做了一个没有设置的小应用程序。 Just copy from A to B. Now I wanted to copy also a shortcut (lnk) file in the Windows system to have the application visible as uninstall-able.只需从 A 复制到 B。现在我还想复制 Windows 系统中的快捷方式 (lnk) 文件,以使应用程序可见为可卸载。 But when googling for keywords like "link shortcut uninstall windows" there are tonns of unneeded stuff.但是,当搜索“链接快捷方式卸载窗口”之类的关键字时,会有大量不需要的东西。

Can you provide me any link how to tell Windows the Icon and Application as uninstallable program?您能给我提供任何链接如何告诉 Windows 图标和应用程序作为可卸载程序吗?

Regards问候

PS: my question is NOT how to create an lnk file. PS:我的问题不是如何创建 lnk 文件。

I'm not sure if i understood your question, but you can add your program to the registry to make it appear in "Software" (Windows):我不确定我是否理解您的问题,但您可以将您的程序添加到注册表中,使其出现在“软件”(Windows)中:

Example:例子:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NameOfYourProgram]
"DisplayName"="NameOfYourProgram"
"UninstallString"="path/to/program/NameOfYourUninstaller.exe"

Replace NameOfYourProgram and path/to/program/NameOfYourUninstaller.exe to fit your needs, then save this as a.reg-file and double click it to add it to the registry.替换NameOfYourProgrampath/to/program/NameOfYourUninstaller.exe以满足您的需要,然后将其保存为 .reg 文件并双击它以将其添加到注册表。

DisplayName and UninstallString are required. DisplayNameUninstallString是必需的。

There are some more parameters, which are optional: http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs#Optional_values还有一些参数,可选: http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs#Optional_values

You can't turn a.lnk file into an install program with uninstall instructions.您不能将 .lnk 文件转换为带有卸载说明的安装程序。

You need to write a simple installer if you want the application to appear in Window's list of installed programs, and be available for uninstall.如果您希望应用程序出现在 Window 的已安装程序列表中并可供卸载,您需要编写一个简单的安装程序。 There are many very simple tools that will let you build an install package—you should use one of these.有许多非常简单的工具可以让您构建安装包——您应该使用其中之一。

In this case, you will need to provide an uninstaller program or script.在这种情况下,您需要提供卸载程序或脚本。 There's no way to tell the installer database "just delete those files".没有办法告诉安装程序数据库“只删除那些文件”。 In that case, you will have to have the user copy both the application and the uninstaller.在这种情况下,您必须让用户复制应用程序和卸载程序。 If they don't, they'll end up with an uninstaller entry that they can't use.如果他们不这样做,他们最终会得到一个他们无法使用的卸载程序条目。 For this reason, if you want an uninstaller, it's best to also use an installer.因此,如果您需要卸载程序,最好也使用安装程序。 Additionally, it's very rare for applications that you just copy wherever you want to come with uninstallers.此外,您只需将应用程序复制到您想随卸载程序一起提供的任何位置,这种情况非常少见。

(I suppose that maybe you could use your application run in a special mode as an uninstaller, but I would recommend against this.) (我想也许您可以使用在特殊模式下运行的应用程序作为卸载程序,但我建议您不要这样做。)

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

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