This is an issue that is dear to my heart. I think it is possible to almost always avoid killing a product. When a company doesn't want to invest further they can do combinations of the following:
* Just open source it.
* If code has external IP, isolate them behind interfaces.
* If product is service and uses internal infrastructure, you can still isolate those interfaces (assume someone else would build necessary infrastructure)
* If core devs have left or aren't interested, hire offshore or freelancers to do this work
* Call for maintainers/fans who are invested in the product to participate
* Instill culture in the company so every new project is architected with eventual open sourcing in future due to reasons such as shutdown
* Put product up for sell to potential companies who are in same space and ask them to take on work for making sure IP and dependencies are abstracted