看看这个
blog在如何创建需要管理权限的自定义操作的部分
另一个link真的解释了所有类型的自定义操作.
CustomAction元素在Wix.
这应该有助于您.
看完您的解决方案后,您似乎正在做一个Type 18 CustomAction,在这里我粘贴了以前的博客的内容:
自定义动作类型18
调用在当前会话期间随应用程序一起安装的可执行文件.
CustomAction表中的“源”列包含“文件”表中记录的键.
CustomAction表中的“目标”列包含可执行文件的命令行字符串.
所有返回处理,执行调度和脚本执行选项都适用.
因为文件与应用程序一起安装,所以有自定义操作的排序限制类型18:
- If the source file is not already installed on the computer:
- Custom action must be sequenced after CostFinalize action because only after this action path to the file can be resolved.
- If the source file is not already installed on the computer:
- Deferred custom actions of this type must be sequenced after the InstallFiles action.
- Non-deferred custom actions of this type must be sequenced after the InstallFinalize action.
自定义操作的入口点接收到安装会话的句柄.在执行延迟自定义操作期间,会话可能不再存在.要获取属性的值,请使用CustomActionData属性.
- <Directory Id="TARGETDIR" Name="SourceDir">
- <Component Id="Component1"
- Guid="{A77C5B06-132D-4884-8E17-EA10A83C812D}">
- <File Id="MyCA" Name="MyCA.exe" />
- </Component>
- </Directory>
- <CustomAction Id="DoSomething"
- FileKey="MyCA"
- ExeCommand="-switch"
- Execute="deferred"
- Return="check"
- HideTarget="no"
- Impersonate="no" />
- <InstallExecuteSequence>
- <Custom Action="DoSomething" Before="InstallFinalize" />
- </InstallExecuteSequence>
我们还向CustomAction表添加了类型18的自定义操作. FileKey属性指向具有自定义操作dll的元素. ExeCommand属性指定可执行文件的命令行字符串.
最后一件事是在所有需要的顺序表中安排我们的自定义操作.