Archive: InstallLib and vista...


InstallLib and vista...
I'm having problems that while using installib on a vista machine that it doesnt seem to work.

I searched the forums but wasn't able to find anything that helped me figure this out and the documentation for InstallLib seems to be non-existant (or at least I havent been able to find it)

On every other version of windows the following code works (or at least it has the desired effect of allowing my application to run) but on vista the files get copied but they do not get registered.

Here is the code:

;at the top of script
RequestExecutionLevel admin

;later on in script
Section "MFC Files"
StrCpy $ALREADY_INSTALLED 0

SetOutPath "$SYSDIR"

IfFileExists "$SYSDIR\MFC42.dll" 0 +2
StrCpy $ALREADY_INSTALLED 1
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED ..\MFC\MFC42.dll $SYSDIR\MFC42.dll $SYSDIR
StrCpy $ALREADY_INSTALLED 0
IfFileExists "$SYSDIR\MFC42u.dll" 0 +2
StrCpy $ALREADY_INSTALLED 1
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED ..\MFC\MFC42u.dll $SYSDIR\MFC42u.dll $SYSDIR
StrCpy $ALREADY_INSTALLED 0
IfFileExists "$SYSDIR\msvcrt.dll" 0 +2
StrCpy $ALREADY_INSTALLED 1
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED ..\MFC\msvcrt.dll $SYSDIR\msvcrt.dll $SYSDIR
StrCpy $ALREADY_INSTALLED 0
IfFileExists "$SYSDIR\msvcp60.dll" 0 +2
StrCpy $ALREADY_INSTALLED 1
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED ..\MFC\msvcp60.dll $SYSDIR\msvcp60.dll $SYSDIR
SectionEnd


Can anyone point me in the right direction?

TIA

Appendix B has documentation for InstallLib. I don't know what causes this to fail on Vista, but you are not using REGDLL as the libtype param....however, these runtimes normally don't get registered on install anyway.
I'd try debugging the install and/or app to see why it isn't working on Vista.


Thats just the thing, one of my ocx files wont run because it fails registration. The reason it fails registration is because MFC42.dll is not registered.

If I try to regsrv32 mfc42.dll from the cmd prompt I get an error.

If I launch cmd.exe "as administrator" and regsrv32 mfc42.dll it works and my ocx will register as well.

Or if I turn off the UAC in vista and just launch my app it works because my app is able to register both files. From that point on everything works fine (even after turning UAC back on since they are now registered).

The problem I have is installing on new vista installs where I have to install mfc42.dll. I suppose its entirely possible that this section of the script has never actually done anything in previous versions of windows since it used to be very rare to find a machine without mfc42 already installed.

I'll take a look at Appendix B....thanks again


Registration through InstallLib should work the same as from plain script on Vista, since InstallLib uses RegDLL. Have you tried unregsvr'ing and deleting mfc42.dll on a pre-vista system and seeing if your installer and app work? That might let you know if this is really a vista problem or if it's always been this way like you suspect.


Ok...a bit more info to add to the puzzle here:

I changed the above InstallLib code to use REGDLL instead of DLL and now the output gives me the error "Could not load symbol: DLLRegisterServer"

How does a dll that can be registered, tell me it cant be registered by the installer?


I just looked at that file, and it depends on MSVCRT.dll. That might be causing your problem.


Oops...I misread the output of the install...

The "Could not load symbol: DLLRegisterServer" error is being generated for the msvcrt.dll and msvcp60.dll and not for the mfc42.dll.

The mfc43.dll is simply saying "Registering c:\windows\system32\mfc42.dll" Can I assume that means it is successful (thats what it says for all the other DLLs that work properly)?

Upon your suggestion, I moved the msvcrt.dll above mfc42 but that did not help (except to make me realise I was misreading the output log).

In light of this, I suppose its time to check for alternative fixes for this.


and almost immediately I found the problem.

Thanks a ton for your help dienjd. I hope you got something good out of the research cause it ended up being a stupid mistake on my end...

Apparently the reason that my ocx wasn't getting registered was because I forgot to tell the installer to register it :cry: :cry:


No problem. I spend most of my day making stupid mistakes :)