Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   System.dll - temporary DLL is not removed (http://forums.winamp.com/showthread.php?t=270103)

Xmort 24th April 2007 16:42

System.dll - temporary DLL is not removed
 
Hello,

i have following problem with my setup, i call C++ DLL during setup, which modifies one installed configuration file. Everything works fine, but the temporary DLL is not deleted after end of setup and remained installed on destination computer. I would say the file is locked and so can not be deleted without rebooting, but on computer, where i compile the setup, the DLL is deleted immediately!

calling function:
Function SetInstDir ;DLL call to make changes in configuration files
SetOutPath "$INSTDIR\"
File "PlugInstAM.dll"
StrCpy $8 ${NSIS_MAX_STRLEN}
System::Call 'PlugInst::SetInstDir(t, t) i(r11., r12.).r15'
SetPluginUnload manual
System::Free 0
Delete "$INSTDIR\PlugInstAM.dll"
FunctionEnd


Section "Account Management" SecAM
.
.
StrCpy $R1 "$INSTDIR\AM\dataconfiguration.config"
StrCpy $R2 "$INSTDIR"
Call SetInstDir
SectionEnd

I would appreciate any tips...
:confused:

kichik 24th April 2007 16:50

You call PlugInst but you extract PlugInstAM.dll.

Anyway, add ?u to the System::Call line and it'll unload the DLL right after it finishes the call.

Xmort 25th April 2007 05:54

Well, you are right, i did not paste the last version, which i left at work :) I call there PlugInstAM...
Anyway, the 'u' switch did not help :( Maybe you meant '/u'. I tried both, even '?u'. But the command
Delete "$INSTDIR\PlugInstAM.dll"
still does not work on some computers. There have to be some differences between environment of computers... :confused:

The function now:
Function SetInstDir
SetOutPath "$INSTDIR\"
File "PlugInstAM.dll"
StrCpy $0 ${NSIS_MAX_STRLEN}
System::Call 'PlugInstAM::SetInstDir(t, t) i(r11., r12.).r15' /u
SetPluginUnload manual
System::Free 0
Delete "$INSTDIR\PlugInstAM.dll"
FunctionEnd

kichik 25th April 2007 18:21

It's ?u with a question mark and it should be in the quotes.
code:
System::Call 'PlugInstAM::SetInstDir(t, t) i(r11., r12.).r15?u'

Xmort 26th April 2007 05:15

The DLL file is deleted now. Thank you very much.
/bow


All times are GMT. The time now is 04:10.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.