Open Mrjamin opened 5 years ago
Thanks for reporting this issue. It also happens on my Windows 10.
To have it fixed, I have manually downloaded and installed 7zip in its default folder.
There's still a problem afterwards, but it could be worked around as you could see where the drivers were downloaded and invoke the install files yourself.
PS C:\Users\Nick Petkanski\Downloads> .\brigadier.exe -k -i
Using Mac model: MacBookPro14,2.
Model supported in package distribution file at http://swcdn.apple.com/content/downloads/58/20/091-07726/qcih6x2vuivj7rnva3zm5lgmig7fuu45n8/091-07726.English.dist.
Distribution 091-07726 supports the following models: MacBookPro14,1, MacBookPro14,2.
Final output path C:\Users\Nick Petkanski\Downloads\BootCamp-091-07726 already exists, removing it...
Making directory C:\Users\Nick Petkanski\Downloads\BootCamp-091-07726..
Fetching Boot Camp product at URL http://swcdn.apple.com/content/downloads/58/20/091-07726/qcih6x2vuivj7rnva3zm5lgmig7fuu45n8/BootCampESD.pkg.
100.0% 409714688 / 409709966 bytes
Extracting...
Calling 7-Zip command: C:\Program Files\7-Zip\7z.exe e -oc:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8 -y c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\BootCampESD.pkg
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive for archives:
1 file, 409709966 bytes (391 MiB)
Extracting archive: c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\BootCampESD.pkg
WARNINGS:
There are data after the end of archive
--
Path = c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\BootCampESD.pkg
Type = Xar
WARNINGS:
There are data after the end of archive
Physical Size = 409706703
Tail Size = 3263
SubType = pkg
Headers Size = 3194
----
Path = Payload
Size = 409701218
Packed Size = 409701218
Modified = 2017-06-01 04:57:03
Created = 2017-06-01 04:57:31
Accessed = 2017-06-01 04:55:24
Mode = -rw-r--r--
User = root
Group = wheel
Method = octet-stream
--
Path = Payload
Type = bzip2
Everything is Ok
Archives with Warnings: 1
Warnings: 1
Size: 410978304
Compressed: 409709966
Calling 7-Zip command: C:\Program Files\7-Zip\7z.exe e -oc:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8 -y c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\Payload~
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive for archives:
1 file, 410978304 bytes (392 MiB)
Extracting archive: c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\Payload~
--
Path = c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\Payload~
Type = Cpio
Physical Size = 410978304
SubType = Portable ASCII
Everything is Ok
Folders: 4
Files: 1
Size: 410977369
Compressed: 410978304
Calling 7-Zip command: C:\Program Files\7-Zip\7z.exe x -oC:\Users\Nick Petkanski\Downloads\BootCamp-091-07726 -y c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\WindowsSupport.dmg
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive for archives:
1 file, 410977369 bytes (392 MiB)
Extracting archive: c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\WindowsSupport.dmg
--
Path = c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8\WindowsSupport.dmg
Type = Dmg
Physical Size = 410977369
Method = Copy ZLIB CRC
Blocks = 854
----
Path = 0.Apple_ISO
Size = 894722048
Packed Size = 410923431
CRC = 97C6358C
Comment = BOOTCAMP (Apple_ISO : 0)
Method = Copy ZLIB CRC
--
Path = 0.Apple_ISO
Type = Iso
Physical Size = 894722048
Created = 2017-06-01 04:51:37
Modified = 2017-06-01 04:51:37
Everything is Ok
Folders: 84
Files: 615
Size: 893590273
Compressed: 410977369
Installing Boot Camp...
Executing command: 'cmd /c msiexec /i C:\Users\Nick Petkanski\Downloads\BootCamp-091-07726\BootCamp\Drivers\Apple\BootCamp.msi /qb- /norestart /log C:\BootCamp_Install.log'
Install log output:
Traceback (most recent call last):
File "<string>", line 339, in <module>
File "<string>", line 306, in main
File "<string>", line 108, in installBootcamp
IOError: [Errno 2] No such file or directory: 'C:\\BootCamp_Install.log'
To the original issue, the logic for handling whether 7zip is installed correctly and is of proper version doesn't work correctly in some configurations. That could definitely get touched up.
The last time I built an installer for this was a couple of years ago, so take this with a grain of salt... The installer that Apple created only seems to work properly when run as SYSTEM (similar to root on macOS). When you try to execute the installer via setup.exe or by using msiexec, the install generally fails due to either timing out or some other error. I believe they did this because it was only intended to be run via the Bootcamp installer which installs it as part of the unattended setup of Windows.
At one point, I re-wrote this whole application as a Powershell script which created a scheduled task to run the setup.exe installer as SYSTEM. I had played with using PsExec, but some AV's were flagging it is a "hacking" tool... PsExec is obviously the easier one to test with and evaluate, so you could give that a try and see if that works better for you. I may be able to go back and find my last version of the script, but I haven't validated it in a couple of years since I moved into an InfoSec role.
I found out that brigadier works fine should it be started in an elevated command prompt. I guess only tech skilled people would try to fix their macbook drivers, so I would question whether any changes are needed at this point. Error messages are pretty clear on what the issue is and one could fix them with ease.
Maybe the prerequisites should be more clearer.
So it doesn't work even after running in cmd with administrator rights having installed 7zip already .
Though there is a workaround. All you need to do is go to
c:\users\nickpe~1\appdata\local\temp\bootcamp-unpack_udazk8
wherever the 7-Zip command was called , and then there extract that pkg file with 7-Zip by right clicking and extract here with 7-Zip .
After that open the file with 7-Zip and you'll be able to see the folders , then you can install the drivers as you want.
im getting a similar error
ERROR: Data Error : Windows6.1-KB2685811-x64.cab
ERROR: Data Error : Windows6.1-KB2685811-x64-pkgProperties.txt
ERROR: Data Error : Windows6.1-KB2685811-x64.xml
To have it fixed, I have manually downloaded and installed 7zip in its default folder.
yes
& 'C:\Program Files\7-Zip\7z.exe' e -o$HOME\appdata\local\temp\bootcamp-unpack_xsp1fw -y $HOME\appdata\local\temp\bootcamp-unpack_xsp1fw\Payload~
... will create Library\Application Support\BootCamp\WindowsSupport.dmg
& 'C:\Program Files\7-Zip\7z.exe' e -o$HOME\appdata\local\temp\bootcamp-unpack_xsp1fw -y "$HOME\appdata\local\temp\bootcamp-unpack_xsp1fw\Library\Application Support\BootCamp\WindowsSupport.dmg"
... will create more files in Library\Application Support\BootCamp
now run Library\Application Support\BootCamp\BootCamp\setup.exe
and afterwards, delete the temporary files in $HOME\appdata\local\temp\bootcamp-unpack_xsp1fw
wild guess: maybe the downloaded file is not fully flushed to disk, so
no, it really is a bug in 7z 23.017z
sees an incomplete file?
Just got a similar issue with a MacBook7,2 using latest release of Brig and a manually downloaded 7zip - on Windows 10; using the latest release .exe. Also ran as "SU" following advice in this thread, then tried manually downloading BootCampESD from the link in the CLI logs and extracting with 7z. Payload extraction also fails there.
Could this be a regression in 7z itself?
Could this be a regression in 7z itself?
Yeah, it seems like a regression in 7z. The older version 7-Zip 19.00 (2019-02-21) worked fine for me, unlike the newest versions (Not sure about releases between the two).
I can confirm that this seems to be a 7zip issue. I get the same errors:
ERROR: Data Error : Windows6.1-KB2685811-x64.cab
ERROR: Data Error : Windows6.1-KB2685811-x64-pkgProperties.txt
ERROR: Data Error : Windows6.1-KB2685811-x64.xml
And manually extracting the files with 7zip was unsuccessful as well, 7zip prompts ".... there's some data at the end of the archive ..." and extraction fails.
Uninstalling the latest 7zip 7-Zip 23.01 (2023-06-20)
and installing the previous version 7-Zip 22.01 (2022-07-15)
resolved the issue.
I can confirm that this seems to be a 7zip issue. I get the same errors:
ERROR: Data Error : Windows6.1-KB2685811-x64.cab ERROR: Data Error : Windows6.1-KB2685811-x64-pkgProperties.txt ERROR: Data Error : Windows6.1-KB2685811-x64.xml
And manually extracting the files with 7zip was unsuccessful as well, 7zip prompts ".... there's some data at the end of the archive ..." and extraction fails.
Uninstalling the latest 7zip
7-Zip 23.01 (2023-06-20)
and installing the previous version7-Zip 22.01 (2022-07-15)
resolved the issue.
THANK YOU! jameswsullivan
we must have been working on this at the same time, because I can confirm this is a 7-zip 23.01 issue also. Immediately downgrading resolved this problem with the following error of:
ERROR: Data Error : Windows6.1-KB2685811-x64.cab ERROR: Data Error : Windows6.1-KB2685811-x64-pkgProperties.txt ERROR: Data Error : Windows6.1-KB2685811-x64.xml
I don't even use this account and I haven't logged in for years, this was one of those times where I had to login to say thank you so much for discovering this. This was driving me up the wall I was about to purchase a license for magic utilities because the trial is very nice and so easy, but now we can finally do something as simple as scroll with this magic mouse. xD
You are a life saver. I have 7zip 22.01 installed and I have placed to brigadier to my desktop. Navigated to my desktop while in command prompt (admin) and have successfully executed this command:
brigadier.exe -m MacBookPro14,1
Now I have all the files extracted into a bootcamp folder with all the files successfully extracted. Installed the AppleWirelessMouse64 in the BootCamp\Drivers\Apple directory, I don't even think i needed to restart. this is groundbreaking! I can confirm this works in windows 11 x64. Thank you again
upstream issue: "ERROR: Data Error". cpio archive is interpreted as cab archive. regression from 7z 22.01 to 7z 23.01
workaround: use cpio
to extract files from Payload~
$ 7z x BootCampESD.pkg
$ file -i Payload~
Payload~: application/x-cpio; charset=binary
$ sha256sum Payload~
390b4f393a979835224e19b749056ab0c2a4bdfa9845d632c3c5d39dfb55963a Payload~
$ cpio --extract --verbose <Payload~
.
./Library
./Library/Application Support
./Library/Application Support/BootCamp
./Library/Application Support/BootCamp/WindowsSupport.dmg
3152046 blocks
$ sha256sum "Library/Application Support/BootCamp/WindowsSupport.dmg"
7c84ace54a095156e6f57da3ba825baf87b9f67308b39099c65b308a94461066 Library/Application Support/BootCamp/WindowsSupport.dmg
workaround: use
cpio
to extract files fromPayload~
i tried to replace 7z with bsdtar of libarchive which is part of windows 10 since 2017 but bsdtar fails to extract dmg archives
alternative: peazip but that is a gui tool
so... either/or
to reduce disk writes, the 3 extraction steps should be done in memory
Similar issue here. 🖐 I got it to work by:
I can confirm that this seems to be a 7zip issue. I get the same errors:
ERROR: Data Error : Windows6.1-KB2685811-x64.cab ERROR: Data Error : Windows6.1-KB2685811-x64-pkgProperties.txt ERROR: Data Error : Windows6.1-KB2685811-x64.xml
And manually extracting the files with 7zip was unsuccessful as well, 7zip prompts ".... there's some data at the end of the archive ..." and extraction fails.
Uninstalling the latest 7zip
7-Zip 23.01 (2023-06-20)
and installing the previous version7-Zip 22.01 (2022-07-15)
resolved the issue.
It indeed is 7zip problem. I used suggested version and managed to un-zip the package 👇🏻
E:\tmp>brigadier -m MacBookPro14,3 -o MacBookPro14.3
Using Mac model: MacBookPro14,3.
Model supported in package distribution file at https://swdist.apple.com/content/downloads/47/29/041-89072-A_HZY5QI4LGV/knck1r3qmsw9nliisjjm7vll0zv1u239eu/041-89072.English.dist.
Distribution 041-89072 supports the following models: MacBookPro14,3.
Final output path MacBookPro14.3\BootCamp-041-89072 already exists, removing it...
Making directory MacBookPro14.3\BootCamp-041-89072..
Fetching Boot Camp product at URL http://swcdn.apple.com/content/downloads/47/29/041-89072-A_HZY5QI4LGV/knck1r3qmsw9nliisjjm7vll0zv1u239eu/BootCampESD.pkg.
100.0% 809738240 / 809731463 bytes
Downloaded 7-zip to c:\users\myname\appdata\local\temp\tmpirquu9\7z2201-x64.msi.
We need to install 7-Zip..
7-Zip install returned exit code 0.
Extracting...
Calling 7-Zip command: C:\Program Files\7-Zip\7z.exe e -oc:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku -y c:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku\BootCampESD.pkg
Traceback (most recent call last):
File "brigadier", line 379, in <module>
File "brigadier", line 313, in main
File "brigadier", line 84, in sevenzipExtract
File "subprocess.py", line 172, in call
File "subprocess.py", line 394, in __init__
File "subprocess.py", line 644, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
[2264] Failed to execute script brigadier
E:\tmp>"C:\Program Files\7-Zip\7z.exe" e -oc:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku -y c:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku\BootCampESD.pkg
The system cannot find the path specified.
E:\tmp>"C:\Program Files (x86)\7-Zip\7z.exe" e -oc:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku -y c:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku\BootCampESD.pkg
7-Zip 22.01 (x86) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15
Scanning the drive for archives:
1 file, 809731463 bytes (773 MiB)
Extracting archive: c:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku\BootCampESD.pkg
WARNINGS:
There are data after the end of archive
--
Path = c:\users\myname\appdata\local\temp\bootcamp-unpack_ghr4ku\BootCampESD.pkg
Type = Xar
WARNINGS:
There are data after the end of archive
Physical Size = 809729833
Tail Size = 1630
SubType = pkg
Headers Size = 4211
----
Path = Payload
Size = 809714113
Packed Size = 809714113
Modified = 2017-04-20 05:51:16.0000000
Created = 2017-04-20 05:51:28.0000000
Accessed = 2017-04-20 05:48:23.0000000
Mode = -rw-r--r--
User = root
Group = wheel
Method = octet-stream
--
Path = Payload
Type = bzip2
Everything is Ok
Archives with Warnings: 1
Warnings: 1
Size: 807774720
Compressed: 80973146
Hi,
Thanks for taking the time to develop this tool. I'm getting a failure at the point Brigadier is trying to extract the 7zip file. Here's the console ouput:
... Fetching Boot Camp product at URL http://swcdn.apple.com/content/downloads/39/14/031-55710/u2c6bi4yl91ud1lqc3k53bx9860hvsnf7z/BootCampESD.pkg.
100.0% 1614454784 / 1614454648 bytes 100.4% 1662976 / 1655808 bytes Downloaded 7-zip to c:\users\ben\appdata\local\temp\tmpvcaver\7z1514-x64.msi.
We need to install 7-Zip..
7-Zip install returned exit code 1603.
Extracting...
Calling 7-Zip command: C:\Program Files\7-Zip\7z.exe e -oc:\users\ben\appdata\local\temp\bootcamp-unpack_ifd_bk -y c:\users\ben\appdata\local\temp\bootcamp-unpack_ifd_bk\BootCampESD.pkg
Traceback (most recent call last): File "", line 358, in
File "", line 309, in main
File "", line 86, in sevenzipExtract
File "c:\jenkins\workspace\brigadier\build\brigadier\out00-PYZ.pyz\subprocess", line 493, in call
File "c:\jenkins\workspace\brigadier\build\brigadier\out00-PYZ.pyz\subprocess", line 679, in init
File "c:\jenkins\workspace\brigadier\build\brigadier\out00-PYZ.pyz\subprocess", line 896, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
Not sure if this is a bug or something with my system, so any thoughts would be greatly appreciated.