Hey Neil,
We haven't used Fody.Costura, but just scanning the docs on github, it looks like fully support "native libraries": https://github.com/Fody/Costura#native-libraries-and-preloadorder
Let me know if that helps.
I understand that the TurboActivate.dll is used simply by being in the same directory as the application binary. However, my application used a reference bundlers to include all references into the application binary in order to make a single .exe portable application. It using a package call Fody.Costura to do that. https://github.com/Fody/Costura It works by looping through the 'copy local' references and doing what it needs to bundle into the output .exe
Thus, my question is, any options on how to include the TurboActivate.dll as a reference or some how indicate that is to be bundled with the output?
Costura does fine with unmanged dlls as well, but they still need a reference.
Hey Neil,
We haven't used Fody.Costura, but just scanning the docs on github, it looks like fully support "native libraries": https://github.com/Fody/Costura#native-libraries-and-preloadorder
Let me know if that helps.
I think I might have gotten past the dll issue, but now I'm not sure how to embed the TurboActivate.dat file, and interestingly enough even when the TurboActivate.dat is in the same dir as my portable .exe, it can seem to find it.
Well, it's likely because of how that particular wrapper/app thing works (it likely just extracts your real exe somewhere on the disk and then executes it there.
So, even if you put the TurboActivate.dat in the same folder as your "app" (the wrapper application that actually extracts your real app) that wrapper application likely won't move the TurboActivate.dat file to the location of your real app.
You have a couple of options:
1. Make sure that wrapper stuff actually brings over the TurboActivate.dat and puts it in the same folder as your real exe.
2. Embed the TurboActivate.dat in your app, and use the TA_PDetsFromByteArray() function to read the data.
3. Embed the TurboActivate.dat in your app, extract it somewhere when your app loads, and use the TurboActivate.PDetsFromPath() function to load the file.
4. Just use an installer and drop the Fody.Costura thing (it seems to be complicating things while providing the exact same benefits of an installer file with more hassle).
Thanks for the help that worked out well, and I was able to accomplish what I needed.
For readers info:
I had to manually add this import for the method that Wyatt instructed me to use. I added it to the TurboActivate.cs class that is included as part of the SDK
[DllImport("TurboActivate.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern int TA_PDetsFromByteArray(IntPtr pArray, int nSize);
Then in the constructor for that class, I modified the interface to pass in a byte[] as a required param
and BEFORE the constructor calls NATIVE.TA_GetHandle, I make a call to this new method
this.PDetsFromByteArray(buffer);
where buffer was my byte[] that contained the bytes from my embedded TurboActivate.dat file.
Hope this helps, and Wyatt thanks for your support and instant feedback!
No problem, glad to help.
In the upcoming 4.0.9 release we'll add constructors for the C#, VB.NET, and Java examples that allow for byte arrays containing the TurboActivate.dat file data.
TA 4.0.9 is now out and it includes constructors in C#/VB.NET/Java that lets you pass in the byte array version of the TurboActivate.dat file.