I found a similar topic in the knowledge base in regards to the error message you receive which is:
"Q. SolidWorks displays the error message "Environment Variable 'temp' must be set to a temp directory" when starting SolidWorks. What might cause this message?
A. There could be a couple of causes of this problem. First, if the operating system is Windows NT go to Properties on the My Computer Icon and then go to Environment. The user should have temp variables TEMP and TMP set in the "User Variables for <username>" section. These variables are generally set up by Windows NT or Windows 2000, but the user may have changed or deleted them. Make sure that the actual folder that the variables refer to also exists. If on a Windows 9x machine, make sure that the folder Windows/temp exits. With any type of operating system, check to make sure there is plenty of disk space on the drive for which these temp variables are defined. Make sure that the temp folders are cleaned out on a regular basis and that the Recycle Bin is also emptied on a regular basis."
I doubt that you're still using NT or 2000 so it's probably something to do with your temp folder as the answer suggests. I've never seen this message before!
I hope this helps.