Yes, a well designed program asks the operating system where to put temporary files, and the operating system will use the value of environment variables or other settings to answer. if you want to know the values of these environment variables you need to dig a bit.
So eg environment variables in XP
Control Panel
System Properties
Advanced
Environment Variables
and they are in there. the TEMP variable is a system setting and a user setting.
As to where the installer puts the files, that depends on how the installer is set up. If you want to know for sure then you will probably need software to monitor changes to the disk contents, then install.