I've been having this issue with several AIP files when using the TeamCity plugin to build the projects. It doesn't happen with all the AIP's, but it happens pretty consistently. I have had issues with this in CCNET as well and the only way I could get around it is to run the build using a batch file and passing the attrib -r on the AIP files before building and then attrib +r afterwards.
From what I can see, it seems that the AIP has readonly set on it and when it tries to build, it fails, but what I don't understand is why it will work with one, but not for others. The AIP's are checked into TFS and pulled down locally on the Agent server. Here is the excerpt from the TeamCity log:
[07:40:12]Running Advanced Installer
[07:40:11]Step 6/10: Build Mongo Configurator MSI (Advanced Installer) (1s)
[07:40:12][Step 6/10] Starting: "C:\Program Files (x86)\Caphyon\Advanced Installer 13.8.1\bin\x86\AdvancedInstaller.com" /execute \\SERVERNAME\f$\TFS\Development\ImageService\Release\Installs\MongoConfigurator.aip C:\TeamCity\buildAgent\temp\globalTmp\aic371276866553526579.tmp
[07:40:12][Step 6/10] in directory: F:\TFS\Development\ImageService
[07:40:12][Step 6/10] Build
[07:40:12][Step 6/10]
[07:40:12][Step 6/10] Checking builds status
[07:40:12][Step 6/10] Build required.
[07:40:12][Step 6/10]
[07:40:12][Step 6/10] [ DefaultBuild ]
[07:40:12][Step 6/10] Building package (en): \\SERVERNAME\c$\InstallerStaging\MongoConfigurator.msi
[07:40:13][Step 6/10] Creating MSI database
[07:40:13][Step 6/10] Writing Summary Information
[07:40:13][Step 6/10] Build time: 1 sec.
[07:40:13][Step 6/10]
[07:40:13][Step 6/10] Total build time: 1 sec.
[07:40:13][Step 6/10]
[07:40:13][Step 6/10] Build finished successfully.
[07:40:13][Step 6/10] Process exited with code 0
[07:40:13]Running Advanced Installer
[07:40:13]Step 7/10: Build ImageService MSI (Advanced Installer) (2s)
[07:40:13][Step 7/10] Starting: "C:\Program Files (x86)\Caphyon\Advanced Installer 13.8.1\bin\x86\AdvancedInstaller.com" /execute \\SERVERNAME\f$\TFS\Development\ImageService\Release\Installs\ImageService.aip C:\TeamCity\buildAgent\temp\globalTmp\aic4069054494315719393.tmp
[07:40:13][Step 7/10] in directory: F:\TFS\Development\ImageService
[07:40:15][Step 7/10] Build
[07:40:15][Step 7/10]
[07:40:15][Step 7/10] Checking builds status
[07:40:15][Step 7/10] Build required.
[07:40:15][Step 7/10]
[07:40:15][Step 7/10] [ DefaultBuild ]
[07:40:15][Step 7/10]
[07:40:15][Step 7/10] Total build time: 0 sec.
[07:40:15][Step 7/10] Error opening file: "\\SERVERNAME\f$\TFS\Development\ImageService\Release\Installs\ImageService.aip".
[07:40:15][Step 7/10]
[07:40:15][Step 7/10] Build finished because an error was encountered.
[07:40:15][Step 7/10] Process exited with code -536805276
[07:40:15][Step 7/10] Step Build ImageService MSI (Advanced Installer) failed
[07:40:15][Step 7/10] Error message is logged