简体   繁体   English

WiX:如果先前已安装,则强制安装程序重新安装文件

[英]WiX: Force installer to reinstall files if previously installed

So we have MSI that installs a patch consisting of two files and a registry entyry. 因此,我们有MSI,它安装了由两个文件和注册表项组成的补丁。 It works fine on the initial installation, however if you try to reinstall it, it will not replace the files that it should. 在初次安装时,它可以正常工作,但是,如果您尝试重新安装它,它将不会替换应有的文件。 Is there a way I can have WiX force the MSI go to into reinstall mode rather than repair mode (I think that is what it is entering)? 有没有办法让WiX强制MSI进入重新安装模式而不是修复模式(我想这就是它要进入的模式)?

Edit: Was asked to clarify the usecase, so here's a copy of the comment I left below. 编辑:被要求澄清用例,所以这是我在下面留下的评论的副本。

So the usecase here is that a client has all the software installed, including this patch. 因此,这里的用例是客户端安装了所有软件,包括此修补程序。 Something doesn't work so they uninstall everything and then try to reinstall the software. 某些功能无法正常工作,因此他们会卸载所有内容,然后尝试重新安装该软件。 When they do so this patch (msi) will not reinstall. 当他们这样做时,将不会重新安装此修补程序(msi)。 It will see that it is already installed, and enter repair mode. 它将看到它已经安装,并进入修复模式。 From there it will see that the files exist, not caring that the files are older, and will not update them. 从那里可以看到文件存在,而不在乎文件是否旧,也不会更新它们。 We need those files updated whether the patch thinks it is currently installed or not. 无论补丁是否认为当前已安装,我们都需要更新这些文件。

It might help if you said exactly what's happening that makes this an issue. 如果您确切地说出正在发生的事情,这可能会有所帮助。

When you install a patch, the files (and so on) are replaced, and now the patch is part of the product, not a separate thing that can be re-applied. 当您安装补丁程序时,文件(等等)将被替换,现在补丁程序是产品的一部分,而不是可以重新应用的单独内容。 Going into repair mode when trying to re-apply should be fine because the repair will be based on the initial product plus the patch, so any files that need repair will be repaired. 尝试重新应用时进入修复模式应该没问题,因为修复将基于初始产品和补丁,因此所有需要修复的文件都会被修复。 You can't install the same patch twice any more than you can install the same MSI file twice - it's already installed! 相同补丁的安装次数不能超过两次安装同一MSI文件的次数,因为它已经安装! Hence my question about what you're seeing that is an issue. 因此,关于您所看到的问题是我的问题。 Is it not repairing correctly? 它修复不正确吗?

After seeing your edit, a patch is an msp file, not an MSI file. 看到您的编辑后,补丁是一个msp文件,而不是MSI文件。 In order to uninstall everything both MSI products need to be uninstalled, not just the first one. 为了卸载所有内容,两个MSI产品都需要卸载,而不仅仅是第一个。

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

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