AAX builds fail due to wrong order of commands in post build step

Every time we re-export a project to Visual Studio, our AAX builds fail. That is because the post build step commands are in wrong order. The call to the AAX SDK’s CreatePackage.bat needs to be first in order for the copy command to be successful. See attached screen shot - that’s how it is now.

It is an easy fix in jucer_ProjectExport_MSVC.h Line 1078 & 1079. I can send it over if desired.

I made a new Audio Plug-In project, with only the AAX format, and without “Enable Plugin Copy Step” and I got the following command line in Visual Studio:

copy /Y "$(OutDir)\MyAAXPlugin.aaxdll" "$(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64\MyAAXPlugin.aaxplugin"
call "C:\\SDKs\\AAX\\Utilities\\CreatePackage.bat" "$(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64" "C:\\SDKs\\AAX\\Utilities\\PlugIn.ico"

CreatePackage.bat runs on $(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64, but $(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64 is created/updated in the previous line, so I don’t understand how these 2 lines could be swapped.

It is a false assumption that the directory is created by the first (copy) step. The AAX package directory structure is created by CreatePackage.bat. The copy command copies the plugin binary from your build folder into that directory structure. The /Y option of the copy command just means that existing files are overwritten without prompt.

Having the steps in that order leads to the first build creating the directory structure but not having the AAX binary copied into it. This can be solved either by checking the directory structure in into your git, running the build twice or by manually changing the order of those commands each time you re-exported the project file.

$(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64 is actually created in the Pre-Build Event:

if not exist "$(OutDir)\MyAAXPlugin.aaxplugin" mkdir "$(OutDir)\MyAAXPlugin.aaxplugin"
if not exist "$(OutDir)\MyAAXPlugin.aaxplugin\Contents" mkdir "$(OutDir)\MyAAXPlugin.aaxplugin\Contents"
if not exist "$(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64" mkdir "$(OutDir)\MyAAXPlugin.aaxplugin\Contents\x64"

so there shouldn’t be any need for adding it to version control.

Maybe you are overriding the Pre-Build Event in your project somehow, thus preventing these directories from being created.