Jump to content











Photo
- - - - -

[solved] reg_binary (0x3) "regwrite" issue


  • Please log in to reply
16 replies to this topic

#1 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 01 November 2009 - 10:48 AM

I do not know if it is a bug, but surely I can not see the "reason" for that issue... :cheers:

HOST OS and SOURCE = XP SP3
WinBuilder 077RC2 and 078SP2


I made a script for Windows Date and Time (service) and I want to write in the registry the host machine values existing in "TimeZoneInformation" key; all seems to work fine... until the reg_binary values writing (0x3) that fails. :cheers:

Settings are the following

[Variables]
%TMPREG%=TMPREG

[Process]
RegHiveLoad,"WB-Setup","%target_sys%\setupreg.hiv"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","ActiveTimeBias",Run,"%ScriptFile%",Transfer-Reg,"ActiveTimeBias","0x4"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","Bias",Run,"%ScriptFile%",Transfer-Reg,"Bias","0x4"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","DaylightBias",Run,"%ScriptFile%",Transfer-Reg,"DaylightBias","0x4"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","DaylightStart",Run,"%ScriptFile%",Transfer-Reg,"DaylightStart","0x3"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","DaylightName",Run,"%ScriptFile%",Transfer-Reg,"DaylightName","0x1"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","DisableAutoDaylightTimeSet",Run,"%ScriptFile%",Transfer-Reg,"DisableAutoDaylightTimeSet","0x4"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","StandardBias",Run,"%ScriptFile%",Transfer-Reg,"StandardBias","0x4"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","StandardStart",Run,"%ScriptFile%",Transfer-Reg,"StandardStart","0x3"
If,ExistRegKey,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","StandardName",Run,"%ScriptFile%",Transfer-Reg,"StandardName","0x1"
RegHiveUnLoad,"WB-Setup"

[Transfer-Reg]
RegRead,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","#1","%TMPREG%"
RegWrite,"HKLM","#2","WB-Setup\ControlSet001\Control\TimeZoneInformation","#1","%TMPREG%"


WB writes all the right values except the REG_BINARY ones ("DaylightStart" and/or "StandardStart") that it does not write at all, but in the error warning/halt all seems correct... :)

RegWrite - Type: [0x3] Section [HKLM\WB-Setup\ControlSet001\Control\TimeZoneInformation] Key [DaylightStart]: 00,00,03,00,05,00,02,00,00,00,00,00,00,00,00,00

Run - Processing section: [Transfer-Reg] From file: [%BaseDir%\Projects\LiveXP\Apps\System\TMPREG-WindowsDateTime.script]
[Parameter] with parameters: [DaylightStart],[0x3]
[Success] RegRead - read specified key from: [HKLM]Section: [SYSTEM\ControlSet001\Control\TimeZoneInformation] Key: [DaylightStart] to variable:: [%TMPREG%] with value: [#$q00#$q#$c#$q00#$q#$c#$q03#$q#$c#$q00#$q#$c#$q05#$q#$c#$q00#$q#$c#$q02#$q#$c
#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q]
[Failed] RegWrite - Type: [0x3] Section [HKLM\WB-Setup\ControlSet001\Control\TimeZoneInformation] Key [DaylightStart]: 00,00,03,00,05,00,02,00,00,00,00,00,00,00,00,00
[Warning] Halt
Run - Processed section [Transfer-Reg] in file: [%BaseDir%\Projects\LiveXP\Apps\System\TMPREG-WindowsDateTime.script]
[Success] RegHiveUnLoad - Unloaded registry hive: [WB-Setup]


#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 01 November 2009 - 11:56 AM

How do you set "DayLightStart" value? :lol:

The "right" Syntax is given by psc here:
http://www.boot-land...?...c=8975&st=1

Or, if you prefer, what does this expand to?:
RegWrite,"HKLM","#2","WB-Setup\ControlSet001\Control\TimeZoneInformation","#1","%TMPREG%"

jaclaz

#3 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 November 2009 - 12:53 PM

[Transfer-Reg]
RegRead,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","#1","%TMPREG%"
RegWrite,"HKLM","#2","WB-Setup\ControlSet001\Control\TimeZoneInformation","#1","%TMPREG%"


quotes can be the trouble, especially the ones at %TMPREG% , can you test with

RegRead,"HKLM","SYSTEM\ControlSet001\Control\TimeZoneInformation","#1",%TMPREG%
RegWrite,"HKLM","#2","WB-Setup\ControlSet001\Control\TimeZoneInformation","#1",%TMPREG%

and before psc gets angry to me, more proper writing:

RegRead,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,#1,%TMPREG%
RegWrite,HKLM,#2,WB-Setup\ControlSet001\Control\TimeZoneInformation,#1,%TMPREG%

#4 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 November 2009 - 01:41 PM

It looks like a bug, but really it is not a bug.

The magic wand gives the syntax:
RegWrite,HKLM,0x3,Section,Key(Binary),00,01,00
That means, the binary value to be written, is a undefined number of hex value parameters.
As usual, paramters are separated by commas.

In this case there is only one parameter, containing the commas as escape.
One parameter of a length greater 2 is treated as syntax error.

I changed the WB 078 SP3 that this %Variable%-syntax is accepted, too.

BTW: Please remember what Lancelot said about quotes:

This syntax is better:
[Transfer-Reg]

RegRead,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,#1,%TMPREG%

RegWrite,HKLM,#2,WB-Setup\ControlSet001\Control\TimeZoneInformation,#1,%TMPREG%


Peter

#5 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 01 November 2009 - 01:47 PM

@ Lancelot

Many thanks for your appreciated reply. :lol:
I removed the quotes at all and it still does not work: I've just noticed that with the current settings then it seems to work, but if I change In Control Panel (just for trying) the Time Zone Information settings then WB refuses to write new values (0x3) in the hive (with the previous error)... :lol:

[Success] IF - Key exists [DaylightStart] evaluated string: [If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DaylightStart,Run,%ScriptFile%,Transfer-Reg,DaylightStart,0x3]

Run - Processing section: [Transfer-Reg] From file: [%BaseDir%\Projects\LiveXP\Apps\System\TMPREG-WindowsDateTime.script]
[Parameter] with parameters: [DaylightStart],[0x3]

[Success] RegRead - read specified key from: [HKLM]Section: [SYSTEM\ControlSet001\Control\TimeZoneInformation] Key: [DaylightStart] to variable:: [%TMPREG%] with value: [#$q00#$q#$c#$q00#$q#$c#$q03#$q#$c#$q00#$q#$c#$q05#$q#$c#$q00#$q#$c#$q02#$q#$c
#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q]

[Success] RegWrite - Type: [0x3] Section [HKLM\WB-Setup\ControlSet001\Control\TimeZoneInformation] Key [DaylightStart]: 00,00,03,00,05,00,02,00,00,00,00,00,00,00,00,00
Run - Processed section [Transfer-Reg] in file: [%BaseDir%\Projects\LiveXP\Apps\System\TMPREG-WindowsDateTime.script]

[Success] IF - Key exists [StandardStart] evaluated string: [If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,StandardStart,Run,%ScriptFile%,Transfer-Reg,StandardStart,0x3]

Run - Processing section: [Transfer-Reg] From file: [%BaseDir%\Projects\LiveXP\Apps\System\TMPREG-WindowsDateTime.script]
[Parameter] with parameters: [StandardStart],[0x3]

[Success] RegRead - read specified key from: [HKLM]Section: [SYSTEM\ControlSet001\Control\TimeZoneInformation] Key: [StandardStart] to variable:: [%TMPREG%] with value: [#$q00#$q#$c#$q00#$q#$c#$q0A#$q#$c#$q00#$q#$c#$q05#$q#$c#$q00#$q#$c#$q03#$q#$c
#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q#$c#$q00#$q]

[Success] RegWrite - Type: [0x3] Section [HKLM\WB-Setup\ControlSet001\Control\TimeZoneInformation] Key [StandardStart]: 00,00,0A,00,05,00,03,00,00,00,00,00,00,00,00,00
Run - Processed section [Transfer-Reg] in file: [%BaseDir%\Projects\LiveXP\Apps\System\TMPREG-WindowsDateTime.script]


#6 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 01 November 2009 - 01:51 PM

@ psc

Thank you very much for your reply: I will read it with attention and will report desirable "new" results. :lol:

#7 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 November 2009 - 03:08 PM

This works:
set,%value%,"00,00,0A,00,05,00,04,00,00,00,00,00,00,00,00,00"

RegHiveLoad,WB-Setup,%target_sys%\setupreg.hiv

RegWrite,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,DaylightStart,%Value%

RegHiveUnLoad,WB-Setup

This dont:
RegRead,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DaylightStart,%test%

RegHiveLoad,WB-Setup,%target_sys%\setupreg.hiv

StrFormat,REPLACE,%test%,#$q,,%value%

RegWrite,HKLM,0x3,WB-Setup\ControlSet001\Control\TimeZoneInformation,DaylightStart,%Value%

RegHiveUnLoad,WB-Setup

Remembering a lately solved bugy with wbsp2, i made another test:
RegRead,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DaylightStart,%test%

StrFormat,REPLACE,%test%,#$q,,%value%

iniwrite,C:\1example.txt,main,test,%test%

checking 1example.txt with an hexeditor, after [main] we have 0D0A :lol: , after test=blabla we have 2 0D0A :lol: (having 2 0D0A maybe showing something wrong! maybe not , At least i expect no *** 0D0A after test=blabla line)

Edit ***
or maybe only 1 0D0A. I feel 1 of 0D0A comes from iniwrite, but i suspect the other.

#8 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 01 November 2009 - 05:45 PM

@Lancelot
I was just trying with an INI file and the results were something like "ad 00 01 00 00" in the hive with any value in the host registry... :lol:

Thanks the same. ;)


@psc
So, it seems that I will must wait for 078/SP3... :lol:

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 November 2009 - 06:30 PM

So, it seems that I will must wait for 078/SP3... ;)

Have a look at the News forum!

Peter ;)

#10 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 November 2009 - 06:32 PM

@psc
So, it seems that I will must wait for 078/SP3... :)

I feel the same

@psc
I don't know your schedule, but if you think new wb version is becoming ready to distribute/announce, Please remember to send some pre-copy to "The test group" before publishing (don't forget me). I look forward to update winbuilder version of livexp with crossing fingers till wb077rc2 and i guess if i cross my fingers more they will be broken. ;)

Instead of crossing fingers more and more, better to use fingers for a vulcan salute
Posted Image

:cheers: ;)

#11 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 November 2009 - 06:33 PM

@psc

Please remember ...

cross posting, I am too late at the cross ;) ;) I hope wb078sp3 is the luck one (with crossing fingers :>)

#12 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 November 2009 - 06:33 PM

Perfect instance of 'Cross Posting'

Peter ;)

#13 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 01 November 2009 - 09:00 PM

Great psc! :cheers: :cheers:

It works fine now! ;) ;)

Thank you (Lancelot too) very much! :)


Just for the record: the following entries were used
[Variables]
%TMPREG%=TMPREG

[Process]
RegHiveLoad,WB-Setup,%target_sys%\setupreg.hiv
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,ActiveTimeBias,Run,%ScriptFile%,Transfer-Reg,ActiveTimeBias,0x4
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,Bias,Run,%ScriptFile%,Transfer-Reg,Bias,0x4
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DaylightBias,Run,%ScriptFile%,Transfer-Reg,DaylightBias,0x4
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DaylightStart,Run,%ScriptFile%,Transfer-Reg,DaylightStart,0x3
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DaylightName,Run,%ScriptFile%,Transfer-Reg,DaylightName,0x1
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,DisableAutoDaylightTimeSet,Run,%ScriptFile%,Transfer-Reg,DisableAutoDaylightTimeSet,0x4
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,StandardBias,Run,%ScriptFile%,Transfer-Reg,StandardBias,0x4
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,StandardStart,Run,%ScriptFile%,Transfer-Reg,StandardStart,0x3
If,ExistRegKey,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,StandardName,Run,%ScriptFile%,Transfer-Reg,StandardName,0x1
RegHiveUnLoad,WB-Setup

[Transfer-Reg]
RegRead,HKLM,SYSTEM\ControlSet001\Control\TimeZoneInformation,#1,%TMPREG%
RegWrite,HKLM,#2,WB-Setup\ControlSet001\Control\TimeZoneInformation,#1,%TMPREG%


#14 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 November 2009 - 09:25 PM

Nice to see that you realized the "No Quotes" suggestion ;)

Peter

#15 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 03 November 2009 - 06:44 AM

Nice to see that you realized the "No Quotes" suggestion ;)

Yep, I like it too. :lol:
Please, in your appreciate opinion if the line was something like
...\Control\Time Zone Information,...
would be a better sintax adding quotes
"...\Control\Time Zone Information,..."
or special chars?
...\Control\Time#$sZone#$sInformation,...


#16 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 03 November 2009 - 07:03 AM

hi online,

my personal choice is using quotes to increase readibility.
"...\Control\Time Zone Information,..."
and for the rest I don't use anymore (and delete quotes when i notice).
but you asked "better" , Remember what the Oracle said in Matrix, "You already know the answer, It is up to the decision" (She said sth like that :lol:)

@psc

an updated reg2WBS which avoids using quotes will eventually decrease number of quotes around. Not a request, just reminding ;)

#17 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 03 November 2009 - 09:57 AM

@psc

an updated reg2WBS which avoids using quotes will eventually decrease number of quotes around. Not a request, just reminding ;)

reg2WBS Version 3.0.3 is on the server. :lol:
http://nativeex.boot.../reg2WBSprg.zip

Peter




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users