Old 6th August 2006, 16:02   #1
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
WordFind2X question

InputString: C:\Path\to\myFile\myFile.exe

${WordFind2X} "$Input" "\" "." "-1" $File

this gives me the filename without the extension, but it's not working when the filename contains dots. i tried a couple of other variants by chance, as i think the documentation on the wiki isn't the best - but i couldn't get it to work as desired.

maybe some of the english tongues can improve the docs for all of instructor's word functions, i think they're not that clear.
Yathosho is offline   Reply With Quote
Old 6th August 2006, 17:39   #2
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
I don't think you will be able to filter the path with a single call to the word functions. I suggest doing it in three steps, first remove the drive and colon, second remove the part before all backslashes ('\\'), finally remove the last '.' and the extension:
code:

${WordFind} "$Input" ":" "+1}" $0 ; returns $Input if no ':'
${WordFind} "$0" "\" "-1}" $0
${WordFind} "$0" "." "-1{" $File

demiller9 is offline   Reply With Quote
Old 6th August 2006, 19:32   #3
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
code:
Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro GetBaseName

Section
${GetBaseName} "C:\ftp\My.Program.exe" $0
MessageBox MB_OK '$$0={$0}'
SectionEnd

Instructor 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