Firstly create a shortcut to setup.exe on the CD. Right click on the shortcut and go to compatibility tab. Select windows 95 compatibility.
You should now be able to run the installer, if it gives you any errors just ignore them.
After installing the installer program will probably hang, so you will need to end task from task manager after if has stopped doing anything.
Get a patch
here
Run the patch using Windows 95 compatibility, same as above by creating shortcut etc.
Now, you need to apply a registry patch.
Copy all the text between the asterisks and call it something like nfs4.reg and run it.
********
Windows Registry Editor Version 5.00
[HKEY_LOCAL MACHINE\SOFTWARE\Electronic Arts\Need For Speed High Stakes]
"3D Device Description"="Direct3D Device1"
"3D Card"="Direct3D Device1"
"Thrash Driver"="d3d"
"Group"="D3D"
"D3D Device"=dword:00000000
"Triple Buffer"=dword:00000000
"Hardware Acceleration"=dword:00000001
"Thrash Resolution"="640x480"
*********
Worked for me anyway.