Preparation of Cd(Zn)Te and CuInSe2 films and devices by a two-stage process