Old 12th November 2014, 05:59   #1
AndyJoeB
Junior Member
 
Join Date: Jan 2014
Posts: 9
Registering same OCX with 2 apps busted (REGDLL issue?)

Hi,

I have 2 apps that both install and register the same OCX (windows). The first installs and uninstalls it this way:

- !insertmacro InstallLib REGDLL 0 NOREBOOT_NOTPROTECTED "n1mm\N1MM-files\XMMT.ocx" "$INSTDIR\XMMT.ocx" "$INSTDIR"
- !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$INSTDIR\XMMT.ocx"

the second installs and uninstalls it this way:

- RegDLL "$INSTDIR\XMMT.ocx"
- UnRegDLL "$INSTDIR\XMMT.ocx"

$INSTDIR is different for each app.

When the 2nd app is uninstalled (via UnregDLL) the first one seems to get busted. I am thinking I should be using the InstallLib macro just as with the first app.

Can someone confirm that this should work?
Is it a supported scenario that the same typelib/dll is registered twice?
What if the second ocx file is deleted manually? or does windows do all the magic behind the covers in the registry?
Would the first apps registration have to be changed to or just the second?

Thanks
AndyJobB
AndyJoeB is offline   Reply With Quote
Old 12th November 2014, 16:44   #2
AndyJoeB
Junior Member
 
Join Date: Jan 2014
Posts: 9
As a follow up question:

If I have a shared dll used by 2 un-related applications, do I also need to push the dll/ocx into the System32 folder? I usually try not to do that as I do not think it is good practice, but is this required if I use InstallLib SHARED in NSIS?

Thanks
AndyJoeB
AndyJoeB is offline   Reply With Quote
Old 12th November 2014, 17:00   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,263
SHARED uses HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs to know if a file is used by multiple applications/installs. UnRegDLL will always unregister, you have to use InstallLib SHARED for shared files and/or shared COM/OLE registrations.

If your target is WinXP+ you can use registration free COM and avoid registering anything if you want a local copy of the dll/ocx in your application folder...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump