Page 1 of 1

Embed DLL in EXE product

Posted: Tue Sep 24, 2019 8:11 pm
by Rocko
Using Flowstone 3.0.8.1 I had built a schematic which loads a DLL file (written in C), from a specific location, and runs it.
The DLL is loaded by RUBY within the schematic, as explained in the user guide.

Within flowstone it runs as expected, but when I export it as EXE, there is no sound and it seems that the DLL is not there. For instance the EXE file has a bypass switch, pressing it does produce sound - but no effect of course.
When exporting I did tick the "embed DLL's from DLL components" option.

Is there something I'm missing ?

Re: Embed DLL in EXE product

Posted: Wed Sep 25, 2019 12:51 am
by trogluddite
The "embed DLLs" option only works for DLLs loaded by DLL primitives, but not for DLLs loaded into Ruby using Win32API - so exports must have access to the DLL file itself. To further complicate matters, the file for the Win32API Ruby library also needs to accessible, as this isn't embedded either (the file itself is within the 'ruby/libraries/win32/common' subfolder of the FS installation). A little Ruby tinkering with file-paths may be required so that these files can be located, especially if the target PC doesn't have FS installed.

It's also worth noting that the Win32API library does not work at all in VST plugins, so you can't use DLLs via Ruby in VST plugins at all (which I find very annoying!).

The alternative would be to use DLL primitives, which allow complete embedding; however, the binary interface is much more restrictive than for Win32API, which can make it harder to do what you need, and the example API is a rather messy bunch of type-casting compiler macros.

Re: Embed DLL in EXE product

Posted: Wed Sep 25, 2019 2:59 am
by tulamide
What trog said, plus this quote from the User Guide, page 218:

"Distribution

If you plan to distribute any exported exes or plugins that use an external DLL you must ensure that the DLL is distributed with it. You must also distribute the ruby\libraries\win32 folder that is located in your FlowStone install folder. You need to have a folder called ruby in the same folder as your exported file. Inside this folder should be a libraries folder and inside that you place the win32 folder and all its contents. Without these your export will not function correctly."

Don't ask me why, I don't have photographic memory or something, but I really do remember when I read something. Creepy or not, it helps.

Re: Embed DLL in EXE product

Posted: Wed Sep 25, 2019 1:28 pm
by Rocko
Thanks Trogluddite and Tulamide - appreciated.
I'm looking into this...

Re: Embed DLL in EXE product

Posted: Mon Sep 30, 2019 1:59 am
by wlangfor@uoguelph.ca
Rocko wrote:Using Flowstone 3.0.8.1 I had built a schematic which loads a DLL file (written in C), from a specific location, and runs it.
The DLL is loaded by RUBY within the schematic, as explained in the user guide.

Within flowstone it runs as expected, but when I export it as EXE, there is no sound and it seems that the DLL is not there. For instance the EXE file has a bypass switch, pressing it does produce sound - but no effect of course.
When exporting I did tick the "embed DLL's from DLL components" option.

Is there something I'm missing ?


Haven't seen you in a while, nice to see you back :)