mirror of
https://github.com/paolo-projects/unlocker.git
synced 2025-07-28 16:34:29 +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
|
99
gettools.py
99
gettools.py
@ -31,6 +31,8 @@ import tarfile
|
|||||||
import zipfile
|
import zipfile
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
ARCH = 'x86'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# For Python 3.0 and later
|
# For Python 3.0 and later
|
||||||
# noinspection PyCompatibility
|
# noinspection PyCompatibility
|
||||||
@ -125,101 +127,40 @@ def main():
|
|||||||
|
|
||||||
lastVersion = parser.HTMLDATA[-1]
|
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()
|
parser.clean()
|
||||||
|
|
||||||
# Download the darwin.iso tgz file
|
urlcoretar = url + lastVersion + '/' + ARCH + '/core/com.vmware.fusion.zip.tar'
|
||||||
print('Retrieving Darwin tools from: ' + urlpost15)
|
|
||||||
|
# Get the main core file
|
||||||
try:
|
try:
|
||||||
# Try to get tools from packages folder
|
urlretrieve(urlcoretar, convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), reporthook)
|
||||||
urlretrieve(urlpost15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
# No tools found, get em from the core tar
|
print('Couldn\'t find tools')
|
||||||
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
|
|
||||||
|
|
||||||
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')
|
|
||||||
return
|
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')
|
||||||
# Extract the tar to zip
|
tar.extract('com.vmware.fusion.zip', path=convertpath(dest + '/tools/'))
|
||||||
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()
|
tar.close()
|
||||||
|
|
||||||
# Extract the iso and sig files from zip
|
print('Extracting files from com.vmware.fusion.zip...')
|
||||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'), 'r')
|
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.zip'), 'r')
|
||||||
cdszip.extract('payload/darwin.iso', path=convertpath(dest + '/tools/'))
|
cdszip.extract('payload/VMware Fusion.app/Contents/Library/isoimages/darwin.iso', path=convertpath(dest + '/tools/'))
|
||||||
cdszip.extract('payload/darwin.iso.sig', path=convertpath(dest + '/tools/'))
|
cdszip.extract('payload/VMware Fusion.app/Contents/Library/isoimages/darwinPre15.iso', path=convertpath(dest + '/tools/'))
|
||||||
cdszip.close()
|
cdszip.close()
|
||||||
|
|
||||||
# Move the iso and sig files to tools folder
|
# 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/VMware Fusion.app/Contents/Library/isoimages/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/darwinPre15.iso'), convertpath(dest + '/tools/darwinPre15.iso'))
|
||||||
|
|
||||||
# Cleanup working files and folders
|
# Cleanup working files and folders
|
||||||
shutil.rmtree(convertpath(dest + '/tools/payload'), True)
|
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.zip.tar'))
|
||||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'))
|
os.remove(convertpath(dest + '/tools/com.vmware.fusion.zip'))
|
||||||
|
|
||||||
# Download the darwinPre15.iso tgz file
|
print('Tools retrieved successfully')
|
||||||
print('Retrieving DarwinPre15 tools from: ' + urlpre15)
|
return
|
||||||
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'))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
@ -30,7 +30,7 @@ echo Patching...
|
|||||||
python2 ./unlocker.py
|
python2 ./unlocker.py
|
||||||
|
|
||||||
echo Getting VMware Tools...
|
echo Getting VMware Tools...
|
||||||
python gettools.py
|
python3 gettools.py
|
||||||
cp ./tools/darwin*.* /usr/lib/vmware/isoimages/
|
cp ./tools/darwin*.* /usr/lib/vmware/isoimages/
|
||||||
|
|
||||||
echo Finished!
|
echo Finished!
|
||||||
|
@ -48,7 +48,7 @@ unlocker.exe
|
|||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Getting VMware Tools...
|
echo Getting VMware Tools...
|
||||||
gettools.exe
|
python gettools.py
|
||||||
xcopy /F /Y .\tools\darwin*.* "%InstallPath%"
|
xcopy /F /Y .\tools\darwin*.* "%InstallPath%"
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user