- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我使用 Wix,并且有一个 customAction 和一个 anb installSequence:
<CustomAction Id='PreInstallAction' BinaryKey='PreInstallBinary' DllEntry='MyCustomAction1' Execute='immediate'
Return='check'/>
<Binary Id='PreInstallBinary' SourceFile='E:\...\MyCustomAction\bin\Release\MyCustomAction.CA.dll'/>
<InstallExecuteSequence>
<Custom Action='PreInstallAction' Before='InstallInitialize'/>
</InstallExecuteSequence>
问题是我的自定义操作被调用了两次 -(在自定义操作中我将内容打印到日志文件中并且我看到了两次)
我试着评论这行:
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" DowngradeErrorMessage="Can't downgrade from newer version" />
它解决了这个问题。但我需要重大更新,所以我尝试取消注释上面的行并向 customAction 添加条件:
<InstallExecuteSequence>
<Custom Action='PreInstallAction' Before='InstallInitialize'>
NOT Installed AND NOT PATCH
</Custom>
</InstallExecuteSequence>
但是现在 ny customAction 又被调用了两次...我的情况有什么问题吗?还有其他解决办法吗?
最佳答案
您的自定义操作执行了两次,因为它在新旧安装的执行顺序中。当 RemoveExistingProducts 执行主要升级时,它实际上正在运行旧产品的卸载,因此两者都在范围内。您可以通过在自定义操作的顺序上放置一个条件表达式来解决此问题,以便它仅在旧的卸载或新的安装期间运行。
此外,根据该 CA 实际执行的操作,立即执行调度可能不是最佳选择。任何更改机器状态的自定义操作都必须安排在 InstallInitialize 和 InstallFinalize 之间,并延迟(通常是系统上下文)执行以确保属性(property)权和回滚行为(您还必须编写回滚和提交操作)。
关于c# - CustomAction 被调用两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9276293/
我有一个要求,如果安装程序失败(通过从另一个自定义操作返回 ActionResult.Failure 自动或手动失败),我需要执行自定义操作。我试过了 但未调用 CA。感谢您的帮助。 编辑:从日志中发
我创建了一个自定义操作: 安装顺序 我的安装程序确实弹出并说它需要管理员权限才能运行。我授予它。 InstallPrivileges='elevated' InstallScope='perMac
我有一个带有 RegistrationType="ContentType"的 CustomAction 定义: 所有使用此内容类型的文档库都将显示此上下文
我创建了一个具有内容类型的功能: 我想为此内容类型创建自定义操作。 这在 ECB 上有效(每个项目标题的弹出菜单): 但是,我无法让它在表单的工具栏上工作(编辑或显示):
我正在创建一个 WiX 安装程序来安装一个连接到数据库的程序。为了解决这个问题,我创建了一个 C dll,它检查服务器上是否存在特定的 SQL 实例: extern "C" UINT __stdcal
我使用 Wix,并且有一个 customAction 和一个 anb installSequence: 问题是我的自定义操作被调用了两
我正在编写我们产品的新的重大升级。 在我的安装程序中,我首先找到以前版本的配置设置,然后我想卸载以前的版本。 我找到了几份指南,告诉我应该如何制作适合此类升级的 MSI。 然而,以前的不是MSI。 这
有人告诉我 WIX 中的 CustomAction 有一种方法可以在控制台日志中显示输出。我包含一个名为 XmlPreprocess.exe 的 .exe 来操作我的 web.config,基于名为
我在 wix 安装程序中有一个相当长的 CustomAction,我希望能够在操作运行时更改“状态:...”文本,以查看其内部状态的进度和更新。 我知道如何设置自定义操作的进度文本 - 但我想要的是在
我想在安装合并模块(由 WiX 创建)期间使用以下代码运行命令行。 当我在命令行上运行命令(目前是硬编码)时,它工作正常。但是,在安装过程中运行时,它会失败。打开日志记录会显示错误代码
有没有办法将数据传递给(托管,C#)CustomAction?最好使用 Session 对象的 CustomActionData 集合。我还想在 UI 控制部分中使用 CustomAction 的返回
如果我有以下 CustomAction,如果 DoTask 失败,安装将中止。 如果我将 Return 设置为 ignore,安装将在失败时继续进行,但我不会得到任何指示。 如果 CustomAct
我想根据某些值在安装中包含不同的 dll。因此,我尝试根据使用自定义操作设置的属性加载组件。 在wxs文件中: ... ... ... ...
请告诉我在这行括号里写什么 var UtilityKey = Registry.LocalMachine.OpenSubKey(...); 这是 CustomAction 的代码: public st
我有一个 CustomInstaller 类 (System.Configuration.Install.Installer),基本上我在 Install 方法中打开一个对话框表单。我想知道是否有可能
我的wxs文件中有以下代码 现在,当我从安装程序调用自定义操作时,如何获取此 exe 的路径?我试过了 var pathToExe = session.G
我想对 WiX 安装程序的 C# CustomAction 函数进行快速测试。即从我的 C# WinForms 应用程序中调用它们。 众所周知,函数的格式为 ActionResult MyAction
据我所知 - WiX 支持两种 CustomActions: 延迟 - 运行此操作的用户(默认情况下)已提升,但不是运行安装的用户(例如,LocalSystem 或类似的用户)。 立即 - 运行此操作
所以我正在创建我的第一个 Wix 项目,但我似乎在执行自定义操作时遇到了问题。我不确定它是否包含在 msi 中,我也不太确定我做错了什么。以下是我的 Wix 文件:
我正在使用 WIX 创建一个 MSI,它具有安装 clickonce 应用程序的自定义操作。我想通过 GPO 部署 MSI。当我双击运行 msi 时自定义操作运行良好,但通过 GPO 部署时自定义操作
我是一名优秀的程序员,十分优秀!