lots of changes, including dynamically generating the dmg path and passing it to the script  #1030