Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 2nd July 2005, 21:43   #1
zukex
Junior Member
 
Join Date: Jul 2005
Posts: 2
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 :/
zukex is offline   Reply With Quote
Old 2nd July 2005, 23:37   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
I'll write a quick function. Will take a few minutes.

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 2nd July 2005, 23:53   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
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

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 3rd July 2005, 03:08   #4
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
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).

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 3rd July 2005, 05:49   #5
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 665
BTW:
code:
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
Instructor is offline   Reply With Quote
Old 3rd July 2005, 08:15   #6
zukex
Junior Member
 
Join Date: Jul 2005
Posts: 2
Thumbs up

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

you guys rock
zukex is offline   Reply With Quote
Reply
Go Back   Winamp 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