What if I give admin rights to a malicious installer?

Solution 1:

An installer's job is to install files. It can also run scripts that can delete files.

Apart from the OS system files themselves, an installer has free rein to install or delete files anywhere. You could make an installer that wasn't able to install or delete files, and while it would be very safe, it would also be very useless.

Generally, if the package file is from a reputable site, then I would not worry too much. You can always use the excellent app Pacifist, which can peek inside .pkg package files, and see what files are installed, and where, and what scripts it will run.

Of course, you have a backup, which you can use to restore your computer's state to before the installer ran.