# BR: AudioPluginHost.exe can not be copied to another folder or it will crash on startup

**URL:** <https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383>\
**Category:** General JUCE discussion\
**Created:** [October 21, 2021, 11:09pm UTC](https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383 "2021-10-21T23:09:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [October 21, 2021, 11:09pm UTC](https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383/1 "2021-10-21T23:09:25Z")

</div>

AudioPluginHost.exe can not be copied to another folder or it will crash on startup. One of the sample synths tries to find `singing.ogg` in the examples folder, and when it can’t `loadNewSample` crashes. It should check it’s not getting passed a `nullptr`

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 26, 2021, 4:49pm UTC](https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383/2 "2021-10-26T16:49:11Z")

</div>

Thank you for reporting this! I noticed that the while the Projucer build resulted in a non-relocatable `AudioPluginHost.exe` the CMake build did not suffer from this problem.

This change will make the Projucer build refer to the absolute path of the `examples/Assets` directory the same way the CMake build does. So you should be able to move the `.exe` to another location.

> <https://github.com/juce-framework/JUCE/commit/f5625179395dea95b460d343eff213d063998358>

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [October 26, 2021, 6:03pm UTC](https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383/3 "2021-10-26T18:03:14Z")

</div>

Wouldn’t it make more sense to have the ogg file as a binary resource? This fix still won’t allow the .exe to be copied to another computer. Or if you move or delete the source after building it will still crash.

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 26, 2021, 8:51pm UTC](https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383/4 "2021-10-26T20:51:46Z")

</div>

I agree that a fully relocatable solution would be worthwhile. I’ll keep an eye on this.

---

<div class="post-metadata">

**Author:** ![RolandMR](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rolandmr/32/641_2.png) [@RolandMR](https://forum.juce.com/u/RolandMR)\
**Post date:** [October 26, 2021, 10:14pm UTC](https://forum.juce.com/t/br-audiopluginhost-exe-can-not-be-copied-to-another-folder-or-it-will-crash-on-startup/48383/5 "2021-10-26T22:14:45Z")

</div>

At least make it not crash, even if it doesn’t load the sample. I don’t really need to use the build in synths, I just want to load my synth quickly for testing.
