将两个具有相同名称的互斥文件安装到同一目录 [英] Install two mutually-exclusive files with the same name to the same directory

查看:203
本文介绍了将两个具有相同名称的互斥文件安装到同一目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序使用配置选项进行部署,该选项已选择作为功能公开.此选项可以是两个值之一.

My program deploys with a configuration option that I've chosen to expose as a feature. This option can be one of two values.

每个配置都会更改一组设置文件.它们具有不同的输入文件名(为方便起见,我们将其称为option1-config20-lv80.xml),但应将其安装为配置目录config20-lv80.xml.每个选件的前缀都应像这样去除,这也意味着一次只能选择其中一个选件进行安装.但是,即使在阻止选择一个功能的情况下也无法安装另一个功能,我的输出仍然乱七八糟:

Each configuration changes a set of settings files. They have different input file names (for the sake of example, let's call it option1-config20-lv80.xml), but should be installed to the configuration directory as config20-lv80.xml. Each option has a prefix that should be stripped like that, which also means only one of these options can be selected for install at a time. However, even with conditions preventing the install of one feature when the other is selected, my output is littered with:

LGHT0204: ICE30: The target file 'config20-lv80.xml' is installed in 'path' by to different components... This breaks component reference counting.

我如何为用户提供选择这些配置选项的选项,并解决我的ICE30问题而没有任何负面影响?

How can I give my users the option to choose between these configuration options and get around my ICE30 issues without any negative side effects?

我看到了类似的问题,但是我不确定100%如何在wix中实现它,或者在不禁用ICE30验证或创建2个安装程序的情况下,还有其他方法可以实现我的目标.

I saw an similar question answered, but I'm not 100% sure how to implement it in wix#, or if there are other ways open to me to achieve my goal without disabling ICE30 validation or creating 2 installers.

推荐答案

有点着急,看看...

A bit rushed, have a look...

牛奶&亲爱的Winnie :在这种情况下,我更喜欢使用两个不同的组件来安装两个具有不同名称的文件,然后使用应用程序本身中显示的选项在它们之间切换.在启动时或在首选项中.使部署变得更简单,它已经很复杂(部署" ).您所指的链接的答案可以在技术上起作用,更多骇客的方法也可以.

Milk & Honey Winnie: In cases like this I prefer to install both files with different names using two different components and then switch between them with an option shown in the application itself. On launch or in the preferences. Makes deployment simpler, it is already complex (section "The Complexity of Deployment"). The linked answer you refer to can work technically, as can more hacky approaches.

替代品 :在这里,我对安装设置文件的不同方式有很长的回答:

Alternatives: I have a long answer here on different ways to install settings files: Create folder and file on Current user profile, from Admin Profile ranging from eliminating the whole file and using internal defaults, to downloading settings files from the network or just relying on clouded web-service settings retrieval from a database. Not 100% match, but maybe give it a skim?

一个相关的问题是,当您拥有普通用户无法写入的设置文件时.这是消除该状况的方法的列表:系统在程序文件下运行.exe时出现.UnauthorizedAccessException..

A related issue is when you have a settings file that regular users can't write to. This is a list of approaches for eliminating that condition: System.UnauthorizedAccessException while running .exe under program files.

这篇关于将两个具有相同名称的互斥文件安装到同一目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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