newbie thats needs a little help with a dll issue

A

Aaron

Hello All,

First, I'm newer than a Newbie... I know its sad, but i'm trying to start
somewhere.

I'm attempting to write what I thought was a very simple program that would
call another program from a command line. Now I got that part to work, but
got hung up on packaging the exe (and its supporting dll) to the target
computer.
So I found an open source program that extracts and create cab files. So
using that I created a small progy to create the cab file containing the the
two other files I need. Then modified my code to call the dll file that I
included into the program(the cab extractor program.. I might also mention
that the open source program is writen in C++ not C# and comes as a dll file
that I included into my project). Everything was working fine till I moved
my program to another computer and discovered that the dll file from the cab
program is not included in my exe file. It has to be copied to the same
directory as my exe.

So does anyone know how integrate that dll file into my exe, or a way to
include it as a resource file and extract it to the working directory(i've
search high and low for that and can not find anything).

I've tried to use the al.exe program included with the SDK's in VS08 but its
fighting me every step of the way. I keep getting caught up on finding the
main entry point. The main entry point in my app is under the program.cs
class - method main. So in the al.exe command line I include
"/main:program.main" like the tech net article refers to.. but it keeps
erroring out.

If anyone has suggestions please respond. I could use a little help before
the sanity fails!!! LOL

Thanks,

Aaron
 
J

Jon Skeet [C# MVP]

If anyone has suggestions please respond. I could use a little help before
the sanity fails!!! LOL

Basically, DLLs are meant to sit alongside EXEs - they're not really
designed to be embedded within them.

It's not clear to me why you need cabs etc in the first place - why
don't you just copy all the files that you need to start with?
 
A

Aaron

Umm well I would like to... however just havn't figured out how to extract
the files to disk yet... if you have any suggestions i would be more than
willing to attempt it. I have tried to use the Assembly and Stream classes
but havn't really got it to work. When reasearching that is when I stumbled
across the cab extractor.

Thanks,

aaron
 
J

Jon Skeet [C# MVP]

Aaron said:
Umm well I would like to... however just havn't figured out how to extract
the files to disk yet...

But you've already *got* the files, haven't you? After all, you wrote:

<quote>
So using that I created a small progy to create the cab file containing
the the two other files I need.
</quote>

If you created the cab file, you must already have the files you need.
So why bother with the cab file? Just copy the files over directly in
the first place, and leave cab files out of it.
 
A

Aaron

ok maybee i'm not being very clear. I'm attempting to write a small program
what will call the free vnc edition by command line to connect to my viewer
with no interaction from the user with the exception of hitting the connect
button. However I have to get the vnc and the supporting dll copied to the
local machine. What I would like to do is have then click on my executable,
that would then extract the files into the appropriate directory and then
call it from the command line. My issue is getting the files extracted to
the users hard disk. Can you help with that?

Thanks,

aaron
 
J

Jon Skeet [C# MVP]

Aaron said:
ok maybee i'm not being very clear. I'm attempting to write a small program
what will call the free vnc edition by command line to connect to my viewer
with no interaction from the user with the exception of hitting the connect
button. However I have to get the vnc and the supporting dll copied to the
local machine. What I would like to do is have then click on my executable,
that would then extract the files into the appropriate directory and then
call it from the command line. My issue is getting the files extracted to
the users hard disk. Can you help with that?

How is the user getting your executable to their computer to start
with? Why can't the VNC files be copied in the same way?
 
L

Lasse Vågsæther Karlsen

Aaron said:
Not really,

they will be downloading it from the web or sent through email


Jon Skeet said:
How is the user getting your executable to their computer to start
with? Why can't the VNC files be copied in the same way?

This is what installation programs are typically for...
 
J

Jon Skeet [C# MVP]

This is what installation programs are typically for...

Or self-extracting zip files, if full installers aren't required.
There's no need for any code though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top