Windows Installer service will not run by default in Safe Mode or Safe Mode with Networking. However, sometimes you may need it. For example I was cleaning up my server over the weekend in Safe Mode with Networking and I needed to install something quick. The trick is adding the Windows Installer service to list of services allowed to run in these modes.

Run below from command line as administrator and you’ll get it going.

For Safe Mode With Networking:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer" /VE /T REG_SZ /F /D "Service"

For Safe Mode:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\MSIServer" /VE /T REG_SZ /F /D "Service"

Then for either mode, just type:
net start msiserver

And you are good to go.