Skip to content

Commit dcb641b

Browse files
committed
32 and 64 bit builds
1 parent c768a33 commit dcb641b

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ __pycache__/
88
*.so
99
*~
1010
venv/
11+
venv32/
12+
venv64/
1113
.pytest_cache/
1214
.cache/
1315
extractor.spec

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Extract your .unitypackage
1414

1515
* Download the [unitypackage_extractor.zip](https://github.com/Cobertos/unitypackage_extractor/releases/tag/0.3.0) from the Releases tab.
1616
* Extract everything into a new directory
17-
* Run the `extractor.exe` inside with `extractor.exe [path/to/your/package.unitypackage] (optional/output/path)`
17+
* Drag and drop your `.unitypackage` onto `extractor.exe` OR
18+
* Run from the command line with `extractor.exe [path/to/your/package.unitypackage] (optional/output/path)`
1819

1920
### Usage with Python 3.6+
2021

@@ -30,11 +31,21 @@ extractPackage("path/to/your/package.unitypackage", outputPath="optional/output/
3031
```
3132

3233
### Contributing
33-
#### Building
34-
Install `pyinstaller` and run `build_exe.py`. I couldn't get this to work with Python 3.7 so I downloaded and ran it with 3.6 and it worked.
34+
#### Building (requires pyenv)
35+
* `pyenv global 3.6.8-amd64`
36+
* Originally wasn't able to get this to run on Python 3.7 when it was new, but 3.6 is guarenteed to build the `.exe`
37+
* `pyenv exec python -m venv venv64`
38+
* `venv64\scripts\activate.bat` or `venv64/scripts/activate` for Linux
39+
* `pip install -r requirements-dev.txt` (Installs `pyinstaller` and `pytest`)
40+
* `python build_exe.py`
41+
* `venv64\scripts\deactivate.bat` (or you'll use the wrong python when you make another `venv`)
42+
* Do the same with `pyenv and 3.6.8` and make a folder called `venv32` instead
3543

3644
#### Testing
37-
Install `pytest` and run `pytest -v -s` in the root directory.
45+
* `python -m venv venv`
46+
* `venv\scripts\activate.bat` or `venv/scripts/activate` for Linux
47+
* `pip install -r requirements-dev.txt` (Installs `pyinstaller` and `pytest`)
48+
* `pytest -v -s` in the root directory
3849

3950
#### Releasing
4051
Refer to [the python docs on packaging for clarification](https://packaging.python.org/tutorials/packaging-projects/).

build_exe.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
import sys
12
import os
23
import shutil
34
import subprocess
45

5-
#Run pyinstaller
6-
subprocess.run(["pyinstaller", "unitypackage_extractor/extractor.py",
7-
"--exclude-module", "ssl",
8-
"--exclude-module", "socket"])
96

10-
#Zip it all up
11-
shutil.make_archive("unitypackage_extractor", "zip", "dist/extractor")
7+
if __name__ == '__main__':
8+
is64bit = sys.maxsize > 2**32
9+
10+
#Run pyinstaller
11+
subprocess.run(["pyinstaller", "unitypackage_extractor/extractor.py",
12+
"--exclude-module", "ssl",
13+
"--exclude-module", "socket"])
14+
15+
#Zip it all up
16+
shutil.make_archive(f"unitypackage_extractor_{'64' if is64bit else '32'}", "zip", "dist/extractor")

unitypackage_extractor_32.zip

3.94 MB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)