As of today, there are no 5.6.0 *.zip archives provided by getGamePackages. Hence, the update_gi.sh script will stop receiving update information.
On my system, HoYoPlay saves HDIFF files to /path/to/game/ldiff. Other launchers might already have reverse-engineered this part. Thus, I wonder:
Is there any demand for an update script?
EDIT: I will continue the development at 16:00 UTC+0 to at least have one alternative way to update the game in case Wine/Proton break the official launcher once again.
EDIT 2 (2025-06-16): The bash update script was replaced by a python script to deal with the protobuf data more easily. Check the updater/ directory for details.
As of today, there are no 5.6.0 *.zip archives provided by `getGamePackages`. Hence, the `update_gi.sh` script will stop receiving update information.
On my system, HoYoPlay saves `HDIFF` files to `/path/to/game/ldiff`. Other launchers might already have reverse-engineered this part. Thus, I wonder:
Is there any demand for an update script?
EDIT: I will continue the development at 16:00 UTC+0 to at least have one alternative way to update the game in case Wine/Proton break the official launcher once again.
---
EDIT 2 (2025-06-16): The bash update script was replaced by a python script to deal with the protobuf data more easily. Check the `updater/` directory for details.
I mostly sticked to using the update_gi.sh because I was too lazy to convert my setup to use the launcher and it Just Worked™. I guess I will start doing this now, though, since I've been using HoYoPlay quite successfully with ZZZ so far.
Edit: Well, and that's done.
I mostly sticked to using the `update_gi.sh` because I was too lazy to convert my setup to use the launcher and it Just Worked™. I guess I will start doing this now, though, since I've been using HoYoPlay quite successfully with ZZZ so far.
Edit: Well, and that's done.
Anyway - after a few hours of coding I ended up with a script that is capable of providing an alternative to the official launcher, offering the following features:
New game installs, including voiceover packs
Game updates, including voiceover packs
Path protection (the script may only write to the game dir or its tmp)
Yet not implemented:
Integrity check after a completed install/update
Game repair
ldiff cleanup
BiliBili special handling (if there is any)
To test the script, --no-dry-run must be specified. If you (anyone) feel lucky, I would greatly appreciate some feedback.
Cheers!
EDIT 2025-05-10: Updated to current progress.
Anyway - after a few hours of coding I ended up with a script that is capable of providing an alternative to the official launcher, offering the following features:
* New game installs, including voiceover packs
* Game updates, including voiceover packs
* Path protection (the script may only write to the game dir or its `tmp`)
Yet not implemented:
* Integrity check after a completed install/update
* Game repair
* ldiff cleanup
* BiliBili special handling (if there is any)
To test the script, `--no-dry-run` must be specified. If you (anyone) feel lucky, I would greatly appreciate some feedback.
Cheers!
EDIT 2025-05-10: Updated to current progress.
@hyperstown Thank you for reporting. I did in fact test the script using the main game exe patch, which had a zero offset, thus working without issues. This issue is now resolved as of commit b622128.
@hyperstown Thank you for reporting. I did in fact test the script using the main game exe patch, which had a zero offset, thus working without issues. This issue is now resolved as of commit b622128.
INFO Downloading diff for'GenshinImpact_Data/StreamingAssets/VideoAssets/StandaloneWindows64/Video_Reunion_56.usm', 51.1 MiB
-> 6f95135524a47348_019c13a486a2c7376b7c6792ebc187bc
DEBUG Download done
ERROR Failed to patch file'Video_Reunion_56.usm' using '6f95135524a47348_019c13a486a2c7376b7c6792ebc187bc':
Exit code: 2Message: open oldFile forread ERROR!
Thanks for a fix @Krock! Now it fails later on:
```
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/VideoAssets/StandaloneWindows64/Video_Reunion_56.usm', 51.1 MiB
-> 6f95135524a47348_019c13a486a2c7376b7c6792ebc187bc
DEBUG Download done
ERROR Failed to patch file 'Video_Reunion_56.usm' using '6f95135524a47348_019c13a486a2c7376b7c6792ebc187bc':
Exit code: 2
Message: open oldFile for read ERROR!
```
Hmm. That's interesting. This file does not exist in 5.5.0, and yet they somehow managed to generate a diff for it. As of commit 9427833, the script will fall back to chunk downloading, just like with any other new file.
Hmm. That's interesting. This file does not exist in 5.5.0, and yet they somehow managed to generate a diff for it. As of commit 9427833, the script will fall back to chunk downloading, just like with any other new file.
At least we'll have safeguards for those edge cases.
But now I think we're getting to a difficult ones, because we're only have exit code and message is "error" lol
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/04/35424067.blk', 51.2 MiB
-> 0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60
DEBUG Download done
ERROR Failed to patch file '35424067.blk' using '0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60':
Exit code: 11
Message: patch run ERROR!
I tried deleting 0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60 and redownload it but result is the same.
At least we'll have safeguards for those edge cases.
But now I think we're getting to a difficult ones, because we're only have exit code and message is "error" lol
```
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/04/35424067.blk', 51.2 MiB
-> 0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60
DEBUG Download done
ERROR Failed to patch file '35424067.blk' using '0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60':
Exit code: 11
Message: patch run ERROR!
```
I tried deleting `0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60` and redownload it but result is the same.
ERROR Failed to patch file '35424067.blk' using '0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60':
Exit code: 11
Message: patch run ERROR!
Seeing the same error:
```
ERROR Failed to patch file '35424067.blk' using '0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60':
Exit code: 11
Message: patch run ERROR!
```
But now I think we're getting to a difficult ones, because we're only have exit code and message is "error" lol
The CLI of hpatchz with its help dialogue and error messages really would benefit from an overhaul. It is also inconsistent with the exit codes.
Turns out that I introduced this error by passing offset == 0 files directly to hpatchz. Fixed in ce776ba7a1.
> But now I think we're getting to a difficult ones, because we're only have exit code and message is "error" lol
The CLI of hpatchz with its help dialogue and error messages really would benefit from an overhaul. It is also inconsistent with the exit codes.
Turns out that I introduced this error by passing `offset == 0` files directly to hpatchz. Fixed in ce776ba7a1.
Still, inconsistent error code is better than none :P
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/00/14649115.blk', 76.8 MiB
-> c52c657c7402d54a_e3d203a36b01888126f1c2663421bfad
DEBUG Download done
ERROR Failed to patch file '14649115.blk' using 'c52c657c7402d54a_e3d203a36b01888126f1c2663421bfad':
Exit code: None
Message:
Retied it, downloaded bunch of other patch files and again errored (but on different file):
DEBUG Diff '7fdc141044369066_9f12d61780fe8101bf1fe8e9eef57a65' is already present. Skipping download.
ERROR Failed to patch file '05224243.blk' using '7fdc141044369066_9f12d61780fe8101bf1fe8e9eef57a65':
Exit code: None
Message:
Still, inconsistent error code is better than none :P
```
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/00/14649115.blk', 76.8 MiB
-> c52c657c7402d54a_e3d203a36b01888126f1c2663421bfad
DEBUG Download done
ERROR Failed to patch file '14649115.blk' using 'c52c657c7402d54a_e3d203a36b01888126f1c2663421bfad':
Exit code: None
Message:
```
Retied it, downloaded bunch of other patch files and again errored (but on different file):
```
DEBUG Diff '7fdc141044369066_9f12d61780fe8101bf1fe8e9eef57a65' is already present. Skipping download.
ERROR Failed to patch file '05224243.blk' using '7fdc141044369066_9f12d61780fe8101bf1fe8e9eef57a65':
Exit code: None
Message:
```
@hyperstownPopen.poll was not the correct function to use. Sometimes hpatchz was faster than Python (no error), else this error was raised. Good that I caught this case as well. It's fixed as of dad1f42.
@hyperstown `Popen.poll` was not the correct function to use. Sometimes hpatchz was faster than Python (no error), else this error was raised. Good that I caught this case as well. It's fixed as of dad1f42.
Traceback (most recent call last):
File "/home/vbox/dev/dawn/updater/updater.py", line 118, in <module>
main()
~~~~^^
File "/home/vbox/dev/dawn/updater/updater.py", line 60, in main
cli.apply_or_prepare_ldiff_files()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/vbox/dev/dawn/updater/sophon_api.py", line 1140, in apply_or_prepare_ldiff_files
self._apply_ldiff_file(ldiff_dir, v)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/home/vbox/dev/dawn/updater/sophon_api.py", line 1078, in _apply_ldiff_file
hpatchz_patch_file(gamefile, dstfile, ldiffname, pinfo.patch_offset, pinfo.patch_length)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vbox/dev/dawn/updater/sophon_api.py", line 207, in hpatchz_patch_file
pout, perr = proc.communicate(timeout=20)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 1222, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 2126, in _communicate
self._check_timeout(endtime, orig_timeout, stdout, stderr)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 1266, in _check_timeout
raise TimeoutExpired(
...<2 lines>...
stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[PosixPath('/home/vbox/dev/dawn/updater/HDiffPatch/hpatchz'), '-f', PosixPath('/mnt/ssd1/Lutris/genshin-impact/Genshin Impact/GenshinImpact_Data/StreamingAssets/AudioAssets/Streamed13.pck'), '/tmp/tmpvl22rf9n', PosixPath('/home/vbox/dev/dawn/updater/tmp/Streamed13.pck')]' timed out after 20 seconds
I increased the timeout to 60s but I can't rerun the script at this point:
INFO Selected branch 'main'
WARN Simulation mode is disabled.
WARN This script may not work perfectly. ENTER to proceed anyway.
INFO Release type: os
INFO Installed game version: 5.6.0
INFO config.ini: Game version 5.5.0
WARN config.ini and the actual installed game version differ!
DEBUG Loaded existing file 'getGameBranches.json'
INFO Sophon provides game version 5.6.0
DEBUG Found voiceover packs: ja-jp
===> Categories to update: game, ja-jp
DEBUG Loaded existing file 'getBuild.json'
DEBUG Loaded getBuild JSON
ERROR There is no update available.
It worked for a while and then it timeouted.
```bash
Traceback (most recent call last):
File "/home/vbox/dev/dawn/updater/updater.py", line 118, in <module>
main()
~~~~^^
File "/home/vbox/dev/dawn/updater/updater.py", line 60, in main
cli.apply_or_prepare_ldiff_files()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/vbox/dev/dawn/updater/sophon_api.py", line 1140, in apply_or_prepare_ldiff_files
self._apply_ldiff_file(ldiff_dir, v)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/home/vbox/dev/dawn/updater/sophon_api.py", line 1078, in _apply_ldiff_file
hpatchz_patch_file(gamefile, dstfile, ldiffname, pinfo.patch_offset, pinfo.patch_length)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vbox/dev/dawn/updater/sophon_api.py", line 207, in hpatchz_patch_file
pout, perr = proc.communicate(timeout=20)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 1222, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 2126, in _communicate
self._check_timeout(endtime, orig_timeout, stdout, stderr)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 1266, in _check_timeout
raise TimeoutExpired(
...<2 lines>...
stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[PosixPath('/home/vbox/dev/dawn/updater/HDiffPatch/hpatchz'), '-f', PosixPath('/mnt/ssd1/Lutris/genshin-impact/Genshin Impact/GenshinImpact_Data/StreamingAssets/AudioAssets/Streamed13.pck'), '/tmp/tmpvl22rf9n', PosixPath('/home/vbox/dev/dawn/updater/tmp/Streamed13.pck')]' timed out after 20 seconds
```
I increased the timeout to 60s but I can't rerun the script at this point:
```bash
INFO Selected branch 'main'
WARN Simulation mode is disabled.
WARN This script may not work perfectly. ENTER to proceed anyway.
INFO Release type: os
INFO Installed game version: 5.6.0
INFO config.ini: Game version 5.5.0
WARN config.ini and the actual installed game version differ!
DEBUG Loaded existing file 'getGameBranches.json'
INFO Sophon provides game version 5.6.0
DEBUG Found voiceover packs: ja-jp
===> Categories to update: game, ja-jp
DEBUG Loaded existing file 'getBuild.json'
DEBUG Loaded getBuild JSON
ERROR There is no update available.
```
@hyperstown As of ba643be there is now a log entry to find out which patch took too long to apply. After a 50 second timeout, it will retry for 3 minutes. The update can be resumed now.
@hyperstown As of ba643be there is now a log entry to find out which patch took too long to apply. After a 50 second timeout, it will retry for 3 minutes. The update can be resumed now.
As of today, there are no 5.6.0 *.zip archives provided by
getGamePackages
. Hence, theupdate_gi.sh
script will stop receiving update information.On my system, HoYoPlay saves
HDIFF
files to/path/to/game/ldiff
. Other launchers might already have reverse-engineered this part. Thus, I wonder:Is there any demand for an update script?
EDIT: I will continue the development at 16:00 UTC+0 to at least have one alternative way to update the game in case Wine/Proton break the official launcher once again.
EDIT 2 (2025-06-16): The bash update script was replaced by a python script to deal with the protobuf data more easily. Check the
updater/
directory for details.I mostly sticked to using the
update_gi.sh
because I was too lazy to convert my setup to use the launcher and it Just Worked™. I guess I will start doing this now, though, since I've been using HoYoPlay quite successfully with ZZZ so far.Edit: Well, and that's done.
Anyway - after a few hours of coding I ended up with a script that is capable of providing an alternative to the official launcher, offering the following features:
tmp
)Yet not implemented:
To test the script,
--no-dry-run
must be specified. If you (anyone) feel lucky, I would greatly appreciate some feedback.Cheers!
EDIT 2025-05-10: Updated to current progress.
Hi, I tested updating
python updater.py "~/Games/genshin-impact/Genshin Impact" --update --no-dry-run
and it fails in ldiff.INFO Downloading ldiff files ... INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/00/15409805.blk', 99.9 MiB -> b80f0c41b7026e78_468369da2575a9fa92eb3e55127f2263 DEBUG Download done ERROR Failed to patch file '15409805.blk' using 'b80f0c41b7026e78_468369da2575a9fa92eb3e55127f2263': Exit code: None Message: oldFile dataSize 47036298 != diffFile saved oldDataSize 36989121 ERROR!
@hyperstown Thank you for reporting. I did in fact test the script using the main game exe patch, which had a zero offset, thus working without issues. This issue is now resolved as of commit b622128.
Thanks for a fix @Krock! Now it fails later on:
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/VideoAssets/StandaloneWindows64/Video_Reunion_56.usm', 51.1 MiB -> 6f95135524a47348_019c13a486a2c7376b7c6792ebc187bc DEBUG Download done ERROR Failed to patch file 'Video_Reunion_56.usm' using '6f95135524a47348_019c13a486a2c7376b7c6792ebc187bc': Exit code: 2 Message: open oldFile for read ERROR!
Hmm. That's interesting. This file does not exist in 5.5.0, and yet they somehow managed to generate a diff for it. As of commit 9427833, the script will fall back to chunk downloading, just like with any other new file.
At least we'll have safeguards for those edge cases.
But now I think we're getting to a difficult ones, because we're only have exit code and message is "error" lol
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/04/35424067.blk', 51.2 MiB -> 0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60 DEBUG Download done ERROR Failed to patch file '35424067.blk' using '0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60': Exit code: 11 Message: patch run ERROR!
I tried deleting
0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60
and redownload it but result is the same.Seeing the same error:
ERROR Failed to patch file '35424067.blk' using '0b50021bc9eaf519_6f9e5a73d1dd6488cef4f85e4a36be60': Exit code: 11 Message: patch run ERROR!
The CLI of hpatchz with its help dialogue and error messages really would benefit from an overhaul. It is also inconsistent with the exit codes. Turns out that I introduced this error by passing
offset == 0
files directly to hpatchz. Fixed in ce776ba7a1.Still, inconsistent error code is better than none :P
INFO Downloading diff for 'GenshinImpact_Data/StreamingAssets/AssetBundles/blocks/00/14649115.blk', 76.8 MiB -> c52c657c7402d54a_e3d203a36b01888126f1c2663421bfad DEBUG Download done ERROR Failed to patch file '14649115.blk' using 'c52c657c7402d54a_e3d203a36b01888126f1c2663421bfad': Exit code: None Message:
Retied it, downloaded bunch of other patch files and again errored (but on different file):
DEBUG Diff '7fdc141044369066_9f12d61780fe8101bf1fe8e9eef57a65' is already present. Skipping download. ERROR Failed to patch file '05224243.blk' using '7fdc141044369066_9f12d61780fe8101bf1fe8e9eef57a65': Exit code: None Message:
@hyperstown
Popen.poll
was not the correct function to use. Sometimes hpatchz was faster than Python (no error), else this error was raised. Good that I caught this case as well. It's fixed as of dad1f42.It worked for a while and then it timeouted.
Traceback (most recent call last): File "/home/vbox/dev/dawn/updater/updater.py", line 118, in <module> main() ~~~~^^ File "/home/vbox/dev/dawn/updater/updater.py", line 60, in main cli.apply_or_prepare_ldiff_files() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/home/vbox/dev/dawn/updater/sophon_api.py", line 1140, in apply_or_prepare_ldiff_files self._apply_ldiff_file(ldiff_dir, v) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/home/vbox/dev/dawn/updater/sophon_api.py", line 1078, in _apply_ldiff_file hpatchz_patch_file(gamefile, dstfile, ldiffname, pinfo.patch_offset, pinfo.patch_length) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vbox/dev/dawn/updater/sophon_api.py", line 207, in hpatchz_patch_file pout, perr = proc.communicate(timeout=20) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "/usr/lib/python3.13/subprocess.py", line 1222, in communicate stdout, stderr = self._communicate(input, endtime, timeout) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/subprocess.py", line 2126, in _communicate self._check_timeout(endtime, orig_timeout, stdout, stderr) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/subprocess.py", line 1266, in _check_timeout raise TimeoutExpired( ...<2 lines>... stderr=b''.join(stderr_seq) if stderr_seq else None) subprocess.TimeoutExpired: Command '[PosixPath('/home/vbox/dev/dawn/updater/HDiffPatch/hpatchz'), '-f', PosixPath('/mnt/ssd1/Lutris/genshin-impact/Genshin Impact/GenshinImpact_Data/StreamingAssets/AudioAssets/Streamed13.pck'), '/tmp/tmpvl22rf9n', PosixPath('/home/vbox/dev/dawn/updater/tmp/Streamed13.pck')]' timed out after 20 seconds
I increased the timeout to 60s but I can't rerun the script at this point:
INFO Selected branch 'main' WARN Simulation mode is disabled. WARN This script may not work perfectly. ENTER to proceed anyway. INFO Release type: os INFO Installed game version: 5.6.0 INFO config.ini: Game version 5.5.0 WARN config.ini and the actual installed game version differ! DEBUG Loaded existing file 'getGameBranches.json' INFO Sophon provides game version 5.6.0 DEBUG Found voiceover packs: ja-jp ===> Categories to update: game, ja-jp DEBUG Loaded existing file 'getBuild.json' DEBUG Loaded getBuild JSON ERROR There is no update available.
@hyperstown As of ba643be there is now a log entry to find out which patch took too long to apply. After a 50 second timeout, it will retry for 3 minutes. The update can be resumed now.
Looks like now it finishes without an issue! Let me know if you want more help with testing.