Jump to content

Shell in Windows PE


v.katalov

Recommended Posts

Hello,

We have developing a commercial application based on Windows PE 2005. At one point, we should browse for the file, but GetOpenFileName works really strange, please have a look:

fileopen1.gif

I can enter into %MY_COMPUTER%, but it does not show any disks -- i.e. the window become empty. In the meantime, "Look in" drop-down box shows all the disk normally:

fileopen2.gif

However, if I select any of the disks (such as 'C') and then go up one level (to "My Computer"), the window is still empty.

I was able to fix the names (to show "My Computer" and "My Network Places") by making some changes in "hivecls.inf" and rebuilding the Registry (SOFTWARE hive), but still cannot get "My Computer" to work properly.

Any ideas? The only solution that comes in mind is to use old-style file open dialog (that shows only disks and "real" folders, but not "virtual" folders such "My Computer", "Desktop" etc), but it looks really ugly.

/Vladimir

Link to comment
Share on other sites


Have you already tried to run your application on a windows PE 1.x? Still haven't tested the 2005 version, but it could help you debug a little bit more on this problem.

Peter (PSC) has also solved this in an automated fashion here. It's a script with a program that will scan all hives and then create PE hives with your locales correctly added.

Hope this helps! :)

Link to comment
Share on other sites

Have you already tried to run your application on a windows PE 1.x? Still haven't tested the 2005 version, but it could help you debug a little bit more on this problem.

Sorry, I'm a bit confused with the version names/numbers. Version 2005 (which I refer to) is based on Windows Server 2003. But actually, the same problem exists in older versions, even based on Windows 2000 (a good example is Winternals ERD Commander).

Peter (PSC) has also solved this in an automated fashion here. It's a script with a program that will scan all hives and then create PE hives with your locales correctly added.

Hope this helps! :)

Our problem is not locale-related (I think). We make WinPE image from US version of Windows, and don't need any additional keyboard layouts, non-US fonts etc. But I cannot understand what's going on with "Desktop" and "My Computer" :(

Thanks anyway! :)

/Vladimir

Link to comment
Share on other sites

We make WinPE image from US version of Windows, and don't need any additional keyboard layouts, non-US fonts etc. But I cannot understand what's going on with "Desktop" and "My Computer" :(

Thanks anyway! :)

/Vladimir

Try copying explorer.exe to %WinDir%, that will fix the icons as for the actual use of virtual folders I got stuck and gave up.

I can't see your images btw.

/Edit - I forgot about the reg edit needed I will have to look for it later, I am at work and have no notes sorry.

Edited by likuidkewl
Link to comment
Share on other sites

Try copying explorer.exe to %WinDir%, that will fix the icons as for the actual use of virtual folders I got stuck and gave up.

Unfortunately, that does not help (already tried that). To fix the problem with %MY_COMPUTER% (name and icon), I've changed two lines in "hivecls.gif":

HKCR,"CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}","",0x00000002,"%MY_COMPUTER%"

HKCR,"CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\DefaultIcon","",0x00020002,"%SystemRoot%\Explorer.exe,0"

To the following ones:

HKCR,"CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}","",0x00000000,"My Computer"

HKCR,"CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\DefaultIcon","",0x00020002,"%SystemRoot%\system32\shell32.dll,15"

By still get an empty window when enter into "My Computer".

I can't see your images btw.

Sorry, no idea why... I do see them in my own post :) Here are the links:

http://www.elcomsoft.com/tmp/fileopen1.gif

http://www.elcomsoft.com/tmp/fileopen2.gif

/Edit - I forgot about the reg edit needed I will have to look for it later, I am at work and have no notes sorry.

Sorry, what do you mean? "regedit.exe" and "regedt32.exe" are already included into my PE compilation.

/Vladimir

Link to comment
Share on other sites

NM about the registry thing you alerady covered it, :)

Have you registered any extra dll's, if I remember correctly they needed to be registered to work correctly. I can't remeber off hand which ones they are I want to say mycomput.dll, browseui.dll, and shell32.dll

HTH

Link to comment
Share on other sites

Have you registered any extra dll's, if I remember correctly they needed to be registered to work correctly. I can't remeber off hand which ones they are I want to say mycomput.dll, browseui.dll, and shell32.dll

Nope. Should I? If yes, how -- through winbom.ini, or some other way? Any suggestions would be really appreciated, thanks beforehand!

/Vladimir

Link to comment
Share on other sites

It all depends on your application, I would set mine up to run after screen selection via a batch and regsvr32.

I never liked the winbom.ini option. Just personal.

Looking for info on this I came across this list of files, that looked eerily familiar.

browselc.dll
fmifs.dll
browseui.dll
shdocvw.dll
shfolder.dll
mlang.dll
advpack.dll
iernonce.dll

Or

shell32.dll
mlang.dll
browseui.dll
msxml.dll
mshtml.dll
shdocvw.dll
mycomput.dll
devmgr.dll
mydocs.dll

Edited by likuidkewl
Link to comment
Share on other sites

It all depends on your application, I would set mine up to run after screen selection via a batch and regsvr32.

I never liked the winbom.ini option. Just personal.

Looking for info on this I came across this list of files, that looked eerily familiar.

Thanks, I'll try that, though I think that the problem is somewhere else -- most probably, in some HIVECLS.INF settings that are missing.

Link to comment
Share on other sites

reg dll's - regsvr32.exe /s <my-dll.dll> from startnet.cmd maby would work?

I've tried that, as well as adding the commands to winbom.ini, like:

"register dll","%SystemRoot%\system32\regsvr32 /s /i %SystemRoot%\system32\advpack.dll"

Neither worked :( Probably, the DLLs have been registered successfully, but I still get an empty windows when double-clicking on "My Computer" in "file open" dialog. But as I already noted, in "Look in" drop-down box everything is OK -- i.e. I see the tree with "Deskop" in the root, "My Compuer" and all local drives there.

Link to comment
Share on other sites

I had a similar problem with the variable indicator thing ('%MyBoxOJunk%' should be just 'MyBoxOJunk'). I believe the problem resides in the registry, variables defined incorrectly. I solved this by rebuilding, good to build near a drive root.

As for nothing in 'my computer', are you removing/upxing .dll files? Upxing saves negligable space in system32, and beware, it can strip more than icons. One the other hand, some enjoy life on the edge.

best of luck.

Link to comment
Share on other sites

It all depends on your application, I would set mine up to run after screen selection via a batch and regsvr32.

I never liked the winbom.ini option. Just personal.

Looking for info on this I came across this list of files, that looked eerily familiar.

Thanks, I'll try that, though I think that the problem is somewhere else -- most probably, in some HIVECLS.INF settings that are missing.

I tried this and it seemed to work for me, I found an old build with similiar symptoms you are describing and gave it a test shot.

Below is a snippet of the code I use in my START.bat:

~*SNIP*~
start /wait regsvr32 /s /i browseui.dll
start /wait regsvr32 /s /i shell32.dll
start /wait regsvr32 /s /i mshtml.dll
start /wait regsvr32 /s /i shdocvw.dll
start /wait regsvr32 /s devmgr.dll
start /wait regsvr32 /s mlang.dll
start /wait regsvr32 /s msxml.dll
start /wait regsvr32 /s mycomput.dll
start /wait regsvr32 /s mydocs.dll
~*SNIP*~

As you know some of these are not copied by default to %windir%\system32 must be added by batch in the build process.

HTH

Link to comment
Share on other sites

  • 4 months later...

Solution to problem of unresolved strings in Windows PE 2005:

HIVECLS.INF file has two [strings] sections in it. This causes the second section to be ignored, so most of the string values are missed (including the ones pictured in the first post, above).

My solution was to add a PAUSE command in MKIMG.CMD:

REM

REM Copy over the required registry hive files

REM

copy %WINPESRCDIR%\hive*.inf 2>nul 1>nul

REM - added this reminder to look out for duplicate [strings] section headers.

echo Watch out for duplicate [strings] section headers.& findstr /b /i /n \[strings\] "%CD%"\hive*.inf & pause

...and then manually comment out the second [strings] header (using a semicolon) before continuing.

Ross Brown

Computer Sciences Corporation

rbrown68@csc.com

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...