We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import needed class only
#1
Hi all,

I am using ILMerge.exe to convert my small basic exe and dlls to a standalone exe (for sake of sharing). Obviously, ILMerge needs ALL of the Microsoft.Expression.Effects, Drawing, System, etc etc too which would be very annoying. Is there any possible way from which i can only include the needed class in my code or reference the only needed .dll in my directory? (e.g LDCmd.dll, etc)

P.S: Programically speaking, this means "By breaking the extension in parts".

I would be grateful for your help,
Thanks.
Reply
#2
Hi,
Not sure I totally follow.  This is my understanding:
You have created a SB program, and compiled it.  You want to combine the required dlls into the exe with ILMerge.

Lots of dlls are added to the exe folder (everything in lib).  To see which are actually needed, recmpile to a new folder and try removing (or renaming) dlls until you have just those actually required.

Existing dlls cannot be split, so there is not such thing as LDCall.dll.

Is is usual to add exe and all required dlls in a single folder, zip this and share the zip, with instructions to install - download, unblock, unzip, run exe.

There are free installers you can use that effectively zip everything into setup file (exe or msi).  These are actually just zips with some scripting to install the bits in the zip.  Also I recently used itch.io for a couple games, and it has nice download/install/run features - you just upload a zip with everything required in it.

If I am missing the point, then please provide more details.

EDIT

If all you need is LDCall, then I guess you could just copy the code and compile it yourself as a small dll - I could help with this.
[-] The following 1 user Likes litdev's post:
  • z-s
Reply
#3
How you are using drawing and etc dll in sb I can't understand if you need to merge the exe and the extension of sb only
All .net dll are in every pc
ZS
Reply
#4
I see there's a bit of confusion here, I'll break it down.

I have LitDev.dll and SmallBasicLibrary.dll along with the exe file. Runs perfectly fine.

However, I want to use ILMerge to merge the dll files with my program to make it only one exe.

This is the issue that occurs: https://pastebin.com/Uv0HTigg

Now, i thought this was probably just because i didnt include SlimDX.dll in my directory, so i did.

Same error this time, but instead, with Microsoft.Expression.Effects.dll

So i included that in my folder too, and more and more dll errors started to come up.

What I think is the problem here is that ILMerge is using all of the classes in LitDev.dll which is causing so many dll errors.

Of course though I'm not a maniac and wouldnt want to include each dll file in my directory, time wasting and resulting in a bigger file size.

I'm trying to achieve a solution for this, I am using LDDialog in my program, and as we all know small basic doesnt support import statements, so the only solution (What i think) is to break the extension in different parts e.g Call.dll, GraphicsWindow.dll, etc etc. Maybe using steve's source code?
[-] The following 1 user Likes hybridClasher.init()'s post:
  • z-s
Reply
#5
I'm afraid its abit complex because DitDev.dll is compiled against native code (eg SlimDX that cannot be ILMerged).  The native code is not ILMerged into LitDev.dll, but held in resources to be extracted as required.

Its not a simple fix.

So your options are:

1] To ship a couple dlls with the exe
2] Bundle in a zip, using an installer if you want
3] Try to break and compile specific source code you want into your exe

Frankly, I don't see a reason to not do 1 or 2 unless you are having fun trying to combine everything.
Reply
#6
Hi,

Turns out, me being the silly one, i was referencing SlimDX.dll and all the others too, whereas i only needed to reference smallbasiclibrary and litdev, not all the others too. ilmerge only needed around 2 or 3 remaining dlls in the directory including microsoft.expression.drawing (i was using a brush type of project so i makes sense). However, the output was still around 9mb, which is a bit absurd for a brush effect project, but if im being honest its better not to mess around with that or else ill dig myself into a deeper hole.

Thanks for your help.
Reply
#7
Not sure I really follow, but glad you got it sorted.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)