# Where does Workbench deploy to?

After a few months pause, I am using Workbench again and I cannot determine where is WB sending (deploying) my built package. WB does not ask for a destination folder, so I guess it must use some preference I set before... only I do not remember it! So, can someone please tell me how to find/set the destination folder for deployed applications? (Searching on my HDDs takes a long time.)

-
If you want more control over things, you can use Apache Ant (or any other build tool, but Ant is integrated into WB) to build the project yourself, and deploy it whereever you like. This is less relevant for a single package, but can be very useful for more complex projects containing several packages, and possibly code in other languages (C/C++/Java/etc). It also is useful when you have paclet documentation, since you may include documentation build as a part of your build process, and have a single build/deploy process then. –  Leonid Shifrin May 21 '12 at 18:38
thank you @Leonid.I have no experience with Ant (yet), but this is the second time you mentioned it, while answering to one of my questions. I guess it is high time to have a look at it :-) –  magma May 21 '12 at 18:44
While Ant has traditionally been more a tool used by professional Java devs (I was in that capacity for a short time, so was lucky to pick it up there), it is a generally useful tool. It is very easy to learn. You write a couple of build scripts and it becomes your friend. In Mathematica, it is also used in quite interesting ways, since it is augmented by Mathematica task, so Ant in fact launches the M kernel for certain builds (such as e.g. Documentation build), and some parts of the build are performed by Mathematica (it can be seen by inspecting documentation build component in WB). –  Leonid Shifrin May 21 '12 at 18:50
I wish to report the following bug in WB: if you use WB and MMA on Windows on a non-English system, the "Application Data" folder has a different name (it gets translated). MMA takes this into account with BaseDirectory and UserBaseDirectory, but WB keeps using "Application Data" as the name of the folder with its BaseDirectory and UserBaseDirectory checkboxes. That's why I could not find my package at first. Maybe this bug exists also with other OS –  magma May 21 '12 at 18:51
I never experienced this, since I only worked with the English version. You can send an email to WRI tech.support, explaining the problem. –  Leonid Shifrin May 21 '12 at 18:55

The default directory is \$UserAddOnsDirectory/Applications and in MacOSX and Linux you see the target folder every time you click on Deploy Application.
What happens when you have a Kernel/init.m file in your package folder? Is it the same as having the commands in your global init.m, but loaded only when you load the package? –  rm -rf May 21 '12 at 20:04
@R.M When you would call <<DrosteEffect  for the above package, you have to notice, that this is a folder you try to load. The correct way would be to make <<DrosteEffectDrosteEffect . The usual way is to put this Get into the init.m, because this file is loaded if the parameter for Get is a folder. Look up the doc to Get: "If the file found by <<name is a directory, Mathematica will try to load the file in that directory." –  halirutan May 21 '12 at 20:17
@R.M. To add to the comment of halirutan, init.m in larger projects with non-trivial directory structure/layout, serves to 1. Enable Mathematica to locate this project, since Get looks also for folders with the name matching the context name and having init.m in them, 2. Make the mapping from context name to file name more flexible 3.(related)Give the developer more freedom to perform initialization steps. In particular, you can use init.m` to load contexts to be used by their shorter names, which would otherwise require a longer name (e.g. like in the example mentioned by halirutan). –  Leonid Shifrin May 21 '12 at 20:30