Old 25th May 2006, 16:21   #1
00zero
Junior Member
 
Join Date: May 2006
Location: pittsburgh
Posts: 7
help changing dir seperators

in my install i make an m file that is used by mathematica that simply points to a directory where the install took place. The problem is that the dir structure in mathematica is semperate by teo slashes {c:\\program files\\ vs the normal c:\program files\} i know there is the wordinsert but it only looks at the nth instance and i dont know how long the director structure may be. is ther an easy to relapce all the \ with \\? i say the str replace but im having trouble implmenting it.

thanks
Jonathan
00zero is offline   Reply With Quote
Old 25th May 2006, 16:33   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
NSIS Wiki is your friend.
http://nsis.sourceforge.net/StrReplace_v4

-Stu
Afrow UK is offline   Reply With Quote
Old 25th May 2006, 16:55   #3
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
* Put a backslash here means replace this text with a real
backslash as for some reason backslashes removed from code.
code:
OutFile "Output.exe"

Section -
StrCpy $0 ''
StrCpy $R0 "c:\program files\my dir\"
StrCpy $R1 0

_loop:
StrCpy $R2 $R0 1 $R1
StrCpy '$0' '$0$R2'

StrCmp $R2 'put a backslash here' +1 +3

StrCpy $0 '$0$R2'
StrCpy '$R2' '$R2also put a backslash here'

StrCmp $R2 '' _end
IntOp $R1 $R1 + 1
goto _loop

_end:
messagebox mb_ok '$0'
SectionEnd


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 25th May 2006, 17:24   #4
00zero
Junior Member
 
Join Date: May 2006
Location: pittsburgh
Posts: 7
thanks

ill give that a try.

-jonathan
00zero 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