I am having trouble installing sql server 2012 on windows 8.
I've never done it myself, but it looks like you may be having a .Net version problem. http://support.microsoft.com/kb/2681562
Take a look at the section titled:
Known SQL Server 2012 setup and migration issues - By default, Windows 8 includes the .NET Framework 4.0. However, the following SQL Server 2012 components depend on the .NET Framework 3.5:
Therefore, we recommend that you enable the .NET Framework 3.5 before you install SQL Server 2012 in a stand-alone or clustered environment to help prevent any possible SQL Server setup failures.
Using this as a guideline.