The final component of my new pc came yesterday, and I put it together. After a relatively simple build process, I tried to install my os, and I ran into a bunch of issues, mainly that whenever I boot from a cd to install the os, my computer randomly restarts during the process, and I can never get a full install. I've tried Windows, Ubuntu, and Elementary OS (my first choice), but nothing will fully install. I almost installed windows several times, but it restarted before I could finish, and the linux distros baraly got past the initial menu. However, there are no restarts when in the bios, as it ran for at least four hours without rebooting. Also, it won't reboot when in grub. I have no idea what the problem is now, so this point any help will be greatly appreciated. Thanks so much guys.
Specs: Intel i5-4590
Samsung 850 EVO 500gb
Gigabyte GA-B85N WIFI
Crucial Ballistix 2x4gb
Thermaltake W0116RU
Bitfenix Prodigy