Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Here's what I'd do: I'd write a little Windows program in C/C++ that reads an INI file that looks something like this:
When you run the program it would appropriately assemble all the above, add any parameters that it was given and ShellExecute() the results.Note, this would not be console app, it would be a Windows app; that is, it would have a If you wanted to get fancy, it could even look around for the JVM if the specified one isn't found (or at least show a useful message). Another option is to do all this with a little JScipr, which can be run on all windows platforms with wscript. In that case, all the above details would be in the JScript, the link would contain > scenario 1: > under all versions of windows i can create a desktop shortcut that has the following target: > "C:\Program Files\MyCompany\MyJRE\bin\javaw.exe" -Xbootclasspath/p:boot.jar - jar MyApp.jar > and then i can double-click the shortcut and launch my application. no problem. however... > when i try to drag and drop my application specific files onto the icon and have it launch and open the file, this only works under windows 2000. other windows versions appear to lose the parameters and try to execute the following command: > "C:\Program Files\MyCompany\MyJRE\bin\javaw.exe" MyFile > which, of course, fails because it's not a class or jar file -- it's a data file! > any suggestions on how to set up the windows nt/95/98 shortcuts without using a BAT file? (i have no desire to have a dos command console window/icon show up every time a user runs my java application.) > scenario 2: > i'm setting up a windows registry entry to associate my file > "C:\Program Files\MyCompany\MyJRE\bin\javaw.exe" -Xbootclasspath/p:"C:\Program Files\MyCompany\MyApp\boot.jar" -jar "C:\Program Files\MyCompany\MyApp\MyApp.jar" > this time everything works great under windows 95/98/200. however... > this time windows nt has a limit on the command length in the registry so it truncates the entry and i get an error when double-clicking in NT. > again, any suggestions on how to set up the windows nt registry > thanks in advance for any suggestions!
|
Sponsored Links
|