InstallShield 对主要更新的自定义操作
InstallShield custom action on major update
当我的 setup.exe 处于主要升级模式时,我正在使用 InstallShield 并尝试执行 shell 脚本(自定义操作)。
我确定安装程序确实在主要升级模式下运行,因为它首先卸载已安装的版本,然后安装 setup.exe 版本。
但是,我在 Behavior and Logic
下添加的操作并没有发生...
我将 Install UI Sequence
设置为 <First Action>
并将 install UI Condition
设置为 IS_MAJOR_UPGRADE
但什么都没有..
如果我希望自定义操作在主要升级过程中发生并且在卸载开始时(安装更新版本之前)发生,我应该在序列中的什么地方插入自定义操作(在哪个序列之后)?
有什么想法吗?我做错了什么?
When a setup is uninstalled as part of a major upgrade it runs in silent mode. This means there is no GUI and the actions you have
inserted in the InstallUISequence sequence will never run - in
technical terms the whole InstallUISequence is skipped, and only the
InstallExecuteSequence runs.
我们需要了解您的行为是为了提供正确的建议。它是在对系统进行更改,还是只是显示信息或请求用户输入?如果您的自定义操作对系统进行了更改,则应将其插入 InstallExecuteSequence 而不是 InstallUISequence(不应从 UI 序列对系统进行任何更改)。在其他情况下,您应该将自定义操作插入到两个序列中——这完全取决于它在做什么。顺便说一句,您在使用 Installshield Express 吗?
你的IS_MAJOR_UPGRADE
条件应该可以,但是你也可以使用UPGRADINGPRODUCTCODE
,这是Windows安装程序中的内置条件,前者是InstallShield自带的,自定义条件我相信。我更喜欢标准的 Windows 安装程序 属性.
However, you should be aware that the condition UPGRADINGPRODUCTCODE
is not true in the installing setup, only in the uninstalling setup. I
believe IS_MAJOR_UPGRADE is valid in the installing setup, but
not in the uninstalling setup. It could be set in both - I am not
sure. See similar issue in the context of WiX.
有关自定义操作条件的便捷图表,请参阅来自 Flexera(InstallShield 的制造商)的 PDF:https://resources.flexera.com/web/pdf/archive/IS-CHS-Common-MSI-Conditions.pdf。我没有测试这些条件,请彻底测试。
在意想不到的时间进行自定义操作的错误条件 运行 非常常见。请仔细分析该动作实际应该在什么时候 运行。如果它应该在每次卸载时 运行(无论是由主要升级启动的卸载还是手动卸载),更好的条件可能是:REMOVE~="ALL"
(对所有卸载都有效)。我个人喜欢将 NOT PATCH
添加到我的所有条件中,以防止所有自定义操作在补丁模式下 运行ning(我发现很少需要)。试试上面的链接图表来帮助你决定你的条件。
当我的 setup.exe 处于主要升级模式时,我正在使用 InstallShield 并尝试执行 shell 脚本(自定义操作)。 我确定安装程序确实在主要升级模式下运行,因为它首先卸载已安装的版本,然后安装 setup.exe 版本。
但是,我在 Behavior and Logic
下添加的操作并没有发生...
我将 Install UI Sequence
设置为 <First Action>
并将 install UI Condition
设置为 IS_MAJOR_UPGRADE
但什么都没有..
如果我希望自定义操作在主要升级过程中发生并且在卸载开始时(安装更新版本之前)发生,我应该在序列中的什么地方插入自定义操作(在哪个序列之后)?
有什么想法吗?我做错了什么?
When a setup is uninstalled as part of a major upgrade it runs in silent mode. This means there is no GUI and the actions you have inserted in the InstallUISequence sequence will never run - in technical terms the whole InstallUISequence is skipped, and only the InstallExecuteSequence runs.
我们需要了解您的行为是为了提供正确的建议。它是在对系统进行更改,还是只是显示信息或请求用户输入?如果您的自定义操作对系统进行了更改,则应将其插入 InstallExecuteSequence 而不是 InstallUISequence(不应从 UI 序列对系统进行任何更改)。在其他情况下,您应该将自定义操作插入到两个序列中——这完全取决于它在做什么。顺便说一句,您在使用 Installshield Express 吗?
你的IS_MAJOR_UPGRADE
条件应该可以,但是你也可以使用UPGRADINGPRODUCTCODE
,这是Windows安装程序中的内置条件,前者是InstallShield自带的,自定义条件我相信。我更喜欢标准的 Windows 安装程序 属性.
However, you should be aware that the condition
UPGRADINGPRODUCTCODE
is not true in the installing setup, only in the uninstalling setup. I believe IS_MAJOR_UPGRADE is valid in the installing setup, but not in the uninstalling setup. It could be set in both - I am not sure. See similar issue in the context of WiX.
有关自定义操作条件的便捷图表,请参阅来自 Flexera(InstallShield 的制造商)的 PDF:https://resources.flexera.com/web/pdf/archive/IS-CHS-Common-MSI-Conditions.pdf。我没有测试这些条件,请彻底测试。
在意想不到的时间进行自定义操作的错误条件 运行 非常常见。请仔细分析该动作实际应该在什么时候 运行。如果它应该在每次卸载时 运行(无论是由主要升级启动的卸载还是手动卸载),更好的条件可能是:REMOVE~="ALL"
(对所有卸载都有效)。我个人喜欢将 NOT PATCH
添加到我的所有条件中,以防止所有自定义操作在补丁模式下 运行ning(我发现很少需要)。试试上面的链接图表来帮助你决定你的条件。