There is a lot of duplicated code here. A better practice is to define vars depending on the OS (including a default value), then use just one "packages" promise.