Archive: How to get a string inside a string


How to get a string inside a string
so, i tried reading the manual about this thing, but it made no sense at all to me. so here goes.

i've got a string
'"C:\Path to\mIRC\mIRC.exe" -uninstall'
without the 's but with the "s.
i know i should create a function to read the string inside the "s, but that's where my lack of skill comes in.

and after i get the string i should then get only the path of it and drop the filename.

and if you are wondering "why do you need something like that"
well mirc's license doesn't allow mirc to be distributed in a modified form or in any other form than the original installer... for for the user to have an enjoyable install experience and to respect the license. the install should auto-detect mirc's install-dir and copy mirc.exe to the scripts dir (everything else is done except the auto-detecting mirc's folder based on that string).

i hope someone can help :/


I'll write a quick function. Will take a few minutes.

-Stu


There are already multi-purpose string functions in StrFunc.nsh which would have done this task equaly well, but here's a function just for doing what you need:

http://nsis.sourceforge.net/wiki/Get...between_quotes

-Stu


Wow, good to see that there is someone very experienced in the functions area. That's a lot of functions you got there (see Afrow UK's signature).


BTW:

Name "Output"
OutFile "Output.exe"

!include "WordFunc.nsh"
!insertmacro WordFind2X

Section
${WordFind2X} '"C:\Path to\mIRC\mIRC.exe" -uninstall' '"' '"' '+1' $0
#$0=C:\Path to\mIRC\mIRC.exe
SectionEnd
The script uses header

thanks a lot everyone.

you forgot to tell how to get just the path from the C:\path\filename.exe but i managed to figure it out with the WordFind function.

now the installer rocks :D

you guys rock :p