Jump to content











Photo
- - - - -

Smallest Win10PE x64 with Wow64 wanted


  • Please log in to reply
44 replies to this topic

#1 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 04:08 PM

I am looking to build the smallest boot.wim which can boot from a USB 3 drive and run a 32-bit VB6 app.

So it needs WoW64 and preferably Explorer and USB drivers.

Other drivers (even HDD drivers!) are not needed.

Using WinBuilder projects, I can get it down to about 480MB.

Any ideas how I can get it any smaller?



#2 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 05:46 PM

You have probably covered it already but I'll ask anyway :)

Do you have the source code? and if so can you migrate it to vb.net?

Or, does it have to be this one particular app : are not there alternatives?

 

I started as a vb6 dev guy in the late 90's...Not my best "souvenirs" ...I clearly welcomed .Net in the early 2000's.

The exe, but also its dependencies (activex in particular) are going to be a PITA...



#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 06:10 PM

Thanks for reply.

yes, I have the source code

No, I can't convert it into another language (without a great deal of effort and testing) - it also runs a 32-bit command line app for which I do not have the source code.

So,yes, it has to be that app. (it is SWITCH_E2B.exe in Easy2Boot)

 

Since I don't need loads of fonts, big dlls, internet/edge, html or many drivers, is there any easy way to pick the ones to delete?

Or maybe use dism to strip out uneeded components?

Or to put it another way, any big font and dll files that I should not delete?

I am now down to 462MB for boot.wim...



#4 noel

noel

    Frequent Member

  • Advanced user
  • 111 posts
  • Location:nantes
  •  
    France

Posted 19 March 2019 - 06:19 PM

hi,

Yes, i'm not a guru. I have some background in winpe ( i use it from the first OPK ). For using in my company, in the past, I put dotnet2 and Powershell in winpe3; i make a "specific" winpe for the configuration of RAID5 card...Now i'm retired.

My English is not good. Sorry. If you don't understand what i write, please, forget me.

 

If my company gave me your goal, i asked :

- first: why winpe64 for launching only one 32bits VB6 application ?

- second : which limit/size ?

- third : i'll start from a winpe that ADK  products ( with only the needed packages ) . And i'll use procmon to "trace" the application for needed files/registry

- forth : why the need of "explorer" : desktop of only the "openfile" window (notepad or a vb6 to launch it)? Slore's WinXShell can be good.

The syswow64 is populated in the winpe from ADK ( i verify in a boot.wim but i added many packages ). The VB6 application needs only a few of them...or some new files.

After, i'll search all big directories, drivers, drivesStore, config... modify system hive for unneeded drivers; search unneeded files.... but it's long.

note : imageres.dll size = 15Mo in winpe from ADK and 23Mo from winpe10SE ( it depends on scripts you use )

 

Perhaps i don't understand your question… so, don't be angry.

Noel



#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 06:44 PM

1. I need to UEFI-64 boot, so it must be WinPE x64

2. No limit - I just need it as small as possible to save space because there will be multiple (0-100+) boot.wim files on a single USB stick.

3. I need WoW64 - I was not aware that DISM supported that? I know I could try a scripted method, but I was hoping for a ready-made (almost) solution, e.g. a WinBuilder project which already has the WoW64 scripts?

4. Yes, that is an option, but it is not a great saving

5. My current build is based on ChrisR's Win10xPE x64 project, MistyPE doen't work with current Win10 boot.wim source files.



#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 March 2019 - 06:44 PM

 

No, I can't convert it into another language (without a great deal of effort and testing) - it also runs a 32-bit command line app for which I do not have the source code.

You mean GetFileExtents?

 

https://web.archive....e/luserland.htm

The source is available:

https://web.archive....FileExtents.zip

 

:duff:

Wonko



#7 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 06:47 PM

Yes! That is the command line app. I couldn't find it thanks!  It is still very difficult (for me anyway) to convert this for Win x64 (ideally I would like it to work on exFATtoo!).



#8 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 06:47 PM

480MB definitely seems a lot to me.

How do you create this ISO? what else is in there?

My "standard" x64 iso (no wow64, made from windows install boot.wim) is below 240MB.

 

Surely some wow64 guru over here can give you an estimation in size of the wow64 overhead.



#9 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 06:50 PM

Yes! That is the command line app. I couldn't find it thanks!  It is still very difficult (for me anyway) to convert this for Win x64 (ideally I would like it to work on exFATtoo!).

 

I can help rewrite/recompile eventually.



#10 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 06:50 PM

ChrisR's Win10xPE WinBuilder project.



#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 07:03 PM

Wow64 in Win10xPE seems to add about 80MB!



#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 07:08 PM

I can help rewrite/recompile eventually.

Thanks, that would be great if you have some time. I would also have to rewrite the Switch_E2B vb6 app in something else too (AutoIt maybe since it is easy to compile it as both 32-bit and 64-bit?)



#13 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 07:29 PM

Thanks, that would be great if you have some time. I would also have to rewrite the Switch_E2B vb6 app in something else too (AutoIt maybe since it is easy to compile it as both 32-bit and 64-bit?)

 

About autoit and x64 you may want to double check : i am not sure about that.

Plus, this is a yet another "scripting" langage which will (to be checked as well) requires a runtime next to it (similar to perl, python, java, dotnet, etc).

Sometimes the runtime is embedded in the exe so it is transparent but still, it remains a script launched by a runtime.

 

I am more in favor of "native" languages with little or no dependencies.

Freepascal is free, so is the IDE (lazarus) and easy to compile for multiple processors/platforms.

 

Hopefully I dont hurt developpers feelings with this post :)

 

Here what I propose : I can have a look at getfilextents.

I have "played" with extents in the past (here) and it might be easy to come with a x32/x64 command line tool.

If the exercice proves succesful I can have a look at Switch_E2B.

I know some bits about filesystems, disks, partitions, etc so it sounds like a possible journey.



#14 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 March 2019 - 07:38 PM

Cannot say, but I believe that re-compiling it for 64 bit should be (relatively) easy (for a programmer), while adding exFAT support is likely to be a "project" in its own. :dubbio:

 

Side note, getfileextents (AFAICR) has (maybe) some issues on some media, there is (was) a similar program (similar in the sense of providing file extents, but using an altogether different approach), part of mydefrag:

 

https://web.archive....Fragmenter.html

Actual download (can extract with Uniextract, it's a Inno Setup):

https://web.archive....frag-v4.3.1.exe

 

There is both a 32 bit version and a 64 bit version. (no source code, I believe and mydefrag.com is long dead).

 

BUT, IF the actual need is to know the LBA address of a file, you can also (in windows 10) use the "built-in" fsutil.

fsutil volume [filelayout] <VolumePath> <fileid>

should provide the info (you might need to do some conversions/parsing of course).

 

:duff:

Wonko



#15 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 07:39 PM

About autoit and x64 you may want to double check : i am not sure about that.

Plus, this is a yet another "scripting" langage which will (to be checked as well) requires a runtime next to it (similar to perl, python, java, dotnet, etc).

Sometimes the runtime is embedded in the exe so it is transparent but still, it remains a script launched by a runtime.

 

I am more in favor of "native" languages with little or no dependencies.

Freepascal is free, so is the IDE (lazarus) and easy to compile for multiple processors/platforms.

 

Hopefully I dont hurt developpers feelings with this post :)

 

Here what I propose : I can have a look at getfilextents.

I have "played" with extents in the past (here) and it might be easy to come with a x32/x64 command line tool.

If the exercice proves succesful I can have a look at Switch_E2B.

I know some bits about filesystems, disks, partitions, etc so it sounds like a possible journey.

That's very nice of you! Ideally the  get_extents function should be integrated into  Switch_e2b but It was beyond my coding skills (patience!) and the command line utility was available...



#16 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 07:41 PM

That's very nice of you! Ideally the  get_extents function should be integrated into  Switch_e2b but It was beyond my coding skills (patience!) and the command line utility was available...

 

I like coding :)

After a long day where my users (or managers) will moan at me because "network is slow" or "it must be a firewall issue", coding (and a beer eventually) relaxes me.

Or flying drones... but wrong forum :)

 

Can you point me at download for getfilextents and Switch_e2b ?

 

edit : got fileextents using Wonko's links (how would we know about wayback if Wonko was not there ! ).



#17 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 07:41 PM

@Wonko

I need to know the LBA disk start address (not logical volume address) + length of file on disk (sectors taken up by file).


Edited by steve6375, 19 March 2019 - 07:42 PM.


#18 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 07:51 PM

P.S. What I REALLY need\want is not a x64 version of SWITCH_E2B.exe, but a version that runs under the UEFI environment (e.g. switch_e2b_x64.efi).

This would allow the user to UEFI-boot directly to SWITCH_E2B via rEFInd and select any of the .imgPTN images on the USB drive without needing to boot to Windows. I am not sure if it can be done however (requires physical sector read/write access to NTFS partitions and getfileextents type calls via UEFI APIs?) and sounds like a really tough bit of code!

So the easier option is to boot to a miniPE x64 (with USB3 drivers) and run SWITCH_E2B.exe.



#19 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 07:57 PM

EFI code is way beyong my league at this point :)

Probably easier to rebuild switch_e2b for x32/x64.

 

In the meantime, i have recompiled getfileextents for both x32 and x64.

Will probably turn into FPC code as well shortly.

 

getfilextents here.



#20 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 March 2019 - 07:57 PM

@Wonko

I need to know the LBA disk start address (not logical volume address) + length of file on disk (sectors taken up by file).

I know. :)

 

That is why you need a complex parsing and converting mechanism, which is so difficult that I needed once (@erwan.l in batch, i.e. a scripting language simpler but similar to perl, python, etc. that offers the advantage of needing not a compiler, nor an environment set for the compiler (and yes noone provides the settings for it with the source code) and that everyone can edit/modify with Notepad) 758 bytes (with a couple hardcoded assumptions) to write it (rigorously half-@§§edly) on-the-fly :

https://msfn.org/boa...comment=1017599

It may take what, 1500 bytes in VB or in AutoIT to write a similar parsing/converting routine?

 

Heck, I can even put it in CODE tags here (so that it will be botched at next board software update) without even needing a spoiler:



@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
Set InitialLBA=63
Set clusterSize=8
Set File=%~dpnx1
ECHO Ext:      Lcn:      LBAstart:  Sects: File:	

FOR /F "tokens=2,4,6,8,9 delims=:=, " %%A IN ('myfragmenter.exe -i "%File%" ^| FIND "="') DO (
CALL :convert_LBA %%A %%B %%C %%D

ECHO !Extent! !Lcn! !LBAstart! !Sectors! %File%
ECHO !Extent! !Lcn! !LBAstart! !Sectors! %File%>>myfragi.log
)

ECHO.>>myfragi.log
GOTO :EOF

:convert_LBA
SET /A Extent=%1
SET /A Lcn=%2
SET /A LBAstart=%InitialLBA%+%2*%clusterSize%
SET /A Sectors=%clusterSize%*(%4-%3)
CALL :set_length Extent 4
CALL :set_length Lcn 11
CALL :set_length LBAstart 12
CALL :set_length Sectors 7
GOTO :EOF

:set_length
SET %1=            !%1!
SET %1=!%1:~-%2,%2!
GOTO :EOF

:duff:

Wonko



#21 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 19 March 2019 - 08:12 PM

EFI code is way beyong my league at this point :)

Probably easier to rebuild switch_e2b for x32/x64.

 

In the meantime, i have recompiled getfileextents for both x32 and x64.

Will probably turn into FPC code as well shortly.

 

getfilextents here.

Thanks - both seem to work! :thumbup:



#22 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 19 March 2019 - 09:46 PM

@Wonko : I know how to retrieve the LBA for a volume offset (using IOCTL_VOLUME_LOGICAL_TO_PHYSICAL).

How do I turn that LBA into a sector number?

I am currently looking at getfileextents code, or trying to understand "Sectors=%clusterSize%*(%4-%3)" but my brain is laggy this evening and you are so agile when it comes to offset/lba/sectors/etc (ugly flatering mode off).

 

Example below.

getFileExtentsX64.exe c:\bootmgr
File offset 0 LBA: 1f2aef8 Sectors: 310


#23 alacran

alacran

    Gold Member

  • .script developer
  • 1135 posts
  •  
    Mexico

Posted 20 March 2019 - 12:02 AM

@ steve6375

 

Try ChrisPE from Misty, download it from this page: https://github.com/p...rispe/tree/test

 

SysWow 64 is working fine, this is almosts a barebores (7 to 10) WinPE + a few applications just to test it works fine, but you can disable them before build if you want, it is the full project including the version of PEBakery that was used at the time of development of this version.

 

My ChrisPE-10x64.iso is 447 MB with a lot of programs included.

 

alacran



#24 noel

noel

    Frequent Member

  • Advanced user
  • 111 posts
  • Location:nantes
  •  
    France

Posted 20 March 2019 - 12:05 AM

@erwan
perhaps ...
the script in post#20 was for myfragmenter.exe !!! not for getFileExtents.exe !!!

myfragmenter.exe -i "%File%"
line 1-->>>Extent 1: Lcn=495625, Vcn=0, NextVcn=2
line 2-->>>Extent 2: Lcn=28135076, Vcn=2, NextVcn=4

read in the script :
Set clusterSize=8
...
FOR /F "tokens=2,4,6,8,9 delims=:=, " %%A IN ('myfragmenter.exe -i "%File%" ^| FIND "="') DO (
-->>> token1 = Extent
-->>> token2 = 1
-->>> token3 = Lcn           Logical Cluster number for the file ?
-->>> token4 = 495625
-->>> token5 = Vcn           Virtual Cluster number for the volume ( on the media ) ?
-->>> token6 = 0
-->>> token7 = NextVcn   next (or last !) Virtual Cluster number of an extend ?
-->>> token8 = 2
-->>> token9 =
CALL :convert_LBA %%A %%B %%C %%D
%%A = 1
%%B = 495625
%%C = 0
%%D = 2
-->>> CALL :convert_LBA %%A %%B %%C %%D
...
:convert_LBA
SET /A Sectors=%clusterSize%*(%4-%3)
-->>> SET /A Sectors= 8*(2-0) =16



#25 steve6375

steve6375

    Platinum Member

  • Developer
  • 7078 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 20 March 2019 - 11:08 AM

@ steve6375

 

Try ChrisPE from Misty, download it from this page: https://github.com/p...rispe/tree/test

 

SysWow 64 is working fine, this is almosts a barebores (7 to 10) WinPE + a few applications just to test it works fine, but you can disable them before build if you want, it is the full project including the version of PEBakery that was used at the time of development of this version.

 

My ChrisPE-10x64.iso is 447 MB with a lot of programs included.

 

alacran

Thanks! It made a smaller boot.wim (410MB), but when I run my SWITCH_E2B.exe app I get a FLTLIB.dll error. Any ideas on how to fix it?

P.S. How can I make the SWITCH_E2B.exe app auto-start when WinPE Desktop is reached? Without Explorer, I can't seem to get it to launch?


Edited by steve6375, 20 March 2019 - 11:20 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users