For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > March 2006 > regsvr32 vb application with dll









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author regsvr32 vb application with dll
elie chucrallah

2006-03-16, 7:55 am



Dear Sirs,

My standard exe vb5 application uses many DLLs.
On application start up , it uses regsvr32 -u then regsvr32 to register
all the applciation dlls.
if the client is a local administartor the applciation runs just fine.
One company does not allow the clients to run as local administrator.
I compiled the exe after removing the regsvr function, the exe gave me
unexpected error while running it as local user and run just fine when
run as administrator.
Any help would be much apreciated
thank you


*** Sent via Developersdex http://www.developersdex.com ***
Karl E. Peterson

2006-03-16, 6:55 pm

elie chucrallah wrote:
> My standard exe vb5 application uses many DLLs.
> On application start up , it uses regsvr32 -u then regsvr32 to
> register all the applciation dlls.
> if the client is a local administartor the applciation runs just fine.
> One company does not allow the clients to run as local administrator.
> I compiled the exe after removing the regsvr function, the exe gave me
> unexpected error while running it as local user and run just fine when
> run as administrator.
> Any help would be much apreciated


Trap the error, and bail with a note to the company's administrators that
they'll need to hand-register the DLLs that aren't properly registered
already.

I gotta ask, though... Why are you doing this? It seems absurd. Best
advice would be to skip the unreg/reg steps, and just whine if they're not
there.
--
Working without a .NET?
http://classicvb.org/


MikeD

2006-03-16, 9:55 pm


"Karl E. Peterson" <karl@mvps.org> wrote in message
news:umFnESSSGHA.3944@TK2MSFTNGP10.phx.gbl...
> elie chucrallah wrote:
>
> Trap the error, and bail with a note to the company's administrators that
> they'll need to hand-register the DLLs that aren't properly registered
> already.
>
> I gotta ask, though... Why are you doing this? It seems absurd. Best
> advice would be to skip the unreg/reg steps, and just whine if they're not
> there.


Or, properly install the app under an Admin login and install for all users.

Bottom line is that registering ActiveX components requires Admin or Power
User rights.

--
Mike
Microsoft MVP Visual Basic



Karl E. Peterson

2006-03-16, 9:55 pm

MikeD wrote:
>
> Or, properly install the app under an Admin login and install for all
> users.


Better still, yep. Reminds me of the sort of defensive shenanigans we saw
back with the threed.vbx fiasco.

> Bottom line is that registering ActiveX components requires Admin or
> Power User rights.


What, specifically, is forcing that? I'm thinking it's writing to
HKEY_CLASSES_ROOT? Is that hive normally read-only at lower privs?
--
Working without a .NET?
http://classicvb.org/


MikeD

2006-03-16, 9:55 pm


"Karl E. Peterson" <karl@mvps.org> wrote in message
news:uybPURWSGHA.1688@TK2MSFTNGP11.phx.gbl...
> MikeD wrote:
>
> Better still, yep. Reminds me of the sort of defensive shenanigans we saw
> back with the threed.vbx fiasco.


Don't know what you could be refering to. VBX files didn't need registered.
Just copy them to a directory in Windows' search path and you're done.
Kinda miss those days of installing VB3 apps.

>
>
> What, specifically, is forcing that? I'm thinking it's writing to
> HKEY_CLASSES_ROOT? Is that hive normally read-only at lower privs?


Correct. "Normal" users generally have write permissions for
HKEY_CURRENT_USER only. I say generally because an admin could give any
user write permissions to any part of the Registry. I don't know of any
admin that would do this though. You might as well just make the user an
admin. Of course, I'm hardly an expert on Windows administration either.
<g>

--
Mike
Microsoft MVP Visual Basic



Karl E. Peterson

2006-03-16, 9:55 pm

MikeD wrote:
> "Karl E. Peterson" <karl@mvps.org> wrote ...
>
> Don't know what you could be refering to. VBX files didn't need
> registered. Just copy them to a directory in Windows' search path and
> you're done. Kinda miss those days of installing VB3 apps.


Yeah, but there were so many versions of that one! Folks would routinely
copy theirs over others just to know what was what.

>
> Correct. "Normal" users generally have write permissions for
> HKEY_CURRENT_USER only. I say generally because an admin could give
> any user write permissions to any part of the Registry. I don't know
> of any admin that would do this though. You might as well just make
> the user an admin. Of course, I'm hardly an expert on Windows
> administration either. <g>


Yeah, I just play an admin on the internet, myself. <g>
--
Working without a .NET?
http://classicvb.org/


MikeD

2006-03-16, 9:55 pm


"Karl E. Peterson" <karl@mvps.org> wrote in message
news:u99yejWSGHA.4300@TK2MSFTNGP14.phx.gbl...

>
> Yeah, but there were so many versions of that one! Folks would routinely
> copy theirs over others just to know what was what.



Probably didn't do version checking either to make sure they weren't
overwriting a newer file. <g>

--
Mike
Microsoft MVP Visual Basic


elie chucrallah

2006-03-21, 9:56 pm



I compiled a new version of the exe with a msgbox on project start up.
running the new version as a normal user gave me unexpected error and
the msgbox never shows running this same version as local machine
administrator will run just fine when run again as normal user it runs
just fine.
sometimes , the next day , after the group policies are applied , the
application gives error.
the normal user has no access to his machine registry.
what is happening when i run the exe ? could the exe trying to register
the dependent DLLS locally resulting an error due to user access
security ?

*** Sent via Developersdex http://www.developersdex.com ***
Karl E. Peterson

2006-03-21, 9:56 pm

elie chucrallah wrote:
> what is happening when i run the exe ? could the exe trying to
> register the dependent DLLS locally resulting an error due to user
> access security ?


Did you *read* the thread that resulted from your initial post???
--
Working without a .NET?
http://classicvb.org/


elie chucrallah

2006-03-22, 3:56 am



1 - I think there is no error to trap as i said it fails before start
up, the version with msgbox on start up does not have regsvr in it.

2 - the application is installed under adminnistrator and for all users.

3 - i found some dlls classes registered under HKEY_CLASSES_ROOT all or
at least this hive is read-only if not accessible to normal user

giving write access to normal users to their local registry is against
our client policies, our application is huge and done long time ago. if
i identify exactly what my application needs to run i'd ask our client
to give access for our application to be able to run

Thank you again Mr. Peterson & Mr. Mike

*** Sent via Developersdex http://www.developersdex.com ***
Karl E. Peterson

2006-03-22, 6:56 pm

elie chucrallah wrote:
> 1 - I think there is no error to trap as i said it fails before start
> up, the version with msgbox on start up does not have regsvr in it.


Why did you focus on that in the initial message, then? This could be a
totally different situation. Fails to start? So, they double-click it, and
_nothing_ happens? Definitely sounds like a missing dependency. I think
you need to check what your application depends upon, and whether these DLLs
are present on the client system.

> 2 - the application is installed under adminnistrator and for all
> users.


If you can't get into Sub Main, something has been overlooked.

> 3 - i found some dlls classes registered under HKEY_CLASSES_ROOT


Some???

> all or at least this hive is read-only if not accessible to normal user


Yep. It certainly should be read-only. But if it's *not accessible*, well,
nothing's gonna work, cause just about everything needs it.

> giving write access to normal users to their local registry is against
> our client policies, our application is huge and done long time ago.
> if i identify exactly what my application needs to run i'd ask our
> client to give access for our application to be able to run


Have you tried running regmon and filemon to see what it's trying to do?
Sounds almost like you don't have access to the source?
--
Working without a .NET?
http://classicvb.org/


elie chucrallah

2006-03-27, 6:55 pm



>Fails to start? So, they double-click it, and
>_nothing_ happens? Definitely sounds like a missing dependency. I think
>you need to check what your application depends upon, and whether these

DLLs
>are present on the client system.


I think it is not a matter of dependecy since it runs just fine under
administrator without any additional component/dependecy registration.
plz read the folowing


[color=darkred]
>Some???


All the dlls classes exists under HKEY_CLASSES_ROOT


user
[color=darkred]
>Yep. It certainly should be read-only. But if it's *not accessible*,

well,
>nothing's gonna work, cause just about everything needs it.


against[color=darkred]
[color=darkred]
>Have you tried running regmon and filemon to see what it's trying to

do?
>Sounds almost like you don't have access to the source?


running my application with msgobx on sub main gave unexpected error
before the msgbox never got the msgbox.
regmon gave me 2 similar lines application : my application , request :
CreateKey , path : HKCR\Typelib\{5860DFD7-E356-4262-BE51-93BFF47BBA96} ,
error : ACCESS DENIED
so it is abvious my applciation is trying to write to the regystry

My question is i need to give a normal user access to write to this path
(HKEY_CLASSES_ROOT hive) on windows 2003 server having group policies.

that is urgent and critical, the client won't tolerate users to be power
users or even local administrators

Thank you very much

*** Sent via Developersdex http://www.developersdex.com ***
elie chucrallah

2006-03-29, 3:56 am



I think it is not a matter of dependecy since it runs just fine under
administrator without any additional component/dependecy registration.
plz read the folowing


All the dlls classes exists under HKEY_CLASSES_ROOT


running my application with msgobx on sub main gave unexpected error
before the msgbox.i never got the msgbox.
regmon gave me 2 similar lines
application : my application , request : CreateKey , path :
HKCR\Typelib\{5860DFD7-E356-4262-BE51-93BFF47BBA96} , error : ACCESS
DENIED
so it is abvious my applciation is trying to write to the registry

My question is i need to give a normal user access to write to this path
(HKEY_CLASSES_ROOT hive) on windows 2003 server having group policies.

that is urgent and critical, the client won't tolerate users to be power
users or even local administrators

Thank you very much

*** Sent via Developersdex http://www.developersdex.com ***
Karl E. Peterson

2006-03-29, 6:56 pm

elie chucrallah wrote:
>
> running my application with msgobx on sub main gave unexpected error
> before the msgbox never got the msgbox.
> regmon gave me 2 similar lines application : my application , request
> : CreateKey , path :
> HKCR\Typelib\{5860DFD7-E356-4262-BE51-93BFF47BBA96} , error : ACCESS
> DENIED
> so it is abvious my applciation is trying to write to the regystry


Yes, that would sure seem to be so. And you're saying you're not doing so
explicitly? This happens *before* the first executable line in Sub Main?
I've never heard of that. I think you'll need to make the absolute minimal
repro case here. Have you looked at that location in the registry, on a
machine where it worked, to see what's there?
--
Working without a .NET?
http://classicvb.org/


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com