Rewrite install hook.

openscholar/openscholar#3265