That's like a minimum wage law. The flip side is that companies will be more guarded about releases. Can you live with that?
And companies can still stop selling the thing. They just need to keep the cloud servers running and maintaining their integrations with the rest of their code.
If maintaining servers for 5 years is the tipping point for them to judge that the product won't be profitable and therefore won't release it, then yeah it doesn't sound like it should be worth selling in the first place.