Help - Search - Members - Calendar
Full Version: Applications that create temporary files
The CD Forum > Bart's PE Builder > Plugins
perky
Hi All,

I'm a noob, just created my first BartPE with XPE and made it bootable via USB using peToUSB. All works fine, kudos to all involved in the creation of those programs rolleyes.gif

I'm now looking at creating my own plugins.

A couple of questions:

1) Let's say I find an application that needs to create temporary or .ini files, maybe in the installation directory or the directory it is run from, and I have no way to tell it to put those files elsewhere. Is the correct procedure to create an autorun command file that copies the entire installation files from X: into B: (the ramdisk) and then change all shortcuts/links and registry settings to reference the ramdrive instead? (I'm assuming BartPE doesn't copy things to ramdisk and run from there by default)

2) I'd like to make the USB stick write protected so that no changes can be made when booting from it. Can I do that simply by marking the files on the USB stick read only? BTW I tried using Bart's pe2usb with the 2 files from the W2003 distribution with no success, the peToUSB utility however works fine.

Thanks!
Mark

jaclaz
QUOTE (perky @ Aug 24 2010, 05:33 PM) *
1) Let's say I find an application that needs to create temporary or .ini files, maybe in the installation directory or the directory it is run from, and I have no way to tell it to put those files elsewhere. Is the correct procedure to create an autorun command file that copies the entire installation files from X: into B: (the ramdisk) and then change all shortcuts/links and registry settings to reference the ramdrive instead? (I'm assuming BartPE doesn't copy things to ramdisk and run from there by default)

Yes. smile.gif

QUOTE (perky @ Aug 24 2010, 05:33 PM) *
2) I'd like to make the USB stick write protected so that no changes can be made when booting from it. Can I do that simply by marking the files on the USB stick read only? BTW I tried using Bart's pe2usb with the 2 files from the W2003 distribution with no success, the peToUSB utility however works fine.


It is only a limited kind of protection, and there may be anyway some files that need to be updated. hmm.gif

If you are using files from Windows 2003 they won't simply work, check this seemingly unrelated thread:
http://www.boot-land.net/forums/index.php?showtopic=4952

jaclaz
Ed_P
QUOTE (perky @ Aug 24 2010, 11:33 AM) *
1) Let's say I find an application that needs to create temporary or .ini files, maybe in the installation directory or the directory it is run from, and I have no way to tell it to put those files elsewhere. Is the correct procedure to create an autorun command file that copies the entire installation files from X: into B: (the ramdisk) and then change all shortcuts/links and registry settings to reference the ramdrive instead?

There are several plugins floating around here who's execution involves running a CMD script that copies the contents of the plugin's Program folder to the RAMdrive and then executing the app from there. You can make the CMD script an autorun but it doesn't have to be. If the app won't be used everytime BartPE is booted it will shorten boot time and save RAM.

QUOTE
(I'm assuming BartPE doesn't copy things to ramdisk and run from there by default)

True.

QUOTE
2) I'd like to make the USB stick write protected so that no changes can be made when booting from it. Can I do that simply by marking the files on the USB stick read only? BTW I tried using Bart's pe2usb with the 2 files from the W2003 distribution with no success, the peToUSB utility however works fine.

If you mark all the files Read Only, a clever idea, it might interfere with the files you copy to the RAM drive which require updating. Some sticks have a write protect switch that can be set on or off. They might be a better option.
perky
QUOTE (jaclaz @ Aug 24 2010, 05:01 PM) *
Yes. smile.gif

It is only a limited kind of protection, and there may be anyway some files that need to be updated. hmm.gif

If you are using files from Windows 2003 they won't simply work, check this seemingly unrelated thread:
http://www.boot-land.net/forums/index.php?showtopic=4952

jaclaz


Thanks! I've given up on the Windows 2003 way, the peToUSB utility does the job for me so I think I'll stick with that for now.

Mark.
perky
QUOTE (Ed_P @ Aug 24 2010, 06:14 PM) *
There are several plugins floating around here who's execution involves running a CMD script that copies the contents of the plugin's Program folder to the RAMdrive and then executing the app from there. You can make the CMD script an autorun but it doesn't have to be. If the app won't be used everytime BartPE is booted it will shorten boot time and save RAM.

If you mark all the files Read Only, a clever idea, it might interfere with the files you copy to the RAM drive which require updating. Some sticks have a write protect switch that can be set on or off. They might be a better option.


Thanks for this! I'll look at some examples - the one I'm thinking of is Truecrypt (they mention on their website that it's best to copy the portable truecrypt.exe to ramdisk and run from there). I can probably get that plugin already but I'd like to do this one myself to gain some experience.

I understand that having the read only bit set might cause problems, your suggestion of using one with a protect switch sounds potentially a lot less problematical.

Mark.
Ed_P
You can use this one as an example: http://www.911cd.net/forums//index.php?showtopic=13844
kaiserslautern
QUOTE (perky @ Aug 24 2010, 05:33 PM) *
1) Let's say I find an application that needs to create temporary or .ini files, maybe in the installation directory or the directory it is run from, and I have no way to tell it to put those files elsewhere. Is the correct procedure to create an autorun command file that copies the entire installation files from X: into B: (the ramdisk) and then change all shortcuts/links and registry settings to reference the ramdrive instead? (I'm assuming BartPE doesn't copy things to ramdisk and run from there by default)


In this cases I make a self-extracting zip-archive with Winrar. This extracts the files automatically to ramdrive (B:\ApplicationName\ or %temp%\ApplicationName\) starts the Exe-file. Filepaths in the registry have to be corrected to the ramdrive (B:\ApplicationName\ or %temp%\ApplicationName\).

also wrote a CMD which can delete all files on ramdisk that aren't needed anymore (after all applications on ramdrive are closed). I placed it on Desktop. Here is an example:

CODE
cleanramdisk.cmd

TITLE Clean ramdisk

IF EXIST "%ramdrv%\crystaldiskinfo" RD "%ramdrv%\crystaldiskinfo" /s /q
IF EXIST "%ramdrv%\testdisk" RD "%ramdrv%\testdisk" /s /q

exit

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.