# Windows Post-Build Script in the new system

**URL:** <https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233>\
**Category:** General JUCE discussion\
**Created:** [March 6, 2017, 7:43pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233 "2017-03-06T19:43:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![trickyflemming](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trickyflemming](https://forum.juce.com/u/trickyflemming)\
**Post date:** [March 6, 2017, 7:43pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/1 "2017-03-06T19:43:15Z")

</div>

The new Windows build system is a bit confusing for post-build copying of binaries. Our previously working script was this:

```
copy /Y "$(OutDir)\$(TargetFileName)" "$(OutDir)\$(TargetName).vst3"
copy /Y "$(OutDir)\$(TargetFileName)" "$(OutDir)\$(TargetName).aaxplugin"
copy /Y "$(OutDir)\$(TargetFileName)" "C:\Program Files\Common Files\VST3\$(TargetName).vst3"
xcopy "$(TargetPath)" "C:\Program Files\VSTPlugins\Unfiltered Audio" /Y

```

That will now copy a whole bunch of build noise into the VSTPlugins folder. The Projucer doesn’t seem to have per-project build settings. What are the best practices now for creating a functioning post-build copy script?

---

<div class="post-metadata">

**Author:** ![trickyflemming](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trickyflemming](https://forum.juce.com/u/trickyflemming)\
**Post date:** [March 10, 2017, 11:29pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/2 "2017-03-10T23:29:30Z")

</div>

Anyone else run into this? It seems like a fairly major issue for Windows developers.

---

<div class="post-metadata">

**Author:** ![trickyflemming](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trickyflemming](https://forum.juce.com/u/trickyflemming)\
**Post date:** [March 14, 2017, 3:59pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/3 "2017-03-14T15:59:45Z")

</div>

Bumping this again. In general, it seems like there’s a lack of information regarding the new system.

1. What’s the best practice for post-build copying?

2. Why can’t we access File Property pages anymore in Visual Studio? Try right-clicking on a file and selecting “Properties”. We need this as we have a required .rc file for our DRM system. We need to open its page and change it from “C++ Source” to “Resource Compiler” every time we re-JUCE. Since we can’t do that anymore, we had to create a hacky script to modify the solution every time it needs resaved.

3. What are the advantages of this new system, aside from smaller binaries? Right now, it seems like everything became more complicated to manage and a whole lot slower to compile/link.

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [March 14, 2017, 5:10pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/4 "2017-03-14T17:10:38Z")

</div>

This is the same behaviour on macOS, right? See, for example, this post:

> [@Post-build script](https://forum.juce.com/t/post-build-script/17637/11):
>
> This is now fixed on the latest develop branch. The post-build script is now also executed for the aggregate target. Xcode conveniently passes the target name that is currently processing to the script via the TARGET\_NAME environment variable. You can then have Xcode only do specific things for specific targets - for example, only when the aggregate target finishes. TARGET\_NAME unfortunately includes the project name as well, so the same build script won’t work between different projects. The …

I think something similar should be done with MSVC. You could use the `$(ProjectName)` build script variable.

---

<div class="post-metadata">

**Author:** ![trickyflemming](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@trickyflemming](https://forum.juce.com/u/trickyflemming)\
**Post date:** [March 14, 2017, 5:17pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/5 "2017-03-14T17:17:44Z")

</div>

On Mac, we don’t need a post-build script since it automatically copies the binaries to the correct user folders.

On Windows, I think the deployment target options page should have an option for a VST2 path. It should copy the VST2 binary there. The VST3 and AAX paths on Windows are constant and not user-defined, so that shouldn’t need an option.

That would solve #1. #2 is another big issue with the new system.

---

<div class="post-metadata">

**Author:** ![IvanC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ivanc/32/685_2.png) [@IvanC](https://forum.juce.com/u/IvanC)\
**Post date:** [April 15, 2017, 8:25am UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/6 "2017-04-15T08:25:01Z")

</div>

I bump this subject because I think the Projucer should provide options for copying the VST/AAX binairies in given folders like with Mac OS X. With all the recent changes on VS projects structure, it is now even more important that it was before.

---

<div class="post-metadata">

**Author:** ![IvanC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ivanc/32/685_2.png) [@IvanC](https://forum.juce.com/u/IvanC)\
**Post date:** [April 18, 2017, 9:22am UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/7 "2017-04-18T09:22:59Z")

</div>

Before the structure changes in VS projects, I could just put the vstplugins folder in binary location, but now with all the new folders generated, I need to do this in the post build section for say the VST2 format only :

`if "$(ProjectName)"=="$(SolutionName)_VST" copy /Y "$(TargetDir)\$(TargetName).dll" "c:\vstplugins\musical entropy\$(TargetName).dll"`

---

<div class="post-metadata">

**Author:** ![Evelyn\_Tremble](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/evelyn_tremble/32/1019_2.png) [@Evelyn\_Tremble](https://forum.juce.com/u/Evelyn_Tremble)\
**Post date:** [October 13, 2017, 5:08pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/8 "2017-10-13T17:08:13Z")

</div>

I’m bumping this up as it actually prevents from manually copying aax plugin bundles in the Post-build script, as the bundle is constructed **after** the Post-build script defined in Projucer, so you just don’t have a bundle to copy.

It would be very nice to have the option, in Projucer, to define plugin installation directories for Visual Studio projects, just like for xcode projects, and to have the copy automatically done in the default post-build script.

---

<div class="post-metadata">

**Author:** ![IvanC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ivanc/32/685_2.png) [@IvanC](https://forum.juce.com/u/IvanC)\
**Post date:** [October 14, 2017, 9:34am UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/9 "2017-10-14T09:34:30Z")

</div>

I agree, and since it is done automatically on macOS, it would be great for Windows builds and more generally for people developing plug-in on Windows to have something equivalent

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [October 19, 2017, 3:43pm UTC](https://forum.juce.com/t/windows-post-build-script-in-the-new-system/21233/10 "2017-10-19T15:43:15Z")

</div>

OK, this is on develop now. Please see [this thread](https://forum.juce.com/t/breaking-change-vs-post-build-copy-for-plugins/24727).
