Here’s a quick Windows 11 tip to stop unwanted programs from installing on your PC.
Click on Settings.

Then choose Apps.

Select Advanced app settings

Click the drop-down arrow next to Choose where to get apps.

You can choose to block apps from installing without your express consent or to be warned before these apps are installed.

Having this activated could stop unwanted programs from sneaking on to your PC.