Instead of using the script in the previous post, I prefer to modify the environment variables manually. For both QII 7.2 and QII 8.0, you need to set QUARTUS_ROOTDIR and SOPC_KIT_NIOS2. QII 7.2 also uses SOPC_BUILDER_PATH.
QII 8.0 does not require SOPC_BUILDER_PATH. I don't remember whether 8.0 will use this variable if it does exist. I would delete this variable (or temporarily rename it to something else) when running 8.0 and instead control the IP path using "Tools --> Options --> IP Search Path" in SOPC Builder if using IP other than what was installed with QII 8.0. The 8.0 IP will be found automatically without setting the search path.
Quartus will set QUARTUS_ROOTDIR automatically when it starts. Be careful to keep this variable in sync between tools. When starting the Nios II IDE, always be sure that the last version of Quartus that had run was the same version as the IDE version.