You have to buy a "Code Signing Certificate". Vendors include Comodo or Godaddy, it costs about $150 to $200. You can make installation packages with it for 1 year. The installation package itself has no expiration date (also look up timestamp option).
Some famous freeware products don't have certificates, but they are allowed through because lots of people download them so they are trusted. With your product, you have to convince lots of people to download them until smart screen eventually leaves it alone.
Alternatively, you can put your product in a zip package, but Windows still gives it a hard time.