Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th May 2011, 23:18   #1
Genjin
Junior Member
 
Join Date: May 2011
Posts: 2
Look for Files containing a certain Word, and if they do, remove them?

I'm basically trying to do an Installer for additional content to my software, specifically Language Packs. Because of the way my software works I first have to remove old package files of Languages before I can add a new one. Now what I need is for the Installer to "scan" the folder of where the software was installed and find files that start with a specific prefix.

For example if my User wants to install Spanish language it should work like this:
- Scan the folder for other already existing language packages starting with "lang-" prefix
- May find a file, such as "lang-german.pack"
- (If found such a file, silently remove it)
- Install new file "lang-spanish.pack" to folder

But how do I do this exactly?

I apologize if this is a simple question that already has been answered somewhere, but I am unsure what the term is of what I am looking for and am unable to find a solution because of that.

Thank you very much in advance
Genjin is offline   Reply With Quote
Old 28th May 2011, 05:32   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
It's all in the manual: http://nsis.sourceforge.net/Docs/Chapter4.html

Use FindFirst etc, then either use FileRead etc, or use the macros in wordfunc.nsh (Again, see manual: http://nsis.sourceforge.net/Docs/AppendixE.html )
MSG is offline   Reply With Quote
Old 29th May 2011, 20:44   #3
Genjin
Junior Member
 
Join Date: May 2011
Posts: 2
Thank you MSG, although I ended up solving it another way. I'm now deleting it with a Wildcard ( Delete "$INSTDIR\lang-*.dcp" ) in my Section and then copy the new package file. My installer checks if if and where my product is installed. It seems to work fine

Thank you again
Genjin 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