每个组件一个文件还是每个组件多个文件? [英] One file per component or several files per component?

查看:25
本文介绍了每个组件一个文件还是每个组件多个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否应该将要安装的所有文件打包到单个组件中?将多个文件放在一个组件中有什么好处?

Should I wrap all the files I want to install in individual components? What is the advantage of putting several files in one component?

推荐答案

每个组件一个文件"的一个原因是 弹性.当应用程序启动时,Windows Installer 可以检查任何组件的keypath不见了.如果缺少密钥路径,则重新安装/修复组件.

One reason for "one file per component" is resiliency. When an application is started, Windows Installer can check whether the keypath of any component is missing. If the keypath is missing, the component is reinstalled/repaired.

如果一个组件有多个文件,那么只有一个文件可以作为keypath.在 wix 中,您通过在 File<上设置 KeyPath=yes 来表明这一点/a> 元素.其他文件将不会受到 Windows Installer 弹性的完全保护.只有当密钥路径文件丢失时才会重新安装它们.

If a component has multiple files, then only one file can be the keypath. In wix you indicate this by setting KeyPath=yes on a File element. The other files will then not be fully protected by Windows Installer resiliency. They will only be reinstalled if the keypath file goes missing.

每个组件一个文件"的另一个原因是将文件安装到它们可能已经存在的位置时(例如应用程序升级,或安装到 c:\windows\system32).Windows 安装程序通过检查密钥路径来确定是否需要安装组件.如果密钥路径是一个文件并且该文件已经存在(具有相同版本或更高版本),则该组件安装.如果组件中的其他文件确实需要安装/升级,那就有问题了.

Another reason to have "one file per component" is when installing files to locations where they may already be present (e.g. an application upgrade, or when installing to c:\windows\system32). Windows installer determines whether a component needs to be installed by checking the keypath. If the keypath is a file and the file is already there (with the same version or higher) then the component is not installed. That's a problem if the other files in the component actually needed to be installed/upgraded.

这篇关于每个组件一个文件还是每个组件多个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆