Old 22nd January 2005, 14:59   #1
Dkom
Junior Member
 
Join Date: Nov 2004
Location: Russia Kursk-city
Posts: 47
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?
Dkom is offline   Reply With Quote
Old 22nd January 2005, 22:18   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Perhaps you could try this one on the next page instead:
http://forums.winamp.com/attachment....postid=1318917

-Stu
Afrow UK is offline   Reply With Quote
Old 22nd January 2005, 23:10   #3
Dkom
Junior Member
 
Join Date: Nov 2004
Location: Russia Kursk-city
Posts: 47
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
code:
!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.
Attached Files
File Type: zip test.zip (36.2 KB, 112 views)
Dkom is offline   Reply With Quote
Old 23rd January 2005, 17:40   #4
Dkom
Junior Member
 
Join Date: Nov 2004
Location: Russia Kursk-city
Posts: 47
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
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)
Dkom is offline   Reply With Quote
Old 27th January 2005, 13:03   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 27th January 2005, 15:50   #6
Dkom
Junior Member
 
Join Date: Nov 2004
Location: Russia Kursk-city
Posts: 47
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)
code:

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


it also leaves emty plugins dir after I press Finish.
Dkom is offline   Reply With Quote
Old 27th January 2005, 17:14   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 27th January 2005, 20:13   #8
Dkom
Junior Member
 
Join Date: Nov 2004
Location: Russia Kursk-city
Posts: 47
>Then you probably have SetOutPath $PLUGINSDIR somewhere
Yes, it was set. Now code is
code:
Function .onInit
InitPluginsDir
SetOutPath $PLUGINSDIR
File "bassmod.dll"
File "test.xm"
SetOutPath "$INSTDIR" # <- added
<other commands>


And It works!
Thanks.
Dkom is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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