在 Windows7 上编写任意值对我来说效果很好。
我使用 NSIS,它不会自动填充这个值或写这个键或在这里做任何神奇的事情。但是您可以自己创建注册表项,并使用普通脚本命令自己将任何您想要的内容放入其中。
这是 NSIS *.nsi 脚本,抱歉,只有 3 行有效。我认为您不必了解 NSIS 就可以看到我只是在任意创建密钥并将我选择的值写入其中。我还可以告诉你,当我在那里输入错误的值时,它肯定会出现在添加/删除程序中,和我写的一样糟糕。(我一开始以为该值应该以字节为单位,所以,我的 3.2 MB 应用程序显示为 3.2 GB)
摘自 foo.nsi :
[...]
; ARP = just convenience variable to hold the long reg key path
!define ARP "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
[...]
; Specify a section ID like SEC_01, for obtaining its size in kilobytes later
Section "Install" SEC_01
; [...copy all files here, before SectionGetSize...]
; Obtain the size of the files, in kilobytes, in section SEC_01
SectionGetSize "${SEC_01}" $0
; Create/Write the reg key with the dword value
WriteRegDWORD HKLM "${ARP}" "EstimatedSize" "$0"
[...write the other keys in the same reg path...]
SectionEnd
[...]