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

**URL:** <https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790>\
**Category:** The Projucer\
**Created:** [April 10, 2019, 8:09am UTC](https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790 "2019-04-10T08:09:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rip-off](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rip-off/32/2406_2.png) [@rip-off](https://forum.juce.com/u/rip-off)\
**Post date:** [April 10, 2019, 8:09am UTC](https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790/1 "2019-04-10T08:09:05Z")

</div>

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.

 ![43](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/0/0e34012500660371fa2663f43826dd0d059116f7.png)

It is an easy fix in jucer\_ProjectExport\_MSVC.h Line 1078 & 1079. I can send it over if desired.

---

<div class="post-metadata">

**Author:** ![mcmartin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mcmartin/32/7432_2.png) [@mcmartin](https://forum.juce.com/u/mcmartin)\
**Post date:** [April 10, 2019, 12:26pm UTC](https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790/2 "2019-04-10T12:26:15Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![rip-off](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rip-off/32/2406_2.png) [@rip-off](https://forum.juce.com/u/rip-off)\
**Post date:** [April 10, 2019, 1:39pm UTC](https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790/3 "2019-04-10T13:39:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mcmartin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mcmartin/32/7432_2.png) [@mcmartin](https://forum.juce.com/u/mcmartin)\
**Post date:** [April 10, 2019, 2:37pm UTC](https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790/4 "2019-04-10T14:37:32Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![dev1am](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dev1am](https://forum.juce.com/u/dev1am)\
**Post date:** [November 19, 2024, 2:58pm UTC](https://forum.juce.com/t/aax-builds-fail-due-to-wrong-order-of-commands-in-post-build-step/32790/5 "2024-11-19T14:58:13Z")

</div>

I’m experiencing the exact same issue
