Looking for A Way to Use A .DLL without Running Regsvr32

Looking for A Way to Use A .DLL without Running Regsvr32

Anonymous
Not applicable
937 Views
17 Replies
Message 1 of 18

Looking for A Way to Use A .DLL without Running Regsvr32

Anonymous
Not applicable
I was wondering if there is a way that I can make my .EXE use a .DLL without having any need to run regsvr32 to register the .DLL and things like that.

Why can't .DLLs be as uncomplicated as .EXE with .EXE everything is heaven ... its just in those situations where I need to make a .DLL help my .EXE where everything gets to feel not so good because I have to register it first.

The process becomes more and more painful the more times you need to edit the .DLL because then you have to unregister and then register again etc.

When I deploy an .EXE everything goes smoothly but deploying an .EXE that depends on a .DLL is often a pain because I need to have the user run regsvr32 just to have the .DLL work ... its just a small department and just a small program but there are red tapes that slows down the process of implementing things with .DLL especially when it changes time and again because when that happens then I need to call up the head office again for registration permissions and things like that which of course never happens when I am just deploying an EXE.

If only I had admistrative permissions on all the machines .. but that is of course a perfect world and in the absence of that perfect world I guess the next best thing is to just have the ability to use a .DLL without having any need to register it... so is there a way to do it?

All suggestions welcome and thank you so much for all the kind help you can give.

Gratefully,
Matt
0 Likes
938 Views
17 Replies
Replies (17)
Message 2 of 18

Anonymous
Not applicable
There is no reason to perform all of these gymnastics. Look into a setup
creation program called Inno setup. You should have the exe file already
compiled with a reference to the newly compiled DLL. The deployment process
should handle the matter of registering the new DLL. I have samples of how
do do all this if you choose to go this route.

Dale


"matt_1ca" wrote in message news:5820329@discussion.autodesk.com...
I was wondering if there is a way that I can make my .EXE use a .DLL without
having any need to run regsvr32 to register the .DLL and things like that.

Why can't .DLLs be as uncomplicated as .EXE with .EXE everything is heaven
... its just in those situations where I need to make a .DLL help my .EXE
where everything gets to feel not so good because I have to register it
first.

The process becomes more and more painful the more times you need to edit
the .DLL because then you have to unregister and then register again etc.

When I deploy an .EXE everything goes smoothly but deploying an .EXE that
depends on a .DLL is often a pain because I need to have the user run
regsvr32 just to have the .DLL work ... its just a small department and just
a small program but there are red tapes that slows down the process of
implementing things with .DLL especially when it changes time and again
because when that happens then I need to call up the head office again for
registration permissions and things like that which of course never happens
when I am just deploying an EXE.

If only I had admistrative permissions on all the machines .. but that is of
course a perfect world and in the absence of that perfect world I guess the
next best thing is to just have the ability to use a .DLL without having any
need to register it... so is there a way to do it?

All suggestions welcome and thank you so much for all the kind help you can
give.

Gratefully,
Matt
0 Likes
Message 3 of 18

Anonymous
Not applicable
I confess to being mental midget but I looked at inno setup some time ago
and got overwhelmed.
seems like you had to learn a whole another language (the inno setup
scripting language?) to write the scripts to install your app... just didnt'
have the spare brain power or time at the time to digest it all...I was
overloaded with other projects at the time already, so I gave up on learning
it back then. (unless I'm misremembering and it was a different installer
prog I was looking at???)

Maybe it's not a complicated as it seemed at the time.
Hopefully some day I'll have time to learn how to use that.

There's also "registry-less" com technique available to avoid regsvr
www.datenhaus.de/Downloads/DirectCOMDemo.zip

Maybe that would help Matt

Mark


"Dale Levesque" wrote in message
news:5820323@discussion.autodesk.com...
There is no reason to perform all of these gymnastics. Look into a setup
creation program called Inno setup. You should have the exe file already
compiled with a reference to the newly compiled DLL. The deployment process
should handle the matter of registering the new DLL. I have samples of how
do do all this if you choose to go this route.

Dale


"matt_1ca" wrote in message news:5820329@discussion.autodesk.com...
I was wondering if there is a way that I can make my .EXE use a .DLL without
having any need to run regsvr32 to register the .DLL and things like that.

Why can't .DLLs be as uncomplicated as .EXE with .EXE everything is heaven
... its just in those situations where I need to make a .DLL help my .EXE
where everything gets to feel not so good because I have to register it
first.

The process becomes more and more painful the more times you need to edit
the .DLL because then you have to unregister and then register again etc.

When I deploy an .EXE everything goes smoothly but deploying an .EXE that
depends on a .DLL is often a pain because I need to have the user run
regsvr32 just to have the .DLL work ... its just a small department and just
a small program but there are red tapes that slows down the process of
implementing things with .DLL especially when it changes time and again
because when that happens then I need to call up the head office again for
registration permissions and things like that which of course never happens
when I am just deploying an EXE.

If only I had admistrative permissions on all the machines .. but that is of
course a perfect world and in the absence of that perfect world I guess the
next best thing is to just have the ability to use a .DLL without having any
need to register it... so is there a way to do it?

All suggestions welcome and thank you so much for all the kind help you can
give.

Gratefully,
Matt
0 Likes
Message 4 of 18

Anonymous
Not applicable
Hi,

Here's an extract of a CMD file I use:

regsvr32 ard08ColourSelect.dll /u
regsvr32 ard08ColourSelect.dll

I think it's pretty self expanatory. The CMD file has to be in the same
folder as the DLL file.

You can use extra switches to control the display of the message, but I
prefer to see them.

Because Inno Setup is designed to do a far wider range of things it has a
few more items you need to consider, but here's some Inno Setup code to do
the same as the above:

It will create an EXE file to run the DLL registration and also as I've set
it, force the user to consider a reboot after the installation

[Inno Setup Code starts]

[Setup]
; Publisher data
AppName=MyDLLUpdater
AppVerName=MyDLLUpdater


; Output file data
OutputBaseFileName=MyDLLUpdater
OutputDir=C:\Installation\MyDLLUpdater


; Company data
AppPublisher=www.MyCompany Pty Ltd
AppPublisherURL=http://www.MyCompany.com
AppSupportURL=http://www.MyCompany.com
AppUpdatesURL=http://www.MyCompany.com


; Installation location data
AppendDefaultDirName=No
AppendDefaultGroupName=No
DefaultDirName={pf}
UsePreviousAppDir=Yes

; Working options
AllowNoIcons=yes
AlwaysRestart=Yes
DefaultGroupName=MyCompany
PrivilegesRequired=admin

; Page display data
DirExistsWarning=No
DisableDirPage=true
DisableProgramGroupPage=true

DisableReadyPage=No
DisableStartupPrompt=Yes
EnableDirDoesntExistWarning=No

[Files]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PROGRAM DLL files: This assumes the DLL will be in the same folder {src}
as the
;; file generated by Inno Setup
;; Change the flags to suit your specific requirements
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Source: "{src}\ard08ColourSelect.dll"; DestDir: "{app}\MyPrograms"; Flags:
external ignoreversion RestartReplace uninsneveruninstall sharedfile
regserver
[Inno setup code ends]


--


Regards

Laurie Comerford
wrote in message news:5820329@discussion.autodesk.com...
I was wondering if there is a way that I can make my .EXE use a .DLL without
having any need to run regsvr32 to register the .DLL and things like that.

Why can't .DLLs be as uncomplicated as .EXE with .EXE everything is heaven
... its just in those situations where I need to make a .DLL help my .EXE
where everything gets to feel not so good because I have to register it
first.

The process becomes more and more painful the more times you need to edit
the .DLL because then you have to unregister and then register again etc.

When I deploy an .EXE everything goes smoothly but deploying an .EXE that
depends on a .DLL is often a pain because I need to have the user run
regsvr32 just to have the .DLL work ... its just a small department and just
a small program but there are red tapes that slows down the process of
implementing things with .DLL especially when it changes time and again
because when that happens then I need to call up the head office again for
registration permissions and things like that which of course never happens
when I am just deploying an EXE.

If only I had admistrative permissions on all the machines .. but that is of
course a perfect world and in the absence of that perfect world I guess the
next best thing is to just have the ability to use a .DLL without having any
need to register it... so is there a way to do it?

All suggestions welcome and thank you so much for all the kind help you can
give.

Gratefully,
Matt
0 Likes
Message 5 of 18

Anonymous
Not applicable
You could just call the DllRegisterServer function exported by your
dll from the exe before using anything else from the dll.
0 Likes
Message 6 of 18

jbooth
Advocate
Advocate
Wouldn't this require late-binding everything that references the dll in the exe project?

Laurie has given you the most effective solution, in my opinion. Create a batch file that calls regsvr32, and get whoever is installing your application to run it.

Dale's suggestion is more appropriate if you want to have a professional look, as innosetup will create an installer application for you.

ps: The only way (in my knowledge) to truly remove the need to register a dll is to upgrade to .NET. .NET uses assemblies to deal with this kind of thing, and it's quite good at it, from what I've seen. Autocad 2006 and later have the ability to load .NET dlls at runtime (as autocad commands) which can run any code you want.

You can find plenty of information on this kind of thing in the Autocad .NET forums.
0 Likes
Message 7 of 18

Anonymous
Not applicable
Thanks, I am going to look at Laurie's sample code in more detail.

I have to say that this assembly idea is a very interesting concept

Thanks again,
Matt
0 Likes
Message 8 of 18

Anonymous
Not applicable
Thanks I will do some more digging on this DllRegisterServer function concept.

Gratefully,
Matt
0 Likes
Message 9 of 18

Anonymous
Not applicable
Hello Laurie,

Thanks for sharing with me some code, I really appreciate it.
I will go and experiment using this idea.

Thanks again,
Matt
0 Likes
Message 10 of 18

Anonymous
Not applicable
Thanks for the link ... I will go and look into it.

Gratefully,
Matt
0 Likes
Message 11 of 18

Anonymous
Not applicable
This Inno Setup looks promising .. I imagine its a very powerful stuff and I would try to learn it more.

Thanks again,
Matt
0 Likes
Message 12 of 18

Anonymous
Not applicable
That will download a sample project showing use of Olaf's Registerless dll
wrapper

Heres some notes I saved from previous posts where I learned about it.

From Olaf Schmidt

You can use my free Helper-Tool for this
purpose (DirectCom.Dll).
Just look at:
www.datenhaus.de/Downloads/DirectCOMDemo.zip
Inside you'll find an example on how to use it for
regfree instantiation of COM-Objects directly
from the Filesystem or a Share (bypassing the registry).

COM has always offered a way for regfree instantiation,
even on Win98 - and my Dll just encapsulates the needed
API-Calls.

For deployment you only need to place everything in the
App.Path. Assuming your App consists of two Binaries:
MyStd.exe and MyAX.dll
then you only need to place DirectCOM.dll beside it,
declare one API-Call inside your Project, and replace
all occurences, where you've instantiated Classes from
MyAX.dll (usually with 'New' or 'CreateObject') with
the declared API-Function GETINSTANCE.
Assuming, your MyAX.dll contains two public Classes:
cMyClass1 and cMyClass2
then you would have to replace e.g.:
Dim oMyClass1 As cMyClass1
Set oMyClass1 = New cMyClass1
with
Set oMyClass1 = GETINSTANCE(App.Path & "\MyAX.dll", "cMyClass1")

and/or all occurences of e.g. (if there are any):
Dim oMyClass2 As cMyClass2
Set oMyClass2 = CreateObject("MyAX.cMyClass2")
with
Set oMyClass2 = GETINSTANCE(App.Path & "\MyAX.dll", "cMyClass2")


That's all you have to do regarding AX-Dlls (DirectCOM.dll is
dedicated only for AX-Dll-Instancing).

hth
Mark
0 Likes
Message 13 of 18

Anonymous
Not applicable
Whatever you do as other suggested (call regsvr32.exe or DLLRegisterServer()
at runtime prior to your exe calls the DLL), you need admin priviledge to
proceed. Since your issue is you, as developer, does not have that required
priviledge ti register a COM DLL, so, most likely, users running your code,
which calling "regsvr32.exe" or "DLLRegisterServer()" do not have higher
level of priviledge than you, so, your code woul fail.

If you really want to avoid register COM DLL, then do not use it. Simply
place code (classes) in DLL file into your exe project.

Or, if you constantly modify your code in DLL (many, if not all, programers
do), then try to maintain the DLL project's binary compatibility. As long as
the change does not break binary compatibilty, you can simply copy/paste
older version of DLL file without re-register it.


"matt_1ca" wrote in message news:5821472@discussion.autodesk.com...
Thanks for the link ... I will go and look into it.

Gratefully,
Matt
0 Likes
Message 14 of 18

Anonymous
Not applicable
Mark,

The first time I looked at Innosetup I had the same reaction and put it aside
until the day came when I really needed it. Then I found it was not that bad
to learn at all. Granted, it will take some effort, but well worth it. Be sure
to also download the ISTool add-on (you can find a link to it on the Innosetup
website. This makes Innosetup easier to use.

Ken Krupa

MP wrote:
> I confess to being mental midget but I looked at inno setup some time ago
> and got overwhelmed.
> seems like you had to learn a whole another language (the inno setup
> scripting language?) to write the scripts to install your app... just didnt'
> have the spare brain power or time at the time to digest it all...I was
> overloaded with other projects at the time already, so I gave up on learning
> it back then. (unless I'm misremembering and it was a different installer
> prog I was looking at???)
>
> Maybe it's not a complicated as it seemed at the time.
> Hopefully some day I'll have time to learn how to use that.
>
> There's also "registry-less" com technique available to avoid regsvr
> www.datenhaus.de/Downloads/DirectCOMDemo.zip
>
> Maybe that would help Matt
>
> Mark
>
>
> "Dale Levesque" wrote in message
> news:5820323@discussion.autodesk.com...
> There is no reason to perform all of these gymnastics. Look into a setup
> creation program called Inno setup. You should have the exe file already
> compiled with a reference to the newly compiled DLL. The deployment process
> should handle the matter of registering the new DLL. I have samples of how
> do do all this if you choose to go this route.
>
> Dale
>
>
> "matt_1ca" wrote in message news:5820329@discussion.autodesk.com...
> I was wondering if there is a way that I can make my .EXE use a .DLL without
> having any need to run regsvr32 to register the .DLL and things like that.
>
> Why can't .DLLs be as uncomplicated as .EXE with .EXE everything is heaven
> ... its just in those situations where I need to make a .DLL help my .EXE
> where everything gets to feel not so good because I have to register it
> first.
>
> The process becomes more and more painful the more times you need to edit
> the .DLL because then you have to unregister and then register again etc.
>
> When I deploy an .EXE everything goes smoothly but deploying an .EXE that
> depends on a .DLL is often a pain because I need to have the user run
> regsvr32 just to have the .DLL work ... its just a small department and just
> a small program but there are red tapes that slows down the process of
> implementing things with .DLL especially when it changes time and again
> because when that happens then I need to call up the head office again for
> registration permissions and things like that which of course never happens
> when I am just deploying an EXE.
>
> If only I had admistrative permissions on all the machines .. but that is of
> course a perfect world and in the absence of that perfect world I guess the
> next best thing is to just have the ability to use a .DLL without having any
> need to register it... so is there a way to do it?
>
> All suggestions welcome and thank you so much for all the kind help you can
> give.
>
> Gratefully,
> Matt
0 Likes
Message 15 of 18

Anonymous
Not applicable
> Wouldn't this require late-binding everything that references the dll in the exe project?

Not if the dll is registered on the dev machine which, if the dll is
built on the dev machine, it would be. If it isn't then register it by
whatever means you choose.

> Create a batch file that calls regsvr32, and get whoever is installing your application to run it.

You still wouldn't need a warm body. The exe could run the bat.
0 Likes
Message 16 of 18

Anonymous
Not applicable
Hi Ken,
Thanks for the encouragement.
If I ever need it I will definitely spend the time to figure it out.
:-)
Mark

"Ken Krupa" wrote in message
news:5821778@discussion.autodesk.com...
Mark,

The first time I looked at Innosetup I had the same reaction and put it
aside
until the day came when I really needed it. Then I found it was not that bad
to learn at all. Granted, it will take some effort, but well worth it. Be
sure
to also download the ISTool add-on (you can find a link to it on the
Innosetup
website. This makes Innosetup easier to use.

Ken Krupa

MP wrote:
> I looked at inno setup some time ago
> and got overwhelmed.
0 Likes
Message 17 of 18

Anonymous
Not applicable
Hello, thanks for the notes, this has given me a head start it is neat and straight forward.

Thanks again,
Matt
0 Likes
Message 18 of 18

Anonymous
Not applicable
Hello Norman,

Thanks for this valuable response ... I have always read things about this binary compatibility but never really had any chance to use it... I guess now is the best time to give it a shot ...your explanation is clear ... and I know it will help me both long and short term.

Thanks again, I really appreciate it...

Matt
0 Likes