Topic: WimBuilder2 - New Builder with Re:WIN10XPE project(~20H2 Supported)  (Read 38311 times)

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Here is WimBuilder2 - a New Builder base on hta/vbs/js/bat SCRIPTS, and everyone can see the all codes and improve it.

WimBuilder2 is a Wim "Editor", first you select the wim file(s), and next here are some project(s) for you to customize.

Features:
Small, Simple, Speedy
Small - made by well-known script language, no need compile, made by text files.
Simple - use BATCH syntax and macros  to modify the wim file which are aim at making PE for end-users, there is no new-to-learn mess syntax. AND easy to extend.
                     - good features structure with just putting them into right folder structure.
Speedy - use wimlib extract files from install.wim like WIN10XPE project does, no need mount/unmount install.wim.
                     - modify wim file with TrustInstaller rights, so needn't grant ACL for registy and file, make wim modifition be faster.
Other - internationalization, open source.
                   - WYSWYG, no need complie, F5 reload the newest version, more customizable settings UI with HTML web page.

Support Run in:Windows 7~Windows server 2019, and origin winre.wim(included HTA package).

For here, I offer a project to build a PE. It  is Re:WIN10XPE project(based on ChrisR's WIN10XPE).
It goes far ahead to give you a more functional PE as normal Windows than the other projects. The project can build PE with MTP, RNDIS support,
worked printers with the newest Windows(20H1), Remote Desktop Service,
origin USB ejector, system-like WIFI connection, and super dual-session SYSTEM<=>Administrator accounts.

screenshots:
tested:v1803, v1809, v19H1, v19H2, 20H1(<=10.0.19041), 20H2(<= 10.0.19569.1000)

ila_rendered

Which one has the origin Windows features:
  • Windows Explorer(Support dark theme)(40MB)
  • DWM visual(minimum additions)(8MB)
  • Compter Management(MMC(~Services): 3MB)
  • Device Manager
  • Disk Management
  • Services
  • Chinese IME(zh-CN, zh-TW)(32MB)
  • Korean IME(ko-KR)
  • Origin display monitor drivers(0.4MB)
  • Network support(33MB)
  • Audio support
  • Search feature(7MB)
  • Bitlocker(0.5MB)
  • Accessibility(6MB)
  • WOW64 support(72MB)  (2018-12-04)
  • Internet Explorer 11(26MB)  (2018-12-04)
  • Windows Media Player   (2020-03-03)
  • Remote Desktop(15MB)  (2019-01-02)
  • MTP support(6MB)  (2018-01-02) BIG thanks to noelBlanc  :thumbsup:
  • RNDIS support(0.5MB)  (2019-10-10)
  • PPPoE support  (2020-03-03)
  • SwitchToAdmin(minimum additions)(29MB)  (2019-01-24)
  • Switch between Admin <=> SYSTEM account(0MB)  (2019-10-10)
  • Windows Photo Viewer(3MB)  (2019-01-30)
  • VC++ Runtime(1.7MB)  (2019-03-20)
  • .NET Framework(140MB) (2019-04-18)
  • System Event Sounds (2019-04-18)
  • SnippingTool(3.5MB) (2019-04-28)
  • Printers (2019-10-10)


Quote
just click button to create PE:
wimbuilder.cmd ->select install.wim -> select winre.wim -> next to PRJECT ->
select WIN10PE -> next to PATCH -> next to BUILD ->
1-run -> make-iso

main frame
ila_rendered
ila_rendered
ila_rendered
build_on_winre
ila_rendered

WimBuilder2 - Chinese Video Tutorial ( 3 MB Animated Gif)

A small step by step pictures for new users. (by Lancelot)
http://lancelot.theoven.org/TheOvenAttach/WimBuilderSlore_Default_Build_Step_By_Step_20191111.zip

The latest and released versions:
http://theoven.org/index.php?topic=3112.0
« Last Edit: May 22, 2020, 03:12:33 PM by slore »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi slore,

instead of another such design (long story to short)

why not simply add gui to cmd file

giving example following pebakery gui

Test.cmdslore
Code: [Select]
cd "%~dp0"
Call :Interface_Read
Echo %pCheckBox5%
cmd
exit

[Interface]
pCheckBox5=pCheckBox5,1,3,173,184,200,18,True

[Interface_Read]
:Interface_Read
Set pCheckBox5=True
goto:eof

-->
this way when
slore.hta(.exe or whatever) used to open Test.cmdslore
one will see gui to enable disable checkbox
using such checkbox will rewrite [Interface_Read] section so when cmd file all will work following rest with cmd.exe (where one can start vbs dism etc.)

*
A developer mostly requires a good editor to add remove interface elements to batch files.

*
%99 new developers needs to add a simple gui to batch files, to create wim or any other thing....
ex: wimbuilder  :wink:


Just an idea.... :turtle:

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Hi, Lancelot

Sorry, I don't understand your image.
Do you mean you want make different plugins selection when the GUI loaded?

just put a config file, when the GUI open, with loading the settings.
Projects\WIN10PE\
    build1.config(JSON format, key=value format ini-like also OK.)
         {
             "pCheckBox5" : false
             "plugins":{
                  "CheckBoxB" : true,
             }
         }

GUI can save as ... the plugins selection to file.
one project can have many build playbooks.

GUI -> batchfile
and, the selection value,can be set to the environment variable table,
and cmd.exe will got the value.
or write to temp/build_87281.config, the batch file load the file to build.
« Last Edit: January 26, 2018, 11:01:56 AM by slore »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi slore,

sorry very busy part of year (life)

+
well you naturally figure out why we use builders to create projects instead of .cmd or .ps
with your words: "UI stuff to configure some settings"

But you follow current builders design, where both miss "simple batch file with UI stuff to configure some settings"
Let's forget now about wimbuilder and other projects and plugins etc., and follow evolution steps with a better way where it should be.


*
Question is simple:
Following previous .cmd example
when we double click Test.cmdslore which will open by slore.hta etc. (assume association made or by open file button)
can we have something like this:
https://www.dropbox.com/s/j5mjlv6li51c3pu/2018-01-26_144801.png?dl=0

+
NotePad2 -> slore.hta
cmd window inside slore.hta (not essential, only to give idea)
Test.cmdslore gui opens as default --> like notepad opens a text file  :wink:

==>
If we can have such thing
Than as a begining, many people may easily create their own .cmdslore following adk install
 and other personal things.  :wink:

--> all requirement is a "open file" and "editor" button

Reminder:
 There is already .cmd and .ps PE projects on net which developers lacks UI stuff to configure some settings with a nice editor.
  They use batch selection things for projects, which is not good on long-term maintenance.

I hope I could explain.

Sorry I will not be able to post more about this stuff, very very busy at current part of my life.....

:turtle:

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Hi, Lancelot

Quote
I hope I could explain.

Sorry I will not be able to post more about this stuff, very very busy at current part of my life.....

OK. take your time.  :thumbsup:

I got it.

assoc with custom extension for this.
this is not  hard part, can adding a simple laucher.vbs(/install /uninstall /otheroption) for the feature.

thanks for the idea.

my baby  is going to be born, next will be my very busy part of my life,
before that I have little time to make the demo, and I post it for collectiing advises,
I will far from computer some months, so the coding thing will be hard, but my mind can take time to think about the design....
so this thread been posted.

RoyM

  • Jr. Chef
  • **
  • Date Registered: Aug 2017
  • Posts: 80
Hey Guys.
Fantastic topic.
@ Slore, 'Congrats on the youngin'.
I will be following this topic.
Regards.
RoyM

Re: WimBuilderUI - create a builder UI with only text file, no need to compile
« Reply #6 on: February 03, 2018, 12:07:31 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
my baby  is going to be born, next will be my very busy part of my life,
Congradulations.  :party_time:

I wish my best to your family.  :great:

:turtle:

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
WimBuilderUI's workflow

ila_rendered
« Last Edit: November 03, 2018, 05:54:21 PM by slore »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
After one week working, here is a working version with a sample project to add explorer shell to origin boot.wim/winre.wim.  :tongue:


upload a MTP patch for noel to test.
« Last Edit: November 26, 2018, 01:40:08 PM by slore »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Another 2 days work with the HTML settings, now wimbuilder can load/set the html UI's settings option.
75% main function be done!

TODO:
1.merge the default option from every patch html.
2.pass the option json settings to batch file(%opt[xxx]%).
3.pass the patches select state to batch file, only apply the selected patches to wim file.
4.convert WIN10XPE's typical scripts to the builder, make a real usefull WinPE, not only windows shell works.
« Last Edit: November 12, 2018, 04:06:18 PM by slore »

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #10 on: November 19, 2018, 05:23:04 PM »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
with some feedback, I improve the prepare page, and make the mapping drive be an option(not fixed X:) on build page.
so the WimBuilder2 is also could run in origin WINRE.wim(of cause WIN10XPE is better) which one happen to have HTA and VBS package be installed.

the WIN10XPE sample project now have something new:
* origin display monitor drives
* network support
* search function
* bitlocker
* Accessibility


Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #11 on: November 19, 2018, 06:10:26 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi slore,

can you save basic configurations (at "Getting Started" & "Project" ) to an ini file
eg.
WimBuilder.ini
Code: [Select]
[WimBuilder]
SelectedProject=Win10XPE
SourceDir=D:\S\Win10_x64_5
InstallImage=D:\S\Win10_x64_5\sources\install.wim
InstallImageIndex=1
BaseImage=D:\S\Win10_x64_5\sources\winre.wim
BaseImageIndex=1

This way, it is more automatic than editing config.js,
-->
For each start of WimBuilder.cmd, no need to point the same folder again and again.  :wink:


*
the WIN10XPE sample project now have something new:
* origin display monitor drives
* network support
* search function
* bitlocker
* Accessibility
not something new most exists since Win7PESE I guess,
 Chris ported Win10PESE plugins to Win10XPE to get new type3 style build.

:turtle:

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #12 on: November 19, 2018, 07:20:33 PM »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Hi, Lancelot

Personal, I don't know what the different between config.js and config.ini.

$wb_base='D:\S\Win10_x64_5\sources\winre.wim'
$wb_base_index=1

is the name problem?

and for JavaScript, a json format is good.
last_settings = {
 'BaseImage':'D:\S\Win10_x64_5\sources\winre.wim',
'BaseImageIndex':1,
'SelectedProject':'WIN10XPE'
}

I think people shouldn't need to know how the settings format is saved, I Will just add a "save" or "make this by default" button, or auto save the lastest selected settings, and when WimBuilder start, use the last selection. this sounds good, is it?
GOOD idea :thumbsup:

sorry about the NEW, they are new porting feature for WimBuilder Project then first version with just explorer,mmc,IME.

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #13 on: November 19, 2018, 07:46:54 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
auto save the lastest selected settings, and when WimBuilder start, use the last selection. this sounds good, is it?
:thumbsup:

I do not care about the setting format saved, ini json etc. all fine to me.  :great:

*
Still whatever you do, also have a design to build unattended.
LiveSystemPro (including WinXPE, Win7PE, Win8PE, Win10PE) have this feature which works fine: See Reply 10 11 12
http://theoven.org/index.php?topic=295.msg28760#msg28760
wb also had this feature in the past.

It is always useful to AutoStart build by providing source with a ready config file (.ini json etc.)  :great:
eg.
WimBuilder.cmd /AutoStart


ps: I have to go now, further will respond tomorrow. Good night.
:turtle:

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #14 on: November 20, 2018, 02:22:18 AM »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Hi, Lancelot

>Still whatever you do, also have a design to build unattended.

because this made by js+html, it is easy do auto action with config.js to write same action like:

Code: [Select]
$wb_src='D:\\sources\\install.wim';
$wb_base = 'winre.wim';
$('#pj_WIN10XPE').click();
$('#menu_patches').click();
open_tree_node('00-Configures');
select_tree_node('00-Configures/Build');
uncheck_tree_node('01-Components');
check_tree_node('01-Components/00-Shell');
check_tree_node('01-Components/DWM');
check_tree_node('01-Components/IME');
check_tree_node('01-Components/MMC');
check_tree_node('01-Components/za-Accessories');
open_tree_node('01-Components');
$('#menu_build').click();
$('#01-exec').click();

build wim and makeISO need combine with some options.
I will add this feature later, for now I'm focus on porting WIN10XPE,
and see how to make patch be simple.(create necessary macros).

like:
Macro_AddFiles: now support version check, simple path, auto mui files added, %xxx% env var support, etc.
Code: [Select]
@echo off

call AddFiles %0 :end_files
goto :end_files

\Windows\SystemResources\Windows.UI.ShellCommon

@\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo\
Compressed (zipped) Folder.zfsendtotarget
Desktop (create shortcut).DeskLink
desktop.ini

; Windows Trusted Runtime Interface Driver
\Windows\System32\drivers\WindowsTrustedRT.sys

; Computer Management shortcut
\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools\Computer Management.lnk

; Explorer
\Windows\explorer.exe
\Windows\??-??\explorer.exe.mui

\Windows\System32\%WB_PE_LANG%\comctl32.dll.mui

@\Windows\System32\
comctl32.dll
+mui
actxprxy.dll,AppHelp.dll,AppResolver.dll,atlthunk.dll,avifil32.dll,clip.exe,Clipc.dll
control.exe,comsvcs.dll,CoreMessaging.dll,CoreUIComponents.dll,cscapi.dll
ctfmon.exe,desk.cpl,edputil.dll

+ver > 17000
cdp.dll,dsreg.dll,VEEventDispatcher.dll

+ver > 17700
; shellstyle.dll(.mui) is now in \Windows\resources\themes\aero\shell\normalcolor
\Windows\resources\Themes\aero\shell

+ver <= 17700
shellstyle.dll

:end_files

Macro_RegEx:NO_KEY,NO_VAL,HAS_KEY option.
Code: [Select]
@echo off
call RegEx HAS_KEY delete "HKLM\Tmp_Software\Microsoft\Windows Search\VolumeInfoCache" /f
call RegEx NO_VAL add %DeviceIdsKey%\{4d36e968-e325-11ce-bfc1-08002be10318} /v displayoverride.inf /t REG_NONE
call RegEx NO_VAL add %DeviceIdsKey%\{4d36e968-e325-11ce-bfc1-08002be10318} /v display.inf /t REG_NONE
call RegEx NO_VAL add %DeviceIdsKey%\{4d36e96e-e325-11ce-bfc1-08002be10318} /v c_monitor.inf /t REG_NONE
call RegEx NO_VAL add %DeviceIdsKey%\{4d36e96e-e325-11ce-bfc1-08002be10318} /v monitor.inf /t REG_NONE



Macro_ACLRegKey:unused now, because run in TrustInstaller right
Macro_RegCopy:same as WIN10XPE's CopyRegKey does.
Macro_OpenTextFile:edit file as what you want.

Code: [Select]
@echo off
call OpenTextFile pecmd.ini %0 :end_pecmd_edit
goto :end_pecmd_edit

TXT.before('wpeinit.exe').insert('echo on')
TXT.replace('//IME.cmd', 'IME.cmd')
TXT.after('LINK_SECTION').append('LINK app1.exe')
TXT.after('LINK_SECTION').append('LINK app2.exe')

:end_pecmd_edit

Macro_X2X(doing now):copy with simple path(Desktop,System32,StartMenu) than xcopy's full path, auto copy files for x64/x86
Quote
X folder under patch folder.
  \Program Files\StartIsBack\*
  \Windows\
  \System32\
      pecmd.exe
      pecmd.ini
  \Desktop\
     shutdown.bat
  \StartMenu\xxxx.lnk
   \X_x64\
      \Program Files\StartIsBack\sib64.dll
   \X_x86\
      \Program Files\StartIsBack\sib32.dll

main.bat
rem xocpy /E X\*.* X:\
call X2X X

and make some sample patch, make people know how this work.

Code: [Select]
@echo off
rem Slim MUI files
call :REMOVE_MUI Windows\Boot\EFI
call :REMOVE_MUI Windows\Boot\PCAT
call :REMOVE_MUI Windows\System32
goto :EOF

:REMOVE_MUI
rem always keep en-US
call :_REMOVE_MUI "%~1" "ar-SA bg-BG cs-CZ da-DK de-DE el-GR en-GB es-ES es-MX et-EE fi-FI fr-CA fr-FR"
call :_REMOVE_MUI "%~1" "he-IL hr-HR hu-HU it-IT ja-JP ko-KR  lt-LT lv-LV nb-NO nl-NL pl-PL pt-BR pt-PT"
call :_REMOVE_MUI "%~1" "qps-ploc ro-RO ru-RU sk-SK sl-SI sr-Latn-RS sv-SE th-TH tr-TR uk-UA zh-CN zh-TW"
goto :EOF

:_REMOVE_MUI
for %%i in (%~2) do (
 if not "x%%i"=="x%WB_PE_LANG%" (if exist "X:\%~1\%%i" rd /s /q "X:\%~1\%%i")
)

Is batch script more simple than .Script [section] syntax?
« Last Edit: November 20, 2018, 02:37:41 AM by slore »

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #15 on: November 20, 2018, 05:10:43 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
and see how to make patch be simple.(create necessary macros).
:thumbsup:
That is what I do with Macro Library plugin.  :wink:

Is batch script more simple than .Script [section] syntax?
They are same, only .cmd more known by internet, but .script have some features to get things easier.
most important, variables comes from [Interface] with a ready gui which makes ".script" batch easier for projects.
eg.
test.cmd:
Code: [Select]
Call :MySection
Echo Continue
exit

:MySection
Echo My Section
goto :EOF


test.script
Code: [Select]
[Process]
Run,%ScriptFile%,MySection
Echo,Continue

[MySection]
Echo,"My Section"

Both do same.

There can be even a .script to .cmd converter one day which can work perfect. (.cmd to .script not possible)

*
If you design your macros nicely, it will be easy for the plugin creators
eg:
Macro_OpenTextFile
here I use
Call,StartDocNotePad,<File>
Code: [Select]
[CallC_StartDocNotePad]
If,ExistFile,#2,Begin
StrFormat,PATH,#2,#9
StrFormat,CTRIM,#9,\,#9
StrFormat,FileName,#2,#8
If,Not,ExistFile,#9\notepad.exe,Begin
System,FileRedirect,OFF
ShellExecuteex,Open,notepad.exe,"#$q#8#$q",#9
System,FileRedirect,ON
End
Else,Begin
Call,HostSystemDir
System,FileRedirect,OFF
ShellExecuteex,Open,%HostSystemDir%\notepad.exe,"#$q#8#$q",#9
System,FileRedirect,ON
End
End

1)
ShellExecuteex,Open,notepad.exe,"D:\1\test.txt"
=
Start notepad.exe "D:\1\test.txt"

2)
ShellExecuteex,Open,notepad.exe,"D:\1\test.txt","D:\1"
=
Start "" /D "D:\1\" notepad.exe "D:\1\test.txt"

3)
ShellExecuteex,Open,%windir%\System32\notepad.exe,"D:\1\test.txt","D:\1"
=
Start "" /D "D:\1\" "%windir%\System32\notepad.exe" "D:\1\test.txt"

Here
Call,StartDocNotePad,"D:\1\test.txt"
do 2) or 3) (depends if notepad.exe exists D:\1 or not)
ps: Test with Win10PESE


One day there will be Call,StartDocNotePadWait ->

ShellExecute,Open,notepad.exe,"D:\1\test.txt","D:\1"
=
Start /wait "" /D "D:\1\" notepad.exe "D:\1\test.txt"

ShellExecute,Open,%windir%\System32\notepad.exe,"D:\1\test.txt","D:\1"
=
Start /wait "" /D "D:\1\" "%windir%\System32\notepad.exe" "D:\1\test.txt"


*
btw,
About notes at "Building"
It is common projects create shortcuts after boot (same with Win10XPE) which makes project admin life easier.
Funny, I have X and Z already assigned and used Y for WimBuilder tests yesterday.

Also This way, unattended build have no trouble.
Or
you can put an "Auto" option to select subst folder following an order eg. X: Y: Z: V: W: A: B:

*
I will add this feature later, for now I'm focus on porting WIN10XPE,
To me, it is easier to port and test things from Win10XPE or Win10PESE to WimBuilder with such available option.
I hope you do soon.  :great:

:turtle:
« Last Edit: November 20, 2018, 05:11:53 AM by Lancelot »

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #16 on: November 20, 2018, 10:11:36 AM »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Quote
They are same, only .cmd more known by internet, but .script have some features to get things easier.
yes, for the :label or the section, they are same, but script's syntax is not simple.

here the .script one:
Code: [Select]
If,ExistFile,%ScriptDir%\Explorer_AddFiles.txt,Begin
  FileCopy,%ScriptDir%\Explorer_AddFiles.txt,%GTemp%\Explorer_AddFiles.txt
  TXTReplace,%GTemp%\Explorer_AddFiles.txt,\xx-xx\,\%Language%\
  // Additions for Win10 1803. Could be done with an extra List files such as Explorer_AddFiles_17xxx.txt or 17xxx_AddFiles.txt
  If,%SourceBuild%,Bigger,17000,Begin
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\cdp.dll,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\??-??\cdp.dll.mui,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\dsreg.dll,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\??-??\dsreg.dll.mui,Append
    TXTDelLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\VEEventDispatcher.dll
  End
  If,%SourceBuild%,Bigger,17700,Begin
    // shellstyle.dll(.mui) is now in \Windows\resources\themes\aero\shell\normalcolor
    TXTDelLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\shellstyle.dll
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\resources\Themes\aero\shell,Append
    // dll for StateRepository (AppRepository). The StateRepository service is not registered in the Registry
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\StateRepository.core.dll,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\Windows.StateRepository.dll,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\??-??\Windows.StateRepository.dll.mui,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\Windows.StateRepositoryBroker.dll,Append
    TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\System32\Windows.StateRepositoryClient.dll,Append
  End

here is the .bat one:
Code: [Select]
+ver > 17000
cdp.dll,dsreg.dll,VEEventDispatcher.dll

+ver > 17700
; shellstyle.dll(.mui) is now in \Windows\resources\themes\aero\shell\normalcolor
\Windows\resources\Themes\aero\shell

+ver <= 17700
shellstyle.dll

remove MUI files .script one(Loop):
Code: [Select]
Run,%ScriptFile%,WimSmallUpdateMui,\Windows\Boot\EFI
Run,%ScriptFile%,WimSmallUpdateMui,\Windows\Boot\PCAT
Run,%ScriptFile%,WimSmallUpdateMui,\Windows\Boot\PXE

[WimSmallUpdateMui]
TxtAddline,%w%,"delete '#1\ar-SA' --force --recursive",Append
TxtAddline,%w%,"delete '#1\bg-BG' --force --recursive",Append
TxtAddline,%w%,"delete '#1\cs-CZ' --force --recursive",Append
TxtAddline,%w%,"delete '#1\da-DK' --force --recursive",Append
TxtAddline,%w%,"delete '#1\de-DE' --force --recursive",Append
TxtAddline,%w%,"delete '#1\el-GR' --force --recursive",Append
TxtAddline,%w%,"delete '#1\en-GB' --force --recursive",Append
TxtAddline,%w%,"delete '#1\en-US' --force --recursive",Append
TxtAddline,%w%,"delete '#1\es-ES' --force --recursive",Append
TxtAddline,%w%,"delete '#1\es-MX' --force --recursive",Append
TxtAddline,%w%,"delete '#1\et-EE' --force --recursive",Append
TxtAddline,%w%,"delete '#1\fi-FI' --force --recursive",Append
TxtAddline,%w%,"delete '#1\fr-CA' --force --recursive",Append
TxtAddline,%w%,"delete '#1\fr-FR' --force --recursive",Append
TxtAddline,%w%,"delete '#1\he-IL' --force --recursive",Append
TxtAddline,%w%,"delete '#1\hr-HR' --force --recursive",Append
TxtAddline,%w%,"delete '#1\hu-HU' --force --recursive",Append
TxtAddline,%w%,"delete '#1\it-IT' --force --recursive",Append
TxtAddline,%w%,"delete '#1\ja-JP' --force --recursive",Append
TxtAddline,%w%,"delete '#1\ko-KR' --force --recursive",Append
TxtAddline,%w%,"delete '#1\lt-LT' --force --recursive",Append
TxtAddline,%w%,"delete '#1\lv-LV' --force --recursive",Append
TxtAddline,%w%,"delete '#1\nb-NO' --force --recursive",Append
TxtAddline,%w%,"delete '#1\nl-NL' --force --recursive",Append
TxtAddline,%w%,"delete '#1\pl-PL' --force --recursive",Append
TxtAddline,%w%,"delete '#1\pt-BR' --force --recursive",Append
TxtAddline,%w%,"delete '#1\pt-PT' --force --recursive",Append
TxtAddline,%w%,"delete '#1\qps-ploc' --force --recursive",Append
TxtAddline,%w%,"delete '#1\ro-RO' --force --recursive",Append
TxtAddline,%w%,"delete '#1\ru-RU' --force --recursive",Append
TxtAddline,%w%,"delete '#1\sk-SK' --force --recursive",Append
TxtAddline,%w%,"delete '#1\sl-SI' --force --recursive",Append
TxtAddline,%w%,"delete '#1\sr-Latn-CS' --force --recursive",Append
TxtAddline,%w%,"delete '#1\sr-Latn-RS' --force --recursive",Append
TxtAddline,%w%,"delete '#1\sv-SE' --force --recursive",Append
TxtAddline,%w%,"delete '#1\th-TH' --force --recursive",Append
TxtAddline,%w%,"delete '#1\tr-TR' --force --recursive",Append
TxtAddline,%w%,"delete '#1\uk-UA' --force --recursive",Append
TxtAddline,%w%,"delete '#1\zh-CN' --force --recursive",Append
TxtAddline,%w%,"delete '#1\zh-HK' --force --recursive",Append
TxtAddline,%w%,"delete '#1\zh-TW' --force --recursive",Append
Loop,%ScriptFile%,WimSmallUpdateMui_Loop,1,%NbLang%,#1

[WimSmallUpdateMui_Loop]
StrFormat,SPLIT,%FallBackLanguage%,|,#c,#9
TXTDelLine,%w%,"delete '#1\#9' --force --recursive"

as .bat has for is easy to understand, and less code.
This is my point(simpler than script).

maybe there are some macro plugins make it easier, but I can't see with WIN10XPE's scripts.

Quote
most important, variables comes from [Interface] with a ready gui which makes ".script" batch easier for projects.
for wimbuilder, the Interface option is exported to be clear-named environment vars(not the Control name).

if "%opt[build.full.source]%"=="true" ...
if "%opt[build.registy.software]%"=="full" ...
if "%opt[system.darktheme]%"=="true" ...

Quote
It is common projects create shortcuts after boot (same with Win10XPE) which makes project admin life easier.
if here have a lot LINKs, the booting is slow, subst to X: is good for what you change in X:, what you got in wim,
and add "pause", can manual change something in X:.
pecmd.log have no timestamp log, or I can test if the LINK take times.

Code: [Select]
Funny, I have X and Z already assigned and used Y for WimBuilder tests yesterday.
:smile: It is luck that I leave 7 options for this,at first, I implement it with if SystemDrive is X, then use the lastest drive Z logic.

you can add $wb_x_drive='A' in config.js , as no floppy disk now to save the click, I will auto detect the usable drive in later version.


Quote
Call,StartDocNotePad,<File>
acturally, I read this hard.

  • no indent for if..else block.
  • "," in anywhere

it is easy in batch:
Code: [Select]
:StartDocNotePad
set "fdir=%~dp1"
if not "%fdir%"==""  pushd "%fdir%"
start notepad.exe "%~1"
if not "%fdir%"=="" popd
goto :EOF

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #17 on: November 20, 2018, 11:44:54 AM »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664


Quote
To me, it is easier to port and test things from Win10XPE or Win10PESE to WimBuilder with such available option.
I hope you do soon.  :great:

well, I will add the feature soon.

FYI:
here is a regexp to replace the convert the reg modify in .script to my macros. (EmEditor)

Code: [Select]
document.selection.Replace "RegCopyKey,HKLM,([^,]+)","call RegCopy HKLM\\\1",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "call RegCopy HKLM\""","call RegCopy ""HKLM\",eeFindNext Or eeReplaceAll
document.selection.Replace "RegCopy HKLM\Tmp_","RegCopy HKLM\",eeFindNext Or eeReplaceAll

document.selection.Replace "RegWrite,HKLM,0x0,([^,]+)","reg add HKLM\\\1 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x1,([^,]+),([^,]+),$","reg add HKLM\\\1 /v \2 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp

document.selection.Replace "RegWrite,HKLM,0x1,([^,]+),,([^,]+)","reg add HKLM\\\1 /ve /d \2 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x2,([^,]+),,([^,]+)","reg add HKLM\\\1 /ve /t REG_EXPAND_SZ /d \2 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x4,([^,]+),,([^,]+)","reg add HKLM\\\1 /ve /t REG_DWORD /d \2 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp

document.selection.Replace "RegWrite,HKLM,0x1,([^,]+),([^,]+),([^,]+)","reg add HKLM\\\1 /v \2 /d \3 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x2,([^,]+),([^,]+),([^,]+)","reg add HKLM\\\1 /v \2 /t REG_EXPAND_SZ /d \3 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x3,([^,]+),([^,]+),(.+)","reg add HKLM\\\1 /v \2 /t REG_BINARY /d \3 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x4,([^,]+),([^,]+),([^,]+)","reg add HKLM\\\1 /v \2 /t REG_DWORD /d \3 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x7,([^,]+),([^,]+),(.+)","reg add HKLM\\\1 /v \2 /t REG_MULTI_SZ /d \3 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "reg add HKLM\""","reg add ""HKLM\",eeFindNext Or eeReplaceAll

document.selection.Replace "#$p","%%",eeFindNext Or eeReplaceAll

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #18 on: November 20, 2018, 11:51:47 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi slore,

maybe there are some macro plugins make it easier, but I can't see with WIN10XPE's scripts.
ChrisR designed Win10XPE with motto:  "Win10XPE is new, simple, independent" (and "stand-alone").
Still there are macros:
DirDeleteQ -> Call,DirDelete
FileDeleteQ -> Call,FileDelete
Download -> Call,Download
OpenDir -> Call,OpenDir
RunFromRAM -> RunFrom,RAM
etc.

When required codes are there open inside Macro Library. Lately I had helped LiveSystem to implement our old Call,DirDeleteE inside LiveSystemPro.exe

*
but script's syntax is not simple.

yes your regexp looks very simple  :lol:
FYI:
here is a regexp to replace the convert the reg modify in .script to my macros. (EmEditor)

Code: [Select]
document.selection.Replace "RegCopyKey,HKLM,([^,]+)","call RegCopy HKLM\\\1",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp
document.selection.Replace "RegWrite,HKLM,0x4,([^,]+),([^,]+),([^,]+)","reg add HKLM\\\1 /v \2 /t REG_DWORD /d \3 /f",eeFindNext Or eeReplaceAll Or eeFindReplaceRegExp

*
you can convert
TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\resources\Themes\aero\shell,Append
to something like:
Echo \Windows\resources\Themes\aero\shell>>%GTemp%\Explorer_AddFiles.txt

just another idea for .cmd -> .script converter.

*
Code: [Select]
:StartDocNotePad
set "fdir=%~dp1"
if not "%fdir%"==""  pushd "%fdir%"
start notepad.exe "%~1"
if not "%fdir%"=="" popd
goto :EOF
I do not see error check if file exist.
And I recommend use notepad from %WinDir%\System32 , another notepad.exe maybe around at the folder you start.
you do not need pushd popd If you use something like (not tested only to give idea)
Start "" /D "%~0\" "%windir%\System32\notepad.exe" "%~1"

on wb without %~1 %~0 etc. all should be done line by line,
 also sometimes create shortpaths to execute faster, sometimes makes very much lines for simple tasks.
Still it works fast when written nicely.  :thumbsup:
Following wb Log is quite easy to figure out how it work. (still sometimes complicated)
ps:
* LSP have many Macros we use inside Macro Library at LiveSystemPro.exe which makes it quite fast. (no log and closed source but you can figure out)
* WinXPE & Win10PESE (+ALL SE) & Gena project plugins have internal macros or special written sections to speed as much as one can,
for mostly core build plugins. Since they are not for General Use (rare for core plugins) or once used for build,
 mostly not added to Macro Library or sometimes added but not widely required.

*
Just a memo, Log required, a log.txt would be good, see tee.exe on internet that may help.
(check with VirusTotal with similar tools to avoid AV reports)
People mostly check log if something not work.

*
  • no indent for if..else block.
  • "," in anywhere
indent exists if you open within wb using wb-editor. (click small edit button at right of icon of any plugin)
you can replace "," with space " " if it is easier to understand for you.
In the end "," and " " is only a seperator.

*
Lnk
pecmd.exe link with pecmd.exe
or
nircmd.exe cmdshortcut with a nircmd.txt file
or
you may create a "sloreshortcuts.exe" to follow sloreshortcuts.json etc. at boot time.
..
All will work fast since subst not used, files available and shortcuts created at the early boot of pe (before shell - after letter assigned to Y:)

I like the idea of creating shortcuts at build time, but wimbuilder requiring a driveletter not looks good to me.
You can put an option "Create Shortcut at Build Time" and "Create Shortcut at Boot Time".
 We had done it before, probably options still exists at Win7PESE and Gena.  :thumbsup:

*
Just to clear,
I do not defend wb against .cmd,
I believe one can make a cmd builder (or a batch builder) following experience gained with wb,
.cmd is good since syntax info is all over internet.  :thumbsup:
Sadly at a point developers get very excited when they see increasing public interest on a pebuilder,
 and they do some "stupid" things which kills initial ideas.
  Always goes that way so far since 10 yeas,
    Life.....

*
Quote
To me, it is easier to port and test things from Win10XPE or Win10PESE to WimBuilder with such available option.
I hope you do soon.  :great:

well, I will add the feature soon.
To me top important.
It is easier to be able to test as fast as possible in this busy world.

See You around.
:turtle:
« Last Edit: November 20, 2018, 11:57:12 PM by Lancelot »

Re: WimBuilderUI - New Builder with WIN10XPE's core features
« Reply #19 on: November 21, 2018, 02:23:23 AM »

slore

  • Moderator, WimBuilder
  • Sr. Chef
  • *****
  • Date Registered: Jun 2016
  • Posts: 664
Hi, Lancelot

Thanks for your information.

DirDeleteQ -> Call,DirDelete        => rd
FileDeleteQ -> Call,FileDelete       => del
Download -> Call,Download         => missing , I'm lazy, I will put a wget.exe/curl.exe  :cool:
OpenDir -> Call,OpenDir              => VBS run
RunFromRAM -> RunFrom,RAM    => ?? I see this in apps plugin, but I don't know what it mean yet.

It seems that WB developer is not lazy/busy as me, I like use the ready-made.  :embarrassed:


Code: [Select]
TXTAddLine,%GTemp%\Explorer_AddFiles.txt,\Windows\resources\Themes\aero\shell,Append
to something like:
Echo \Windows\resources\Themes\aero\shell>>%GTemp%\Explorer_AddFiles.txt
WimBuilder combine the AddFiles.txt and .Script for a plugin to one main.bat, so I just need the
registry in script.

Quote
I do not see error check if file exist.
for the txtfile, yes it is missing, add one line ahead:
if not exist "%~1" goto :EOF

for the notepad.exe?
that is why I use pushd.
start "" /d "D:\1" notepad.exe 1.txt
don't start the "D:\1\notepad.exe" but system notepad.exe, pushd make it be prior,
 if it not exsit, will auto start one under the "PATH" envvar, I needn't check it.

Code: [Select]
Just a memo, Log required, a log.txt would be good, see tee.exe on internet that may help.
I'm working on it. my cmd's buff is set to 3000 lines, so I check after the build, but is not good future to share and help people find their problem.

there is WB_LOG.cmd in bin, people can put log and a noticed color message, but it not useful for building.

1-exec one will show the building message in the HTA, but when I use NSudo.exe to graint the TrustInstaller right,
it start a new windows. Yestoday I found out there is a NSudoC.exe for commandline, and it has keep the Console message option.

I will replace NSudo to NSudoC, and add tree button for "save the HTA result", "copy the HTA result", "open the log file"...
I'm not good at the UI layout, maybe the UI need be redesign later.
Shoud I leave a "Echo on"/"Echo off" option for see more details of the batch patches building message?
or leave people set it on the main.bat as necessary by themself?

Quote
I like the idea of creating shortcuts at build time, but wimbuilder requiring a driveletter not looks good to me.
Why wimbuilder needs a driveletter?
* when you change things in "X", it does in the PE as same.
   copy abc X:\Windows => boot.wim\Windows\abc => PE's X:\Windows\abc
   no matter doing by script, or doing in manual.

* short path when people want to modify files.
   del /f X:\Windows\System32\abc.dll
   xcopy X\ X:\

* shortcuts or something relative to the real path in PE, it will be the same.
   If I change the shortcuts some option that LINK,nircmd don't have, I can set it manual in drive X:\ without error cause by the TARGET path.
   and "nircmd.exe X:\ProFile\abc.exe" will be simple. I can save the parameter about file/target path, be cause they are same in PE.

well, as someone needn't it, I will change it to be option.
  • subst the mounted folder

--------------------------------------------(hidden if not check)
A: B: V: W: X: Y: Z:
--------------------------------------------
%X% => Wimbuilder2\_Factory_\build\WIN10XPE\mounted or %X% => X: or Y:
(I will replace %X%:\ => %X%\ in WIN10XPE)

also they are some "NOTICE" message, I will leave a "X" button for close it,
and auto save the settings as others, make people just see them in the first run, since they already know the option's mean.

Quote
Just to clear,
I do not defend wb against .cmd
OK, I got this point. you give more about the .script things.  :thumbsup:

 :mellow: with the discussion, too many UI improve come out...
my porting work...will be later.

TODO:
1.auto save the selection(first one)
    save the settings on every change? or just on close() be enugh?
    need go to patch page direct?

2. build log

3. make "subst drive" be option

4. notice message could be hidden after read
« Last Edit: November 21, 2018, 02:29:33 AM by slore »

 

Powered by EzPortal