Jump to content











Photo
* * * - - 4 votes

BootSDI, zCopy and ImageCreator utility


  • Please log in to reply
595 replies to this topic

#1 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 25 February 2007 - 06:29 AM

BootSDI.script (former IMGinRam)
Creates BootSDI.IMA file that can be booted into Ram from CD, HDD and USB devices (sticks and flash cards). By default script creates an ISO image for burning CD but you can grab this file alone in ISO\RAM folder and use it as you want :P
Note 1: if you want the build running in qEmu please uncheck any other "Create ISO" scripts inside the project.
Note 2: for using this utility FileDisk driver is required. It can be installed directly from the script interface and there is no need to reboot the computer after that.

zCopy utility Download | Beta testing and discussion
NIKZZZZ from Ru-Board created scpecial utility for this script - zCopy.exe for copying all files and folders from one pointed folder to any pointed disk drive. zCopy creates the exact mirror of "home" directory on a destination drive. Then it lists all files and start copying from the biggest with compressing and checking integrity of files.. zCopy may stuff the image even if there is nearly no place on it :P This gives you ability to make the smallest image possible and you can boot using 50MB image on a computer with only 80MB of RAM! This utility will be extracted in your Tools directory. Try it also for your other usual tasks.

ImageCreator.script and ImageCreator utility (reg.exe and notepad.exe are required in system32)
The other utility created by NIKZZZZ for using especially with RAM Boot. The utility makes the image of running WB system so that any changes to the regestry will be available during next boot to the build. It creates drive image (HDD or RAM disk) from the loaded system itself using direct access to the disk. Regestry files are imaged from the working system too.
In other words - it is possible to install neary any program directly when running WB build and save the settings specified in configuration file for the next time you will run WB build again! It can save some time for writing program scripts also. Why write complex scripts with files placement and regestry settings if you can just install and configure a program and save all changes directly in the base build?

How to use ImageCreator
1. Create an image file that is a RAW full sized image of a working system (virtual image in RAM, system installed on HDD or running from CD) and it is as big as this system.
2. After creating an image choose to save it as a separate image with any extention or replace with it the original one (of course only images on writable booting devices like HDD or USB sticks can be replaced).

Configuration file parameters:
[Drive] - source and temporary drives letters
SourceDrive=x:
TempDrive=z:
[RegSave]; - writes regestry hive into a file
%WinDir%\System32\config\Software=HKLM\SOFTWARE
%WinDir%\System32\config\Default=HKU\.DEFAULT
[FileDel]; - delete a file
%WinDir%\System32\Setupreg.hiv
[RegCopy]; - copies only defined regestry key into a file. If the file doesn't exist it is created.

%WinDir%\System32\Setupreg.hiv:HKLM\SYSTEM\ControlSet001\Hardware Profiles=HKLM\SYSTEM\ControlSet001\Hardware Profiles

in one line
[Arc]; - used third party archiver
Arc=gzip.exe

Allowed pathes:
%WinDir%
%SystemRoot%
%UserProfile%
Full pathes are also allowed but the drive letter is ignored and used by default.

Note: it's recomended to save only Default and Sofware hives and only some keys in System and User.dat because if you save ALL regestry it will save your hardware configuration too and may cause BSOD during next run. But - good news! - the default Ic.ini file is about 70% enough for successful installation and configuration of your licenced software directly in running system. This configuration file is recommended for the starter:

[Drive]
SourceDrive=x:
TempDrive=z:
[RegSave]
%WinDir%\System32\config\Software=HKLM\SOFTWARE
%WinDir%\System32\config\Default=HKU\.DEFAULT


How you can use BootSDI.IMA file
(make sure you have a backup of this computer sensetive information just in case - you are worned! don't complain if you loose any data during tests)

Running from HDD (best way to test your WinBuilder builds on a real computer).
1. Get Grub4DOS here and extract only one file from Zip archive - grldr (this file has no extention!).
2. Open Notepad and past and copy next lines in it:

color white/red black/red
default 0
timeout 10

title BootSDI from HDD
find --set-root /grldr
chainloader /i386/setupldr.bin

title Load Windows
root (hd0,0)
chainloader +1

title Reboot computer
savedefault --wait=2
reboot

Save this file as menu.lst (note the extention!).
3. Open Notepad and past and copy next lines in it:

[SetupData]
BootDevice = "ramdisk(0)"
BootPath = "\I386\SYSTEM32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdexportashd /rdpath=\i386\BootSDI.IMA"

Save this file as WINNT.SIF.
4. Go to Start > Settings > Control Panel. On the window menu choose Tools > Folder Options... Go to tab View and uncheck Hide Protected Operating System Files (Recommended) - don't worry, no harm is expected you can check it back later.
5. Go to you system drive (most ofter is drive C:) and you will see the file BOOT.INI. Open the file with Notebook and add a line at the bottom of all other lines:

C:\grldr="Grub4Dos"

(You may also change timeout from 30 to 5 - it means how long in seconds you will see the choice for booting.)
6. Place files grldr, menu.lst, WINNT.SIF on drive C:
7. Create a folder i386 on drive C: and place there setupldr.bin (Win2003 file), ntdetect.com and BootSDI.IMA (not ISO but IMA file!).
Now each time you boot you will see the choice:

Windows XP
Grub4DOS

If you choose Windows XP it's obviously loads your Windows.
If you choose Grub4DOS you will be forwarded to the next menu choice and you can choose to boot Windows, reboot or load your BootSDI.IMA file on your real computer! If the build you created is bootable in qEmu during building the image will defenitely boot :P

Running from a USB stick or a flash card (your movable Windows in a pocket :P
(USB stick of flash card should be bootable on your computer - miracles are not possible yet :P
1. Copy file WINNT.SIF created in previous step 3 to your prepared USB stick.
2. Copy the folder i386 with all files inside created in previous step 7 to the USB stick.
3. Rename setupldr.bin (Win2003 file) to ntldr (file has no extention!) and place this file (ntldr) to USB stick.
Thats all! If your USB stick or flesh card is capable to boot at all, your motherboard supports booting from USB (make needed settings in BIOS setup) and your image is bootable it should work! :P

Download: please download the latest "stable" versions from nativeEx_barebone update server. This topic will contain only beta versions.

Attached Files



#2 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 25 February 2007 - 04:58 PM

BootSDI.script v007 (former IMGinRam)

Creates BootSDI.IMA file that can be booted into Ram from CD, HDD and USB disks.
By default script create an ISO image for burning CD but you can grab this file alone in ISO\RAM folder and use it as you want :P

NIKZZZZ from Ru-Board created scpecial utility for this script - zCopy.exe. It copys all files and folders from one pointed folder to any disk. Try this utility also for your other usual tasks.

Note 1: if you want the build running in qEmu please uncheck any other "Create ISO" scripts inside the project.

Note 2: for using this utility FileDisk driver is required. It can be installed directly from the script interface. At the moment you need to reboot the computer after installing the driver and before continuing the build.

I tried with the script's default RAM disk size of 88MB and drive letter X:
I got an error message by zCopy:

Minimum RamDisk size 63MB

When stopping the script at the zCopy command (by message command) I do not have a drive X:

Reason:
The path on my system contains spaces.
After changing code to

ShellExecute,Hide,"%Tools%\qEmu\qemu-img.exe","create -f raw #$q%RAMFolder%\i386\BootSDI.ima#$q %IMGSize%M"
ShellExecute,Hide,"filedisk.exe","/mount 0 #$q%RAMFolder%\i386\BootSDI.ima#$q %RAMDrive%"

it works well.

Question: what is the reason for the 11 identical lines
ShellExecute,Hide,"filedisk.exe","/umount %RAMDrive%"
I removed 10 lines and The ISO still boots into VirtualBox.

Peter

#3 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 25 February 2007 - 07:37 PM

psc
Thank you very much for testing and good advises :P

NIKZZZZ found a couple more bugs and I'll correct the script by tomorrow.

Minimal disk size error - very good :P I was wondering myself about this error. It sometimes appears on my XP installation but mostly worked well if I install FileDisk with my own installator. And it often appears in W2k. You found it :P

As for repeting lines - some time FileDisk behaviour is a bit strange and it doesn't unmount disk with one command (there was such feedback on Ru-Board).

We also confirmed one simple way to install FileDisk without reboot and try to incorporate it in the script tomorrow :P

#4 TheHive

TheHive

    Platinum Member

  • .script developer
  • 4199 posts

Posted 26 February 2007 - 01:08 AM

psc
We also confirmed one simple way to install FileDisk without reboot and try to incorporate it in the script tomorrow :P

Is this included in v7 of the script? I'll wait till this is implemented.

#5 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 26 February 2007 - 04:14 AM

TheHive

Is this included in v7 of the script? I'll wait till this is implemented.

Not yet. Please wait until v8 (I'll inform).

I have hard disk problem on my test computer (it is nearly 5 years old) so I'm late with bug fixing.
Next version is 7.5 and it is not tested thourothly, corrected only obvious errors in the script.


psc
Nikzzz explained about repeting lines - unmount command for FileDisk has very short "waiting" time and some time it's just not enough for real unmounting of virtual disk. Two or three lines are usually enough, the execution is extreamly fast and there is no harm if a few commands come after disk is already unmounted.
It mostly needed just for sure.

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 08:14 AM

psc
Nikzzz explained about repeting lines - unmount command for FileDisk has very short "waiting" time and some time it's just not enough for real unmounting of virtual disk. Two or three lines are usually enough, the execution is extreamly fast and there is no harm if a few commands come after disk is already unmounted.
It mostly needed just for sure.

This behaviour should not be handled by walkarounds in the script.

@Nuno: I think we need a 'wait' option in the ShellExecute command.
(Similar problem I have with the VirtualBox script. I cannot clean up correctly).
When processing a script line by line, the engine has to wait for completion!
As far as I remember, that has been at least with qEmu in former times.

Peter

#7 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 February 2007 - 12:27 PM

Yes I also think that such workrounds ar not a good idea. Maybe you could use and autoIt script.

#8 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 26 February 2007 - 02:19 PM

Yes I also think that such workrounds ar not a good idea. Maybe you could use and autoIt script.

Not that I'm against this but I'm not even from IT business :P I can't make an AutoIt script. NIKZZZZ is very busy (he made the bigest programming and scripting part already) and HighwayStar is not here for some time already...

But I'm not against some help here :P

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 02:39 PM

Not that I'm against this but I'm not even from IT business :P I can't make an AutoIt script. NIKZZZZ is very busy (he made the bigest programming and scripting part already) and HighwayStar is not here for some time already...

But I'm not against some help here :P

I'm too strictly against an autoit script.
This wait/nowait is really an issue of WinBuilder and the script engine has to handle it.

Peter

#10 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 04:16 PM

I tested version 7.5:

There is still a bug:
Line

ShellExecute,Hide,"filedisk.exe","/mount 0 #$q%RAMFolder%\i386\BootSDI.ima#$q %RAMDrive%"

misses the quote at the end.
And two smaller features:
bootfont.bin is missing on some CDs, e.g. English.
Therefore i added a condition:

If,ExistFile,"%TargetDir%\Bootfont.bin",FileCopy,"%TargetDir%\Bootfont.bin","%RAMFolder%"

And I added the 'pass-through' of the (optional) 'Hit any key to start from CD' option:

If,ExistFile,"%TargetDir%\i386\Bootfix.bin",FileCopy,"%TargetDir%\i386\Bootfix.bin","%RAMFolder%\i386"


I did an upload as version 008 to nativeEx_barebone.
@Oleg_II
Please use this as root for further developments.

Peter

#11 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 26 February 2007 - 04:33 PM

psc
Thanks :P The code will still need A LOT of cleaning to make it simple and logical to read :P

NIKZZZZ is testing registering driver without reboot (I can't do any tests right now, running HDD test on my testing computer right now :P

We will need to import a REG file. I have a question: REG.EXE is not in Windows 2000 by default. Would it be possible to use REGEDIT.EXE like this:

ShellExecute,Hide,"%WindowsDir%\Regedit.exe","/s #$q%Temp%\filedisk.reg#$q"

Or wold it be better to do something like this:

If,ExistFile,"%WindowsDir%\System32\reg.exe",ShellExecute,Hide,"%WindowsDir%\System32\reg.exe","import %Temp%\filedisk.reg"
If,ExistFile,"%WindowsDir%\Regedit.exe",ShellExecute,Hide,"%WindowsDir%\Regedit.exe","/s #$q%Temp%\filedisk.reg#$q"

:P

#12 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 05:24 PM

psc
We will need to import a REG file. I have a question: REG.EXE is not in Windows 2000 by default. Would it be possible to use REGEDIT.EXE ...

Your regedit suggestion is ok. I already used it in some older scripts to become w2k compatible.
(Sorry, I did not check syntax exactly, but it looks to be correct)

Question:
A .reg is 'suspicious' to the user because he/she does not see what happens.
In order to become more readable, I suggest (and do) to use RegWrite script lines.
I wrote a tool which converts .reg to WB script.
Think about that.

Peter

#13 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 February 2007 - 05:30 PM

Question:
A .reg is 'suspect' to the user because he/she does not see what happens.
In order to become more readable, I suggest (and do) to use RegWrite script lines.
I wrote a tool which converts .reg to WB script.
Think about that.


That's true but if the .reg files are too big, it will last longer.

#14 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 05:34 PM

That's true but if the .reg files are too big, it will last longer.


@Smilley: Long time ago that we responded directly. Nice to 'see' you again :P

That's once during build time!
And it gives the ability to the user, for his own purposes to add, remove or change a single line.

Peter

#15 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 February 2007 - 05:37 PM

@Smilley: long time ago that we respoded directly :P

That's once during build time!
And it gives the ability to the user, for his own purposes to add, remove or change a single line.

Peter


Ooops I made a mistake...

I mean that many RegWrite commands are slower than merging a single .reg file.
If someone use a reg file, the script easier to read.

#16 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 26 February 2007 - 05:43 PM

Lines are not too much :P

psc
Good suggestion! :P

#17 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 26 February 2007 - 05:53 PM

wb can import reg files natively - this is good since it will even work on Windows/9x/2000/XP/...

Here's the command:
RegImport,"RegFileToImport"

Regarding shellExecute - wb will wait for the application to finish before continuing - but I'm guessing that FileDisk starts an external process and finishes without waiting for this second process to finish also.

So the best approach might be a small autoIT script to start filedisk, lock the handle of the external process that is started and only finish when this process has also finished.

There is also ShellExecuteEx on wb - wich will start a process and continue the project building - I've only used it on qEmu since it is the last step and doesn't interfer in the overall processing.

:P

#18 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 06:00 PM

Regarding shellExecute - wb will wait for the application to finish before continuing - but I'm guessing that FileDisk starts an external process and finishes without waiting for this second process to finish also.

Does that mean that 'naturally' no chance for WinBuilder to wait for the FileDisk process structure (or for my VirtualBox VBoxManage.exe program)? :P

Peter

#19 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 February 2007 - 06:09 PM

Regarding shellExecute - wb will wait for the application to finish before continuing - but I'm guessing that FileDisk starts an external process and finishes without waiting for this second process to finish also.

So the best approach might be a small autoIT script to start filedisk, lock the handle of the external process that is started and only finish when this process has also finished.


Nuno I suspect that if FileDisk fails to unmount the disk , it ends.

Here is a simple autoIt script to do the rest: :P
Attached File  FileDisk.au3.txt   596bytes   548 downloads
( the forum doesn't allow me to upload it as .au3, so irenamed it to .txt)

Its command line is very simple:
AutoIt3.exe [path]\Filedisk.au3 /unmount [DriveLetter]

Note:
If the disk can't be unmounted the user is asked to retry or exit .
The script must be in the same folder with Filedisk.exe


John

#20 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 26 February 2007 - 07:03 PM

Does that mean that 'naturally' no chance for WinBuilder to wait for the FileDisk process structure (or for my VirtualBox VBoxManage.exe program)? :P

Peter


ShellExecute is behaving as expected, starts a program and only continues when it is closed.

First it is necessary to understand the reasons why filedisk won't unmount as expected, as far as we know it could even have a few locked folders by the antivirus, explorer or something else and take a while for the handles to be released.

There is a wait command already added on wb would this help? - perhaps it could be added to wait n seconds before attempting to unmount the disk..

#21 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 February 2007 - 07:22 PM

ShellExecute is behaving as expected, starts a program and only continues when it is closed.

First it is necessary to understand the reasons why filedisk won't unmount as expected, as far as we know it could even have a few locked folders by the antivirus, explorer or something else and take a while for the handles to be released.

There is a wait command already added on wb would this help? - perhaps it could be added to wait n seconds before attempting to unmount the disk..


I think its the same when using a flash disk. When you are doing some thing in it, it can't be unmounted imediately . I also think that saying to the script to wait for n seconds before executing is also a bad idea because not all computers work fast so in a VERY slow computer it will just fail.

#22 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 26 February 2007 - 07:22 PM

ShellExecute is behaving as expected, starts a program and only continues when it is closed.

First it is necessary to understand the reasons why filedisk won't unmount as expected, as far as we know it could even have a few locked folders by the antivirus, explorer or something else and take a while for the handles to be released.

There is a wait command already added on wb would this help? - perhaps it could be added to wait n seconds before attempting to unmount the disk..

Thanks for your explanations. They are exactly my opinion (Including thinking about 'wait')
But my theory went into:

While (ShellExecuterHandler <> 0)
Wait 10 //(milliseconds, not seconds!)
Wend

And this could be done inside the ShellExecute command

Peter

#23 smiley

smiley

    Silver Member

  • .script developer
  • 905 posts
  •  
    Greece

Posted 26 February 2007 - 07:28 PM

While (ShellExecuterHandler <> 0)
Wait 10 //(milliseconds, not seconds!)
Wend


My autoit script does almost the same . The only difference is that it repeats the same until the disk is unmounted

#24 Oleg_II

Oleg_II

    Frequent Member

  • Advanced user
  • 298 posts
  • Location:Somewhere in the East

Posted 26 February 2007 - 07:38 PM

Nuno Brito
NIKZZZZ explained that FileDisk /umount command is not starting new proccess for unmounting drive. It just has limited "waiting" time for actual unmounting. It could exit with a time-out error when copying proccess is not finished.

Two or three repeting commands were enough to solve this problem.

But now it should work with only one line of code :P NIKZZZZ updated zCopy.exe utility and it waits until all operations are completed.


New beta is out! :P No need to reboot! :P

#25 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 26 February 2007 - 08:34 PM

Here's the shellExecute code I use:
//  SetPriorityClass&#40;exinfo.hProcess, HIGH_PRIORITY_CLASS&#41;;



												  While GetExitCodeProcess&#40; exinfo.hProcess, exitcode &#41;

														and &#40;exitcode = STILL_ACTIVE&#41; and &#40;Scripthalt = False&#41;

												  Do begin

													 //Sleep&#40; 150 &#41;;

													 application.ProcessMessages;

														end;



													 if scriptHalt

													  then

													   terminateProcess&#40;exInfo.hProcess, WM_QUIT&#41;;

Just commented out the SetPriorityClass since it would cause single core CPU's to freeze and replace the Sleep function with a call to application.processMessages to make the program more responsive.

Oleg, thanks for the new beta!

NIKZZZZ has done a good option in my opinion - how about also adding MD5 comparing if it doens't slow down the filecopy process too much?

100% sure that the file is correctly written (just an idea tought), nice work! :P




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users