Jump to content











Photo
- - - - -

The new API and the registry


  • Please log in to reply
18 replies to this topic

#1 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 17 December 2007 - 12:27 AM

This may be the wrong place ...

I can't find any examples of using the new API to write to HKLM. It seems to me that this should work:

Hive_Load,HKLM

Reg_Add,0x3,"%reg%\Software\Roadkil","Lic_Unstp","31"

Hive_Unload,HKLM

and there is no problem indicated in the log:

Processing section: [reg_hiveload] From file: [%BaseDir%\Projects\VistaPE-Beta\api.script]



  SetVar - Sucessfuly changed the value of [%hive_file%] to: [%HIVE_#1%]

  System - Refreshing all variables

  Loading HKLM hive..

  Loading hive from %BaseDir%\Target\VistaPE\windows\system32\config\system

  RegHiveLoad - File: [%BaseDir%\Target\VistaPE\windows\system32\config\system] Section [wb-hive]





  RegWrite - root key: [HKLM] Type: [0x3] Section [wb-hive\Software\Roadkil] key [Lic_Unstp=31..]





 Processing section: [reg_hiveunload] From file: [%BaseDir%\Projects\VistaPE-Beta\api.script]



  Unloading wb-hive

  RegHiveUnLoad - Unloaded registry hive: [wb-hive]

but nothing gets into the registry. Am I doing something wrong?

#2 powaking

powaking

    Frequent Member

  • Advanced user
  • 238 posts
  • Location:Fall River, MA
  •  
    United States

Posted 17 December 2007 - 03:33 AM

This may be the wrong place ...

I can't find any examples of using the new API to write to HKLM. It seems to me that this should work:

Hive_Load,HKLM

Reg_Add,0x3,"%reg%\Software\Roadkil","Lic_Unstp","31"

Hive_Unload,HKLM

and there is no problem indicated in the log:

Processing section: [reg_hiveload] From file: [%BaseDir%\Projects\VistaPE-Beta\api.script]



  SetVar - Sucessfuly changed the value of [%hive_file%] to: [%HIVE_#1%]

  System - Refreshing all variables

  Loading HKLM hive..

  Loading hive from %BaseDir%\Target\VistaPE\windows\system32\config\system

  RegHiveLoad - File: [%BaseDir%\Target\VistaPE\windows\system32\config\system] Section [wb-hive]





  RegWrite - root key: [HKLM] Type: [0x3] Section [wb-hive\Software\Roadkil] key [Lic_Unstp=31..]





 Processing section: [reg_hiveunload] From file: [%BaseDir%\Projects\VistaPE-Beta\api.script]



  Unloading wb-hive

  RegHiveUnLoad - Unloaded registry hive: [wb-hive]

but nothing gets into the registry. Am I doing something wrong?


Shouldn't it start something like:

RegWrite,HKLM,0x4,"WB-Software\

#3 pscEx

pscEx

    Platinum Member

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

Posted 17 December 2007 - 08:19 AM

Loading hive from %BaseDir%\Target\VistaPE\windows\system32\config\system

  RegHiveLoad - File: [%BaseDir%\Target\VistaPE\windows\system32\config\system] Section [wb-hive]

  RegWrite - root key: [HKLM] Type: [0x3] Section [wb-hive\Software\Roadkil] key [Lic_Unstp=31..]

The system hive does not have a 'Software' section.

I think you should use HKU

Peter

#4 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 17 December 2007 - 01:29 PM

@powaking:

All I have is the documentation at http://www.vistape.n...pe-api.html#api. Somewhere I found a supposedly working script that did exactly what I did except used HKU instead of HKLM, but I can't find it now. If something like WB-Software\ is required then it's a guessing game what it should be. There are no examples in the scripts supplied with VistaPE 11.

@psc:

OK, I will try it, but I bet that it winds up in HKCU\Software ... which would be wrong. If HKU means HKLM, what do I use for HKCU? If HKU means HKCU, what do I use for HKLM?

#5 pscEx

pscEx

    Platinum Member

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

Posted 17 December 2007 - 02:18 PM

@psc:

OK, I will try it, but I bet that it winds up in HKCU\Software ... which would be wrong. If HKU means HKLM, what do I use for HKCU? If HKU means HKCU, what do I use for HKLM?

There are three different hives which by RegHiveLoad are added as subkeys of HKLM.
  • ...\System32\Config\default
    • API name %HIVE_HKCU%
    • representing parts of HKCU
    • mounted as WB-Default
  • ...\System32\Config\software
    • API name %HIVE_HKU%
    • representing parts of HKCU\Software and HKLM\Software
    • containing subkey 'Classes', representing HKCR
    • mounted as WB-Software
  • ...\System32\Config\system (VistaPE) or ...\System32\setupreg.hiv (XP, W2003)
    • API name %HIVE_HKLM%
    • representing parts of HKLM\System
    • mounted as WB-Setup
The mount names are the programmer's choice, for nativeEx based scripts I introduced and recommend the above mentioned.

Peter

#6 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 17 December 2007 - 05:01 PM

That looks like the "old" api. I know how to use the "old" api, I'm specifically asking about the "new" api documented at http://www.vistape.n...pe-api.html#api and in a few messages around here.

HCU doesn't work either, I get:

SetVar - Sucessfuly changed the value of [%hive_file%] to: [%HIVE_#1%]

  System - Refreshing all variables

  Loading HKU hive..

  Loading hive from %BaseDir%\Target\VistaPE\windows\system32\config\software

  RegHiveLoad - File: [%BaseDir%\Target\VistaPE\windows\system32\config\software] Section [wb-hive]





  RegWrite - root key: [HKLM] Type: [0x3] Section [wb-hive\Software\Roadkil] key [Lic_Unstp=31..]





 Processing section: [reg_hiveunload] From file: [%BaseDir%\Projects\VistaPE-Beta\api.script]



  Unloading wb-hive

  RegHiveUnLoad - Unloaded registry hive: [wb-hive]
and the value winds up in the same place as before: HKLM\SYSTEM\Software\Roadkil.

This "new" api seems quite promising, but there are too many parts of it that are secret.

#7 pscEx

pscEx

    Platinum Member

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

Posted 17 December 2007 - 05:14 PM

That looks like the "old" api. I know how to use the "old" api, I'm specifically asking about the "new" api documented at http://www.vistape.n...pe-api.html#api and in a few messages around here.

HCU doesn't work either, I get:

SetVar - Sucessfuly changed the value of [%hive_file%] to: [%HIVE_#1%]

   System - Refreshing all variables

   Loading HKU hive..

   Loading hive from ºseDir%\Target\VistaPE\windows\system32\config\software

   RegHiveLoad - File: [ºseDir%\Target\VistaPE\windows\system32\config\software] Section [wb-hive]

 

 

   RegWrite - root key: [HKLM] Type: [0x3] Section [wb-hive\Software\Roadkil] key [Lic_Unstp=31..]

 

 

  Processing section: [reg_hiveunload] From file: [ºseDir%\Projects\VistaPE-Beta\api.script]

 

   Unloading wb-hive

   RegHiveUnLoad - Unloaded registry hive: [wb-hive]
and the value winds up in the same place as before: HKLM\SYSTEM\Software\Roadkil.

This "new" api seems quite promising, but there are too many parts of it that are secret.

I think I cannot help here anymore.

The API is made mainly by Nuno, Pedrole15 and Galapo, to make common tasks possible in different projects.

And I know that the 'old' api worked.

If there inside VistaPE is a 'new' API, it is outside my knowledge.

Sorry

Peter

BTW: The Boston area has been my 'second home' for about 6 years in the 80th. Many month I spent there more time than in Germany. If I'm asked, I always confirm that I know a lot of US cities, but there are only two I like: Boston and SF.

And the Boston area is beautiful with it's unique geology and it's wunderful Indian Summer.

#8 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 17 December 2007 - 05:32 PM

And I know that the 'old' api worked.

Oh, anybody can make it work! <g> But I am trying to master something new.

(it appears that I can't insert smilies in Opera)

The Boston area has been my 'second home' for about 6 years in the 80th. Many month I spent there more time than in Germany. If I'm asked, I always confirm that I know a lot of US cities, but there are only two I like: Boston and SF.

And the Boston area is beautiful with it's unique geology and it's wunderful Indian Summer.

I love it. I spent quite some time in Dresden in the late 90's, and that also is a lovely city. Alas, I cannot learn other languages.

#9 pscEx

pscEx

    Platinum Member

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

Posted 17 December 2007 - 05:38 PM

Oh, anybody can make it work! <g> But I am trying to master something new.

So tell us, what you want to have in the final VistaPE registry where?

Peter

#10 powaking

powaking

    Frequent Member

  • Advanced user
  • 238 posts
  • Location:Fall River, MA
  •  
    United States

Posted 17 December 2007 - 06:15 PM

BTW: The Boston area has been my 'second home' for about 6 years in the 80th. Many month I spent there more time than in Germany. If I'm asked, I always confirm that I know a lot of US cities, but there are only two I like: Boston and SF.

And the Boston area is beautiful with it's unique geology and it's wunderful Indian Summer.


Agree. Tons of history and when you get the 4 seasons you really get 4 seasons. Past week has been brutal but that's New England weather for you.

#11 pscEx

pscEx

    Platinum Member

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

Posted 17 December 2007 - 06:34 PM

Agree. Tons of history and when you get the 4 seasons you really get 4 seasons. Past week has been brutal but that's New England weather for you.

I also remember a weekend (just around my birthday) when I could not leave my Hotel in Woburn for three days because of 'some inches' of snow. I think 'some' has been somewhat more than 20.

Peter

#12 powaking

powaking

    Frequent Member

  • Advanced user
  • 238 posts
  • Location:Fall River, MA
  •  
    United States

Posted 17 December 2007 - 06:55 PM

I also remember a weekend (just around my birthday) when I could not leave my Hotel in Woburn for three days because of 'some inches' of snow. I think 'some' has been somewhat more than 20.

Peter


Sounds like you just got a dusting. :cheers:

#13 pscEx

pscEx

    Platinum Member

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

Posted 17 December 2007 - 07:07 PM

Sounds like you just got a dusting. :cheers:

I think so, too. On Friday noon in the office they told us 'If there is nothing really important to do here, try to go home. Something is coming from the Big Lakes'

And in the afternoon, for me (in my region the usual snow heihgt is really less than 2 or 3 inches, if there is any ...) it has been incredible that so much snow could come within about two hours.

BTW: The two or three inches of snow in my region cause several traffic breakdowns!

But let's stop the 'offtopic' now ...

Peter

#14 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 18 December 2007 - 01:06 PM

OK, I dug through the project scripts, and figured it out. HKU is what I want. I don't know why it failed the first time I tried it; I must have made some mistake.

Hive_Load,HKU

Reg_Add,0x3,&#34;%reg%\Roadkil&#34;,&#34;Lic_Unstp&#34;,&#34;31&#34;

Hive_Unload,HKU

writes 31 (in binary, that's the 0x3) into HKLM\Software\Roadkil\Lic_Unstp.

Hive_Load,HKLM

Reg_Add,0x3,&#34;%reg%\Roadkil&#34;,&#34;Lic_Unstp&#34;,&#34;31&#34;

Hive_Unload,HKLM

writes (in binary, that's the 0x3) 31 into HKLM\System\Roadkil\Lic_Unstp.

Hive_Load,HKCU

Reg_Add,0x3,&#34;%reg%\Software\Roadkil&#34;,&#34;Lic_Unstp&#34;,&#34;31&#34;

Hive_Unload,HKCU

writes (in binary, that's the 0x3) 31 into HKCU\Software\Roadkil\Lic_Unstp (actually into the default user profile which gets copied to the current user profile). Note that the Reg_Add line is slightly different in this one!

I don't know the purpose of the constant %reg%; perhaps that's so you can have multiple registry hives loaded in the script.

#15 powaking

powaking

    Frequent Member

  • Advanced user
  • 238 posts
  • Location:Fall River, MA
  •  
    United States

Posted 18 December 2007 - 01:19 PM

OK, I dug through the project scripts, and figured it out. HKU is what I want. I don't know why it failed the first time I tried it; I must have made some mistake.

Hive_Load,HKU

Reg_Add,0x3,&#34;%reg%\Roadkil&#34;,&#34;Lic_Unstp&#34;,&#34;31&#34;

Hive_Unload,HKU

writes 31 (in binary, that's the 0x3) into HKLM\Software\Roadkil\Lic_Unstp.

Hive_Load,HKLM

Reg_Add,0x3,&#34;%reg%\Roadkil&#34;,&#34;Lic_Unstp&#34;,&#34;31&#34;

Hive_Unload,HKLM

writes (in binary, that's the 0x3) 31 into HKLM\System\Roadkil\Lic_Unstp.

Hive_Load,HKCU

Reg_Add,0x3,&#34;%reg%\Software\Roadkil&#34;,&#34;Lic_Unstp&#34;,&#34;31&#34;

Hive_Unload,HKCU

writes (in binary, that's the 0x3) 31 into HKCU\Software\Roadkil\Lic_Unstp (actually into the default user profile which gets copied to the current user profile). Note that the Reg_Add line is slightly different in this one!

I don't know the purpose of the constant %reg%; perhaps that's so you can have multiple registry hives loaded in the script.


So......this reg simply supresses the licensing window when you launch unstoppable copier? If so I can implement it into my Unstoppable Copier & Undelete script and give the update to Nightman to post on the server.

#16 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 18 December 2007 - 10:12 PM

So......this reg simply supresses the licensing window when you launch unstoppable copier? If so I can implement it into my Unstoppable Copier & Undelete script and give the update to Nightman to post on the server.

Yes.

Do you have version 3.2? FWIW, here's my "new API" script that should work in all projects, with v3.2 ...Attached File  UnstoppableCopier.7z   74.31KB   193 downloads

#17 powaking

powaking

    Frequent Member

  • Advanced user
  • 238 posts
  • Location:Fall River, MA
  •  
    United States

Posted 19 December 2007 - 02:48 PM

Yes.

Do you have version 3.2? FWIW, here's my "new API" script that should work in all projects, with v3.2 ...Attached File  UnstoppableCopier.7z   74.31KB   193 downloads


My script is pretty much the same but also includes his Undelete program. Wonder if there is a reg for Undelete as well? Here it is.

Attached File  UnstopableCopier.script   162.39KB   283 downloads

#18 JonF

JonF

    Gold Member

  • .script developer
  • 1185 posts
  • Location:Boston, MA
  •  
    United States

Posted 19 December 2007 - 11:51 PM

Wonder if there is a reg for Undelete as well?

Reg_Add,0x3,"%reg%\Roadkil","Lic_Undelete","31"

#19 DigeratiPrime

DigeratiPrime

    Newbie

  • Advanced user
  • 15 posts
  •  
    United States

Posted 18 January 2008 - 06:07 AM

There are three different hives which by RegHiveLoad are added as subkeys of HKLM.

  • ...\System32\Config\default
    • API name %HIVE_HKCU%
    • representing parts of HKCU
    • mounted as WB-Default
  • ...\System32\Config\software
    • API name %HIVE_HKU%
    • representing parts of HKCU\Software and HKLM\Software
    • containing subkey 'Classes', representing HKCR
    • mounted as WB-Software
  • ...\System32\Config\system (VistaPE) or ...\System32\setupreg.hiv (XP, W2003)
    • API name %HIVE_HKLM%
    • representing parts of HKLM\System
    • mounted as WB-Setup
The mount names are the programmer's choice, for nativeEx based scripts I introduced and recommend the above mentioned.

Peter


I dont think WB-Setup works anymore, and is now WB-System.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users