简体   繁体   中英

How to run QuickTime-associated file from NSIS installer?

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.

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:

ReadRegStr $0 HKLM "SOFTWARE\Apple Computer, Inc.\Quicktime" "InstallDir"
ExecShell "" '"$0\QuicktimePlayer.exe"' '"$Instdir\MyFile.mov"'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM