|
|
|
|
#1 |
|
Junior Member
Join Date: Jul 2003
Location: LA USA
Posts: 37
|
Displaying $InstDir in a textbox
Slashes get removed.
I wanted to display a custom page right before the InstFiles page (mostly because I wanted an Install button). I decided to use this page to review the users selections during the install. I have a multiline textbox and I try to do this: !insermacro MUI_INSTALLOPTIONS_Write "readytoinstall.ini" "Field n" "State" "Directory To Install To:\r\n\t$InstDir\r\n\r\n" but the output in the textbox is Directory To Install To: C:Program FilesFolder Name ('C:' and 'Program Files' may not actually be the user selection obviously, I just used those in this example.) I checked the $InstDir variable and it still has slashes before and after I use it here but they won't show up in the textbox. Ultimately, the program gets installed correctly. |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
your question is similar to mine:
http://forums.winamp.com/showthread....hreadid=142732 i also need to transfer $INSTDIR to the IO pls help Greets, Brummelchen |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2003
Location: LA USA
Posts: 37
|
I had originally written my post as a reply to yours but then I wasn't sure what it was exactly you were trying for so I posted a new thread.
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jul 2003
Location: LA USA
Posts: 37
|
My problems is solved here kind of:
http://forums.winamp.com/showthread....hreadid=135250 Later I escape the slashes in a CopyFiles thing and it doesn't work. I'll keep you all up to date on my progress. Edit: Guide to escaping things in NSIS $$ is $ $\" is " && is & \\ is \ The convention appears to be double everything except the quote because that means null? If some other character has a natural meaning in it's double form like the quote then it will need to be escaped with $\x x being the character with natural double meaning. Last edited by bSecRes; 19th July 2003 at 20:29. |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Use the ConvertBStoDBS function on the NSIS archive for placing paths in an IO page.
http://nsis.sourceforge.net/archive/...ances=0,11,122 -Stu |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
Does not work so far - or am i wrong with this?
[Field 7] Type=DirRequest Left=10 Right=300 Top=95 Bottom=108 State=$R0 Greets, Brummelchen |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jul 2003
Location: LA USA
Posts: 37
|
Brummelchen, according to Afrow, you would want to do something like this:
Push $R0 Call ConvertBStoDBS Pop $R0 WriteINIStr "SomeFile.ini" "Field 7" "State" $R0 You cannot set the value of state to $R0 in a text editor and then, once the Field is processed, have the current value of $R0 appear there. |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
bSecRes is correct.
-Stu |
|
|
|
|
|
#9 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
no fortune
![]() code: Greets, Brummelchen |
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Should be:
code: Doing a WriteINIStr "menu02a.ini" "Field 7" "State" $R0 will write it to C:\menu02a.ini, because you did not specify the file path. With MUI_INSTALLOPTIONS_WRITE, the macro puts the file path in for you (which is $PLUGINSDIR\menu02a.ini) -Stu |
|
|
|
|
|
#11 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
This works, thx.
But i dont need "ConvertBStoDBS" any longer - the directory is shown proper without. But there is something strange - the content of this page is shown after a second intermission (blank page) - huh, thats Mcafee - if deactivated its fast. grmpf - operation must be inside RAM. aha - IC - i put that line somewhere before (.oninit) - now it's fast again
Greets, Brummelchen |
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
The \\ \ problem must have been an old IO issue, and must have been fixed in latest (or a recent) CVS.
-Stu |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Jul 2003
Location: LA USA
Posts: 37
|
Still an IO issue, just not with DirRequest fields.
|
|
|
|
|
|
#14 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
jep it is
i used your idea for a pre-install page and get no "\" Greets, Brummelchen |
|
|
|
|
|
#15 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
"\" becomes "" in labels.
"\" stays as "\" in anything else (text boxes, dirrequest etc) -Stu |
|
|
|
|
|
#16 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
It's not an issue, it's by design. It is this way so you can use line breaks in labels. The unfortunate side affect is the need to double every black slash when writing to labels.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#17 |
|
Major Dude
Join Date: May 2003
Posts: 681
|
i tried to use this function but i had a minor problem that i have to be compatible to my "version 1" which has a "\" at each path infomation
eg c:\programs\ and not c:\programs ConvertBStoDBS has bug inside which converts c:\programs\ to c:\programs\c:\programs\ Not familiar with the code i wrote the following script which is not comfortable but which does it better. maybe someone can use it... code: Greets, Brummelchen |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|