If you are using 'Windows 10 Creators Update', you can now optionally block installation of any software on a PC, if it's not trusted by the Windows Store. Instead of a complete restriction, you can also warn the user.
If you are unaware of this new feature, let's go a step forward to learn how to configure your PC with this settings, provided that you are running Creators Update.