未选择的功能正在安装 [英] Unselected Feature Being Installed
问题描述
在我对InstallShield或我在做什么的了解很少的情况下,我被推到了DevOps的职位.通过阅读和阅读Flexera的文档,我学到的一切.我们的其中一张票是一个问题,我在谷歌搜索时无法找到结果-我可能使用了错误的搜索词,但不知道正确的词是什么.
I've been shoved into a DevOps position at work with very little knowledge about InstallShield or what I'm doing. Everything I've learned I've learned by doing and reading Flexera's documentation. One of our tickets is a problem that I haven't been able to find results for when Googling - I'm probably using the wrong search terms, but don't know what the right ones are.
基本上,我们的安装程序具有许多功能.其中一些功能具有子功能,如果您选择主要功能,则这些子功能将始终安装.一切设置为默认安装,但是您可以禁用任何功能.如果您希望它们成为独立的,则它们应该是完全独立的.功能1的子功能在安装程序中可见(尽管您不能取消选择它们,或与功能1分开选择它们),但功能4却没有.
Basically, our installer has a buttload of features. Some of these features have sub-features, which are always installed if you select the main feature. Everything is set to be installed by default, but you can disable any of the features. They're meant to be completely standalone if you want them to be. Feature 1's sub-features are visible in the installer (though you can't deselect them, or select them separately from Feature 1), but Feature 4's are not.
|- FEATURE 1
|---- FEATURE A
|---- FEATURE B
|---- FEATURE C
|- FEATURE 2
|- FEATURE 3
|- FEATURE 4
|---- FEATURE D
|---- FEATURE E
|---- FEATURE F
| ...
功能F之下只有一个组成部分.该组件安装了一堆DLL和配置文件-不是最佳实践,但在此问题的范围内我也无法更改.当查看组件的功能列表时,它仅设置为FeatureF.它(包含文件夹)在查看任何其他功能的文件时不会显示.
Feature F has exactly one component under it. That component installs a whole bunch of DLLs and config files - not best practice, but also not something I can change in the scope of this issue. When looking at the feature list for the component, it's set to only Feature F. It - and it's containing folder - don't show up when looking at the files for any other feature.
选择功能1作为唯一选项时,将安装功能F.其他功能也可能会发生这种情况,但是功能1的安装速度最快,因此经过了最多的测试.
Feature F is being installed when you select Feature 1 as the only option. It might happen with other features as well, but Feature 1 is the fastest to install so it's been tested with the most.
这是一个基本的MSI项目.我试图通过将创建MSI日志"选项设置为是"来让InstallShield创建日志,但是当我运行Setup.exe进行测试安装时,它没有生成日志文件.我浏览了UI中的脚本并执行了安装序列,看起来没有什么选择了Feature F.
It's a Basic MSI project. I tried to get InstallShield to create a log by setting the 'Create MSI Logs' option to yes, but it didn't generate a log file when I ran through a test install by running Setup.exe. I went through the scripts in the UI and Execute install sequences and it didn't look like anything was selecting Feature F.
我是否错过了一个可以将要素相互链接的地方-如果可以的话,在哪里?
Am I missing a spot where features can be linked to each other - and if so, where?
推荐答案
尝试的具体答案:
自定义操作 :根据可用信息(0个条件),我假设一个或多个自定义操作用于实施您在上面介绍了功能逻辑.您应该能够在我认为的项目Installscript view
中找到自定义操作代码? (在Custom actions view
中具有关联的自定义操作条目).
Attempted Specific Answer:
Custom Actions: Based on the available information (0 conditions), I would assume one or more custom actions are used to implement the feature logic you describe above. You should be able to find the custom action code in the project's Installscript view
I would presume? (with an associated custom action entry in the Custom actions view
).
也有可能不使用Installscript,而是以其他某种语言(VBScript
,C++
,JavaScript
,PowerShell
等)实现了逻辑-在这种情况下,您应该直接转到Custom actions view
并查找可疑对象.源可以嵌入到自定义操作(脚本)中,也可以存储在其他位置(对于C ++始终如此).
It is also possible that Installscript is not used, but the logic is implemented in some other language (VBScript
, C++
, JavaScript
, PowerShell
, etc...) - in which case you should go directly to the Custom actions view
instead and look for suspects. Source could be embedded in the custom action (scrips), or stored elsewhere (always the case for C++).
日志记录 :为了启用日志记录,请尝试打开您的项目,然后转到Build => Settings... => MSI Log File
,现在单击All Error Messages
和Verbose Output
并键入Log File
框中的文件名.单击OK
.现在尝试构建并运行您的项目. 此处介绍了如何使用msiexec.exe启用日志记录(外部Installshield).具体的例子;最简单形式的日志记录命令:
Logging: In order to enable logging, please try to open your project, then go to Build => Settings... => MSI Log File
, now click All Error Messages
and Verbose Output
and type a file name in the Log File
box. Click OK
. Now try to build and run your project. Here is how to enable logging using msiexec.exe (outside Installshield). Concrete example; the logging command in its simplest form:
msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log
更新: 我找到了这个示例在Installshield的KDB(Q208877) 中( KDB ).它使用了一些非常奇怪的功能选择技术-有关详细信息,请参见实际文章.有一个可下载的ISM文件. 在我看来,一种更好的方法是.您的设置可以使用其中一些技巧.
UPDATE: I found this sample in Installshield's KDB (Q208877) (KDB). It uses some very odd feture selection techniques - please see the actual article for details. There is a downloadable ISM file. A slightly better approach in my view is here. Your setup could be using some of these techniques.
有可能影响功能选择的机制的完整列表,如下所示.以下内容主要用于基本MSI项目,对于 Installscript MSI项目,还有更多可用的机制-主要是Installscript功能.在列表之前,有一些重要的花絮:
There is a whole list of mechanisms which can affect feature selection, and it is shown below. The below is primarily for Basic MSI projects, for Installscript MSI projects there are even more mechanisms available - largely Installscript functions. Before the list, some important tidbits:
- 功能名称区分大小写!
- 下面的不同机制肯定会相互干扰.
- Feature names are case sensitive!
- The different mechanism below can definitely interfere with each other.
现在是列表.据我了解,功能选择可能会受到(至少)以下机制的影响:
And now the list. To my knowledge feature selection can be affected by (at least) the below mechanisms:
- 标准
msiexec.exe
命令行- 用户可以设置
REMOVE
,但也可以使用其他按钮(请参见上面的链接). - 示例:
msiexec.exe /i MySetup.msi ADDLOCAL="Core,English,German,SDK"
- 用户可以设置
- Standard
msiexec.exe
Command Line- User can set feature installation options properties via the
msiexec.exe command line
. - Generally
ADDLOCAL
andREMOVE
, but others can also be used (see above link). - Sample:
msiexec.exe /i MySetup.msi ADDLOCAL="Core,English,German,SDK"
- User can set feature installation options properties via the
- "MSI GUI功能选择"对话框(如果在设置中可用).
- 某些设置(不是全部)有一个自定义"对话框,允许用户选择要安装的功能,而不选择要安装的功能.
- 可见功能可以直接受到影响(及其子功能-可见或不可见-
- 例如,基于用户交互选择一个功能,然后可以选择其他功能,也可以不选择其他功能.
- 对于Installscript MSI设置,其逻辑是内置的(并且可以自定义).对于基本的MSI设置,可以执行类似的操作,但可用的自动魔术师较少.
- MSI GUI feature selection dialog (if available in setup).
- Some setups (not all), have a "Custom" dialog which allows the user to select what features to install and not.
- Visible features can be directly affected (and their sub-features - visible or not - depending on feature configuration - search for
msidbFeatureAttributesFollowParent
). - There are several possible feature states to set in some setups. Advertise feature, install feature, do not install feature, etc...
- There could be custom actions running from the setup GUI which affects feature selection state (see custom action section below).
- For example based on a user interaction selecting one feature, then other features could be selected - or unselected.
- For Installscript MSI setups the logic for this is built-in (and also customizable). For Basic MSI setups it is possible to do something similar, but there is less automagic available.
- 应提及此强制设置属性.这是确定是否要安装特定功能的基准.每个设置都有一个
INSTALLLEVEL
. - 每个功能都有其自己的级别属性,并且如果其级别属性设置为等于或小于设置的整体
INSTALLLEVEL
. - 因此,一个人可以通过调整安装程序的设置来影响某些功能的请求安装状态.
INSTALLLEVEL
到32767,以强制安装所有功能.这是错误的,因为某些功能可能与系统不兼容(错误的文件代表错误的系统).
- This mandatory setup property should be mentioned. It is the baseline determining whether a specific feature is to be installed or not. Every setup has an
INSTALLLEVEL
. - Every feature has its own level attribute and the feature will be installed if its level attribute is set to an equal or lower number than the setup's overall
INSTALLLEVEL
. - As a consequence one can affect the requested installation state for several features by adjusting the setup's
INSTALLLEVEL
. - A bad, but not uncommon practice, is to max out
INSTALLLEVEL
to 32767 to force all features to be installed. This is wrong because some features may not be compatible with the system (wrong files for wrong system).
- 如前所述,所有功能都具有 level属性,可以通过在运行时评估的条件语句来对其进行操作.
- 这与上一点有关,但恰恰相反:现在,我们正在更改每个功能的级别属性,而不是安装程序自己的基线功能级别(
Feature Table
. - 实际条件逻辑在
Conditional Statement Syntax
.因此,条件会被评估,如果条件评估为真,则会影响功能的安装级别. -
AppSearch
可能涉及设置构成特征条件的属性. - 对于每个功能,如果该功能的安装级别低于或等于安装程序的
- As mentioned all features have a level attribute that can be manipulated via conditional statements that are evaluated at runtime.
- This is related to the previous point, but it is the opposite: now we are changing each feature's level attribute, not the setup's own baseline feature level (
INSTALLLEVEL
). - See the level column in the
Feature Table
. - The actual conditional logic is in the
Condition table
usingConditional Statement Syntax
. So conditions are evaluated and if they evaluate to true this affects the feature's install level. AppSearch
can be involved setting the properties that make up the feature conditions.- For each feature, if the feature's install level is lower or equal to the setup's
INSTALLLEVEL property
, then the feature is set to install.
-
ADDLOCAL
,etc...
.这里有一整套财产. - MSI Win32函数 :它们可以调用
MsiSetFeatureState
. 安装脚本中的常用. - MSI COM自动化功能 :
Session.FeatureCurrentState
- Custom actions are armed and dangerous (my propaganda against them), but sometimes they are the only option (you have something very specific you need done).
- Custom actions can modify feature states in a number of different ways:
- Feature state properties: they can manipulate properties such as
ADDLOCAL
,REMOVE
,etc...
. There is a whole family of properties. - MSI Win32 functions: they can call
MsiGetFeatureState
andMsiSetFeatureState
. Common in Installscript. - MSI COM automation functions:
Session.FeatureRequestState
andSession.FeatureCurrentState
- 最后,我要提及
MigrateFeatureStates
.一个标准的MSI操作,将尝试在重大升级方案中重现"在原始安装中选择的安装状态. -
MigrateFeatureStates
可以基于MigrateFeatureStates
可以通过其他各种机制禁用.
- Finally I want to mention
MigrateFeatureStates
. A standard MSI action which will attempt to "reproduce" the installation state selected in your original install during a major upgrade scenario. MigrateFeatureStates
can be enabled or disabled for a setup, based on settings in theUpgrade table
- and it can hence affect feature states differently in different setups.- PhilDW reminded me that
MigrateFeatureStates
can be disabled by various other mechanisms.
某些链接 :
Some Links:
- 推荐: 以下是各种功能操纵的简短说明: 2.MSI功能"的部分,涉及不同的主题( WiX ),但是关于功能的逻辑是通用的-它会尝试解释功能条件:未安装的未选择功能
- 在升级过程中手动迁移功能状态
- MSI安装程序中的ADDLOCAL = FEATURE1会删除其他功能
- Windows Installer可以未安装功能,并且不报告错误. (请求:空)
- Recommended: Here is a short explanation of feature manipulation of various kinds: How to install feature based on the property set in custom action?
- More on Features: There is a section called "2. MSI Features" in this long answer which deals with a different topic (WiX), but the logic is generic with regards to features - it tries to explain feature conditions: Wix Installer : Setting component condition property when doing a MSIEXEC admin install at command line
- Some related answers:
- Unselected Feature Being Installed
- Manually migrate feature states during upgrade
- ADDLOCAL=FEATURE1 in MSI installer removes other FEATURES
- Windows Installer does not install feature and does not report an error. (Request: Null)
这篇关于未选择的功能正在安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- Feature state properties: they can manipulate properties such as