Adding post build script for AAX breaks copy and CreatePackage.bat commands


#1

I’m using a post build script for my plugin on Windows as discussed here (similar to the Mac technique):


For some reason this seems to inhibit the copy and CreatePackage.bat commands from executing. The constructed post build event is something like this:

copy /Y "C:\Users\myusername\MyProject\Builds\VisualStudio2015_64\Debug\AAX\\MyProject (64-bit).aaxdll" "C:\Users\myusername\MyProject\Builds\VisualStudio2015_64\Debug\AAX\\MyProject (64-bit).aaxplugin\Contents\x64\MyProject (64-bit).aaxplugin"
"c:\\SDKs\\AAX\\Utilities\\CreatePackage.bat" "C:\Users\myusername\MyProject\Builds\VisualStudio2015_64\Debug\AAX\\MyProject (64-bit).aaxplugin\Contents\x64" "c:\\SDKs\\AAX\\Utilities\\PlugIn.ico"```

If I remove the first line (my batch script):

```copy /Y "C:\Users\myusername\MyProject\Builds\VisualStudio2015_64\Debug\AAX\\MyProject (64-bit).aaxdll" "C:\Users\myusername\MyProject\Builds\VisualStudio2015_64\Debug\AAX\\MyProject (64-bit).aaxplugin\Contents\x64\MyProject (64-bit).aaxplugin"
"c:\\SDKs\\AAX\\Utilities\\CreatePackage.bat" "C:\Users\myusername\MyProject\Builds\VisualStudio2015_64\Debug\AAX\\MyProject (64-bit).aaxplugin\Contents\x64" "c:\\SDKs\\AAX\\Utilities\\PlugIn.ico"```

Then it all works. So I seem to have to edit the AAX project to remove this first line (I need the script for VST to do something else) and sign the AAX manually too.

Anyone got any clues as to what might be going on? There are no suspicious messages in the build output. And I'm returning `exit 0` from by `.bat`.

#2

Turns out that the exit 0 in my batch script is what is causing it.

I need to reset the %errorlevel% variable instead. Which according to this SO post (http://stackoverflow.com/questions/1113727/what-is-the-easiest-way-to-reset-errorlevel-to-zero) is easiest done by calling verify >nul

I’ve edited the linked post containing my script to do this instead (in case any one else hits this issue).


#3

Yes, that will exit all the batches currently in progress and give control back to the prompt (or Visual Studio in this case).

What you want to only exit the current one is the /B switch, so

exit /B 0

will return 0 from your batch, and resume execution from the following line in the caller batch


#4

I just set up the first new AAX build on Windows since switching from JUCE 4 to 5. I noticed:

a) Post build commands are the wrong way round after generating the VS2017 solution with Projucer. It first attempts to copy the aaxdll and then creates the aaxplugin package which leads to a package missing the binary on the first build. If you don’t check in the package, the package will always be ampty on your CI system unless you fix the solution manually.

b) Instead of using the $(Platform) variable, different commands are issued for each platform.