如何制作仅包装EXE文件的MSI [英] How to make an MSI that simply wraps an EXE file

查看:77
本文介绍了如何制作仅包装EXE文件的MSI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过太多的实验,我得出的结论是Windows Installer只是一项糟糕的技术.但是客户想要MSI文件.

After way too many experiments, I've come to the conclusion that Windows Installer is simply bad technology. But the customers want MSI files.

那么,如何创建一个将EXE文件提取到临时目录并使用与传递给EXE文件相同或相似的选项运行它的MSI文件?

So, how can I create an MSI file that extracts an EXE file to a temporary directory and runs it with options same or similar as were passed to the EXE file?

Msiexec(命令行选项)中解释了MSI的选项) (MSI的低级运行"是msiexec选项package.msi).

Options to an MSI are explained in Msiexec (command-line options) (low level "run" of an MSI is msiexec option package.msi).

mjmarsh的WiX解决方案看起来很有效.我只是还没有机会尝试(锻炼时间).如果可行,我会接受.

mjmarsh's WiX solution looks like it works. I just haven't had a chance to try it yet (crunch time). If it works, I'll be accepting it.

它不起作用.遗失的物品:有人值守/无人值守似乎不可用.

it does not work. Missing piece: attended/unattended does not seem to be available.

无论如何,唯一可以使这项工作奏效的是自定义操作,以杀死其父进程!

Anyway, the only to make this work at all would be for the custom action to kill its parent process!

因此有人发布了进一步的答案,将整个内容包装为安装后的自定义操作.从理论上讲是可能的,但是由于可能需要重新启动(感谢MS for .NET 4有时需要重新启动),因此我们必须进行进一步的黑客攻击.因此,从优势矩阵来看:

So somebody posted as a further answer wrapping the whole thing as a post-install custom action. Theoretically possible but since a reboot may be required (thanks MS for .NET 4 requiring a reboot sometimes) we have to do further hackery. So from the matrix of advantages:

Transparency: No. One big custom action.
Customizability: No.
Standardization: No. 
Management and reporting: No. Appears to work but will not.
Security: No benefit.
Validation: No. The hackery required to survive reboot makes this sure to not work.
Resiliency: Completely defeated.
Rollback: No. Rollback didn't work when we were using MSI anyway.
Patching & Updates: No. We have a local solution anyway.
Logging: No. Appears to work but will not.

没有意义.

推荐答案

添加到 weir's 答案中,如下所示更改 custom action属性:

Adding to weir's answer, change the custom action attribute like below:

<!--Run Action-->
    <CustomAction Id="RunWrappedExe"
                  Return="asyncNoWait"
                  FileKey="ApplicationFileId"
                  Execute="deferred"
                  ExeCommand=""
                  HideTarget="no"
                  Impersonate="yes"/>

设置 Return = asyncNoWai 不会等待 exe 返回.安装程序完成工作并正常关闭.同时, exe 继续执行.

Setting Return=asyncNoWai does not wait for the exe to return. The installer does it's job and closes normally. Meanwhile, the exe continous its execution.

-Madhuresh

-Madhuresh

这篇关于如何制作仅包装EXE文件的MSI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆