unify the two branches for picking .inv files
derive output filename from input filename