ip7z / 7zip

7-Zip
695 stars 71 forks source link

wim support #40

Open Quqas opened 3 months ago

Quqas commented 3 months ago

Почему на чтение открывает все wim файлы, а на изменение\удаление содержимого далеко не все. (от вида сжатия не зависит)

Часто пишет "Some files have incorrect reference count" и изменить ничего не даёт.

Вам известны "правильные" параметры в командной строке dism, для того чтобы создать wim который 7zip сможет открыть для изменения? Или это от версии dism зависит?

ip7z commented 2 months ago

"Some files have incorrect reference count" means that archive is incorrect. But also it could mean that 7-zip works incrorrectly, if there is bug in 7-zip. And we don't want to change archive in that case, because it can remove the data, if the reference count of some file will be low.

You can test different versions of dism, and describe what exact versions create incorrect wims. Maybe dism creates incorrect file after updating operation.

Quqas commented 2 months ago

The fact of the matter is that I can’t understand a clear pattern on what the “proper” opening of wim depends on 1) if there is a “good” wim with a windows image”, it can be edited both via 7zip and via dism (/commit) - the wim “does not break”. 7zip continues to open it for editing/writing 2) if you create a wim “from scratch” (Dism / Capture-Image) from a folder with meaningless data, a “good” wim is created 3) But at the same time, if you create a new wim from the folder where a “good” wim with a windows image is mounted”, then the new wim always turns out “bad”. and 7zip cannot open it for editing/writing

I checked on many versions of dism. I used different command line parameters, but wim always turns out “bad” for 7zip. It is obvious that in fact there are no errors in the data. Dism and the newly created wim are not considered “bad”.

It remains unclear whose side is the biggest part of the problem? On the one hand, there are wim that 7zip can open for editing/writing (but there is no way to understand how they were created) On the other hand, 7zip mistakenly considers “bad” wims that are created from obviously correct data.


В том то и дело что я не могу понять внятную закономерность от чего зависит "правильное" открытие wim 1) если есть ""хороший" wim с образом windows", его можно редактировать и через 7zip и через dism (/commit) - wim "не ломается". 7zip продолжает его открывать под редактирование\запись 2) если создавать wim "с нуля" (Dism /Capture-Image) из папки с ничего не значащими данными создаётся "хороший" wim 3) Но в тоже время если создавать новый wim из папки куда смонтирован ""хороший" wim с образом windows", то новый wim всегда получается "плохой". и 7zip его под редактирование\запись не может открыть

Проверял на множестве версий dism. Использовал разные параметры командной строки, но всегда wim получается "плохим" для 7zip. Очевидно что на самом деле ошибок в данных нет. Dism и вновь созданный wim "плохим" не считает.

Остаётся непонятным с чьей стороны Большая часть проблемы? С одной стороны бывают wim которые 7zip умеет открывать под редактирование\запись (но нет возможности понять как они созданы) С другой стороны 7zip ошибочно считает "плохими" wim, которые созданы из заведомо правильных данных.

ip7z commented 2 months ago

You can compare good and bad archives for same data. Look Links property of files: 7z l a.wim -slt > log.txt Then you can try to find simplest and smallest bad archive that can be produced with some script. And you can try to report about that problem to Microsoft.

Quqas commented 2 months ago

you can try to report about that problem to Microsoft :100:

По логам сразу видно разницу 1) какие параметры создания не используй - теряется атрибут s системный 2) Links тоже всегда уменьшаются до 1 в новом wim

очевидно проблема в неправильных параметрах командной строки dism, осталось только выяснить какие "истинно правильные"

я думал что Вы знаете... на момент интеграции поддержки wim выяснили.

Но всё равно спасибо. Пойду попробую у M$ спросить.

можно закрывать

ip7z commented 2 months ago

If you have identical data in several files, SHA-1 values must be identical for them, and Links - is the number of such files with same data.

7-Zip sets read-only mode for such archives with bad Links value, because sha-1 and multiple links is key feature of wim format.

When I developed wim code for 7-zip, there was imagex program instead of dism. I didn't try to fix bugs in microsoft's wim programs.

Quqas commented 2 months ago

Yes, my mistake was using Dism.

imagex creates "correct and good" wim.

I didn’t know that now it can be freely downloaded from the m$ website