如何从 NSIS 安装程序运行 QuickTime 相关文件?
我们要求用户在其 jre/lib/ext 文件夹中拥有 QTJava.zip 的副本,以便我们可以在不添加到类路径的情况下播放 QuickTime 文件。 QuickTime 在此提供了安装过程:http://commons.oreilly.com/wiki/index.php/QuickTime_for_Java:_A_Developer%27s_Notebook/Getting_Up_and_Running_with_QuickTime_for_Java(请参阅标记为预检 QTJ 安装的部分)所以基本上我们需要从安装程序中运行与 QT 相关的文件 - 因为 QT 已经安装,所以它只会启动运行“.mov”文件时的电影播放器。
我们有一个选择对话框,用户可以在其中选择他的 JRE,并且我们希望提示用户在此步骤之后立即运行此安装程序(假设 QTJava 尚不存在;我们会检查这一点)。假设“.mov”文件位于基本安装程序文件夹中,“运行”该文件涉及哪些步骤?到目前为止还没有什么效果,列出我们尝试过的每种方法会占用很多页,所以一个新的视角会有所帮助。
We require users to have a copy of QTJava.zip in their jre/lib/ext folder so that we can play QuickTime files without adding to the classpath. QuickTime provides an installation process for this here: http://commons.oreilly.com/wiki/index.php/QuickTime_for_Java:_A_Developer%27s_Notebook/Getting_Up_and_Running_with_QuickTime_for_Java (see the section labeled Preflighting a QTJ Installation) So basically we need to run a QT-associated file from within the installer - since QT will already be installed, it will just launch the movie player when the ".mov" file is run.
We have a selection dialog where the user selects his JRE, and we'd like to prompt the user to run this installer immediately after this step (assuming QTJava isn't there already; we do check for this). Assuming the ".mov" file resides in the base installer folder, what steps are involved in "running" this file? Nothing so far has worked, and listing each method we've tried would take up pages, so a fresh perspective would be helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
运行非 .exe/.cmd/.bat 文件需要 ExecShell。 ExecShell 与您将得到的“在资源管理器中双击”非常接近。
但这里有一个问题,.mov 是一个常见的扩展名,你不知道最终用户设置了什么来打开 .mov 文件,它可能是 MPC、VLC、mplayer 等,因此仅使用 ExecShell 可能会失败。
尝试找到 QT 并直接执行它可能会更好:
Running non .exe/.cmd/.bat files requires ExecShell. ExecShell is as close to "double-click in explorer" you are going to get.
But there is a problem here, .mov is a common extension and you don't know what the end user has set to open .mov files, it could be MPC, VLC, mplayer etc so just using ExecShell could fail.
It is probably better to try to locate QT and execute it directly: