Windows 安装程序检测:完整的关键字列表是什么?

Windows Installer Detection: What's the full list of keywords?

On Microsoft's website about UAC and in several existing answers and articles (like this one) 提到 Windows 的 Installer Detection 检查程序集的某些关键字以检测应用程序是否为安装程序:

Before a 32 bit process is created, the following attributes are checked to determine whether it is an installer:

  • Filename includes keywords like "install," "setup," "update," etc.

但是,我找不到这些关键字的完整列表。即使在微软的网站上也只提到“安装”、“设置”、“更新”等。那么“其他”是什么?

完整列表可能是故意未记录的,并且可能在 Windows 的所有版本中都不相同。它还可能包括 Microsoft 不想在 public.

中羞辱的 ISV

正如 MSDN 所说,文件名不是唯一的触发器,我知道 NSIS 安装程序是根据字节签名检测的。

处理此问题的正确方法是确保您的安装程序 Vista/UAC 兼容并将 requestedExecutionLevel 节点添加到您的清单中。

另一方面,如果您真的想触发检测,那么我假设您只需将关键字添加到您的版本资源或字符串 table...

可能您会发现最接近 "full list of keywords" 的方法是阅读位于 %windir%\AppPatch\sysmain.sdb 的 shim 数据库本身。 (可能还有同一文件夹中的其他 .sdb 个文件)。

sdb2xml utility seems to do a good job of parsing it. The XML output from the sysmain.sdb on my Windows 7 x64 system can be found here.

一个有用的起点是在文件中搜索字符串“GenericInstaller”。您会发现 <exe> 配置文件与文件名(“*instal*”、“*setup*”、“trustedinstaller.exe”等)、校验和、文件版本信息字符串(“ InstallShield*”、“RTPatch Executable”等)等各种属性。它有时甚至可以识别其他文件的存在,例如 "EULA.rtf".

要提取用于安装程序检测的文件名模式的完整列表有点困难,因为安装程序似乎有许多不同的分类("GenericInstaller"、"SpecificInstaller"、"MozillaFirefoxSetup", ETC。)。但我相信任何读到这里的人都能够通过在 XML.

中挖掘来找到他们需要的信息。