Go Back   Winamp Forums > Developer Center > NSIS Discussion

 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 19th February 2002, 16:28   #1
CodeSquid
Member
 
Join Date: Dec 2001
Posts: 89
Improved UpgradeDLL macro

The improved UpgradeDLL macro can upgrades DLLs that are in use.

!macro UpgradeDLL
Exch $0
Push $1
Push $2
Push $3
Push $4
Push $5
ClearErrors
GetDLLVersionLocal ${DLL_NAME} $1 $2
GetDLLVersion $0 $3 $4
IfErrors upgrade_${DLL_NAME}
IntCmpU $1 $3 noupgrade_${DLL_NAME} noupgrade_${DLL_NAME} upgrade_${DLL_NAME}
IntCmpU $2 $4 noupgrade_${DLL_NAME} noupgrade_${DLL_NAME}
upgrade_${DLL_NAME}:
GetTempFileName $5
File /oname=$5 ${DLL_NAME}
UnRegDLL $0
delete /REBOOTOK $0
rename /REBOOTOK $5 $0
IfRebootFlag regreboot regnoreboot
regreboot:
WriteRegStr HKLM Software\Microsoft\Windows\CurrentVersion\RunOnce $0 "$SYSDIR\regsvr32 /s $0"
goto regrebootfinish
regnoreboot:
RegDLL $0
regrebootfinish:
noupgrade_${DLL_NAME}:
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
!undef DLL_NAME
!macroend
CodeSquid is offline   Reply With Quote
 
Go Back   Winamp 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