3

The application I'm working on has simple functionality, but has one requirement that's giving me trouble. The application will be run from a thumb drive, and requires access to write a file to said thumb drive, so browser-based javascript/html is out.

My ideal goal is to have a single script that can be double clicked from mac's finder or windows explorer that will kick-off the update of this file that is stored on the usb drive. Is this possible?

I've come across similar questions (OK Programming language from USB stick with no installation), but everything I've found would still require separate starting points for each script. For example, if I put Lua binaries on the usb stick I will have to have a separate script for each platform I want to support.

Community
  • 1
  • 1
Aaron Bruce
  • 1,130
  • 1
  • 12
  • 24

2 Answers2

1

i really think it's not possible. otherwise, JAVA, Adobe Air and other platforms wouldn't have been created in the hope of a cross-platform language. besides, mac, linux and windows have different "executable" file types.

how bad can 3 (mac, windows, linux) start-points be? they could operate on the same file anyway.

Joseph
  • 117,725
  • 30
  • 181
  • 234
  • thanks for the reply, it wouldn't be that bad in my opinion for several starting points, I just wanted to do my due diligence for my client. I think you're probably right. – Aaron Bruce Nov 21 '11 at 18:06
  • you could create a portable JAVA program that runs on a JAR file. That way, you have one file to run (not to mention portable). however, that runs on the assumption that your client has JAVA installed. – Joseph Nov 21 '11 at 18:09
  • fskreuz, yeah we're considering that. We even though about including a JRE on the stick, which brings us back to square one, because you have to know which platform you're on in order to make sure you start the jar using the correct JRE. – Aaron Bruce Nov 21 '11 at 18:12
0

It is possible to create Java jar-files which are startable with a double click. No platform specific scripts are required. See this question and its linked stuff.

This works of course only, if a JRE has been installed correctly on each computer.

Community
  • 1
  • 1
A.H.
  • 63,967
  • 15
  • 92
  • 126
  • but what if the user had no Java? one has to download the right Java for the OS he has.. wait.. install.. portability breaks just because he has to install Java for his platform. the asker wants a plug-and-play, cross-platform executable via a thumb drive. but what if the user HAD Java already? :) – Joseph Nov 21 '11 at 23:03