Archive: Problem with deleting $PluginsDir folder


Problem with deleting $PluginsDir folder
I want to use MOD music in my installer (example from sentry.zip (post http://forums.winamp.com/showthread....hreadid=169817 )
But after every install it leaves new empty folder ns***.tmp in my Temp folder.
What is wrong in this code?
Can I use BassMod 1.6 defines for BassMod 2.0?


Perhaps you could try this one on the next page instead:
http://forums.winamp.com/attachment....postid=1318917

-Stu


It seems this one works (into test.zip). When I install untill the end - it's OK, but when I press Cancel - installer leavs empty $PluginsDir.
I tried

!define MUI_CUSTOMFUNCTION_ABORT myOnUserAbort
Function myOnUserAbort
!insertmacro BASSMOD_Free
FunctionEnd
but it doesn't help.
How to delete $PluginsDir on user abort?
Another question: How can I use BASSMOD_GetVolume()? I want to get system volume into some variable, then set volume to 50% (for example) and play music. In .onGUIEnd I want ot set volume back using this variable. But I cant understand how to apply BASSMOD_GetVolume to this variable.

It seems that if no sections are executed (no files (like programs files, shortcuts or uninstaller) was installed) - installer doesn't remove $PluginsDir (it only removes files from this dir, and leaves emty dir). It removes this dir only after installing something. Strange...
If I write this code

Function .onGUIEnd
!insertmacro BASSMOD_Free
System::Free 0
FunctionEnd
installer must unload all plugins and delete PluginsDir on any GUIEnd (caused by pressing Cancel button or after successful install)

What version of NSIS are you using? The latest version will remove all files in the plug-ins directory but the files that are in use. If you use the latest version and open the plug-in directory, you'll see which file is in use.


V 2.04. Yes, it removes all files and directory, but if I install files. If I press Chancel - it removes plugins, but leaves empty plugins dir. Also if I put empty section (see test.zip above)


Section "file"
;SetOutPath "$INSTDIR"
;File "test.xm"
SectionEnd

it also leaves emty plugins dir after I press Finish.

Then you probably have SetOutPath $PLUGINSDIR somewhere. This causes the plug-ins directory to be the current working directory. The current working directory can not be deleted. Use File /oname or just SetOutPath to something else after you finish extracting.


>Then you probably have SetOutPath $PLUGINSDIR somewhere
Yes, it was set. Now code is

Function .onInit
InitPluginsDir
SetOutPath $PLUGINSDIR
File "bassmod.dll"
File "test.xm"
SetOutPath "$INSTDIR" # <- added
<other commands>

And It works!
Thanks.