fix #1617 Generates zip file only if necessary