Jump to content











Photo
- - - - -

RegMulti fails on append if key doesn't exist

regmulti

  • Please log in to reply
21 replies to this topic

#1 Rolf

Rolf

    Newbie

  • Members
  • 13 posts
  •  
    Germany

Posted 25 November 2011 - 02:28 PM

Good afternoon everybody,

I just want to mention that regmulti fails on append if the key doesn't exist:
RegMulti,HKLM,%reg%\ControlSet001\Control\Class\{71A27CDD-812A-11D0-BEC7-08002BE2092F},UpperFilters,APPEND,snapman
fails if UpperFilters doesn't exist.

Rolf

#2 pscEx

pscEx

    Platinum Member

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

Posted 25 November 2011 - 03:23 PM

I think you are in the wrong train here.

RegMulti is neither a WinBuilder command, nor a command described in the WinBuilder help's API section.

Appearently you have here some troubles with a proprietary script.

And that is not theme of "Bugs on the latest stable edition of WinBuilder.exe".

Peter

#3 homes32

homes32

    Gold Member

  • .script developer
  • 1030 posts
  • Location:Minnesota
  •  
    United States

Posted 25 November 2011 - 04:38 PM

I think you are in the wrong train here.

RegMulti is neither a WinBuilder command, nor a command described in the WinBuilder help's API section.

Appearently you have here some troubles with a proprietary script.

And that is not theme of "Bugs on the latest stable edition of WinBuilder.exe".

Peter

look again in the magic wand under Registry... :whistling:

#4 pscEx

pscEx

    Platinum Member

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

Posted 25 November 2011 - 04:43 PM

OOPS! :frusty:

Sorry, Rolf!

Seems that Mr. Alzheimer is catching me.

I'll try in debugger.

Peter

#5 pscEx

pscEx

    Platinum Member

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

Posted 25 November 2011 - 05:05 PM

Good afternoon everybody,

I just want to mention that regmulti fails on append if the key doesn't exist:
RegMulti,HKLM,%reg%ControlSet001ControlClass{71A27CDD-812A-11D0-BEC7-08002BE2092F},UpperFilters,APPEND,snapman
fails if UpperFilters doesn't exist.

Rolf

When the key does not exist, WinBuilder gives correctly an error message that it cannot append to a non - existing key:

[RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr]: does not exist

IMO it is in the responsibility of the script developer, to append something only to existing items.

EDIT: Could look like this:
If,EXISTREGKEY,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr

Else,RegWrite,HKLM,0x7,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,PartMgr


An automatic creation of a missing key is not recommended.

Imagine that the developer did a small misspelling of the key. When WinBuilder creates it silently, the developer would get knowledge about this only after hard debug work, when something does not work as assumed.

To create and give a warning, is also not recommended, because many people like not to show warnings.

Peter

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15149 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 November 2011 - 06:04 PM

When the key does not exist, WinBuilder gives correctly an error message that it cannot append to a non - existing key:


[RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr]: does not exist


Actually the error is not at all "clear".
WHAT is not existing?

This (fake) error message:

[RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr]: Error Key "UpperFilters" does not exist

or:

[RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr]: Error THe specified path does not exist



would be more clear IMHO.
Since the Registry is a filesystem ;), when you do:
COPY C:foo.txt D:IdontExistfoo.txt
in a console (given that directory D:IdontExist does not actually exists) you get error:

Cannot find specified PATH...


that gives you a hint that you have to make sure that directory D:IdontExist actually exists and you can add a check and a md command.....

:cheers:
Wonko

#7 sbaeder

sbaeder

    Gold Member

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

Posted 25 November 2011 - 07:21 PM

Agree that error from WB could be better, but also added comment to the docs on the wiki, and pointer back to this topic.

#8 pscEx

pscEx

    Platinum Member

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

Posted 25 November 2011 - 07:46 PM

Agree that error from WB could be better, but also added comment to the docs on the wiki, and pointer back to this topic.

Thanks for the fast reaction, Scott!

But as usual, I have some concerns:

There should the same Note: for the section.
A typo Th (e?)

And with item #1 we have the issue Wonko speaks about:

Currently WinBuilder only gets to know from Billy The Gates, that there is something wrong with opening the key.

To decide and create an "Error Message for Dummies", after getting the error, WinBuilder has to do some tests in order to be able to write a more detailled message.

I do not want to spend the time to code (with all possible first-coding-bugs etc.)

Peter

#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15149 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 November 2011 - 07:57 PM

I do not want to spend the time to code (with all possible first-coding-bugs etc.)


How long it takes to replace "does not exist" with "The specified Registry PATH does not exist"? :dubbio:

:cheers:
Wonko

#10 sbaeder

sbaeder

    Gold Member

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

Posted 25 November 2011 - 08:03 PM

Thanks for the fast reaction, Scott!

But as usual, I have some concerns:

This is why MANY eyes looking at the docs can see much more than my own set of just two eyes...Fixed and added!

#11 homes32

homes32

    Gold Member

  • .script developer
  • 1030 posts
  • Location:Minnesota
  •  
    United States

Posted 25 November 2011 - 08:06 PM

How long it takes to replace "does not exist" with "The specified Registry PATH does not exist"? :dubbio:

:cheers:
Wonko

I suppose that depends on wether or not WB is generating the message text or passing it directly on from the Windows API

#12 pscEx

pscEx

    Platinum Member

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

Posted 25 November 2011 - 08:07 PM

How long it takes to replace "does not exist" with "The specified Registry PATH does not exist"? :dubbio:

:cheers:
Wonko

You can do it for yourself in some seconds.

Just change in ToolsLanguages<your language>.txt
!#2209=does not exist

to
!#2209=The specified Registry PATH does not exist

But maybe that as report about a missing icon, you get the message

The specified Registry PATH does not exist

If you like that, it is your pleasure!

Peter :hyper:

#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15149 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 November 2011 - 08:41 PM

I see. :)
It is a generic "does not exist" error message.
Then, I guess that this would be - if not more clear - at least more sincere:

!#2209=*something* among the *whatever* needed by this command does not exist

or:

!#2209=HI, I am a generic error, *something* does not exist


or (more aggressive ;)):

!#2209=Generic error #2209, *something* does not exist (and it's your fault as you suck at writing .scripts)


or (plain generic english)

!#2209=An error occurred...

:whistling:


:cheers:
Wonko

#14 pscEx

pscEx

    Platinum Member

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

Posted 25 November 2011 - 08:54 PM

I like your third alternative.

But perhaps that can cause some developers to switch to the Over forum :dubbio:
(In those cases of unprofessional developers maybe not a big loss? :happy_dance2: )

Peter

#15 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 25 November 2011 - 11:31 PM

Would be even better if the original win api error code was logged as well.

In this case though I agree with the first post that its a bug more than a feature.

#16 pscEx

pscEx

    Platinum Member

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

Posted 26 November 2011 - 09:24 AM

I changed WinBuilder to bring a more meaningful message:

[Failed] [RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE103},UpperFilters,APPEND,PartMgr]: Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE103} does not exist

[Failed] [RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr]: Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters does not exist


Will be in next release.

Peter

#17 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15149 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 November 2011 - 12:09 PM

I changed WinBuilder to bring a more meaningful message:
....

Will be in next release.


:thumbup:

:cheers:
Wonko

P.s.: unfortunately antoher nice example of the current stupid board software the codebox doesn't scroll on the right......:(

#18 homes32

homes32

    Gold Member

  • .script developer
  • 1030 posts
  • Location:Minnesota
  •  
    United States

Posted 26 November 2011 - 03:56 PM

I changed WinBuilder to bring a more meaningful message:


[Failed] [RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE103},UpperFilters,APPEND,PartMgr]: Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE103} does not exist

[Failed] [RegMulti,HKLM,Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,APPEND,PartMgr]: Tmp_setupreg_hivControlSet001ControlClass{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters does not exist


Will be in next release.

Peter

excellent. thanks.

#19 Rolf

Rolf

    Newbie

  • Members
  • 13 posts
  •  
    Germany

Posted 28 November 2011 - 09:43 AM

Good morning everybody,

thanks for all your comments. This is really a living forum.

Back to the issue in focus:
I think RegMulti should work in the same way as reg_add. If the key doesn't exist it should be created of course. Reg_add has no need to do something like
If,Not,EXISTREGKEY, ... reg_add ...
to avoid warnings.

#20 pscEx

pscEx

    Platinum Member

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

Posted 28 November 2011 - 09:54 AM

Here it is the opposite.

Reg_add is intended to add a non existent value.

If an existing value is overwritten, a warning (depending on build options) is given.

Peter

#21 sbaeder

sbaeder

    Gold Member

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

Posted 28 November 2011 - 10:18 PM

And also, since the RegMulti can do all sorts of other manipulations (like insert in the middle), it could go either way. I think that as long as the behavior is rational (can be explained) and is documented, it is OK, especially when there are good arguements each way.

#22 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 29 November 2011 - 12:49 PM

Biggest reason for changing the behavior is that it makes the scripts that use it look messy.

Probably a new function should be added to the common api to wrap the method with a function that does the if not exists, write else .. calls.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users