You are here

What about DOS programs?

6 posts / 0 new
Last post
longtex
Offline
Last seen: 11 years 4 months ago
Joined: 2007-10-16 17:30
What about DOS programs?

This is two questions, basically, because this is pretty much done already.

Well, it's not "done" done, but it's close. Before I proceed, I have a couple of questions.

How much is it “done”? Well, it works. I can copy the executable and data files onto a PA USB stick in the PA directory, and it shows up on the menu, and it launches and runs. I haven't done the full-bore install and all that, and before I do, I need to know:

(1) how does the launched program know the drive letter it's running on?

(2) is there really any interest in this???

First, why am I even doing this?

Well, I've been approached by one of the few remaining clients for one of my old DOS packages about doing a portable version of some or all of our software he's still using. I turned him on to PA a couple of months ago, and he loves it - took awhile to wean him off of Outlook and IE, but he's been clean and sober for several weeks now.

He runs a kind of mini-Sam's Warehouse in the wilds of Alaska, so when a computer breaks, he now has to keep "hot" spares. Since he sells computers, too, he'd like to be able to just roll out a new PC, plug in a USB stick and be up and running in as much time as it takes to install the printer.

I've read the PortableApps.com Format doc and I don't think it's any problem to follow that pretty strictly.

It's a business package, which actually goes back to CP/M days before IBM finally snapped to the fact that microcomputers might actually be a commercially viable business. The "current" version (which is more or less untouched except for some minor stuff, for the last 4 or 5 years) is an xBase product using Clipper and FoxPro code, compiled and linked to DOS executables. There are actually a half-dozen main programs in the suite and numerous little utilities – I'll just call the whole thing “it” in this.

It runs just fine on Windows. Okay, not just fine - it takes some tweaking because Micro$oft's last couple of OS's insist on "owning" the peripherals, but it works on 98 and XP, and as far as I can tell (not owning it, but I've tested on a couple of computers) seems to work on Vista reasonably well. There's a Linux version that uses Harbour/xHarbour and is about 98% compatible with the DOS version, too, but I'm thinking of the Windows-compatible systems first.

The main program in the suite is Point of Sale, and what we're looking at is running it from a USB stick, with the idea in mind that you can plug it in on pretty much any computer, and you have an instant "cash" register (cash not necessary - besides multiple kinds of cash (dollars, pesos, euros, etc...) it supports all manner of cards and other media including store accounts, gift certificates, credit slips, etc) and there's a stub that can be adapted to paypal, barter, social credit, or whatever. It also sells fractional quantities, so you can sell 1.33 hours of consulting just as easily as you can sell one case of Heineken (but it would have to verify the buyer's birthdate to sell that. It's been fully networkable since before Novell Netware, so it can access a server or be a standalone, and we even have a version that uses an ssh server and needs nothing but an ssh client on the user's end.

I tested it just by copying the executable and data files to a PortableApps USB stick, and it already seems to work - that is, by copying the executable to :\PortableApps\exename directory, the program shows up on the PA menu and actually launches... so I'm thinking that the rest may be a whole lot easier than I thought. So far I've only tried the PS and Inventory Control, but they run perfectly.

What I know I need, is the USB's drive letter, so it can find the data files - the full-paths are in a data file, and if the drive letter matches, everything's cool right now, but for example, the USB stick ranges from E: to L: on various computers that I've tried, so it does need to be found. If the launcher provides it (or other info) as command line parameters, that would be sweet.

Also it occurs to me that anyone who's read this far and not fallen off a chair laughing about "DOS crap" might have some insight into the main problem (not that it's a PA issue) which is printing from DOS programs. USB printers are particularly a problem, although if the user's computer supports networking (and I haven't seen many that don't, any more) it's not too hard to connect a USB printer to a “port” that DOS knows about. And one of the little tweaks from the last few years was to add an option to print to file and kick off an external program to view/print it (which generally has meant Notepad or Wordpad)... but maybe there's a better way?

My ultimate goal in this is to open source it, but I want it working in compiled version first. Of course, open source implies (more or less) a compile/link mechanism that's either also open source or at least freely available – Harbour is, but Clipper and FoxPro are not, so I need to back-convert the Harbour/xHarbour version from Linux to Windows... but before I even think hard about that, I'll have to see if there's enough interest, which was my second question... what do you think? Is there?

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 18 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Launcher

I'd recommend a launcher in the base directory. It can go through and alter the paths in the various config directories before launching the app. You wouldn't even need to recompile or recode your main app to do it. We have code you can use under the GPL in our launchers. Pidgin and GIMP do this if I recall correctly.

Sometimes, the impossible can become possible, if you're awesome!

longtex
Offline
Last seen: 11 years 4 months ago
Joined: 2007-10-16 17:30
But...

... how does it know the PA stick's drive-letter?

NOTE FYI: I wrote originally angle-bracket drive-letter angle-bracket and this fine forum editor converted it to ...blank... I think I may have done that in the original message and I'll bet my hat, ass, and suitcase it did the same thing there.

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 18 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Code

In NSIS, the language it's written in, it uses $EXEDIR to get the path to the current executable. You can then use something like ${GetRoot} to get the root directory. Like I said, it's all in the code.

Sometimes, the impossible can become possible, if you're awesome!

longtex
Offline
Last seen: 11 years 4 months ago
Joined: 2007-10-16 17:30
it uses $EXEDIR Great! I can

it uses $EXEDIR

Great! I can use that in the regular code and not need to do a front-end launcher on it ... most of the data is in .dbf's, not in .ini's anyway.

Thanks for the help, John.

Regards - Tex

OliverK
OliverK's picture
Offline
Last seen: 2 years 9 months ago
Developer
Joined: 2007-03-27 15:21
I won't luagh at dos lovers.

I won't luagh at dos lovers. I'm starting to like it myself.

There was a app mentioned on lifehacker for printing from dos, but I don't have a link handy.

Also, check ATPad Portable or Notepad++ Portable for how to get the drive letter.

If you want a base point, I'd suggest the Guerrilla Field Guide to get you started. It'll cover the basics, if you haven't already gotten them.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

Log in or register to post comments