mirror of
https://github.com/paolo-projects/unlocker.git
synced 2025-07-28 00:14:36 +02:00
Merge pull request #7 from Debdut/master
Fixed darwin.iso download errors
This commit is contained in:
commit
3fa8d0b87f
33
README.md
Normal file
33
README.md
Normal file
@ -0,0 +1,33 @@
|
||||
# Unlocker
|
||||
|
||||
Unlocker for Mac OS in VMware Workstation
|
||||
|
||||
This project fixes the erros of [paolo-projects/unlocker](https://github.com/paolo-projects/unlocker)
|
||||
|
||||
Works on
|
||||
|
||||
- Workstation 11-16 on Windows and Linux
|
||||
- Workstation Player 7/12/14/15/16 on Windows and Linux
|
||||
|
||||
## Install
|
||||
Linux
|
||||
|
||||
```sh
|
||||
$ sudo ./lnx-install.sh
|
||||
```
|
||||
|
||||
Windows
|
||||
|
||||
Run `win-install.cmd` file
|
||||
|
||||
## Prerequisites
|
||||
|
||||
python2 and python3
|
||||
|
||||
## Note
|
||||
|
||||
Always uninstall the previous version of the Unlocker before using a new version. Failure to do this could render VMware unusable.
|
||||
|
||||
## Acknowledgement
|
||||
|
||||
Thanks to [paolo-projects/unlocker](https://github.com/paolo-projects/unlocker) and it's contributors
|
113
gettools.py
113
gettools.py
@ -31,6 +31,8 @@ import tarfile
|
||||
import zipfile
|
||||
import time
|
||||
|
||||
ARCH = 'x86'
|
||||
|
||||
try:
|
||||
# For Python 3.0 and later
|
||||
# noinspection PyCompatibility
|
||||
@ -125,101 +127,40 @@ def main():
|
||||
|
||||
lastVersion = parser.HTMLDATA[-1]
|
||||
|
||||
urlpost15 = url + lastVersion + '/packages/com.vmware.fusion.tools.darwin.zip.tar'
|
||||
urlpre15 = url + lastVersion + '/packages/com.vmware.fusion.tools.darwinPre15.zip.tar'
|
||||
parser.clean()
|
||||
|
||||
# Download the darwin.iso tgz file
|
||||
print('Retrieving Darwin tools from: ' + urlpost15)
|
||||
try:
|
||||
# Try to get tools from packages folder
|
||||
urlretrieve(urlpost15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
|
||||
|
||||
except:
|
||||
# No tools found, get em from the core tar
|
||||
print('Tools aren\'t here... Be patient while I download and' +
|
||||
' give a look into the core.vmware.fusion.tar file')
|
||||
urlcoretar = url + lastVersion + '/core/com.vmware.fusion.zip.tar'
|
||||
|
||||
# Get the main core file
|
||||
try:
|
||||
urlretrieve(urlcoretar, convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), reporthook)
|
||||
except:
|
||||
print('Couldn\'t find tools')
|
||||
return
|
||||
urlcoretar = url + lastVersion + '/' + ARCH + '/core/com.vmware.fusion.zip.tar'
|
||||
|
||||
print()
|
||||
|
||||
print('Extracting com.vmware.fusion.zip.tar...')
|
||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), 'r')
|
||||
tar.extract('com.vmware.fusion.zip', path=convertpath(dest + '/tools/'))
|
||||
tar.close()
|
||||
|
||||
print('Extracting files from com.vmware.fusion.zip...')
|
||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.zip'), 'r')
|
||||
cdszip.extract('payload/VMware Fusion.app/Contents/Library/isoimages/darwin.iso', path=convertpath(dest + '/tools/'))
|
||||
cdszip.extract('payload/VMware Fusion.app/Contents/Library/isoimages/darwinPre15.iso', path=convertpath(dest + '/tools/'))
|
||||
cdszip.close()
|
||||
|
||||
# Move the iso and sig files to tools folder
|
||||
shutil.move(convertpath(dest + '/tools/payload/VMware Fusion.app/Contents/Library/isoimages/darwin.iso'), convertpath(dest + '/tools/darwin.iso'))
|
||||
shutil.move(convertpath(dest + '/tools/payload/VMware Fusion.app/Contents/Library/isoimages/darwinPre15.iso'), convertpath(dest + '/tools/darwinPre15.iso'))
|
||||
|
||||
# Cleanup working files and folders
|
||||
shutil.rmtree(convertpath(dest + '/tools/payload'), True)
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.zip.tar'))
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.zip'))
|
||||
|
||||
print('Tools retrieved successfully')
|
||||
# Get the main core file
|
||||
try:
|
||||
urlretrieve(urlcoretar, convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), reporthook)
|
||||
except:
|
||||
print('Couldn\'t find tools')
|
||||
return
|
||||
|
||||
# Tools have been found, go with the normal way
|
||||
print('Extracting com.vmware.fusion.zip.tar...')
|
||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), 'r')
|
||||
tar.extract('com.vmware.fusion.zip', path=convertpath(dest + '/tools/'))
|
||||
tar.close()
|
||||
|
||||
# Extract the tar to zip
|
||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'), 'r')
|
||||
tar.extract('com.vmware.fusion.tools.darwin.zip', path=convertpath(dest + '/tools/'))
|
||||
tar.close()
|
||||
|
||||
# Extract the iso and sig files from zip
|
||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'), 'r')
|
||||
cdszip.extract('payload/darwin.iso', path=convertpath(dest + '/tools/'))
|
||||
cdszip.extract('payload/darwin.iso.sig', path=convertpath(dest + '/tools/'))
|
||||
print('Extracting files from com.vmware.fusion.zip...')
|
||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.zip'), 'r')
|
||||
cdszip.extract('payload/VMware Fusion.app/Contents/Library/isoimages/darwin.iso', path=convertpath(dest + '/tools/'))
|
||||
cdszip.extract('payload/VMware Fusion.app/Contents/Library/isoimages/darwinPre15.iso', path=convertpath(dest + '/tools/'))
|
||||
cdszip.close()
|
||||
|
||||
|
||||
# Move the iso and sig files to tools folder
|
||||
shutil.move(convertpath(dest + '/tools/payload/darwin.iso'), convertpath(dest + '/tools/darwin.iso'))
|
||||
shutil.move(convertpath(dest + '/tools/payload/darwin.iso.sig'), convertpath(dest + '/tools/darwin.iso.sig'))
|
||||
|
||||
shutil.move(convertpath(dest + '/tools/payload/VMware Fusion.app/Contents/Library/isoimages/darwin.iso'), convertpath(dest + '/tools/darwin.iso'))
|
||||
shutil.move(convertpath(dest + '/tools/payload/VMware Fusion.app/Contents/Library/isoimages/darwinPre15.iso'), convertpath(dest + '/tools/darwinPre15.iso'))
|
||||
|
||||
# Cleanup working files and folders
|
||||
shutil.rmtree(convertpath(dest + '/tools/payload'), True)
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'))
|
||||
|
||||
# Download the darwinPre15.iso tgz file
|
||||
print('Retrieving DarwinPre15 tools from: ' + urlpre15)
|
||||
urlretrieve(urlpre15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'))
|
||||
|
||||
# Extract the tar to zip
|
||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'), 'r')
|
||||
tar.extract('com.vmware.fusion.tools.darwinPre15.zip', path=convertpath(dest + '/tools/'))
|
||||
tar.close()
|
||||
|
||||
# Extract the iso and sig files from zip
|
||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip'), 'r')
|
||||
cdszip.extract('payload/darwinPre15.iso', path=convertpath(dest + '/tools/'))
|
||||
cdszip.extract('payload/darwinPre15.iso.sig', path=convertpath(dest + '/tools/'))
|
||||
cdszip.close()
|
||||
|
||||
# Move the iso and sig files to tools folder
|
||||
shutil.move(convertpath(dest + '/tools/payload/darwinPre15.iso'),
|
||||
convertpath(dest + '/tools/darwinPre15.iso'))
|
||||
shutil.move(convertpath(dest + '/tools/payload/darwinPre15.iso.sig'),
|
||||
convertpath(dest + '/tools/darwinPre15.iso.sig'))
|
||||
|
||||
# Cleanup working files and folders
|
||||
shutil.rmtree(convertpath(dest + '/tools/payload'), True)
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'))
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip'))
|
||||
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.zip.tar'))
|
||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.zip'))
|
||||
|
||||
print('Tools retrieved successfully')
|
||||
return
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -30,7 +30,7 @@ echo Patching...
|
||||
python2 ./unlocker.py
|
||||
|
||||
echo Getting VMware Tools...
|
||||
python gettools.py
|
||||
python3 gettools.py
|
||||
cp ./tools/darwin*.* /usr/lib/vmware/isoimages/
|
||||
|
||||
echo Finished!
|
||||
|
@ -48,7 +48,7 @@ unlocker.exe
|
||||
|
||||
echo.
|
||||
echo Getting VMware Tools...
|
||||
gettools.exe
|
||||
python gettools.py
|
||||
xcopy /F /Y .\tools\darwin*.* "%InstallPath%"
|
||||
|
||||
echo.
|
||||
|
Loading…
x
Reference in New Issue
Block a user