Installing to USB Drive and writing to program directory

Try looking for help here if you are having problems with the Ultimate Boot CD.

Moderators: Icecube, StopSpazzing

Locked
Message
Author
CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

Installing to USB Drive and writing to program directory

#1 Post by CBailey » Thu Sep 18, 2008 9:53 am

I'm trying to install a small program into UBCD, installed on a USB drive, so that it can write back to it's directory. I've put the program in the DOSAPPS directory, and I think that part of it is OK (I'm not sure, I've never gone this far in customizing UBCD). The second problem is that this program needs a VERY lean DOS environment, with no drivers, no Config.sys, and nothing in the Autoexec.bat. I tried making my own lean boot image, and run the program using it, but it's not working. I put a start.bat in the DOSAPPS\myprogram directory. Does the lean.img need anything special in it to run the program? Thanks for any help!

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

Re: Installing to USB Drive and writing to program directory

#2 Post by as702 » Thu Sep 18, 2008 1:02 pm

CBailey wrote:I'm trying to install a small program into UBCD, installed on a USB drive, so that it can write back to it's directory. I've put the program in the DOSAPPS directory, and I think that part of it is OK (I'm not sure, I've never gone this far in customizing UBCD).
Sounds good.
CBailey wrote:The second problem is...
What exactly is your first problem??? q-:
CBailey wrote:...that this program needs a VERY lean DOS environment, with no drivers, no Config.sys, and nothing in the Autoexec.bat.
The image is designed to run so as to allow the user to customise the set-up; if you don't want to install a module, simply select cancel when it prompts you to install (e.g. cdrom, udma, lfn etc). Alternatively, select "Clean boot" and run the program from the command prompt.
CBailey wrote:I tried making my own lean boot image, and run the program using it, but it's not working. I put a start.bat in the DOSAPPS\myprogram directory. Does the lean.img need anything special in it to run the program?
What's the program? Furthermore, what's in your startup.bat file?
"If you think things can't get any worse it's probably because you lack sufficient imagination."

CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

#3 Post by CBailey » Thu Sep 18, 2008 1:23 pm

Sorry, the first problem was figuring out how to run the program from a directory instead of an image. At least it was a problem for me :)


As for answering a whole bunch of prompts, I'd probably not make all those annoying prompts in time, and I'd wind up rebooting many times. This would eventually make me go mad, and I'd be committed. If I wanted hard, I'd just put it in a directory somewhere, and drop to a DOS prompt. I'm trying to make it EASY :) I'm very lazy. I want to do some work now, so it will be butter-smooth easy from now on.

The program is the paid version of Copyr DMA. The author recommends write access, and no drivers, himem.sys, etc...

This is my startup.bat:

cls
cd \dosapps\HDDup
HDDUP.EXE

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#4 Post by as702 » Thu Sep 18, 2008 1:38 pm

No worries.

What we can do is reach a close approximation to your desired modus operandi.

Firstly, look for the file /etc/global.set. From there, you can configure how the associated modules behave. For example, to disable CD-ROM prompt AND to disable auto-installation, insert the following:

Code: Select all

CDROM_INSTALL=0
CDROM_NCFG=1
This should disable any pop-ups during boot.

To further configure a minimal a boot as possible, you can edit /config.sys and set the menu to automatically prompt to your desired boot mode (e.g. Ultra-defensive). The only thing in memory should then be PERUSE (screen scroll-back program), HIMEM (extended memory manager), XMSDSK/SHSURDRV (ramdisk) and the command processor.

This should be minimal enough(?).

Finally, be sure to edit the isolinux menu so it matches the relative path of the program it is you're trying to launch.
"If you think things can't get any worse it's probably because you lack sufficient imagination."

CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

#5 Post by CBailey » Thu Sep 18, 2008 1:46 pm

Sounds good. Unfortunately, I need to get rid of himem, and preferably the other two as well. I've had a great deal of difficulty in compatibility with this program, and I'm trying to do exactly what the author recommends. He specifically mentioned no memory managers. Can these be disabled by default as well?

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#6 Post by as702 » Thu Sep 18, 2008 1:57 pm

Hmm...you could get rid of PESUE easily enough. However, the boot disk requires a ramdisk driver, which in turn, relies on there being a memory manager present.

One solution would be to write your own boot disk with a custom config.sys and autoexec.bat. Would the program fit on a 1.44/2.88Mb image? If yes, transfer the everything onto a fresh boot disk, write the relevant config/autoexec files to launch and then transfer the image onto the CD. You can then launch the image using isolinux.

Does this make sense?
"If you think things can't get any worse it's probably because you lack sufficient imagination."

Icecube
Posts: 1278
Joined: Fri Jan 11, 2008 2:52 pm
Contact:

#7 Post by Icecube » Thu Sep 18, 2008 2:07 pm

From where did you buy the program, it seems free to me.
CBailey wrote:The program is the paid version of Copyr DMA. The author recommends write access, and no drivers, himem.sys, etc...
COPYR.DMA is a free application for making copies of hard disks with bad sectors.
http://www.freedownloadscenter.com/Util ... R_DMA.html
http://www.filetransit.com/view.php?id=29519

The original website isn't available.

EDIT: I looked over the sentence:
The program is the paid version of Copyr DMA.
Sorry for bothering you.
Last edited by Icecube on Thu Sep 18, 2008 2:30 pm, edited 1 time in total.

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#8 Post by as702 » Thu Sep 18, 2008 2:22 pm

Image
"If you think things can't get any worse it's probably because you lack sufficient imagination."

CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

#9 Post by CBailey » Thu Sep 18, 2008 2:22 pm

I don't think I understand. The program will easily fit in a 1.44 floppy image, but if it's in an image, I'm guessing I won't be able to write to to the image. With previous versions of this program, that's what I did. The author even included an image. With this version, he's telling me to install to a USB drive instead, and has a utility to do so. I think the program can save it's copying progress, and resume at a later time if interrupted. What I'm trying to do is put UBCD on a USB drive (Well, it's done already), and put this version on as well, with the same functionality as if it just ran by itself on a bootable USB drive.

Also, I don't remember the website, but HD Duplicator is Copyr DMA's big brother. Honestly :)

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#10 Post by as702 » Thu Sep 18, 2008 2:37 pm

CBailey wrote:I don't think I understand. The program will easily fit in a 1.44 floppy image, but if it's in an image, I'm guessing I won't be able to write to to the image.
True, but you should be able to save directly to the USB stick amirite? (-;

Put simply, create a boot disk which runs to your desired spec. For example, custom your boot disk should contain the following files...
/kernel.sys (freedos kernel)
/command.com (command processor)
/autoexec.bat
/config.sys
/myapp.exe (your target binary)
modify autoexec.bat and config.sys to your liking. You should be able to direct any write operations to the USB stick directly (I forget which drive it would appear under).

You can prompt UBCD to launch the image by editing the isolinux menu to point to the image in question.

/custom/others.cfg

Code: Select all

LABEL Copyr DMA
MENU LABEL Copyr DMA
KERNEL memdisk
APPEND initrd=/custom/copyrdma.img
"If you think things can't get any worse it's probably because you lack sufficient imagination."

CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

#11 Post by CBailey » Thu Sep 18, 2008 2:57 pm

I think the problem lies in the answer to "You should be able to direct any write operations to the USB stick directly". I have no control over what directory temp files are written to. The author designed the latest version to be on a bootable USB drive all by itself, and I assume writes to the current directory.

It's ironic. I've spent most of the morning making plugins for tons of apps for UBCD4Windows, and all my problems were because things got more complicated. Here, I realize I'm trying to do possibly one of the simplest things, yet the solution doesn't seem quite so easy :)

Icecube
Posts: 1278
Joined: Fri Jan 11, 2008 2:52 pm
Contact:

#12 Post by Icecube » Thu Sep 18, 2008 3:09 pm

You can do the things that as702 says:

Make a floppy image with the following files:
/kernel.sys (freedos kernel)
/command.com (command processor)
/autoexec.bat
/config.sys
Copy HDDUP.EXE to the USB stick (e.g.: /dosapps/hddup/hddup.exe).

Now when you boot the image from the USB stick, it will go to the prompt:
Type:
X: ==> this is the drive letter of you USB stick (will be another letter)
cd dosapps\hddup
hddup.exe
@as702
Can't you give a autoexec.bat file that searches all available drives for the path /dosapps/hddup/, changes the current directory to it and runs hddup.exe. You can grab the right path from the memdisk command with getargs.com.

Download getargs.com from http://people.cs.uchicago.edu/~gmurali/ ... loads.html.
This is needed to grab parameters that are added to the MEMDISK command.

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#13 Post by as702 » Thu Sep 18, 2008 3:13 pm

CBailey wrote:I think the problem lies in the answer to "You should be able to direct any write operations to the USB stick directly". I have no control over what directory temp files are written to. The author designed the latest version to be on a bootable USB drive all by itself, and I assume writes to the current directory.
Maybe you can copy these said files using autoexec.bat after the program has finished??
CBailey wrote:It's ironic. I've spent most of the morning making plugins for tons of apps for UBCD4Windows
UBCD4Windows=Pain in arse

(-:
"If you think things can't get any worse it's probably because you lack sufficient imagination."

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#14 Post by as702 » Thu Sep 18, 2008 3:19 pm

Icecube wrote:@as702
Can't you give a autoexec.bat file that searches all available drives for the path /dosapps/hddup/, changes the current directory to it and runs hddup.exe. You can grab the right path from the memdisk command with getargs.com.
Yeah, I use a similar method in NwDsk for UBCD4.11 and UBCD5.0b5. It does requires ancillary utils such as xgrep.com and lmod.com, and may be considered overkill for this particular application.
"If you think things can't get any worse it's probably because you lack sufficient imagination."

CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

#15 Post by CBailey » Thu Sep 18, 2008 3:33 pm

Sounds good. Having the app on the drive, and just finding a way to find it sounds like a good solution. I'm not familiar with xgrep or lmod. Can these search drives for a specific file?

CBailey
Posts: 7
Joined: Thu Sep 18, 2008 8:32 am

#16 Post by CBailey » Thu Sep 18, 2008 3:45 pm

This might make a long batch file, but is it possible to do something like :

If exist c:\hddup\hddup.exe then hddup.exe
if exist d:\hddup\hddup.exe then hddup.exe
if exist e:\hddup\hddup.exe then hddup.exe
....

as702
Posts: 276
Joined: Tue Jun 17, 2008 3:14 am

#17 Post by as702 » Thu Sep 18, 2008 3:47 pm

CBailey wrote:Sounds good. Having the app on the drive, and just finding a way to find it sounds like a good solution. I'm not familiar with xgrep or lmod. Can these search drives for a specific file?
Quite easily. For instance, suppose isolinux passes the following variable to memdisk as follows

Code: Select all

UBCDCMD=HDDUP.EXE
Retreive it using getargs.com. Then, we'd do something like this...

Code: Select all

dir /s /b %DRV%\ | xgrep -shy %UBCDCMD%$ | lmod set _tmp=[] >%tmp%\_tmp.bat
call %tmp%\_tmp.bat
call var set _path=full %_tmp%\..
cd %_path%
%UBCDCMD%
You'd need varset.com and var.bat. The above is a real simple example. %DRV% is your target drive (e.g. T:).

It retrieves the bare directory listing, searches for the binary, returns a match, generates a relative path and executes. You'd need to set a %tmp% directory for writing to (can eliminate disk-write by using nset.com).

Edit:
You can download lmod and varset (with instructions) from here
http://home.mnet-online.de/horst.muc/div.htm
xgrep.com from here
http://short.stop.home.att.net/freesoft/txtutil3.htm
"If you think things can't get any worse it's probably because you lack sufficient imagination."

Locked