Xmort
24th April 2007 17:42 UTC
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 17:50 UTC
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 06:54 UTC
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 19:21 UTC
It's ?u with a question mark and it should be in the quotes.
System::Call 'PlugInstAM::SetInstDir(t, t) i(r11., r12.).r15?u'
Xmort
26th April 2007 06:15 UTC
The DLL file is deleted now. Thank you very much.
/bow