Archive: DllRegisterServer Problem


I've got quite a problem here:

I'd like NSIS to do this:

$SYSDIR\regsvr32.exe /s File.ax

How do I do that? I tried it with Exec and ExecShell, but that doesn't work. I tried the RegDLL Instruction and somehow feel this is the right command, but I can't figure out how to get the line above work.

Could somebody give me a hint here?:(

THX

[Edited by arundel on 06-21-2001 at 08:11 AM]


Well thank you very much for that big help.

After a few hours of hard thinking and trying I found out a good way of executing the following command myself:

"$SYSDIR\regsvr32.exe /s $SYSDIR\File.ax"

This worked well:

WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\Setup" "This will appear in the Register-Window" "$SYSDIR\regsvr32.exe /s $SYSDIR\File"

ExecWait $SYSDIR\runonce.exe ;This will run the above line and remove it from the registry


I hope someone will respond to my next article!:mad:


Ciao


:0

You only gave them 1 day....do you pay more for faster response times or something...

I get my tech support for free here, and I never had a problem waiting for a week or so until I got an answer. I read your post, but, heck, I didn't know the answer.

Sorry, just venting a little. :D

I'm glad you figured it out though, what exactly were you trying to do there. I was a bit confused on the first post, and now I'm totally lost. Are you just registering an ActiveX component?

-=Gonzotek=-


Yeah, no need to get all upset because there was no response. You have to remember two things - this is the least visited of the Winamp forums and also what if nobody had the solution? Plus you didn't give it enough time like Gonzotek said.

No need to get pissed off.


APOLOGISE
i wasn't realy angry that nobody was responding to my thread. I was just hanging around that part which did not work and was feeling like this was realy essential.

I only started scripting with NSIS a week ago and was getting to the point, where the manual can't help you anymore. Although I'm not into this business for very long I read quite a lot of threads in this Forum and must say that there are a lot of friendly guys in here who enjoy helping their troubled pals.

So please don't take my IMPATIENCE personaly.:rolleyes:

Gonzotek:

Yes, it was my intention to register an ActiveX component.
I'm putting up a compilation of DivX Codecs and needed to register the Direct Show Decoder (DivXa32.ax).



OK, It's cool. Don't let me scare you off from asking for more help...Sometimes all the attitude in messages boards in general gets to me (and then I get my own attitude :) ).

-=Gonzotek=-


Strange that you need to go to all that trouble just to register the ActiveX component, I would think that these lines should work:

SetOutPath "$SYSDIR"
File "divxa32.ax"
RegDLL "$SYSDIR\divxa32.ax"

If RegDLL doesn't do it, this should definately work:

SetOutPath "$SYSDIR"
File "divxa32.ax"
ExecWait "$SYSDIR\regsvr32.exe /s $SYSDIR\divxa32.ax"

And if neither of those work, then there is something wrong with NSIS because they both ought to do the job. What version of NSIS are you using?


I'm using Nullsoft's pre-compiled NSIS 1.44!

Your lines also work, but if I use the Run Once Wrapper Windows gives me a nice output window displaying the Registration Progress. Well actualy it all does the same and after all that trial-and-error procedure I went through I'd like to keep those lines of code.

It surely is a bit longer and takes up a few more lines, but the final installer-output-file is just 500 KB, so that's not a problem at the moment.

What also helped me a lot was your WindowsVersionDetect Function. I put that right into my .oninit Function.

If you don't mind I made the following modification which might help in the future:

;OLD PART OF CODE

lbl_winnt:

StrCpy $9 $0 1
StrCmp $9 '3' lbl_winnt_x
StrCmp $9 '4' lbl_winnt_x
StrCmp $9 '5' lbl_winnt_5 lbl_error


;NEW PART OF CODE

lbl_winnt:

StrCpy $9 $0 1
StrCmp $9 '3' lbl_winnt_x
StrCmp $9 '4' lbl_winnt_x
StrCpy $9 $0 3
StrCmp $9 '5.0' lbl_winnt_5
StrCmp $9 '5.1' lbl_winxp lbl_error

After finishing my current project I think I oughta extend my C++ and Assembler horizon...

Thanks for your help...;)


Other software install programs often put stuff in the RunOnce section and expect it to be run at the next reboot, in order to replace or upgrade DLL files before they are loaded into memory.

By running "runonce.exe" yourself instead of letting Windows trigger it on reboot, you might break other install/uninstall programs that the user has run right before yours. Using ExecWait on "regsvr32.exe" should have the same effect as using runonce but without that possible side effect.

No matter what you do, though, I'm glad it works for you :)