Two tips -- the TestStand Deployment Utility has a simple command line API for building deployments (and even installers), and I've talked with devs who successfully use TestStand sequences as functional/unit tests not only in the build environment, but also deployment environment (a particularly clever use of TestStand!)