源文件 X 是否在 c# 中的 Windows 系统文件保护下?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1321205/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:01:45  来源:igfitidea点击:

Source file X is under Windows System File Protection in c#?

c#windowsinstaller

提问by Partha

I got an error during creating a installer for my web application(c#). The error is

在为我的 Web 应用程序 (c#) 创建安装程序时出错。错误是

Error 19 'msado20.tlb' should be excluded because its source file 'C:\Program Files\Common Files\system\ado\msado20.tlb' is under Windows System File Protection.

应排除错误 19 'msado20.tlb',因为其源文件 'C:\Program Files\Common Files\system\ado\msado20.tlb' 受 Windows 系统文件保护。

what does mean?

这是什么意思?

回答by RRUZ

You need to exclude the file from the installer.

您需要从安装程序中排除该文件。

From MSDN

来自 MSDN

The specified file is a protected system file on Windows 2000, Windows XP, and Windows Server 2003. Protected system files are usually installed via operating-system service packs or separate setup packages, such as Windows Media Player or Internet Explorer. Including this file in an installer may cause instability if installed on operating systems that do not support protected system files. For example, by installing a component such as stdole.tlb outside of the System folder and registering it, you will overwrite the registration for the component under system-file protection. When your application is uninstalled, the component installed by the application is removed and the component under system file protection is left in an unregistered state.

指定的文件是 Windows 2000、Windows XP 和 Windows Server 2003 上的受保护系统文件。受保护的系统文件通常通过操作系统服务包或单独的安装包(如 Windows Media Player 或 Internet Explorer)安装。如果安装在不支持受保护系统文件的操作系统上,在安装程序中包含此文件可能会导致不稳定。例如,通过在 System 文件夹外安装 stdole.tlb 等组件并注册它,您将覆盖系统文件保护下组件的注册。当您的应用程序被卸载时,应用程序安装的组件将被删除,系统文件保护下的组件将处于未注册状态。

Bye.

再见。

回答by andynormancx

Windows File Protection system stops important system files from getting over written. You installer doesn't want to be installing files like this.

Windows 文件保护系统阻止重要的系统文件被覆盖。您的安装程序不想安装这样的文件。

It looks like the file in question is part of Microsoft ADO. So rather than installing this file via your installer you need to make it requirement that the version of ADO that your application needs is installed.

看起来有问题的文件是 Microsoft ADO 的一部分。因此,与其通过安装程序安装此文件,不如要求安装应用程序所需的 ADO 版本。