Install script: improve local repository detection