基于 WiX 的安装期间提取 SFX 时出现问题
我的 WiX 项目中有以下代码
<CustomAction Id="ExtractHelp" Directory="DocFolder" Execute="commit" Impersonate="no" ExeCommand="[MYAPPINSTALLFOLDER]Doc\help_zip.exe" />
<InstallExecuteSequence>
<Custom Action="ExtractHelp" Before="NativeCompilation">NOT REMOVE</custom>
</InstallExecuteSequence>
,其中 help_zip 是我创建的 7z SFX 存档,用于捆绑我们的帮助文件并在安装过程中将它们提取到我们的 DocFolder 中。唯一的问题是,文件不断解压到 C:\Windows\SysWow64,而不是 DocFolder 指定的文件夹。有什么想法吗?
另外,help_zip.exe 驻留在 DocFolder 中,因此它甚至不需要参数即可输出到它所在的目录,至少据我所知 =\
编辑 我已将上面的代码编辑为展示我的解决方案。请注意,NativeCompilation 是我们创建的另一个操作(不是 WiX 的一部分),NOT REMOVE 是指在我们不卸载时执行该操作。
I have the following code in my WiX project
<CustomAction Id="ExtractHelp" Directory="DocFolder" Execute="commit" Impersonate="no" ExeCommand="[MYAPPINSTALLFOLDER]Doc\help_zip.exe" />
<InstallExecuteSequence>
<Custom Action="ExtractHelp" Before="NativeCompilation">NOT REMOVE</custom>
</InstallExecuteSequence>
Where help_zip is a 7z SFX archive i created to bundle up our help files and extract them in our DocFolder during install. The only issue is, the files keep extracting to C:\Windows\SysWow64, not the folder specified by DocFolder. Any ideas?
Also, help_zip.exe resides in DocFolder, so it shouldn't even need arguments to output to the directory it sits in, at least as far as I know =\
EDIT I have edited the code above to show my solution. Please note that NativeCompilation is another action we created (not a part of WiX), and NOT REMOVE refers to executing the action when we are not uninstalling.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试设置 Directory 属性,以便您可以使用 类型 34 自定义操作(带有工作目录的 EXE)。这样您就可以决定 SFX 存档的工作目录。
Try setting the Directory attribute so you can use a type 34 custom action (EXE with working directory). This way you can decide the working directory of the SFX archive.