Jump to content











Photo
- - - - -

nt6.exe installer modification?


  • Please log in to reply
13 replies to this topic

#1 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 19 July 2011 - 11:36 AM

Hello guys,
:(
I'm using nt6 fast installer which helps me alot when it comes to installing win7 to hard disks.
:(
I have created a .wim file of xp and would like to install it via this way as well, However, I am having a problem when it comes to applying the boot files and sector to the disk.

could somebody please help me to add a menu which would help me choose whether I'd like to add either the windows 7 or xp MBR to the disk, please?
I understand that:

echo Creating bootmgr menu and bootsect...
bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul
if exist %bootpath%\ntldr (
REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu
md %installpath%\$ntldr
)
bootsect.exe /nt60 %bootpath% >nul
echo The boot menu and bootsector has been created!
Will create the bootmgr along with the files and if xp is found, will add windows xp to the boot menu.

However, I'd like to have a menu which is something like:
1. apply ntldr boot code.
bootsect.exe /nt52 %bootpath% >nul
2. apply bootmgr and add existing ntldr to bootmenu:
bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul
if exist %bootpath%\ntldr (
REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu
md %installpath%\$ntldr
)
bootsect.exe /nt60 %bootpath% >nul

Really, I have no knowledge of batch creation, and your help would be much appreciated.

Regards,

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 July 2011 - 01:10 PM

You have got it mostly :cheers:, but I am failing to see the logic of applying the NTLDR bootsector to later add an entry to the BCD.
If there is the NTLDR bootsector, the NTLDR will be invoked (and it will check BOOT.INI and ignore the BCD) :(
If you overwrite it with the BOOTMGR bootsector, what is the point of writing the NTLDR invoking one? :(

:ranting2:
Wonko

#3 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 19 July 2011 - 01:40 PM

Hello Wonko,

,"but I am failing to see the logic of applying the NTLDR bootsector to later add an entry to the BCD."
I'm so sorry about my earlier explanation, I think I have it mixed up, I'll try again hopefully better this time.

maybe this causes the confusion?:
"2. apply bootmgr and add existing ntldr to bootmenu"
what I actually mean is:
2. apply bootmgr and if exist ntldr add xp to bootmgr menu?

My aim of this topic is that:
1. if I decide to apply the xp image from the wim file to the hdd, it will write the ntldr bootsector,
bootsect.exe /nt52 to the boot drive.
2. if I decide to install windows 7 to the bootable partition, it will apply bootsect.exe /nt60
or, if I have two partitions on the hdd, one with xp, and one which will be with 7, it will then add an entry of xp to the bootmgr menu?

I hope I am making sense...

thanks much for your time.

Regards,

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 July 2011 - 02:02 PM

Let's start again, OK :cheers: :(.
Are we (actually you) talking of this, right?
http://reboot.pro/10126/
There are several batch files in it, the snippet you posted is in installer.cmd, but what actually does is to create a "tag" for post-processing:

REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu


The post-processing is actually done by SetupComplete.cmd:
@echo off







if exist %SystemDrive%\$usb (

powercfg -h off

rd %SystemDrive%\$usb >NUL

)

if exist %SystemDrive%\$ntldr (

bcdedit /delete {ntldr} /f >NUL

bcdedit /create {ntldr} -d "boot.ini Menu" >NUL

bcdedit /set {ntldr} device boot >NUL

bcdedit /set {ntldr} path \ntldr >NUL

bcdedit /displayorder {ntldr} /addlast >NUL

rd %SystemDrive%\$ntldr >NUL

)

The main part of it checks for the "tag" and if it finds it adds the NTLDR entry to the BCD.
What do you want it to do INSTEAD (and no I am afraid I am not undersanding fully you r explanation as well as your original post :().

Try doing the whatever you want to do manually, then post the commands you used for doing it, and we will find a way to add the feature to the small batch above.

:ranting2:
Wonko

#5 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 19 July 2011 - 04:25 PM

Hello Wonko,

You're making me scared, I wonder, what is happenning to my English?
:(
or maybe I don't speak to much so perhaps...
but anyways,


but yes, I'll start over, and so, here is the situation:

I have a .wim file with windows xp, and so I do as follows:
1. format f: /q /y
2. imagex /apply x:\wxp.wim 1 f:\
3. bootsect.exe /nt52
4. Restart pc to continue xp install.

I figured by using nt6 fast installer, it would automaticly take care of the formatting, imagex processing and so now, I'm trying to make it with your help that this installer.cmd automaticly applies:
bootsect.exe /nt52?

I hope you maybe able to understand me this time?

Again, Wonko, thanks for your time, much appreciated.

:(

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 July 2011 - 04:42 PM

It would then be something like :(?:
if exist %SystemDrive%\$ntldr (

bootsect.exe %SystemDrive% /nt52

REM Add here for provisions for creation of BOOT.INI

REM CALL :write_BootINI

rd %SystemDrive%\$ntldr >NUL

)

What is/are needed entry(ies) in BOOT.INI?
Do they need to be "dynamically generated" or a "standard/simple":
:write_BootINI

(

ECHO [boot loader]

ECHO Timeout=30

ECHO default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

ECHO [operating systems]

ECHO multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

)> %SystemDrive%\BOOT.INI

ATTRIB +h +r +s %SystemDrive%\BOOT.INI

GOTO :EOF
would do?
Or is a BOOT.INI already inside the .wim?

I am perplexed by your:
4. Restart pc to continue xp install.
WHAT is inside the .wim you make:
  • an already installed XP
  • a "setup for XP"
  • a partial install of XP made with WINNT32.exe /syspart:Y: /tempdrive:Y: /makelocalsource /noreboot
  • something else (describe)

:(
Wonko

#7 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 19 July 2011 - 06:52 PM

Hello Wonko,

Thankyou really much for the syntax on how to go about doing this. I've not yet had a chance to test it out, as I'd just like to make sure I've put your code in the correct place.
so it goes something like this?:

echo Creating bootmgr menu and bootsect...

if exist %SystemDrive%\$ntldr (
bootsect.exe %SystemDrive% /nt52
GOTO :EOF
bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul

if exist %bootpath%\ntldr (

REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu

md %installpath%\$ntldr

)

bootsect.exe /nt60 %bootpath% >nul

echo The boot menu and bootsector has been created!
or, have I blown it...
:(

Yep the .wim does contain a boot.ini however, I shall keep all the code in case it will come in handy...
;)

Yep, the .wim is a pre-installed xp, and then syspreped using the system preparation assistant tool from:
http://gostep.info

I don't know of any other better way to sysprep the xp so that it boots from a SATA hdd or IDE hdd.
But I've had success installing this xp to different hardware and because I use the easy drv I also add the drivers to the .wim as well.

Just a question if you don't mind?

why is it, that in the batch file it is refered to as "$ntldr" yet the filename when I hear it is "ntldr"? what does the $ represent?

Thanks again for your time.
:cheers:

:cheers:

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 July 2011 - 07:26 PM

....
or, have I blown it...
:(

The second you said. :(


Yep, the .wim is a pre-installed xp, and then syspreped using the system preparation assistant tool from:
http://gostep.info

I don't know of any other better way to sysprep the xp so that it boots from a SATA hdd or IDE hdd.
But I've had success installing this xp to different hardware and because I use the easy drv I also add the drivers to the .wim as well.

http://www.911cd.net/forums//index.php?showforum=43
;)

Just a question if you don't mind?

why is it, that in the batch file it is refered to as "$ntldr" yet the filename when I hear it is "ntldr"? what does the $ represent?

There are TWO batches involved :ranting2: :
  • installer.cmd
  • SetupComplete.cmd

This snippet:
echo Creating bootmgr menu and bootsect...

bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul

if exist %bootpath%\ntldr (

REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu

md %installpath%\$ntldr

)

bootsect.exe /nt60 %bootpath% >nul

echo The boot menu and bootsector has been created!
"belongs" to #1

This other snippet:
if exist %SystemDrive%\$ntldr (

bcdedit /delete {ntldr} /f >NUL

bcdedit /create {ntldr} -d "boot.ini Menu" >NUL

bcdedit /set {ntldr} device boot >NUL

bcdedit /set {ntldr} path \ntldr >NUL

bcdedit /displayorder {ntldr} /addlast >NUL

rd %SystemDrive%\$ntldr >NUL

)
"belongs" to #2

The first CREATES a DIRECTORY named $ntldr IF FILE ntldr is found.
The second checks for the presence of the DIRECTORY $ntldr, and IF it is found, adds the entry for ntldr in the BCD AND removes the $ntldr DIRECTORY.

You can replace in #2 the snippet:
if exist %SystemDrive%\$ntldr (

bcdedit /delete {ntldr} /f >NUL

bcdedit /create {ntldr} -d "boot.ini Menu" >NUL

bcdedit /set {ntldr} device boot >NUL

bcdedit /set {ntldr} path \ntldr >NUL

bcdedit /displayorder {ntldr} /addlast >NUL

rd %SystemDrive%\$ntldr >NUL

)
with the proposed snippet:
if exist %SystemDrive%\$ntldr (

bootsect.exe %SystemDrive% /nt52

REM Add here for provisions for creation of BOOT.INI

REM CALL :write_BootINI

rd %SystemDrive%\$ntldr >NUL

)
changing in #1 to:
echo Creating bootmgr menu and bootsect...

REM bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul

if exist %bootpath%\ntldr (

REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu

md %installpath%\$ntldr

)

REM bootsect.exe /nt60 %bootpath% >nul

echo The boot menu and bootsector has been created!

(or at least this was the proposed way :cheers:, still IF I got the idea of what you are trying to achieve right :cheers:), and of course the:
echo The boot menu and bootsector has been created!
would become a LIE! :w00t: ;)


:cheers:
Wonko

#9 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 19 July 2011 - 08:49 PM

hello Wonko,

My appoligies for making you mad with regard to the batch files, it's entirely my fault and after listening to it more cloesely and with my fullest attention, I better understand what is being done.
;)

Please, some questions and perhaps a new proposed suggestion if you could help me?

1. Thanks for the thread on syspreping that you have given me, do you feel that there are advantages to it then to use the one from gostep?
2. While I know this question, might make you feel as if we are going in circles here, could perhaps, the following be done?:
2.1. create a file and name it whatever.bat
place the following in whatever.bat:
if exist %SystemDrive%\$ntldr (
bootsect.exe %SystemDrive% /nt52
REM Add here for provisions for creation of BOOT.INI
REM CALL :write_BootINI
rd %SystemDrive%\$ntldr >NUL
)
2.2. in install.cmd add the following after:
echo Creating bootmgr menu and bootsect...
a menu to choose if I'd like to install the ntldr bootsector or bootmgr bootsector
so if I choose ntldr bootsector it would call whatever.bat, and then it would goto eof. Whereas, if i choose the bootmgr bootsector it would continue processing the batch file from:
bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul
...

I don't mean to go in a circle here, and I hope maybe you can see where this is going by my example?

I'd like to use this batch installer to install both 7 or xp, along with their necessary boot information.

Thanks again for your time and suggestions Wonko,

:cheers:

#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 July 2011 - 08:38 AM

Sure, 2.2 is Ok, I think I finally got the idea :cheers: but then you don't really need the whatever.bat, you can insert the few lines in the installer.cmd.

This:
REM --------------------------------------------------------------------------------------

REM Creating bootmgr menu and bootsect

REM --------------------------------------------------------------------------------------

echo    Creating bootmgr menu and bootsect...

bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul

if exist %bootpath%\ntldr (

REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu

md %installpath%\$ntldr

)

bootsect.exe /nt60 %bootpath% >nul

echo    The boot menu and bootsector has been created!

may become something like:
REM --------------------------------------------------------------------------------------

REM Creating bootmgr menu and bootsect

REM --------------------------------------------------------------------------------------

:choose_loop

CLS

echo    Creating bootmgr menu and bootsect...

ECHO.

SET chooseOS=

SET /P chooseOS=Are you installing XP or 7? [X/7] 

IF %chooseOS%.==X. GOTO :Wise_ChoiceX

IF %chooseOS%.==7. GOTO :Wise_Choice7

ECHO Are you dumb or what? You are supposed to type ONLY "X" or "7"!&Pause

GOTO :choose_loop

:Wise_ChoiceX

bootsect.exe %SystemDrive% /nt52

REM Add here for provisions for creation of BOOT.INI

REM CALL :write_BootINI

ECHO.

echo    The boot menu and bootsector has been created!

ECHO.

echo    Everything is completed, press any key to exit.

echo    Please reboot your computer to continue the installation!

Pause>nul

GOTO :EOF

:Wise_Choice7

bcdboot %installpath%\Windows /s %bootpath% /l %lang% 2>nul

if exist %bootpath%\ntldr (

REM Post-process tag if exist NT 5.x in order to add an ntldr item in the bootmgr menu

md %installpath%\$ntldr

)

bootsect.exe /nt60 %bootpath% >nul

echo    The boot menu and bootsector has been created!

:cheers:
Wonko

#11 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 20 July 2011 - 11:44 AM

Hello Wonko,
:cheers:
My post of thanks and appoligies.

I really would like to thank you in giving your time to help achieve what I have wanted. I have tested it, and made just a minor correction, and all works fine now, again, I can't tell you in writing how happy I am.
:(
:cheers:

I'd also like to appoligise for the vague use of the english language which resulted in you not understanding initially what I wanted to do, but I must thank you for not giving up with me and I'm happy all is well now.
:cheers:

:)
ps.
after analysing the spat from gostep.info carefully, I think I may no the reason why you have given me the topics to look at from the 911 cd forum concerning sysprep.

Have a great day, sir,

:cheers:

#12 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 July 2011 - 11:54 AM

I'd also like to appoligise for the vague use of the english language which resulted in you not understanding initially what I wanted to do, but I must thank you for not giving up with me and I'm happy all is well now.
:cheers:

No need to apologise at all, it's not your English (or mine :cheers:) it is most likely different terms used and some (yet) missing familiarity with the "jargon" and with batch scripting.

Only too happy that it is working, but of course the idea is that of making you more familiar with batches, so that you can do this kind of little mods by yourself or at least experiment different ways :cheers:.

Batch language - at least in these kind of simple scripts - is quite easy to follow as it greatly resembles "plain English".

:)
Wonko

#13 TheRookie

TheRookie

    Newbie

  • Advanced user
  • 156 posts
  • Location:in your mind
  • Interests:computers: (repairing, administration), reading: (technological info), outing: (having a good time), music (electronic, house, instrumental...) and hiking
  •  
    South Africa

Posted 20 July 2011 - 09:37 PM

Hello Wonko,

I do understand your point about me having to learn to create or modify batch files myself, so that I may be able to do it on my own someday.

Truth is, I think I need to find a guide to the basics of batch scripting and built on what I learn as I go through the guide. My problem is, I don't really know what to choose since when asking for one by google, I get 10... and don't quite know which one would be sufficient for me.

But hopefully if I do find one, I'll present the batch the next time I have a problem rather than you actually writing the script for me which you've kindly did in the previous posts.
:cheerleader:

Again, tahnks for your help I really appreciate it.
:cheerleader:

Anyways, must go and have my cup of tea, (my daily dose of survival)

take care,

Regards,

#14 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 11,105 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 21 July 2011 - 06:37 AM

Guides? :cheerleader:
Naah, examples! (commented)

Just go through this site:
http://www.robvanderwoude.com/
http://www.robvander.../batchstart.php

(slowly at first)

:cheerleader:
Wonko