Soemhow, you made a mess of it. And it seems the defragging of the registry started it. That's lesson #1: leave the registry alone (no cleaning, no optimizing, no defragging).
Some things are not clear in your post (that might come because I don't have Vista):
- doing diagnostic when asked to choose between setup or recovery
- "all good but the last came up with osnotinstalled": what's 'all' and what is 'the last'
The 'how and why' isn't clear. But if the OS isn't installed indeed, better reinstall it from your DVD.
Kees
Have a begger of a prob got a comp now this is the first vista os i have delt with here had a malicis ad on it so have removed that and computer booted normaly so i then cleaned the registry and again it booted normaly then i did a reg defrag and the comp just keeped going to the first screen on where you chose setup or recovery so i did the dignostic and every thing says 100% so i did the boot recovery and all good but the last came up with
osnotinstualled
now too me that looks like it has unistalled vista but how and why some help would be most excellint

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic