Thank you for your answer. Indeed, the problem does not appear in Win7, Win8.1 and later version. Is there no way if I just want to use the original Win8 setup? Even lower versions like Win7 don't have this problem. I don't understand why does this problem occur in Win8?
The obvious answer if wimlib fails for whatever reason is use dism. Eventually test an older wiblib build, eventually report the problem in the wimlib forum.
I extracted winre.wim from install.wim. Then delete winre.wim in install.wim. Export boot.wim, install.wim, winre.wim together and compress them into one esd file. Doing so reduces file size. I made the script to revert to the standard install.wim for convenience. The final step is to add winre.wim to install.wim. Using dism requires mounting, then saving and unmounting. This is undoubtedly very time-consuming compared to wimlib. I already reported this issue on wimlib forum two days ago. But there has been no reply.
Sure, but the whole idea of using a ISO and setup.exe is a very time consuming compared to just applying images or using native vhds. Personally I never use ISO sitce the were made obsolete by the evolution. And never used winre in my life. If I have a problem I just start from a parallel OS and fix the one that has troubles.[/QUOTE]
Just tested, wimlib-imagex v1.8.0 was the last one that worked fine. Started getting errors from v1.8.1.
It was easy to guess it was a regression, very likely a byproduct of changes introduced to support the latest dism features. The lack of testing on an unsupported OS that almost nobody uses anymore completed the scenario,