Old 20th December 2008, 06:40   #1
volpolo
Junior Member
 
Join Date: Nov 2008
Location: Italy
Posts: 13
DLL register / unregister

Hi, please help me with this problem.

Some my applications use the same SHARED DLL and/or OCX:

-installing one or more of them, Reg Counters seems NOT change (i found the same values after each installation)
- the first application I un-install CLEAR all REG Values (de-register) and delete the DLL

Here my code

Section /o "Vr Client" SecClient

StrCpy $Version 0
ReadRegDWord $Version ${UMUI_PARAMS_REGISTRY_ROOT} "${UMUI_PARAMS_REGISTRY_KEY}" "VR CLIENT"

StrCmp $Version 1 ClientOLD ClientNEW
ClientNEW:
StrCpy $ALREADY_INSTALLED 0
Goto ClientSTOP
ClientOLD:
StrCpy $ALREADY_INSTALLED 1
Goto ClientSTOP
ClientSTOP:
Nop

!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
"Client\Support\XPCONTROLS.OCX" "$SysDir\XPCONTROLS.OCX" "$SysDir"


WriteRegDWord ${UMUI_PARAMS_REGISTRY_ROOT} "${UMUI_PARAMS_REGISTRY_KEY}" "VR CLIENT" 1

SectionEnd

Section /o "Vr Sportello" SecSportello

StrCpy $Version 0
ReadRegDWord $Version ${UMUI_PARAMS_REGISTRY_ROOT} "${UMUI_PARAMS_REGISTRY_KEY}" "VR SPORTELLO"

StrCmp $Version 1 SportelloOLD SportelloNEW
SportelloNEW:
StrCpy $ALREADY_INSTALLED 0
Goto SportelloSTOP
SportelloOLD:
StrCpy $ALREADY_INSTALLED 1
Goto SportelloSTOP
SportelloSTOP:
Nop


!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \
"Sportello\Support\XPCONTROLS.OCX" "$SysDir\XPCONTROLS.OCX" "$SysDir"

WriteRegDWord ${UMUI_PARAMS_REGISTRY_ROOT} "${UMUI_PARAMS_REGISTRY_KEY}" "VR SPORTELLO" 1

SectionEnd


Function ${un}CLIENT

IfFileExists $INSTDIR\$PathClient\VR_CLIENT.exe 0 Fine3

!insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\XPCONTROLS.OCX"

DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} "${UMUI_PARAMS_REGISTRY_KEY}" "VR CLIENT"


Fine3:
Nop

FunctionEnd

Function ${un}SPORTELLO

IfFileExists $INSTDIR\$PathSportello\VR_SPORTELLO.exe 0 Fine4

!insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\XPCONTROLS.OCX"

DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} "${UMUI_PARAMS_REGISTRY_KEY}" "VR SPORTELLO"
Fine4:
Nop

FunctionEnd

---------------------- STOP

Please help me,I don't undersrtand what to do

Tks
volpolo is offline   Reply With Quote
Old 20th December 2008, 06:45   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If $ALREADY_INSTALLED is not empty, it won't increase the share count as your installer has probably already done it the last time it installed your application.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 20th December 2008, 09:29   #3
volpolo
Junior Member
 
Join Date: Nov 2008
Location: Italy
Posts: 13
First of all, thanks for your replya.

Please, verify my code.

I want to install 2 different application (Section SecClient, Section SecSportello), and individually un-install. In this way each application must manage the share count.

If my code in OK for my idea, what else dosn't works?

Thansk again for a new reply
volpolo 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