Adopt a law or make a regulation that will make companies that shut down software products or services, either their own or of recently acquired companies, open source such products.
Regardless of who paid for the development, shutting down a product or service still in use needlessly harms its users. Giving a product a chance to survive will add to public goods.
With an exception of products being sold to other companies, all discontinued products shall be subject to mandatory open-sourcing. If the product is useless nobody will adopt it. If it's any good somebody will. Free market will sort things out.
(Additionally, the Government shall shield the companies releasing software into open source against liability lawsuits.)



