Wix:CustomAction 中二进制文件的路径
我的 wxs 文件中有以下代码
<Directory Id="TempFolder" Name="Temp">
<Component Id="TempExes" Guid="DF92ED79-28AB-4E88-81F2-8B035D4B8A01" DiskId="1">
<File Id="CACLS_EXE" Name="CACLS.EXE" Source="Binary\CALCS.EXE" />
</Component>
</Directory>
现在,当我从安装程序调用自定义操作时,如何获取此 exe 的路径?我尝试过
var pathToExe = session.GetTargetPath("TempFolder") + "CACLS.exe"
哪个不起作用。 有什么想法吗?谢谢。
I have the following code in my wxs file
<Directory Id="TempFolder" Name="Temp">
<Component Id="TempExes" Guid="DF92ED79-28AB-4E88-81F2-8B035D4B8A01" DiskId="1">
<File Id="CACLS_EXE" Name="CACLS.EXE" Source="Binary\CALCS.EXE" />
</Component>
</Directory>
Now when I call a Custom Action from the installer, how do I get the path to this exe? I tried
var pathToExe = session.GetTargetPath("TempFolder") + "CACLS.exe"
which doesn't work.
Any ideas? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您尝试过吗:
并且
公共属性全部大写。
我有一段时间没有使用 wix 但如果我没记错的话,如果您的自定义操作计划在安装过程中对系统进行更改的部分运行,那么如果您希望能够访问信息。
Did you try:
and
public properties are in all caps.
I haven't used wix in a while but if i remember correctly, if your custom action is scheduled to run during the part of the installation where changes are made to the system you have to use a special property if you want to be able to access the information.
为什么您甚至要在流程之外使用自定义操作来首先使用 CACLS? WiX / MSI 已经具有内置权限操作功能。保持声明性而非强制性,安装程序的质量将大大提高,同时通过不重新发明轮子来节省您的时间。
Why are you even going out of process with a custom action to use CACLS in the first place? WiX / MSI already has built in permissions manipulation functionality. Stay declarative not imperative and the quality of your installer will improve greatly while saving you time by not reinventing the wheel.