slorelee / wimbuilder2

wimbuilder with new UI & new syntax (hta+bat+vbs+js)
470 stars 105 forks source link

A few small changes #64

Closed rupelodn closed 2 years ago

rupelodn commented 2 years ago

Hi slore, here are a few small changes: rewrote Explorer++ to automatically detect the language, fixed the WimBuilder2\Projects\WIN10XPE\00-Configurations\x-Account\Admin\SwitchToAdmin file.bat - the value of custom_admin_name has not changed. And the Explorer label was localized using shell32.dll like the command line. I wrote down all the explanations in the commits.

slorelee commented 2 years ago

@rupelodn

Thanks for the contribution.

I amend the "Smal fixes" commit with next commit log, and merged to master.

SHA-1: 3c1ffadd7f80b5853c08eaccd37411c1c838bec9
* update for localization

About rewrote Explorer++ to automatically detect the language, I updated the Explorer++\main.bat, and pushed it on Apps/Explorer++ branch. You can review the code if it works on your side. If that is OK, I will close this PR.

Create pullrequest with next rule, will be good to merge.

slorelee commented 2 years ago

Something with the MACRO:

call App pull will set the APP_FILE var automatically. It can be use to the V2X with %APP_FILE%.

App macro also set next vars. WimBuilder2\lib\macros\App.cmd

:INFO
if /i "x%1"=="xINFO" shift
set "APP_FILE[dp]=%~dp1"
set "APP_FILE[n]=%~n1"
set "APP_FILE[x]=%~x1"
goto :EOF
rupelodn commented 2 years ago

Hi slore, the code is working correctly, but it is not optimized. I'm sorry for the mistakes I made, Do not add Explorer++\main.bat, I will fix it. I'll rewrite it again, I made a few mistakes with extra variables. In the next commit, I will provide it separately within a day. One more point: you can not add information about the language to the registry - at the first launch, the desired language will turn on automatically if its dll is present. I checked this moment separately - I started Explorer++, and the Russian language was installed automatically. I assume that the exception will be the 3 languages that I commented out at the end, these are the ones listed after the marker :MANUAL. There is no localization in Windows for these languages.

rupelodn commented 2 years ago

The %APP_File% variable failed the second time. She unpacked the program, but the language file was ignored. I thought to leave everything as you have for the Chinese language, it turned out like this: The program was downloaded and unpacked, text documents were cleaned, the archive with the Russian language was downloaded, the program was unpacked again. result: there is a program and text files inside, but there is no language. Therefore, when downloading and unpacking the language, I will specify the real file name instead of the variable.

rupelodn commented 2 years ago

Another big problem is that the code doesn't jump. I found out about it after several checks. It is assumed that when the language is automatically detected, the batch file is terminated. So I write: goto :EOF. But the processing does not stop, the batch file will continue to work. he needs to find the marker :EOF, but it's not there. I commented out Farsi for verification, and it was added. As a result, I got Explorer++ with two language files - Russian and Farsi. The Russian language value was written in the registry, then it was changed to Farsi. Here is such a study. And the Microsoft documentation says that this file completion should be without a colon. Here I specifically found the links: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/goto or https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/goto In general, if you need to complete a batch file, I now write: "goto eof". Bottom line: the code has been rewritten, it works as expected. First the build takes place, then the language auto-detection. If the desired language is not detected, the "MANUAL" marker will be triggered. When the user uncomments something in it, it will be added. In the next commit I will update Explorer++.

slorelee commented 2 years ago

the archive with the Russian language was downloaded, the program was unpacked again. result: there is a program and text files inside, but there is no language.

I tested origin/Apps/Explorer++ branch, the :BUILD will unpacked the Explorer++.exe, and the :GETLANGPACKS will unpacked the explorer++_1.3.5_RU.zip, the program didn't extract twice.

https://github.com/slorelee/wimbuilder2/commit/47baa8065af0f48ae5fb52fd02d973870a8fcf2f

About goto :EOF

Remark you use the goto command with a target label of :EOF, you transfer control to the end of the current batch script file and exit the batch script file without defining a label.

I use call :GETLANGPACKS, it will make the :LABEL work like a function, and the goto :EOF will act as end the function than end the batch script.

Here is a version for testing.(rename to main_test.bat, and double click to run.) main_test.bat.txt

rupelodn commented 2 years ago

Hi, slore, I'm completely confused... I tested the attached file and looked at your version of main.bat. In any case, your variant works better. I didn't figure out the functions either - I was still thinking from my experience of creating a talking boot floppy... And I also didn't immediately notice the message from you and hurried to send another pull request. Do you have such rights to remove my commits from my copies as well? I'm a beginner here, I'm afraid to touch too much.

rupelodn commented 2 years ago

Hello slore! It seems I'm gradually starting to figure it out. What are my actions next? Or will it already get into the general Master? I apologize for the inconvenience.

slorelee commented 2 years ago

I apologize for the inconvenience.

No need apologize for about the git operation. Thanks for the contribution.

This commit already merge into slorelee/wimbuilder2/master branch. No more action to do.

rupelodn commented 2 years ago

Ok, thanks!