Jump to content











Photo
- - - - -

How to put '%BaseDir%\something' into a filebox without resolving?

esc

  • Please log in to reply
4 replies to this topic

#1 Rolf

Rolf

    Newbie

  • Members
  • 13 posts
  •  
    Germany

Posted 15 September 2011 - 06:32 AM

Good morning,

I want to fill a filebox with %BaseDir%\something as is, without resolving.

[Interface]
pFileBox1=D:\Toolbox\Win7PE_SE\BaseDir\..\Logs,1,13,0,40,330,20,dir
pCheckBox2="Compress Log file",1,3,0,80,200,20,False
pTextLabel1="Save Log file to (empty: don't save)",1,1,0,20,240,20,8,Normal
pButtonDefault="Restore default",1,8,355,35,90,30,ButtonDefaultClick,0,False,False,_ButtonDefaultClick_,False

[Variables]

[ButtonDefaultClick]
set,%pFileBox1%,%BaseDir%\..\Logs,Permanent
System,RefreshInterface
I want to get
pFileBox1=%BaseDir%\..\Logs,1,13,0,40,330,20,dir
instead of
pFileBox1=D:\Toolbox\Win7PE_SE\BaseDir\..\Logs
but I've no idea beside of IniWriteTextLine or something else on this level.

Thanks in advance

#2 RoyM

RoyM

    Frequent Member

  • .script developer
  • 420 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 15 September 2011 - 07:31 AM

See if this will do what you need

it appears to have been changed,
The command used to be WriteInterface
info here
http://wb.paraglider...face-Write.html


Example:
[Toggle_Refresh]
System,FILEREDIRECT,OFF
//UNINSTALL BUTTON
If,ExistRegKey,HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NBRTWizard,UninstallString,RegRead,HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NBRTWizard,InstallFileName,%InstallFileName%
If,ExistRegKey,HKLM,SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NBRTWizard,UninstallString,RegRead,HKLM,SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NBRTWizard,InstallFileName,%InstallFileName%
If,ExistFile,"%InstallFileName%",Begin
// show refresh rate controls
System,CURSOR,WAIT
WriteInterface,1,%ScriptFile%,pButton1_refresh,Button,2
End
Else,Begin
// hide refresh rate controls
WriteInterface,0,%ScriptFile%,pButton1_refresh,Button,2
End


#3 ChrisR

ChrisR

    Silver Member

  • .script developer
  • 784 posts
  •  
    France

Posted 15 September 2011 - 01:36 PM

About WriteInterface rarely used because a bit buggy, this function has been reviewed few months ago.
and was replaced by ScriptInterface in CApi v25rev81 or later, with a program autoit (thanks Lancelot and bluelife) that manages much better things :)
winbuilder.chm or the online help has not been reviewed, I hope this will be fixed as it works fine now.

ScriptInterface,Read,[Element],<file>,<section>,<name>,var

ScriptInterface,Write,[Element],<file>,<section>,<name>,<data>

ScriptInterface,Write|Read,Value,<file>,<section>,<name>,<data>

ScriptInterface,Write|Read,State,<file>,<section>,<name>,<data>

ScriptInterface,Write|Read,Position,<file>,<section>,<name>,<data>,<posleft>
ex in image configuration to write Wim Index and Wim Index Name in textlabel 'WimImageInfo_Name' :

ScriptInterface,Write,Value,,,WIMImageInfo_Name,"Install.wim : %WIMIndex% - %WIMNAME%"

System,RefreshInterface

 

gives

WIMImageInfo_Name="Install.wim : 5 - Windows 7 ULTIMATE",1,1,295,10,255,18,8,Bold
I don't know to not extend the,%BaseDir% value, with set,%pFileBox1%,%BaseDir%\..\Logs,Permanent

:cheers:

#4 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1338 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 15 September 2011 - 04:33 PM

the real issue here is that you want a literal for the % sign - and not have it interpreted as a indicator that this is a variable...so use the #$p in the string to write!...

And while the above API command may be useful *IF* you want to just update one of the parameters, you *CAN* use the "INIWrite" functionality, since you know all the values for the interface item...

[Interface]

pFileBox1=%BaseDir%\..\Logs,1,13,336,274,200,20,file

pButton2=Ok,1,8,376,237,80,25,pButton2,0,False,False



[pButton2]

IniWrite,%scriptfile%,Interface,pFileBox1,"#$pBaseDir#$p\..\Logs,1,13,336,274,200,20,file"

System,REFRESHINTERFACE


This would reset the value - and the location, etc. The only down side is that *IF* you move the box, you have to update the code (since it has hardcoded values in it)

#5 Rolf

Rolf

    Newbie

  • Members
  • 13 posts
  •  
    Germany

Posted 16 September 2011 - 09:44 AM

Thank you, working now.
I'm using the ScriptInterface now with ScriptInterface,Write,Value,,,pFileBox1,#$pBaseDir#$p\..Logs




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users