Jump to content











Photo
- - - - -

How to change registry keys according to PE path


  • Please log in to reply
5 replies to this topic

#1 Rogas

Rogas
  • Members
  • 4 posts
  •  
    Italy

Posted A week ago

Hi all guys.

It is my first post here. It's one year I'm using Winbuilder to mount a Win7PE and I love it. Last version is great, I think. I found many responses to my doubts on this web site and I thank everybody for sharing such program and help.

 

I'm starting now coding some script with PC Packed to add simple programs.

What I would like to add now are the registry keys. What should I replace a key like this with:

 

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.....]  ?

 

With this:

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.....]  ?

 

This is just an example as I know some keys might be useless on the PE.

 

Another doubt is the Programs path. Let's suppose we have a x86 architecture program and his registry keys looks like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\ <name of program folder >\\ <name of program>.exe"="DISABLETHEMES RUNASADMIN"

 

Wich folder should I change it to?

 

Thank you!



#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted A week ago

I think you'd better provide a "real" example of a "real" program you are having a "real" problem with, otherwise it is likely that you will get an "out of scope" answer.

 

About paths that is simple enough, the PE (unless it is a modified build of some kind) will always get the X:\ drive letter.

 

If the PE is 64 bit based AND the particular build has the 32 bit sub-system[1] added (not really common, but still possible) only the drive letter will change (from C:\ to X:\ in this case), whilst if the PE is 64 bit has no WOW64 the program won't ever work and if the PE is 32 bit the path will simply be "X:\Program FIles\...".

 

If you create a 32 bit PE you *need* a computer (or a VM) with a corresponding 32 bit OS, while doable "porting to PE" a 32 bit program installed on a 64 bit OS is prone to a numebr of unneeded complications (it is already complex enough for some applications to find the needed dependencies and needed Registry entries that having not a "normal" install on the SAME OS as the one from which the PE is built is IMHO a "suicide plan").

 

:duff:

Wonko

 

 

 

[1] what the good MS guys called "WOW64" so that it's scope is intuitive ;)



#3 Rogas

Rogas
  • Members
  • 4 posts
  •  
    Italy

Posted A week ago

Thanks for your answer.

If you'd really like a real program example, I can tell you EasyClean, a registry monitoring tool I'm using since Windows 98 and wich works great on Windows 7 too. However, as I wrote, it's just a test I'm doing and I don't really need it on the build... Anyway, it's a program that needs an additional file only for the translation from German to English. The only needed thing in the registry is disabling the themes, as it doesn't work while they are enabled.

 

I only do what you call "uncommon": I add the 32 bit subsystem to a 64 bit build. I prepare the PE on a 64 bit PC. This way I have neither to install a virtual machine, nor to download 32 bit drivers too. Everything works like a charm.

I'm using 32 bit downloaded plug-in's. They work too. Maybe they where prepared on the 32 bit machine (no idea). However, Mozilla Firefox 32 bit is an example and it's running flawlessly. I don't think it's a "simple" program... :)

 

What about the "Current User" registry key? Should I put a corresponding key on the . DEFAULT key or how should I do?

 

 

 

I think you'd better provide a "real" example of a "real" program you are having a "real" problem with, otherwise it is likely that you will get an "out of scope" answer.

 

About paths that is simple enough, the PE (unless it is a modified build of some kind) will always get the X:\ drive letter.

 

If the PE is 64 bit based AND the particular build has the 32 bit sub-system[1] added (not really common, but still possible) only the drive letter will change (from C:\ to X:\ in this case), whilst if the PE is 64 bit has no WOW64 the program won't ever work and if the PE is 32 bit the path will simply be "X:\Program FIles\...".

 

If you create a 32 bit PE you *need* a computer (or a VM) with a corresponding 32 bit OS, while doable "porting to PE" a 32 bit program installed on a 64 bit OS is prone to a numebr of unneeded complications (it is already complex enough for some applications to find the needed dependencies and needed Registry entries that having not a "normal" install on the SAME OS as the one from which the PE is built is IMHO a "suicide plan").

 

:duff:

Wonko

 

 

 

[1] what the good MS guys called "WOW64" so that it's scope is intuitive ;)


Edited by Rogas, A week ago.


#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted A week ago

I only do what you call "uncommon": I add the 32 bit subsystem to a 64 bit build. I prepare the PE on a 64 bit PC. This way I have neither to install a virtual machine, nor to download 32 bit drivers too. Everything works like a charm.

Which is good :) of course, I just wanted to underline how you are standing on the shoulders of giants[1], adding the WOW64 subsystem to a PE was - at the time - a great achievement (and it was made more difficult after Windows 7).

 

About some paths, as said, it depends, the easiest would be to check what working scripts for similar programs do or find (and read) the (actually few) "fully open" threads about manual PE building (not that Winbuilder scripts are not open, but in many cases the Author, having already a large experience, simply posts a - hopefully working - "finalized" script that needs to be read and understood without the reports on the processes that lead to writing it), here, JFYI, are a couple of those "non-winbuilder" exceptions (but there are more, both here on reboot.pro or on MSFN.ORG:

http://www.msfn.org/...e-windows-7-pe/

http://www.msfn.org/...-from-winpe-30/

 

:duff:

Wonko

 

[1] http://digitallibrar.../object_id/9285


  • Rogas likes this

#5 Rogas

Rogas
  • Members
  • 4 posts
  •  
    Italy

Posted A week ago

Great. Thanks Wonko.

Yes, I know I arrived when the dinner is ready. Ahah!

I thought what you recommend: reading the others' scripts. I will! :thumbsup:

What I think is that I have to replace every "user related" key in a default key and leave all the Local Machine keys as they are...

I'll give a read to your links. Thanks again!

PS: ma sei italiano!

 

 

 

Which is good :) of course, I just wanted to underline how you are standing on the shoulders of giants[1], adding the WOW64 subsystem to a PE was - at the time - a great achievement (and it was made more difficult after Windows 7).

 

About some paths, as said, it depends, the easiest would be to check what working scripts for similar programs do or find (and read) the (actually few) "fully open" threads about manual PE building (not that Winbuilder scripts are not open, but in many cases the Author, having already a large experience, simply posts a - hopefully working - "finalized" script that needs to be read and understood without the reports on the processes that lead to writing it), here, JFYI, are a couple of those "non-winbuilder" exceptions (but there are more, both here on reboot.pro or on MSFN.ORG:

http://www.msfn.org/...e-windows-7-pe/

http://www.msfn.org/...-from-winpe-30/

 

:duff:

Wonko

 

[1] http://digitallibrar.../object_id/9285



#6 Rogas

Rogas
  • Members
  • 4 posts
  •  
    Italy

Posted A week ago

I think I found the way. Nothing new to those that are not WB newbies as me...

 

Given that in the section [Variables] we have something like (example):

[Variables]
%ProgramTitle%=MyProgram
%ProgramEXE%=MyProgram.exe
%ProgramFolder%=MyProgramFolder
%SetupFile%=%SetupFilex86%
%SetupFilex86%=MyProgram.7z

.

.

.

 

we'll replace:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\ <name of program folder >\\ <name of program>.exe"="DISABLETHEMES RUNASADMIN"

 

with this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"%PE_Programs%\%ProgramFolder%\ <name of program>.exe"="DISABLETHEMES RUNASADMIN"






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users