Archive: WordFind2X question


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.


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:


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

Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro GetBaseName

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