Jump to content











Photo
- - - - -

Win2k as host


  • Please log in to reply
8 replies to this topic

#1 rscataran

rscataran
  • Members
  • 3 posts

Posted 18 July 2006 - 11:07 PM

I have posted from the previous forum that I want to run win2k as host for OpenBuilder. The reply was some files may be missing like 'reg.exe'.

I copied the reg.exe from my XP installation and the scripts work and made an ISO of it. But when I tested the ISO there are missing files. If I recall correctly 'mouse.sys' or something. I have to get back to you on that for confirmation.

-Wind0ws 2000
-PentiumIII 800Mhz
-256Mb
-VittualPC 2004

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 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 18 July 2006 - 11:18 PM

Well.. If I'm interpreting your results right, I think I have both good and bad news for you..


The good news is that probably you have all the tools needed to sucessfully build your CD projects..



The bad news is that your source windows is one of those that still gives mouclass.sys problems, wich hopefully will be definitively fixed soon enough..


You can fix it by manually adding the file to your target folder files.

Mouclass.sys can be found on your source files at least in two places:

DRIVER.CAB (inside this cab file)

or as mouclass.sy_ (needs to be decompressed using expand.exe)

The file mouclass.sys goes into the system32\drivers, you can place it there, then deselect all scripts except for the mkisofs (to create the ISO) and the qemu (to see the results..)

Hopefully this will leave your ISO file boot as expected..

:P


btw: if you have some spear time, you can always download and use a trial win2003 from ms as source..

#3 rscataran

rscataran
  • Members
  • 3 posts

Posted 19 July 2006 - 01:39 AM

The bad news is that your source windows is one of those that still gives mouclass.sys problems, wich hopefully will be definitively fixed soon enough..
You can fix it by manually adding the file to your target folder files.

Mouclass.sys can be found on your source files at least in two places:

DRIVER.CAB (inside this cab file)

or as mouclass.sy_ (needs to be decompressed using expand.exe)

The file mouclass.sys goes into the system32\drivers, you can place it there, then deselect all scripts except for the mkisofs (to create the ISO) and the qemu (to see the results..)

Hopefully this will leave your ISO file boot as expected..

:P
btw: if you have some spear time, you can always download and use a trial win2003 from ms as source..


This means that if I change that source to win2k3 then mouclass.sys would not be a problem?? I'm using WinXPSP2 as source as of the moment.

I will try using win2k3 as source and will let you know of the results.

Thanks.

#4 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2006 - 10:51 AM

I tried it on my W2K SP4 system.

The missing reg.exe is no problem, because it is in the <setupCD>\support directory. I just copied into system32.

My installation had no success, too. I found the root of the problem:

In the Hives script the lines
FileCreateBlank,%hivedir%\%hive%

if,NotExistFile,%hivedir%\%hive%,exit,&#34;File &#91;%hivedir%\%hive%&#93; was not found!&#34;

RegHiveLoad,&#34;%WorkHive%&#34;,&#34;%hivedir%\%hive%&#34;
bring the log:

FileCreateBlank - Successfully created a new file:[C:\Dokumente und Einstellungen\Administrator\Desktop\OpenBuilder_Test\Projects\NanoXP\Target\i386\system32\setupreg.hiv]
If clause ignored - File already exists: [C:\Dokumente und Einstellungen\Administrator\Desktop\OpenBuilder_Test\Projects\NanoXP\Target\i386\system32\setupreg.hiv] evaluated string: [if,NotExistFile,%hivedir%\%hive%,exit,"File [%hivedir%\%hive%] was not found!"]
RegHiveLoad - Failed to load registry hive: [reg-setup] from file: [C:\Dokumente und Einstellungen\Administrator\Desktop\OpenBuilder_Test\Projects\NanoXP\Target\i386\system32\setupreg.hiv]


Result:

Under W2K the RegHiveLoad script command has a different behaviour.

Without a change of the script engine the Hive script never will run on a W2K host, not even with W2K3 source.

Peter

#5 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 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 21 July 2006 - 12:28 PM

That's strange.. On older versions the regHiveLoad command was a wrapper to:

reg.exe LOAD HKLM\%HiveName% %HiveFile%

But since dirkgently42 reported his problems with Win2k, I realized that windows 2000 is using reg.exe version 1, where only 2 and 3 (found in XP and 2003) will support the hive load feature (or am I wrong? :P)

To solve this problem, I've added code to load the hives directly throught win32API - wich *should* be working on every single version of win32 since windows 95.. :P

My happyness quickly faded when I realized that while scripts that only loaded the hives would work, there still would be no solution to import registry files (.reg) into the registry, unless they are converted to native script format, and this could take a good while to mannualy translate all registry keys..

All of this because the hive script will still reg.exe "import" option to silently add the .reg files data into the fresh hive..


While I'm writing this topic I remembered that one could use shellexecute on each file - but the user would need to press "yes" on the question "Are you sure you want this registry keys into the registry?" each time to create a new hive.. Any way to workaround this on windows 2000? (or win9x..) :P

---------------------------------------------------------------

Now the problem that psc reports is quite different, since it shows that the hive isn't being loaded at all, I just wonder why?? :P

psc, You tested using an admin account when running the script, right?

I'm still clueless on why.. perhaps win2000 does has backup accounts to perform registry backups..

:P

#6 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2006 - 02:35 PM

In the mean time I did some tests.

In my system is reg.exe version 2, Testing with version 3 from XP gives the same result.

I tried to load the hive in a cmd window by:
2000reg load &#34;HKEY_LOCAL_MACHINE\reg-setup&#34; &#34;C&#58;\Dokumente und Einstellungen\Administrator\Desktop\OpenBuilder_Test\Projects\NanoXP\Target\i386\system32\setupreg.hiv&#34;

I got an error message

Error: Das System hat versucht, eine Datei in die Registrierung zu laden oder wiederherzustellen, aber die angegebene Datei hat nicht das Format einer Registrierung.


In English it is something like: The system tried to load a file into registry or to rebuild it, but the file does not have registry format.

On a different system W2000 Sp4 Pro (no server like the first one) the same result.

Peter

BTW: I'm logged in as local administrator .

#7 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 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 21 July 2006 - 03:09 PM

It seems win2000 does work on winxp .reg files.. I just wish I had a W2k machine to try it.. perhaps it's related to the version of syntax in the .reg files? :P

#8 pscEx

pscEx

    Platinum Member

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

Posted 21 July 2006 - 05:05 PM

Works!

Build of "my" NanoXP version on XP Sp2 host with XP Sp2 source: :P
Build of "my" NanoXP version on W2K Sp4 host with XP Sp2 source: :P

The problem is that W2K does not accept an empty hive. Therefore I started with an hive template w/o any contents.

ToDo:

Step1a: Create with regedit an empty key whereever you want.

I used HKLM\Software\xxx (Just HKLM\xxx is not allowed under W2K)

Step 1b: Export this key by
reg save HKLM\Software\xxx <NanoXP>\build\template.hiv

Step 1c: Delete the new key by regedit

(This template could be encoded inside the script, my next step)

Step 2: Modify the Hive script:

Replace in [process] some FileCreateBlank to a Run call
&#91;process&#93;

echo,&#34;Creating blank files...&#34;

Set,%hivedir%,%targetdir%\i386\system32\config

Set,%hive%,&#34;sam&#34;

Run,%ScriptFile%,create-Blank

Set,%hive%,&#34;security&#34;

Run,%ScriptFile%,create-Blank

FileCreateBlank,%targetdir%\i386\system32\config\sam.log

FileCreateBlank,%targetdir%\i386\system32\config\software.log

ExtractAllFilesIfNotExist,&#34;%ScriptFile%&#34;,&#34;Boot&#34;,&#34;%TargetDir%&#34;

Set,%hivedir%,%targetdir%\i386\system32

Set,%hive%,setupreg.hiv

Run,%ScriptFile%,process-runhive

Set,%hiveREG%,reg-software.reg

Set,%hive%,software

Set,%workhive%,reg-software

set,%hivedir%,%TargetDir%\i386\system32\config

Run,%ScriptFile%,process-runhive

Set,%hivedir%,%targetdir%\i386\system32

Set,%hive%,&#34;default&#34;

Run,%ScriptFile%,create-Blank

Define this new procedure:
&#91;create-Blank&#93;

FileCopy,&#34;%ScriptDir%\template.hiv&#34;,&#34;%hivedir%&#34;

If,ExistFile,&#34;%hivedir%\%hive%&#34;,FileDelete,&#34;%hivedir%\%hive%&#34;

FileRename,&#34;%hivedir%\template.hiv&#34;,&#34;%hivedir%\%hive%&#34;

if,NotExistFile,%hivedir%\%hive%,exit,&#34;File &#91;%hivedir%\%hive%&#93; was not found!&#34;

Change [process-runhive]
&#91;process-runhive&#93;

echo,&#34;Creating a new %hive% hive..&#34;

extractfile,%scriptfile%,Hives,%hiveREG%,%hivedir%

if,NotExistFile,%hivedir%\%hiveREG%,exit,&#34;%hiveREG% was not found!&#34;

Run,%ScriptFile%,create-Blank

RegHiveLoad,&#34;%WorkHive%&#34;,&#34;%hivedir%\%hive%&#34;

ShellExecute,&#34;hide&#34;,&#34;reg.exe&#34;,&#34;import #$q%hivedir%\%hiveREG%#$q&#34;

RegHiveUnLoad,&#34;%WorkHive%&#34;FileDelete,&#34;%hivedir%\%hiveREG%&#34;

RegHiveUnLoad and RegHiveLoad inside let create the ISO correctly. But during the setup phase it hangs w/o any error message.

Good luck in testing!

Peter

Correction!

RegHiveUnLoad and RegHiveLoad work! I made a mistake when testing.
I changed the above codes accordingly.

Edited by psc, 21 July 2006 - 06:31 PM.


#9 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10544 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 21 July 2006 - 07:14 PM

I used HKLM\Software\xxx (Just HKLM\xxx is not allowed under W2K)

I wonder why win2000 won't allow to create hives on the root of HKeys, but I'm really glad your solution works fine on win2k machines.. :P

There were two different problems to handle from the beginning, but you also provided a solution for the second.. excellent work!

An hive template really seems a more stable ground to work when creating hives, this should be the final step towards win9x as well.. :P


Very well.. :P




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users