-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into safe_devices
- Loading branch information
Showing
28 changed files
with
824 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,3 +147,6 @@ cython_debug/ | |
ev3sim/user_config.yaml | ||
# Generated logs | ||
ev3sim/logs | ||
|
||
# Python embeddable with pip | ||
python_embed* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
import argparse, sys | ||
import PyInstaller.__main__ | ||
import os | ||
import shutil | ||
from subprocess import Popen | ||
from ev3sim import __version__ | ||
|
||
parse = argparse.ArgumentParser() | ||
parse.add_argument("--admin", action="store_true", dest="admin") | ||
|
||
res = parse.parse_args(sys.argv[1:]) | ||
|
||
# First, generate the version file to be used in generation. | ||
with open("version_file_template.txt", "r") as f: | ||
string = f.read().replace("<VERSION_NUMBER>", __version__) | ||
with open("version_file.txt", "w") as f: | ||
f.write(string) | ||
|
||
# Then generate the build. | ||
PyInstaller.__main__.run( | ||
[ | ||
"-y", | ||
"executable_entry.spec", | ||
] | ||
) | ||
if os.path.exists("dist"): | ||
shutil.rmtree("dist") | ||
os.makedirs("dist", exist_ok=True) | ||
os.makedirs("dist/ev3sim", exist_ok=True) | ||
if os.path.exists("dist/python_embed"): | ||
shutil.rmtree("dist/python_embed") | ||
shutil.copytree("python_embed-32", "dist/python_embed") | ||
|
||
import os | ||
if os.path.exists("dist/ev3sim/user_config.yaml"): | ||
os.remove("dist/ev3sim/user_config.yaml") | ||
|
||
process = Popen("makensis config.nsi") | ||
process.wait() | ||
shutil.move("installer.exe", "installer-32bit.exe") | ||
|
||
if os.path.exists("dist"): | ||
shutil.rmtree("dist") | ||
os.makedirs("dist", exist_ok=True) | ||
os.makedirs("dist/ev3sim", exist_ok=True) | ||
if os.path.exists("dist/python_embed"): | ||
shutil.rmtree("dist/python_embed") | ||
shutil.copytree("python_embed-64", "dist/python_embed") | ||
|
||
if os.path.exists("dist/ev3sim/ev3sim/user_config.yaml"): | ||
os.remove("dist/ev3sim/ev3sim/user_config.yaml") | ||
if os.path.exists("dist/ev3sim/user_config.yaml"): | ||
os.remove("dist/ev3sim/user_config.yaml") | ||
|
||
if res.admin: | ||
process = Popen("makensis config.nsi") | ||
else: | ||
process = Popen("makensis config-no-admin.nsi") | ||
process = Popen("makensis config.nsi") | ||
process.wait() | ||
shutil.move("installer.exe", "installer-64bit.exe") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Creating the python embed folder | ||
|
||
First, Ensure you have the matching python installed locally, as you'll need to copy some files over. | ||
|
||
1. Download get-pip.py and run `python get-pip.py`. | ||
2. Change the contents of `python39._pth` to | ||
|
||
``` | ||
python39.zip | ||
. | ||
.\Lib | ||
.\Lib\site-packages | ||
# Uncomment to run site.main() automatically | ||
#import site | ||
``` | ||
|
||
3. Copy `tcl` to `tcl` (Local install to embed) | ||
4. Copy `Lib/tkinter` to `Lib/tkinter` (Local install to embed) | ||
5. Copy `DLLs/_tkinter.pyd`, `DLLs/tcl86t.dll`, `DLLs/tk86t.dll` to `_tkinter.pyd`, ... (NOT in DLLs folder in embed) | ||
|
||
After this, `python -m build_exe` should generate a good installer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from ev3sim.entry import main | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.