A much easier way than the posts above and with no extra code in your installer is to use the following:
installUtil.exe /username=domain\username /password=password /unattended C:\My.exe
Just ensure the account you use is valid. If not you will receive a “No mapping between account names and security id’s was done” exception