Is it illegal for a friend to install a game on their computer then install it on yours
Is it illegal for a friend to install a game on their computer then install it on yours
Strictly speaking yes it is. If it is a commercial game that your friend has purchased, or been given as a gift having been purchased by someone else, then they will have agreed to some conditions when they installed it. One such condition is that the game is for their use on their computer only. Both your friend (in giving something that was not theirs to give) and you (in receiving) would be guilty for sharing such a game between yourselves.
If it is a free public domain/open source game then any conditions attached to the game often require you to freely share the game with your friends.