'install': configure all known programs before doing anything.

Fixes #2241.

I think the ProgramDB API should be redesigned to prevent such
problems in the future.