Archive: unload dll from memory


unload dll from memory
Hi

2nd problem

i have a dll here which is not a registered dll - any attempts to do so failed

this dll is somewhere - not any system folder.
i made effort to replace it with the UnloadDLL script - the reboot option is offered.

but when i try to delete this dll inc the folder i made no effort

rmdir /rebootok does not work till now (2b3) - tried several solutions from this forum.

UnRegDLL <dll> does not work either

i can delete it with the wininit.ini (OS=XP) but the folder is not deleted yet.

any hints?

THX


Does it work if you put RMDir /REBOOTOK after UpgradeDLL?


Hi Joost

rmdir /rebootok causes error - must be rmdir /r :(


To delete a file after reboot you should use Delete /REBOOTOK not RMDir /REBOOTOK. Use Delete /REBOOTOK on the file first and then RMDir /REBOOTOK on the folder containing the file, it should execute in the order you specify it.


you are talking about the cvs?
cvs causes errors during compilation on my script while 2b3 does not


RMDir /REBOOTOK is the only thing that depends on the latest CVS version, other things apply to b3 too.

What errors do you get when you get the latest CVS version? If it's MUI errors then you should probably read the MUI readme again, define names and other things have changed. If not, attach the output of makensis.exe here and I'll have a look.


2b3
!insertmacro MUI_SECTIONS_FINISHHEADER

cvs
!insertmacro: MUI_SECTIONS_FINISHHEADER
!insertmacro: macro named "MUI_SECTIONS_FINISHHEADER" not found!
Error in script "setup.nsi" on line 182 -- aborting creation process

i did not found any documentation :( or i have the wrong docs


The documentation is in ${NSISDIR}\Contrib\Modern UI

-Stu


readme.htm
Old Section "7. Insert the MUI_SECTIONS_FINISHHEADER macro"
is missing

:hang:


That's because you don't need MUI_SECTIONS_FINISHHEADER any more :)


@kichik

thank you very much - i deleted it and put the new strings from MUI into.

it is always strange to use something and then someones tells me i dont need it any longer ;)

BTW the history file told me about nsis 2b4 - is this the cvs (loaded on 27th of mai) ?

from my other posting - it went wrong there.

~~~8<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i have a solution to my problem

; Usage:
; push dirname\dllname
; call exchange

Function exchange
Exch $R1
Push $R2
Push $R3
Push $R4
; $R1=oldname
; $R2=newname
; $R3=counter
StrCpy $R3 0

;check first if deletable
Delete $R1
IfFileExists $R1 0 copy

loop:
StrCpy $R2 $R1.$R3.tmp
IfFileExists $R2 0 done
IntOp $R3 $R3 + 1
Goto loop

done:
Rename $R1 $R2

copy:
;file was found and renamed
File "yourdll.dll"
;delete old TMP-files on next boot
Delete /REBOOTOK "$INSTDIR\*.tmp"

Pop $R3
Pop $R2
Pop $R1
FunctionEnd


another installer gave me that hint to rename that file, copy new file and delete old one on reboot.
i dont need the other script (UpgradeDLL.nsh]any longer :)

Now it is a fine peace of work i finshed a couple of minutes ago WITH your help

PS the function isnt perfect at all but it takes someone only a minute to make it 100% variable

PPS some explanation:
the file that has to be replaced will be renamed to <oldname.ext.counter.tmp>
counter goes up from "0" to anywhere but it is quite impossible that someone has done this a million times
before renaming it is controlled if that file is not there otherwise counter=counter+1 and loop
TMP-files are deleted on reboot

~~~8<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~