You are here

What programming language should I use to code an application that runs on Flash Drive?

15 posts / 0 new
Last post
rockdale
Offline
Last seen: 16 years 11 months ago
Joined: 2008-01-02 11:56
What programming language should I use to code an application that runs on Flash Drive?

Hi, all:

Not sure is this the right forum for this post. I am quite new about "portable apps". so please forgive my ignorance.

I need to program an application (from scratch) that view/edit/save user's data. The application and data will be put on the flash drive and distributed to end user.

I read a lot of post here but only found that most you guys are modify existing apps to make it portable. I am wondering what language I need to use for this portable app? Mostly I am using asp.net for web application development. If I use C#, I believe there will be an error when the end user try to run my appl since there is no .net runtime. like Java, the end user must download JRE also. I am thinking using C++ but afraid that I need to compile all the user interface DLL I needed into the executable? and finally, how about Visual Basic 6.0.

Last question, are these portable apps runs on windows OS only, how about Mac or Linux.

Thanks in advance
-rockdale

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
you could use...

C++ or C
or delphi (if you are willing to pay)
any language as long as it does not require something from the registry.

Most of the apps work on linux with wine
hope that helps
~regards

Please search before posting. ~Thanks

PieterK
PieterK's picture
Offline
Last seen: 14 years 5 months ago
Joined: 2007-07-17 15:07
Actually there exists a free

Actually there exists a free Delphi compiler. Check out Borland Turbo Delphi. It requires registration but no payment in any way.

Optimism is a moral duty - Karl R. Popper

rockdale
Offline
Last seen: 16 years 11 months ago
Joined: 2008-01-02 11:56
well, most of our end user

well, most of our end user are using windows OS. Normally I always include MFC in my C++ applications( I did not do many C++ client side appls), does it mean the MFC DLL need to copy to flash drive too? I do not have a single idea of how to program user interface using C, are there any library for drop down list, window, textbox ...etc?

John Bentley
John Bentley's picture
Offline
Last seen: 15 years 3 months ago
Developer
Joined: 2006-01-24 13:26
Just set it to link

Just set it to link statically with the dll.

cowsay Moo
cowthink 'Dude, why are you staring at me.'

rockdale
Offline
Last seen: 16 years 11 months ago
Joined: 2008-01-02 11:56
ok, so C or C++ as long as I

ok, so C or C++ as long as I set those dlls to static link.

not C#.net or Java since they need .NET Runtime or JRE.

How about Visual Basic 6.0 assume conside the falsh drive only works for Windows OS only. Why I mention VB is because VB has a less and quick dev effort compare to C and C++.

mjcarman
Offline
Last seen: 13 years 10 months ago
Joined: 2006-07-27 17:05
Self contained is best

For maximum portability you should minimize external dependencies. That generally means avoiding anything that uses a VM or depends on a non-standard library. If you can count on things being installed then go ahead and and take advantage of it. (e.g. my workplace includes the .NET 1.1 and 2.0 runtimes in the standard PC loadset, so I was able to write a little app in C#.)

Java can be made portable so that might be an option for you (if you have a preference for it).

.NET can't be made portable. Once Vista becomes the norm you'll be able to assume that the framework is installed, but for now you can't.

From what I can find, VB depends on a runtime that is standard as of Windows 2000. It should be safe to assume that your users have it installed.

rockdale
Offline
Last seen: 16 years 11 months ago
Joined: 2008-01-02 11:56
What do you mean Java can be

What do you mean Java can be made portable? Don't they need to download JRE too? most of my end users are not computer literate and may not access to internet, they may not be able to download JRE.

Thanks for the VB hint, I will do more research on VB dependents.

thanks

rab040ma
Offline
Last seen: 5 months 5 days ago
Joined: 2007-08-27 13:35
I think "make Java portable"

I think "make Java portable" means that your program would rely on a version of the Java executable or VM or whatever that you include on the USB drive, a version that would work on all possible versions of Windows, and not interfere with or get upset by another version of Java already being installed on the machine. It should theoretically be possible; the main issues cited have to do with whether or not Java needs to make or rely on Registry entries or write to the user's AppData directory, and whether your program can find all the pieces whenever it is launched no matter what the drive letter of the USB drive might be.

I've not tried it myself, but others report that doing this is not trivial. Maybe it would be easy for you.

MC

mjcarman
Offline
Last seen: 13 years 10 months ago
Joined: 2006-07-27 17:05
Use the Java Portablizer

Yes, I meant create a portable Java to include with your application:

https://portableapps.com/support/openoffice_portable#java

The page is about Open Office but the Java stuff is applicable to any program that needs a JVM. It's worked fine for me but I haven't stress tested it.

rockdale
Offline
Last seen: 16 years 11 months ago
Joined: 2008-01-02 11:56
I also come across

I also come across http://www.memecode.com/lgi.php
is this lgi a framework that I can use for my appls in this case?

rab040ma
Offline
Last seen: 5 months 5 days ago
Joined: 2007-08-27 13:35
If you can be sure that the

If you can be sure that the correct support libraries are going to be available (e.g. all the end users are using identical OS and machines managed by an IT department, or the libraries you need are included with all possible consumer or business OS versions they might use) it doesn't much matter. If you are not picky about your app being "open source", you can use pretty much anything for which you have license.

As for including other libraries like LGI or GTK, as long as you have enough room on the drive, that shouldn't be a problem either, especially if you plan things so your files are in locations that your program expects, preferably relative to the main executable, and ignore or work with similar versions already installed on the computer. It might be cleaner if most of those other files were in a subdirectory. The PortableApps platform has a file layout that works pretty well, if you want your program to work as part of the PA system.

Since you are starting from scratch, you can make sure any dependencies are met, and that you don't expect or rely on anything in the registry, or rely on installed programs that might not be there. (Which, as you say, might be the case if .Net or Java runtimes are not installed or are the wrong version, or there are controls that must be registered before they will work properly.)

For testing, you could use a couple of virtual machines; one might be a completely bare install of, say, Windows 2000, with no Java or .Net or Script engine or anything else; another would be a typical consumer install with Office/Works and a few other things commonly found on PCs.

You (or your company) would of course need to make sure you have license to use whatever libraries or support code you include. I'm not going there. Wink

MC

m2
Offline
Last seen: 13 years 9 months ago
Joined: 2006-12-12 12:00
VB is portable as long as

VB is portable as long as you take virtual machine with you (msvbvm60.dll for VB6).
There are 1000 other portable languages. I can't think of any thing that is not .NET / Java I know to be unportable.
To list some portable ones, not mentioned here before:
perl
ahk
auto it
power pro
asm
pascal
haskell
batch
php
nsis ( not meant to be a programming language, but some people like to use it this way Wink )
All these things should run on Linux / Mac. Just take wine for each OS with you.

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2005-12-10 15:22
Basically

anything that you can compile into an exe is easily portable, those that require a virtual machine can usually be made portable, with the notable exceptions of .Net and Java.

P.S. Can you imagine trying to write an entire program in asm, ouch Smile

m2
Offline
Last seen: 13 years 9 months ago
Joined: 2006-12-12 12:00
There are some not very

There are some not very small ones. Faim is my favourite. I had once a dual pane file manager, IIRC 170 KB compiled w/out too much graphics.
It can be done... Wink

"Those people who think they know everything are a great annoyance to those of us who do." Asimov

Log in or register to post comments