Archive: NTLDR is missing!!!!


NTLDR is missing!!!!
  Hi everyone.

While testing an installer built by NSIS, I got the error

NTLDR is missing
Press Ctrl+Alt+Delete to Restart

What possible scenarios could cause this error to occur. It occurs not one time after installation, but after 10 or so install/uninstalls. Could it be involved in writing to the registry and deleting specific registry keys? I know this is quite a vague question but I don't know where to begin with this issue.


I have had this same problem before (recently in fact. It happened when I was trying to compile an example script made with the experience ui. I finally got it to run but with no pages and this must have deleted the files). NTLDR stands for NT file system loader. This file is in the root directory with a few other files (io.sys, msdos.sys, detect.com). I found out (using someone elses computer with windows xp) that the file system is intact, it is just that startup is missing this file. I recommend backing up all of your personal stuff and reinstall windows (if you have that luxury). Hey, I had to do it (I also found out that setup deletes the files in the my documents folder. The folders are still there but the files are gone - even copying and renaming the folder on the same drive does not work - poor me, I lost all my documents, music, and videos).

Before you reinstall windows (if you have that luxury), you could try copying the NTLDR file from someone elses computer that has the NT file system.

Hope this helps.


This would have been caused if you did a Delete "*.*" by giving it a relative path rather than a full path.
NTLDR is a file that sits on the root of your system HDD and without it your PC will not boot.
I fixed it by installing Windows on another HDD and then creating a new NTLDR file on my original HDD.

-Stu


Maybe it is a good idea to test your new scrips on a virtual PC installed on your developing machine instead of directly on your developers machine. Just do not change settings and restart the virtual PC for another test round.

If you make a shared folder where the install.exe lands you do not even move files around.


What the...!?
  I have never heard of such an issue as this but I will look into it and see what I can do. What example script are you compiling? The main ExperienceUI setup program does not use a "Delete *.*" but it deletes every file individually on a whitelist basis.

Edit: I have noticed that on several different machines, with different configurations, all files in root of C: are deleted when Windows Media Slayer is launched for the first time. This took place on new installations of Win2k Pro with no SPs, and WinXP Home SP1, nothing else installed yet. If you haven't snooped around your WinXP cd at all, all of the i386\*.??_ files are compressed CAB files that can be unzipped with Recovery Console's EXPAND command. NTLDR is not compressed however, so you can simply pop in your XP cd, start Recovery Console, and copy the CD's i386\NTLDR file to C:

BattyNDN, did the installer that you were having trouble with use the ExperienceUI? If so, was it one of the example installers or was it an installer for a real program?

This looks like a rather big issue, so I will work on it hard and see what I can find.

-dandaman32


>> What possible scenarios could cause this error to occur

Listen to me - pls - you have an undeclared variable such as

$PLUGINSDIR

and if you have that

Function .onGUIEnd
Delete $PLUGINSDIR\*.*
RMdir $PLUGINSDIR


and it NOT declared that var is set to System-Root.

Thats a minor bug and annoying "feature" that NSIS dont
verify all vars in sc. :/

hth

I have a sanity checking function for that... need to wikify it...

Done: http://nsis.sourceforge.net/IsRoot_-...esults_in_root

Things missing is checking for things like ".." in the path... not too sure yet how to deal with that - such paths tend to be 'deliberate' rather than the result of e.g. missing data or typos, which the sanity check is really intended for.


I was using the Windows Notepad example script. It would not compile the first time so I started commenting out the lines where the compile would freeze. After running it, I found I couldn't boot my system again. Just started tinkering again and found out that it was file /oname=$PLUGINSDIR\filename.bmp "${XPUI_${UNINSTALLER}LEFTLOGO} in GUIINIT that was causing it to not compile. Taking out the defined uninstaller created another error: cannot open include file system.nsh. After commenting out this line, I was shown a nice Experience UI installer for the first time.


JasonFriday13 wrote:
Just started tinkering again and found out that it was file /oname=$PLUGINSDIR\filename.bmp "${XPUI_${UNINSTALLER}LEFTLOGO} in GUIINIT that was causing it to not compile.
Ah - I think I see what happened here: XPUI.nsh, around line 1588

 !insertmacro XPUI_DEFAULT XPUI_UNLEFTLOGO `${XPUI_LEFTLOGO}`

!
insertmacro XPUI_DEFAULT XPUI_HEADERIMAGE `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\Header.bmp`
!insertmacro XPUI_DEFAULT XPUI_UNHEADERIMAGE `${XPUI_HEADERIMAGE}`
!insertmacro XPUI_DEFAULT XPUI_BOTTOMIMAGE_BMP `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\Bottom.bmp`
!insertmacro XPUI_DEFAULT XPUI_UNBOTTOMIMAGE_BMP `${XPUI_BOTTOMIMAGE_BMP}`
!ifdef XPUI_PAGE_BGIMAGE
!insertmacro XPUI_DEFAULT XPUI_PAGE_BGIMAGE_BMP `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\Page.bmp`
!insertmacro XPUI_DEFAULT XPUI_LEFTLOGO `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\lb_page.bmp`
!else
!insertmacro XPUI_DEFAULT XPUI_LEFTLOGO `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\LeftBranding.bmp`
!endif
Should be:

 !ifdef XPUI_PAGE_BGIMAGE

!insertmacro XPUI_DEFAULT XPUI_PAGE_BGIMAGE_BMP `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\Page.bmp`
!
insertmacro XPUI_DEFAULT XPUI_LEFTLOGO `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\lb_page.bmp`
!else
!insertmacro XPUI_DEFAULT XPUI_LEFTLOGO `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\LeftBranding.bmp`
!endif
!insertmacro XPUI_DEFAULT XPUI_UNLEFTLOGO `${XPUI_LEFTLOGO}`
!insertmacro XPUI_DEFAULT XPUI_HEADERIMAGE `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\Header.bmp`
!insertmacro XPUI_DEFAULT XPUI_UNHEADERIMAGE `${XPUI_HEADERIMAGE}`
!insertmacro XPUI_DEFAULT XPUI_BOTTOMIMAGE_BMP `${NSISDIR}\\Contrib\\ExperienceUI\\Skins\\Default\\Bottom.bmp`
!insertmacro XPUI_DEFAULT XPUI_UNBOTTOMIMAGE_BMP `${XPUI_BOTTOMIMAGE_BMP}`
I'm not sure, but there may have been a hidden "feature" in 1.1M3 that was not yet documented but nevertheless existed (maybe - still not sure if it made it or not :shrug:) that used a bitmap behind the page area. Truth is, that demanded a new Left Logo in order to work. I needed to check the state of the background image (XPUI_PAGE_BGIMAGE) and change the Left Logo accordingly. This script should fix it.

Edit: Also removed $PLUGINSDIR cleaning, I'll let NSIS do it for me.

For more information, see this forum thread.

-dandaman32

JasonFriday13 wrote:
Taking out the defined uninstaller created another error: cannot open include file system.nsh
System.nsh is just a pointer to the SysFunc.nsh included with NSIS. File attached. Will include System.nsh in 1.1.

-dandaman32

NTLDRismissing.com
  Missing registry keys (or a damaged registry) will not cause the "NTLDR is missing" error. The NTLDR is called before the registry when your computer gets booted.

Microsoft mentions in KB article 320397 that if to many files are added and then removed from the root of the system disk, the MFT will become fragmented and the entry that points to the NTLDR will be in the "second allocution index". Which apparently is a problem.

If anyone happens to be coming here looking for a fix for this error might I humbly suggest:

http://ntldrismissing.com/

You can use it to create a boot disk to get you back into Windows where you can back up your data and attempt further troubleshooting from a more familiar environment.


Thanks, I will put a link to that on my website for future reference if that is OK

-Stu :)


No problem, feel free to link all you like.