If it's bluescreening while Ubuntu's installing, that would mean you're using Wubi (Windows UBuntu Installer). This installs Windows on a file on your existing Windows partition, which is nice for trying Ubuntu out without committing to repartitioning your hard drive.
The problem with it (especially in your situation) is that because of the "installed in a file" thing, it's extra susceptible to data loss from hard reboots.
30-40 C shouldn't be any problem at all. For a desktop, I'd say it's likely to be a fairly typical idling temperature. My laptop is currently running a bit above idle at 50 C.
If you want to make sure it's not a heating issue, shut down and boot from your Ubuntu CD directly (instead of through your Wubi install, as you don't want to mess that up if the following stress test does cause the machine to crash). Then open up a terminal window for each CPU core you have, plus one more. For each CPU core, type "top -d0" into one of your terminal windows and hit enter (top is a process monitoring program, but we're using it here because the -d0 option makes it update its display as fast as it possibly can, making it take up as much CPU time as it can get ahold of. It's only single threaded, though, so each instance will only max out one core). In the remaining terminal window, type "sensors" and hit enter. This will give you a temperature reading (and should also give you the critical temperature for the components your sensors are monitoring).
The output of "sensors" should look something like this:
Code:
acpitz-virtual-0
Adapter: Virtual device
temp1: +52.8°C (crit = +95.0°C)
Every 10 seconds or so, type "sensors" again (or hit the up arrow key, then enter). If after 10 minutes the machine hasn't exceeded any of the critical temperatures listed (my machine only displays output for one sensor, but I believe "sensors" can display output for more than one, depending on the machine), it is almost certainly not a heating issue (though it might be if it's getting close (within 5 degrees or so) to some of the critical temperatures).