Topic: PEBakery Release  (Read 14560 times)

PEBakery Release
« on: December 16, 2017, 05:41:58 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
What is PEBakery?
PEBakery is a builder specialized in customizing Windows PE.
It is intended to be used with projects such as Win10PESE, Win10XPE, MistyPE and ChrisPE.

Why PEBakery was written?
PEBakery is compatible with WinBuilder 082.
Projects like Win10PESE are dependent on WinBuilder 082, but WB082's development went discontinued.
PEBakery works as a drop-in replacement of WB082, while providing much improved envrionment.

Download
Binary and source of PEBakery can be downloaded from github.
Nightly binary can be downloaded from here, thanks to AppVeyor service.

Source
PEBakery is a open source software, licensed under GPLv3.
Source of PEBakery can be downloaded in GitHub.
Bug report or Pull request is always welcome.

How to Test
.Net Framework 4.7.1 and Windows 7 or upper is required to run PEBakery.
1. Download PE project zip distribution and extract it. (e.g. ChrisPE, Win10XPE)
2. Put 'Binary' and 'PEBakeryLauncher.exe' in project root (the directory where Project directory resides in).
3. Read NOTICE_SHOULD_READ_FIRST.txt and follow instructions.
4. Run 'PEBakeryLauncher.exe' with admin privilege.
5. Configure project and run. Compare with WinBuilder 082 (which is bundled by default).

Documentation
Specification of PEBakery script language is being done in GitHub.

Disclaimer
- All implementation is only backed by documentation and black box testing, without violating WinBuilder 082's EULA.
- I do not provide any warranty, use at your own risk. Backup is highly recommended.
- Windows Preinstalled Environment is a registered trademark of Microsoft.
« Last Edit: September 08, 2018, 01:32:37 PM by ied206 »

Re: PEBakery Release
« Reply #1 on: December 16, 2017, 05:45:10 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
Latest Stable Version
Visit github release page.
Download

Latest Nightly Version
Nightly version reflects the bleeding edge development version. There may exist bugs, so use with care!

1. Download the proper version of PEBakery
Download stable  release and nightly release.

2. Copy PEBakery binaries
Unzip PEBakery stable to %BaseDir%. Delete directory Binary, and unzip PEBakery nightly. Rename the directory Release to Binary.

3. Turn on compatibility optionss
For Win10PESE and Win10XPE, turning on compatibility options is required.
Create PEBakery.ini in %BaseDir% and paste these snippets:
Code: [Select]
[Compat]
AsteriskBugDirCopy=True
AsteriskBugDirLink=True
FileRenameCanMoveDir=True
AllowLetterInLoop=True
LegacyBranchCondition=True
LegacyRegWrite=True
AllowSetModifyInterface=True
LegacyInterfaceCommand=True
IgnoreWidthOfWebLabel=True
OverridableFixedVariables=True
EnableEnvironmentVariables=True
With this settings PEBakery simulates WinBuilder's bugs and quirks.

4. Build!
Run PEBakery.exe, press build button, see the result.
If you want to inspect logs, press the log button and export build log.
« Last Edit: July 30, 2018, 02:22:51 AM by ied206 »

Re: PEBakery Release
« Reply #2 on: December 16, 2017, 05:53:30 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
Build 20171216

Changelog
- Fix TXTDelLineOp optimization bug
- Fix NullReferenceException in System,RefreshInterface
- Disable System,SaveLog when logger is turned off
- Recognize "PathSetting=False" in "script.project - [Main]" and disable path setting.
- Prevent possible UI exceptions.
- "[Main] - Description=" line is no longer mandatory in plugin.
- CodeParser.GetNextArgument will not slice argument with "".
- Support legacy branch condition when compatibility option is set.
- Support 4-argument 0x7 RegWrite.
- Do not touch escape characters when setting variables.
- Ignore the plugin itself in "[Main] - Disable" directive.
  It fixes a bug VMWare.script is uncheckable.
- TXTReplace will be optimized to TXTReplaceOp if condition is met.
- IniReadOp will set varible to empty string when key is not found.
- Do not escape variables imported from interface.
- Pressing Update button of LogWindow while building no longer crashes program.
- Log stdout and stderr in ShellExecute,Hide.
- Implement ShellExecute,Min.
- Implement GetParam, PackParam.
- Implement "#a" to track section parameter count.
- Allow "-" in variable name, for compatibility with Gena_Meal.
- Fix IOException in CopyOrExpand.
- Fix UIParser to recognize tooltip in TextFile

1. Update to .Net Framework 4.7.1
PEBakery uses several libraries.
Update of some library caused PEBakery to malfunction (problem with .Net Standard 2.0), so I had to update .Net Framework to 4.7.1.

2. [New] PathSetting
Adding these lines into script.project will disable path textboxs of SettingWindow.
Code: [Select]
[Main]
...
PathSetting=False
...

3. [New] ShellExecute
ShellExecute,Min added to execute programs minimized.
ShellExecute,Hide will show and log stdout and stderr.

4. [New] parameter count token #a
To deprecate PackParam, #a token is added.
When used in command, #a denotes section parameter's number.
« Last Edit: December 16, 2017, 05:59:44 AM by ied206 »

Re: PEBakery Release
« Reply #3 on: December 24, 2017, 05:14:52 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
Build 20171225

Changelog
Fixed:
- Fix FileBox to handle root directory path correctly.
- Encode command no longer duplicate entry under [EncodedFolders]
- Launcher.exe will alert user to update .Net Framework if 4.7.1 is not installed.
- Prevent crash in PluginEditButton.

Added
- ShellExecuteSlow, a variant of ShellExecute to run process in BelowNormal Priority.
- ShellExecute's Standard Output Redirect TextBox will be autoscrolled.
- ShellExecute's Standard Output Redirect can be hidden in Setting.
- Implemented EchoFile command.
- .db files are moved info database directory.
- Implemented System,SetLocal|EndLocal, and #r.
- Implemented System,Load.
- System,LoadAll as a new alias of System,RescanScripts.
- New setting to let user choose custom code editor.
- Display line number in error or warning log.
- Implemented INIReadSection.

1. Alert user to install .Net Framework 4.7.1
Launcher.exe now depends on .Net Framework 4.6.2, and alert user to install .Net Framework 4.7.1 if not installed.
4.6.2 was chosen because it is the minimal version supports HiDPI natively.

- Speculations
Launcher.exe's target framework can be lowered more, minimum 4.0 (Windows 8 has this by default).
.Net Framework 4.0 is not installed in Windows 7 by default, but it cannot be trageted.
It is because starting from Windows 8, Microsoft ommited .Net Framework 3.5 in default install.

2. Display Line Number in Error Logs
PEBakery will display line number along with code in error logs.
It will help troubleshooting bugs in .script files.

3. [New] System,SetLocal|EndLocal, #r
I noticed Macro Library relies on section parameters rather than local variables.
I guessed it is because using local variable in macro call can affect other plugins.
Using section parameter as a free memory slot can also cause PackParam to malfunction, unable to count parameter number (#a).
To solve these problem, System,SetLocal and System,EndLocal is introduced from cmd syntax.

After calling System,SetLocal, all modification to local variables are isolated.
To end isolation call System,EndLocal. System,EndLocal will be called automatically when a section exits.
System,EndLocal will revert local variable state to before calling System,SetLocal.
Its logic is similar with how Windows isolate envrionment variable in batch file.

New token #r is introduced to be used as return value.
#r is not affected by SetLocal and EndLocal, and it does not affect parameter number counting in PackParam or #a.
Its value cannot be guaranteed to survive another macro/section call, so copy value into local variables to preserve.
(Think how EAX hold return value in x86 assembly language).

Code: [Select]
[Process]
Set,%B%,F
Run,%ScriptFile%,A
Echo,B = %B%
Echo,C = %C%
Echo,R = #r

[A]
System,SETLOCAL
Set,%B%,T
Set,%C%,T
Set,#r,T
System,ENDLOCAL

Code: [Select]
Result:
B = F
C = %C%
R = T

4. [New] System,Load
New syntax to refresh/load plugin introduced.

Code: [Select]
System,Load,<FilePath>,[NOREC]

In FilePath, wildcard can be used. Unless NOREC flag is used, PEBakery will search for file recursively.

System,RescanScripts now have an alias, to match terminoloy with System,Load.
Code: [Select]
System,LoadAll

- Limitation
PEBakery cannot fully refresh current plugin.
Code: [Select]
System,Load,%ScriptFile%
Refreshed plugin is applied in next build run, not in current build run.
-> Using System,Load,%ScriptFile% in interface button is okay.
-> Using System,Load,%ScriptFile% in project building is not okay.
It is due to PEBakery's internal design, modifing architecture will require many changes.

Discussed in this topic.

5. [New] INIReadSection
See the manual in GitHub.


Re: PEBakery Release
« Reply #4 on: January 02, 2018, 05:49:47 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
Build 20180103 (Beta 1)

EDIT
Beta 1 was taken down because of potential license issue.
Please use beta 2 or later, sorry for inconvenience.

Changelog
- [Added] ReadInterface, WriteInterface
- [Added] WimMount, WimUnmount
- [Added] ProgressBar for WebGet/WimMount/WimUnmount
- [Added] Flag GLOBAL introduced to SetMacro
- [Added] FileCopy/RegWrite produce LogState.Overwrite instead of LogState.Warning
- [Added] Print summary of warning as well as error in exported log.

- [Changed] Improved Console Output in ShellExecute,Hide.

- [Fixed] Handle negative number properly in Command 'If'.
- [Fixed] Fix hang in System,Cursor.
- [Fixed] Fix hang in UserInput,Dir.
- [Fixed] Fix crash in SettingWindow.
- [Fixed] OnPluginExit/OnBuildExit produces proper #1 argument.
- [Fixed] ShellExecute,Hide,XCOPY.exe,... now work properly on Windows 7


1. Improved Console Output in ShellExecute,Hide
PEBakery will display and log stdout and stderr as unified one output, to simulate real console print.

2. ReadInterface, WriteInterface
This command is a native version of Macro Library's ChangeInterface.
See manual for usage.

3. WimMount, WimUnmount
New commands for handling wim files are being added.
WimMount and WimUnmount depends on wimgapi, and the other commands are planed to use wimlib.
See manual for usage.

4. ProgressBar for Current Command
PEBakery will display current progress in some commands.
Currently WebGet, WimMount, WimUnmount is supported.
ila_rendered

5. FileCopy/RegWrite produce [Overwrite] log instead of [Warning] log
PEBakery was producing too much overwrite warning, making hard to find more important warnings.
So FileCopy and RegWrite will generate [Overwrite] log instead of [Warning].
« Last Edit: January 20, 2018, 08:23:43 PM by ied206 »

Re: PEBakery Release
« Reply #5 on: February 24, 2018, 05:34:56 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
PEBakery Beta 3
Commands for wim file mainpulation are added as main feature, powered by wimlib.
Manual for new commands can be found here.

You can download binary and source from github.

Special thanks to PEBakery Team and wimlib.

Changelog
- [ADD] Commands for wim file
- [ADD] Command LoopLetter
- [ADD] Show url of WebLabel as tooltip
- [ADD] Caption can be specified in Bevel
- [ADD] NT6 Style FolderBrowserDialog
- [ADD] Indicate build progress on taskbar
- [FIX] Before execution of scripts run `script.project`
- [FIX] Missing formats added to StrFormat,Date
- [FIX] Drive letter support for StrFormat,Inc/Dec
- [FIX] Escape characters interpreted case insensitive properly
- [FIX] Escape character `##` works properly with `#c`, `#a`, `#r`

Re: PEBakery Release
« Reply #6 on: June 03, 2018, 02:02:41 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
PEBakery Beta 4
Script Editor is finally implemented!
Beta 4 also includes many bugfixs and new features.

You can download binary and source from github.

PEBakery manual and syntax highlighter was also updated.
- Manual : English
- Syntax Highlighter : Notepad++, Visual Studio Code


Changelog
- [ADD] Script header/logo/interface/attachment editor
- [ADD] Runtime optimization of WimPath*, WimExtract, ReadInterface, WriteInterface
- [ADD] Compression method can be set when using Encode (None, Deflate, LZMA2)
- [ADD] Error in WimExtractBulk can be suppressed by using NOERR flag
- [ADD] Optimized memory usage when attaching/extracting files from script
- [ADD] WebGet saves HTTP status code into %StatusCode%
- [ADD] Implemented RegCopy
- [ADD] Support more properties in ReadInterface and WriteInterface
- [CHANGE] Treat %SourceDir% , %ISOFile%, %TargetDir% as global variables
- [CHANGE] Fixed variables are no longer overridable
- [CHANGE] Deprecate environment variables
- [FIX] Directory link (folder.project) support
- [FIX] Report error when WimExtract cannot find single file
- [FIX] Nested System,SetLocal support
- [FIX] Proper implementation of System,ErrorOff
- [FIX] Web browser is no longer launched as Adminstrator in WebLabel control
- [FIX] Display caption of Bevel control by default
- [FIX] Logging is enabled by default in interface button
- [FIX] Use default encoding of console in ShellExecute console ouput


1. Script Editor
Script's header, interface, logo, attachment now can be handled in internal script editor.
ila_rendered
ila_rendered
ila_rendered

2. Enabled Logging in Interface Button
Starting from Beta 4, interface button's action is logged with minimal slowdown.
It was disabled in the past due to performance impact, but it was fixed.

3. LZMA2 Compression
WinBuilder 082 compresses attached file with deflate (used in .zip, .gz) algorithm.
For better compression rate, PEBakery now supports LZMA2 (used in .7z, .xz) algorithm.
Ex) Encode command was updated, see manual

4. Partial Intellisense for Visual Studio Code
PEBakery extension 1.0.3 for VSCode now provides command snippet.
ila_rendered
« Last Edit: June 03, 2018, 02:13:38 PM by ied206 »

Re: PEBakery Release
« Reply #7 on: September 08, 2018, 01:07:48 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 257
PEBakery Beta 5 (v0.9.5.1)
PEBakery Beta 5 is released!
Beta 5 fixed many bugs and focused on compatibility.

You can download binary and source from github.

PEBakery manual and syntax highlighter were also updated.
- Manual : English, Spanish
- Syntax Highlighter : Notepad++, Visual Studio Code

Please note there are two version of beta 5, v0.9.5 and v0.9.5.1.
Please use v0.9.5.1 since it fixes some issues of v0.9.5.

NOTICE - SHOULD READ FIRST!
Starting with beta 5, all compatibility options are turned off by default.
You should set appropriate compatibility options to build legacy projects successfully.
Presets are provided for known projects.

To build Win10PESE or Win10XPE, rename PEBakery_Win10PESE_Win10XPE.ini to PEBakery.ini.
To build ChrisPE or MistyPE, rename PEBakery_ChrisPE_MistyPE.ini to PEBakery.ini.
If a build fails even after applying presets, try deleting project temp directories.

Changelog
- [ADD] `List` commands added
- [ADD] `StrFormat,Left` and `StrFormat,Right` added
- [ADD] Full deferred logging for interface build
- [ADD] Command's real position is shown in warning and error logs
- [ADD] Filtering comments and macros are supported in LogWindow
- [ADD] Section out parameter support (e.g. `#o1`, `#o2`), ...
- [ADD] `RunEx`, `LoopEx` and `LoopLetterEx` added to support section out parameter
- [ADD] Compatibility options for turning off extended section parameter (`#r`, `#a`, `#o1`)
- [ADD] Compatibility options are turned off by default
- [CHANGE] `IniReadSection` redesigned
- [CHANGE] Allow short terms in `Message`
- [CHANGE] Interface value of `TextLabel` is also saved to variables when running a script
- [FIX] `UserInput,Dir` no longer crashes
- [FIX] `#r`, `#a` is matched case-insensitively
- [FIX] `SaveLog` produces a proper log when deferred logging is set
- [FIX] Scripts are ordered like the Windows File Explorer
- [FIX] Proper refresh of MainScript
- [FIX] Script editor correctly reflects any changes made by a user
- [FIX] Prevent crash from a race condition in `ShellExecute`
- [FIX] Fix rare crash when opening script source
- [FIX] Saving settings no longer crashes when no projects are loaded
- [FIX] Several regressions affected build of Win10PESE and Win10XPE are fixed
« Last Edit: September 08, 2018, 01:11:47 PM by ied206 »

 

Powered by EzPortal