Jump to content











Photo
* * * * * 2 votes

[tool] reg2WBS


  • This topic is locked This topic is locked
324 replies to this topic

#101 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 23 October 2008 - 07:54 PM

I tested and the program really changes ALL <local program files path> to %PE_programs% and then the remaining <local system drive letter> to #$pSystemDrive#$p.

As you are living in California, is it possible that your local OS language is Spanish?

Peter

:cheers: soon but for now still ENGLISH

#102 pscEx

pscEx

    Platinum Member

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

Posted 24 October 2008 - 06:56 AM

:cheers: soon but for now still ENGLISH

Can you post the output of your Set command in the command window.

Remove personal lines like user, host name etc.

Peter

#103 pscEx

pscEx

    Platinum Member

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

Posted 24 October 2008 - 07:16 AM

now:
reg_add,0x2,"%reg%\ControlSet001\control\Session Manager\Environment","Path","#$pSystemRoot#$p\system32;#$pSystemRoot#$p;#$pSystemRoot#$p\System32\Wbem"

should be:
reg_add,0x2,"%reg%\ControlSet001\control\Session
Manager\Environment","Path","%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem"

If I would follow your suggestion, WB would write the actual values of %systemroot% into the PE's registry, e.g. 'C:\Windows'

BTW: Currently this variable is not yet implemented, but who kbows, when it will be needed?
With #$p you are on the safe side.

Peter

#104 paraglider

paraglider

    Gold Member

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

Posted 24 October 2008 - 12:08 PM

Are you saying winbuilder expands environment variables at build time when writing values into a registry hive?

#105 pscEx

pscEx

    Platinum Member

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

Posted 24 October 2008 - 12:24 PM

Are you saying winbuilder expands environment variables at build time when writing values into a registry hive?

Not directly!

Currently WinBuilder offers these (internal) environment variables:
Environment.GIF
And there is the same name like the OS name AFAIK only with %WinDir%, %UserProfile% and %UserName%

But it seams reasonable that WinBuilder knows all environment variables, and maybe it will be implemented anywhen.

And therefore:
  • Use #$p, if you want to transfer the environment variable name (rather than eventually the OS's environment variable value) to the PE
  • With %UserName%, %UserProfile% and %WinDir% you currently already would transfer the value!
Peter

#106 pscEx

pscEx

    Platinum Member

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

Posted 24 October 2008 - 03:44 PM

Version 2.0.0 is abailable! :cheers:

It hopefully fullfils Amalux's 'Foxit' wishes.

Now it is possible to define two strings which will be replaced by the API used variables %ProgramEXE% and %ProgramFolder%

reg2WBS.gif

Updated link in the first post


Peter

#107 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 24 October 2008 - 04:37 PM

Version 2.0.0 is abailable! :cheers:

It hopefully fullfils Amalux's 'Foxit' wishes.

Now it is possible to define two strings which will be replaced by the API used variables %ProgramEXE% and %ProgramFolder%

reg2WBS.gif

Updated link in the first post


Peter

Sorry slow response...
r2wbs2x.JPG
:cheers:

Nevermind, I get it, works well!! :cheers:

--

If I would follow your suggestion, WB would write the actual values of %systemroot% into the PE's registry, e.g. 'C:\Windows'

wbem1.JPG wbem2.JPG
no 'C:\Windows' occurs in PE reg.
--

Can you post the output of your Set command in the command window.

Only using GUI version :cheers:

#108 pscEx

pscEx

    Platinum Member

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

Posted 24 October 2008 - 04:54 PM

Only using GUI version :cheers:

I do not know the English menu line, but it could be 'Execute' or similar. It usually is the line above 'shut down'

Go Start > Execute > (write) CMD > <return>
Command window comes up.

Type 'Set' > %temp%\myset.txt <return>

Post the fiel %Temp%\myset.txt


Peter

#109 pscEx

pscEx

    Platinum Member

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

Posted 24 October 2008 - 04:58 PM

wbem1.JPG wbem2.JPG
no 'C:\Windows' occurs in PE reg.

Not yet, maybe never. Read BTW of post #104 and post #105

Peter

#110 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 24 October 2008 - 05:42 PM

I do not know the English menu line, but it could be 'Execute' or similar. It usually is the line above 'shut down'

Go Start > Execute > (write) CMD > <return>
Command window comes up.

Type 'Set' > %temp%\myset.txt <return>

Post the fiel %Temp%\myset.txt


Peter

'Run' is the equivalent here, I hope this is what you needAttached File  temp.zip   607bytes   253 downloads

Sorry, I don't understand - please explain if #$pSystemDrive#$p\Program Files can be replaced with %PE_Programs% or if not why. It seems to work fine in my scripts now (API=Version=14) :cheers:

#111 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 24 October 2008 - 05:43 PM

no 'C:\Windows' occurs in PE reg.

Do you mean you get the above and don't want to or you want hte above and don't get it?

:cheers:

#112 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 24 October 2008 - 05:52 PM

Do you mean you get the above and don't want to or you want hte above and don't get it?

:cheers:

(Server=ME :cheers: :cheers: )
Was responding to Peter

If I would follow your suggestion, WB would write the actual values of %systemroot% into the PE's registry, e.g. 'C:\Windows'

it doesn't write 'C:\Windows' in PE reg, maybe this is a 'language thing' :cheers:

#113 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 24 October 2008 - 06:28 PM

it doesn't write 'C:\Windows' in PE reg, maybe this is a 'language thing' :cheers:

No the thing is that it shouldn't write C:\Windows in the PE registry. Or are we still not on the same page?


:cheers:

#114 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 24 October 2008 - 06:40 PM

No the thing is that it shouldn't write C:\Windows in the PE registry. Or are we still not on the same page?


:cheers:

I agree, it should not and does not write C:\Windows in the PE reg. I was responding to Peters assertion that it would :cheers:

#115 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 24 October 2008 - 07:10 PM

:cheers: Ok, now i get it, there is no problem.

:cheers:

#116 pscEx

pscEx

    Platinum Member

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

Posted 25 October 2008 - 07:46 AM

I agree, it should not and does not write C:\Windows in the PE reg. I was responding to Peters assertion that it would :cheers:

@Amalux,
do not worry about Medevil's posts.

He sometimes likes to more confuse than to help :cheers:

But to make the issue clear: You have this snippet and execute it:
&#91;process&#93;

   RegHiveLoad,WB-Software,%Target_Sys%\config\software

   //non - environment, %MyVar% not defined

   RegWrite,HKLM,0x1,WB-Software\Amalux,Something_Escape,#$pMyVar#$p

   RegWrite,HKLM,0x1,WB-Software\Amalux,Something_Percent,%MyVar%

   //environment

   RegWrite,HKLM,0x1,WB-Software\Amalux,Environment_Escape,#$pUserName#$p

   RegWrite,HKLM,0x1,WB-Software\Amalux,Environment_Percent,%UserName%

   RegHiveUnLoad,WB-Software

The result is:
AMALUX_reg.gif

As result a general rule:

If you want to output an environment variable name, use escapes.
If you want to output an environment variable value, use percent.

Peter

BTW: My special sample hasn't been a good choice :cheers:

#117 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 25 October 2008 - 08:22 AM

Peter, first thank you again for your help and willingness to work with me on this!! I have been testing the new 2.0 and it is a HUGE improvement! However, it is still not complete. If you are willing to indulge me a bit further, I believe it can be made 'perfect' :cheers:

Here are the new requests (can be merged into three options):

1-
#$pSystemRoot#$p -to-> %SystemRoot%

2-
#$pSystemDrive#$p\Program Files -to-> %PE_Programs%
#$pSystemDrive#$p\PROGRA~1 -to-> %PE_Programs%
C:\\Program Files -to-> %PE_Programs% (current function)

3-
<exeName>~1.EXE -to-> %ProgramEXE%
<exeName>.exe -to-> %ProgramEXE% (current function)

1.JPG
1 - This is not needed(?) Just type/paste name(s) in the '2' box(s) This allows seperate naming
2 - Currently, tied to a single name ('1') but needs to allow separate naming.

So, can box '1' be converted for third option/function above? OK, that's it! :cheers:

Obviously, this is all up to you and in your good timing (if at all); I'm just trying to put forth my idea for a more 'universal' solution to the API scripting issues. Let me know what you think :cheers:

Added: Sorry, I took so long posting I missed your last post; I'm trying to figure out what you're getting at but will have to to some experiments of my own to fully understand...

#118 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 25 October 2008 - 09:12 AM

I understand what you're trying to say but it's too theoretical; please have a look at these script snippets and point out anywhere you think I'm in error because this is exactly how the scripts would look if ALL of the recommendations in my previous post were adopted. The only difference is that I made these changes manually in a text editor. All of these scripts have been tested and work good for me (files removed for size consideration).

Attached Files



#119 pscEx

pscEx

    Platinum Member

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

Posted 25 October 2008 - 10:05 AM

I understand what you're trying to say but it's too theoretical; please have a look at these script snippets and point out anywhere you think I'm in error because this is exactly how the scripts would look if ALL of the recommendations in my previous post were adopted. The only difference is that I made these changes manually in a text editor. All of these scripts have been tested and work good for me (files removed for size consideration).

Do a test:
1 a: run your original script > PE runs well
1 b: by editor change every %SystemRoot% to #$pSystemRoot#$p and run script > PE runs well

Now imagine that a later WB version will 'know' %SystemRoot%. You can imitate that by inserting [variables] %SystemRoot%=C:\WINNT in script.project

1 a: run your original script > PE fails
1 b: by editor change every %SystemRoot% to #$pSystemRoot#$p and run script > PE runs well

You see that the #$p variant works under ALL circumstances, the % variante will not.

And that is the reason that my programs writing a reg entry with environment variables, intend to use the #$p.

And I'll not change that, even if you think that this looks nicer.

Peter

#120 pscEx

pscEx

    Platinum Member

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

Posted 25 October 2008 - 10:17 AM

First let me thank for your suggestions. I appreciate it.
Now the details, which unfortunatell have to start with a 'NO'

1-
#$pSystemRoot#$p -to-> %SystemRoot%

Never! See my previous post

2-
#$pSystemDrive#$p\Program Files -to-> %PE_Programs%
#$pSystemDrive#$p\PROGRA~1 -to-> %PE_Programs%
C:\\Program Files -to-> %PE_Programs% (current function)

This is the way how it is intended to work. And with German 'Programme' instead of 'Program Files' it works.
In the environment variables list you posted some posts ago, I do not find any reason why it should not work.

Unfortunatelly I cannot reproduce on my system, because I do not have 'Program Folder'.
But maybe anywhere the space is doing some confusion. I'll check this again.

3-
<exeName>~1.EXE -to-> %ProgramEXE%
<exeName>.exe -to-> %ProgramEXE% (current function)

This should be fullfilled in 2.0.0.

1 - This is not needed(?) Just type/paste name(s) in the '2' box(s) This allows seperate naming
2 - Currently, tied to a single name ('1') but needs to allow separate naming.

1 - I'll remove, it has been just an idera of mine. And if the user does not want, forget it ...
2 - Currently after copying ('1') you can edit ('2') and ('3') separatelly.


Peter

#121 pscEx

pscEx

    Platinum Member

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

Posted 25 October 2008 - 10:42 AM

Unfortunatelly I cannot reproduce on my system, because I do not have 'Program Folder'.
But maybe anywhere the space is doing some confusion. I'll check this again.

@Amalux!

On my system in my Avast.reg I manually changed the German 'Programme' to 'Program Folder'

Using the debugger I also changed the read env var to 'Program Folder'

And I got correctly %PE_Programs%.

What's different in your system?

Can you post one of your .REG files and the result Reg2WBS creates on your system?

Thanks.

Peter

#122 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 25 October 2008 - 04:04 PM

(server on/off, s-l-o-wwwww and buggy, I'll try to answer some of these...)

Do a test:
1 a: run your original script > PE runs well
1 b: by editor change every %SystemRoot% to #$pSystemRoot#$p and run script > PE runs well

Now imagine that a later WB version will 'know' %SystemRoot%. You can imitate that by inserting [variables] %SystemRoot%=C:\WINNT in script.project

Please confirm #$pSystemRoot#$p works in VistaPE, it has caused issues in past. The API's are under development and this may have already changed; I'm currently using vpe-api12 and lxp-api14 (cur=18). later versions of api caused problems for me and I was reluctant to update but will now. Bottom line, use #$pSystemRoot#$p everywhere, with latest api and report if any issues in appropriate forum, got it. ;~) no toolbar=no smilies, pics, links etc :-(

#123 pscEx

pscEx

    Platinum Member

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

Posted 25 October 2008 - 04:23 PM

(server on/off, s-l-o-wwwww and buggy, I'll try to answer some of these...)


Please confirm #$pSystemRoot#$p works in VistaPE, it has caused issues in past. The API's are under development and this may have already changed; I'm currently using vpe-api12 and lxp-api14 (cur=18). later versions of api caused problems for me and I was reluctant to update but will now. Bottom line, use #$pSystemRoot#$p everywhere, with latest api and report if any issues in appropriate forum, got it. ;~) no toolbar=no smilies, pics, links etc :-(

#1 the #$p escape functionality is INDEPENDENT from the project. It cannot be that it works in nativeEx and causes troubles in VistaPE. If there are troubles in VistaPE in the sorrounding of a #$p, then there is a different reason.

#2 the #$p escape functionality is valid since a time where nobody thought about API. So it CANNOT be the reason for API issues.

BTW: If you three times switch the coffee machine in your home on, and all the three times in the same moment a traffic crash occures in front of your house:

You say: Switching my coffee machine on, causes a crash in front of my home, and I'll live the rest of my life w/o coffee.
I say: NO, Technically there is no connection between the events, and your experience is based on pure random. The crash has different reasons!

Peter

#124 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 25 October 2008 - 05:00 PM

First let me thank for your suggestions. I appreciate it.
Now the details, which unfortunatell have to start with a 'NO'

Never! See my previous post

This is the way how it is intended to work. And with German 'Programme' instead of 'Program Files' it works.
In the environment variables list you posted some posts ago, I do not find any reason why it should not work.

Unfortunatelly I cannot reproduce on my system, because I do not have 'Program Folder'.
But maybe anywhere the space is doing some confusion. I'll check this again.

This should be fullfilled in 2.0.0.

1 - I'll remove, it has been just an idera of mine. And if the user does not want, forget it ...
2 - Currently after copying ('1') you can edit ('2') and ('3') separatelly.


Peter

OK, so how about just giving us 2-3 text replacement boxes i.e
1 - <origText> -to-> <newText>
2 - <origText> -to-> <newText>
3 - <origText> -to-> <newText>

if not, no problem; I'll just continue to use an editor to do this to get the scripts working under whatever the current api requirements happen to be :cheers:

#125 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 25 October 2008 - 05:06 PM

<exeName>~1.EXE -to-> %ProgramEXE%
<exeName>.exe -to-> %ProgramEXE% (current function)

This should be fullfilled in 2.0.0.

Hive_Load,Software
--
reg_add,0x2,"%reg%\Classes\CLSID\{14E8BBD8-1D1C-4D56-A4DA-D20B75EB814E}\DefaultIcon",,"#$pSystemDrive#$p\PROGRA~1\Foxit\FOXITR~1.EXE,1"
--
reg_add,0x2,"%reg%\Classes\FoxitReader.Document\DefaultIcon",,"#$pSystemDrive#$p\PROGRA~1\Foxit\FOXITR~1.EXE,1"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users