Jump to content











Photo
- - - - -

[Win7PE_SE] API changes?

unrecognized command

Best Answer Brito , 25 July 2013 - 08:03 AM

Well, I see some misunderstanding here.

 

I have the impression that MichaelZ is running a recent Win7PE_SE release where the API was "improved" by the respective project authors.

 

From personal experience I'd suggest looking at the way how other scripts on the same distribution that you are running call the registry functions.

 

Unfortunately, not much can be done on our side. This likely means that any scripts that have been working for years are now broken when running inside that specific project, sorry. <_<

 

 

If you don't want to rewrite your scripts, there might be other projects where they are still working as intended. The mulitPE project from Peter is one of them: http://reboot.pro/fi...ile/61-multipe/

 

Another one is EzPE3: http://reboot.pro/fi...file/265-ezpe3/

 

Hope this helps.

:cheers:

Go to the full post


  • Please log in to reply
11 replies to this topic

#1 MichaelZ

MichaelZ

    Frequent Member

  • Team Reboot
  • 333 posts
  • Location:Braunschweig, Germany
  •  
    Germany

Posted 24 July 2013 - 01:30 PM

Hi everyone,

 

I encounter a problem with some of my scripts. Project is Win7PE_SE with WinBuilder 82 (82.0.1.0). I get warnings that

   Hive_Load

   Reg_Add

   Hive_Unload

   Associate_File

are unrecognized commands. API is Macro_Library.script 42.19 and I see that those commands are still included. Is it now necessary to add a command in the script so that API calls can be used?

 

If I can't use Hive_Load any more, what is the file name to load HKCU using WinBuilder's command RegHiveLoad?

 

Many Greetings

MichaelZ

 



#2 homes32

homes32

    Gold Member

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

Posted 24 July 2013 - 03:37 PM

If I can't use Hive_Load any more, what is the file name to load HKCU using WinBuilder's command RegHiveLoad?

there really isn't any benefit to using API/Macro registry commands. they only call the built in commands and slow script processing down as the script jumps in and out of the API/Macro script.

best to "go native" whenever possible.

 

you can use the following native code load the HKCU hive. %RegDefault% is a global variable and points to: %TargetDir%\Windows\System32\config\Default on vista/7/8 projects

some projects will also define %RegUser% which points to the same hive.

RegHiveLoad,Tmp_Default,%RegDefault%
RegWrite,HKLM,0x1,"Tmp_Default\Software\MyProgram","MyKey","MyValue"
RegHiveUnLoad,Tmp_Default

  • pscEx likes this

#3 pscEx

pscEx

    Platinum Member

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

Posted 24 July 2013 - 04:08 PM


RegHiveLoad,Tmp_Default,%RegDefault%
RegWrite,HKLM,0x1,"Tmp_Default\Software\MyProgram","MyKey","MyValue"
RegHiveUnLoad,Tmp_Default

WinBuilder allows the use of any name for the opened hive, like here "Tmp_default".

 

But when you want to use some tools like Reg2WBS etc. you should use the stone aged "standard names" WB-Default, WB-Software, WB-System

 

Peter



#4 MichaelZ

MichaelZ

    Frequent Member

  • Team Reboot
  • 333 posts
  • Location:Braunschweig, Germany
  •  
    Germany

Posted 24 July 2013 - 04:21 PM

RegHiveLoad and RegWrite work fine, also %RegDefault% to write user settings.

I have one script with tons of API registry calls. What would I have to do to enable the slow API calls before the script is rewritten?

 

Does the first parameter of RegWrite make sense? The hive is selected by the file name in the RegHiveLoad command. I guess the parameter must always be HKLM?

 

Many Greetings

MichaelZ



#5 pscEx

pscEx

    Platinum Member

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

Posted 24 July 2013 - 04:35 PM

Post your script "logically", that means just the first and last registry commands (and one or two commands from the middle).

 

Peter



#6 MichaelZ

MichaelZ

    Frequent Member

  • Team Reboot
  • 333 posts
  • Location:Braunschweig, Germany
  •  
    Germany

Posted 24 July 2013 - 04:52 PM

Post your script "logically", that means just the first and last registry commands (and one or two commands from the middle).

 

The script is Galapo's NTFS Link, included by one of Markus c't PE Editions.

Hive_Load,HKU
reg_add,0x4,"%reg%\elsdoerfer.net\NTFS Link\Config","JunctionTrackingMode","0"
reg_add,0x1,"%reg%\Microsoft\EventSystem\{26c409cc-ae86-11d1-b616-00805fc79216}\Subscriptions\{E8B7D913-890B-4C02-9D9B-B027E5409E38}-{00000000-0000-0000-0000-000000000000}-{00000000-0000-0000-0000-000000000000}\SubscriberProperties","WriterInstanceId","{1B81511F-C071-44F9-9062-EC3E3790EC1D}"
Hive_Unload,HKU

I know, it is not too difficult using a decent editor, like Notepad++. Would it be possible to leave the double quotes in the source that RegWrite doesn't need or do they have to be removed?

 

Why doesn't anyone tell me what would be necessary to call the API functions? :dubbio:

 

Many Greetings

MichaelZ



#7 pscEx

pscEx

    Platinum Member

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

Posted 24 July 2013 - 05:02 PM

Your script calls the API functions correct.

 

Mabye there is a glitch in definitions.

 

Look at script.project [Variables] %API????% and compare with reality.

 

Peter

 

BTW: When (estimated) did THIS project build successfully?

THIS means "unchanged now"

 

BTW2: have a look into the  log.html.

Usually such cryptic API code is resolved there.



#8 MichaelZ

MichaelZ

    Frequent Member

  • Team Reboot
  • 333 posts
  • Location:Braunschweig, Germany
  •  
    Germany

Posted 24 July 2013 - 06:05 PM

 

BTW: When (estimated) did THIS project build successfully?

THIS means "unchanged now"

 

 

Peter, I absolutely don't like such annoying questions !!!   :boxing:   :white_flag:



#9 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 25 July 2013 - 08:03 AM   Best Answer

Well, I see some misunderstanding here.

 

I have the impression that MichaelZ is running a recent Win7PE_SE release where the API was "improved" by the respective project authors.

 

From personal experience I'd suggest looking at the way how other scripts on the same distribution that you are running call the registry functions.

 

Unfortunately, not much can be done on our side. This likely means that any scripts that have been working for years are now broken when running inside that specific project, sorry. <_<

 

 

If you don't want to rewrite your scripts, there might be other projects where they are still working as intended. The mulitPE project from Peter is one of them: http://reboot.pro/fi...ile/61-multipe/

 

Another one is EzPE3: http://reboot.pro/fi...file/265-ezpe3/

 

Hope this helps.

:cheers:



#10 MichaelZ

MichaelZ

    Frequent Member

  • Team Reboot
  • 333 posts
  • Location:Braunschweig, Germany
  •  
    Germany

Posted 25 July 2013 - 04:49 PM

I guess Nuno described the problem very well. Too bad that the long time Common API is not Common anymore.   :frusty:

 

Many Greetings

MichaelZ



#11 homes32

homes32

    Gold Member

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

Posted 25 July 2013 - 07:38 PM

and a perfect example on why not to rely on any API when native commands will do the job with the same amount of coding/effort and greater speed.

registry commands like this are a textbook example of what should have never been implemented in CAPI in the first place.


  • Brito and pscEx like this

#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 July 2013 - 03:23 PM

and a perfect example on why not to rely on any API when native commands will do the job with the same amount of coding/effort and greater speed.

registry commands like this are a textbook example of what should have never been implemented in CAPI in the first place.

It's so UNcommon to find some common sense nowadays that I have to take my hat off to you  :hi: .

:cheers:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users