禁止显示有关自定义安装程序中下载的可执行文件的警告消息
我们正在为我们的软件编写一个自定义安装程序。此安装程序将执行通过网络或 USB 磁盘传输的其他几个安装程序。当在自己的进程中执行这些安装程序时,我们会收到 Windows 警告,指出这些安装程序可能不安全。有没有办法抑制此类消息?
We are writing a custom installer for our software. This installer will execute several other installer that are either transferred over the network or on a usb disk. When executing these in their own process we get Windows warnings that these installers might not be safe. Is there a way to suppress this type of messages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您使用的 API,文件可能会获取指示文件来自的“区域”的备用数据流。根据所在区域以及计算机上的安全设置,系统可能会提示您允许该文件执行。我不知道在哪里或是否有正式记录,但备用数据流的名称是“Zone.Identifier”;我确信谷歌搜索会发现有趣的东西。我认为在执行文件之前简单地删除备用数据流就足够了。
Depending on what APIs you are using, the file may get an alternate data stream that indicates the "zone" the file came from. Depending on what zone it is and on the security settings on your machine, you may be prompted to allow the file to execute. I don't know where or if this is officially documented, but the name of the alternate data stream is "Zone.Identifier"; I'm sure a Google search would find interesting things. I think it would be enough to simply delete the alternate data stream before executing the file.
这些警告消息的目的是避免意外执行来自不受信任来源的软件。
如果有办法绕过这些对话框,您不认为恶意软件程序员已经会使用它们了吗?
在您的情况下,由于您已经代表用户执行,因此将文件复制到本地磁盘并从那里执行它们,这应该可行。
The point of these warning messages is to avoid accidentally executing software from an untrusted source.
If there is a way to circumvent these dialogs, don't you think malware programmers would use them already?
In your case, since you're already executing on the behalf of the user, copy the files onto the local disk and execute them from there, that should work.