简体   繁体   English

安装/部署项目:防止在卸载时删除已修改的文件

[英]Setup/Deployment project: Prevent modified files from being removed when uninstalling

I have a setup project. 我有一个安装项目。 If the user modifies one of the installed files and then un-installs the application, I'd like the file to NOT get deleted by the uninstall (so that when the user re-installs later, the modified file is used rather than the default one that the installer would normally use). 如果用户修改了其中一个已安装的文件然后卸载了该应用程序,我希望该文件不会被卸载删除(这样当用户以后重新安装时,会使用修改后的文件而不是默认文件安装人员通常会使用的一个)。 Is this at all possible? 这是可能吗?

Note: Files which have not been edited should be applicable for upgrades/removal. 注意:尚未编辑的文件应适用于升级/删除。

To prevent uninstall you should mark the files' component as Permanent 要防止卸载,您应将文件的组件标记为永久

http://msdn.microsoft.com/en-us/library/windows/desktop/aa368007(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/aa368007(v=vs.85).aspx

由于在卸载时无法阻止安装项目删除已修改的文件,因此我发现的最佳方法(如Ciprian所述)是创建一个自定义操作,在卸载之前备份修改后的文件,并在另一个自定义中恢复它们之后的行动。

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

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