How Do I Embed A .dll To My .exe [HELP]

nulldata
by nulldata · 4 posts
5 years ago in .Net (C#, VB, etc)
Posted 5 years ago · Author
just finished a program and I would like to make it just one file so its easy to hand out and not have extra files just laying around. I made a program using a framework that needs a .dll to be in the same location as the .exe. Could someone help on how i can embed it to make it just 1 file?


I tried to use the (Package Manager Console) with "install-package costura.fody"
and that didn't seam to work then i tried (ilmerge) and that wasn't working also.

Made with: vb.NET

Image
Posted 5 years ago · Author
@DataMine
I got it downloaded but am clueless on how to actually use it
Posted 5 years ago
Did you download an executable? If so just create a batch script to automate it:


LibZ Compressor.bat
Code
REM This script automates the LibZ compression process
REM It automatically builds the LibZ command with exe and dll file names

@echo off

::Delayed Expansion will cause variables to be expanded at execution time rather than at parse time
setlocal enabledelayedexpansion

::Path to the LibZ executable
set LibZpath="PATH TO LIBZ\libz.exe"

::Declare variable to hold the path of the program
set exepath=

::Declare variable to hold the name of the program
set exename=

::Declar variable to hold the names of the dlls
set dlls=

::Iterate over current directory and grab the exe name and path
for /r %%i in (*.exe) do (
   set exepath="%%i"
   set exename=%%~nxi
)

::Iterate over the current directory and grab names of the dlls wrapping them in quotes
for /r %%i in (*.dll) do set dlls=!dlls! "%%i"

::Execute the LibZ command plugging in the current directory, exe and dll names
::%LibZpath% inject-dll --assembly %exepath% --include %dlls% --move
%LibZpath% inject-dll --assembly %exepath% --include *.dll --move

pause

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT
Select a forum Protection     Help & Support     Introductions     Mafia News     IMVU News General Discussion     IMVU Lounge        IMVU Series / Roleplaying        Social Games     Mafia Market     Mafia Tools        Premium IMVU Tools        Off Topic Tools     Off Topic     Contests Creator Corner     Graphics Design        Photoshop        GIMP     Basic Creator Help     Catalog And Product Showcase     3D Meshing        3Ds Max        Sketchup        Blender Gangsters with Connections     White Hat Activities        Google Hacking        Trackers Programming Corner     Coding        Python        .Net (C#, VB, etc)        Flash        JAVA        Autoit        Batch        HTML & CSS        Javascript        PHP        Other        IMVU Homepage Codes           General           About me Panel           Messages Panel           Special Someone Panel           Visitors Panel           New Products Panel           Rankings Panel           Wishlist Panel           My Badges Panel           Outfits Panel           Url Panel           Groups Panel           Slideshow Panel           My Room Panel           Sandbox panel           Layouts     Help & Requests Free Credits     Approved Methods     Submit Methods Free Money     Approved Methods     Submit Methods Adult Corner     Get Mafia AP Here     AP Lounge        AP Social Games        Casual Dating Tips     IMVU Slave Market & Escorts