Skip to content

Commit

Permalink
Temp fix for cx_freeze windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
brzGatsu committed Aug 27, 2022
1 parent 27f6e88 commit b208105
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Sephrasto/CxFreezeBuild.py
Expand Up @@ -38,7 +38,8 @@ def cleanBuildFolder():
"excludes" : ["tkinter", "distutils", "html", "unittest", "pydoc", "bz2", "pyexpat", "lzma"],
"optimize" : 2,
"zip_include_packages" : "*",
"zip_exclude_packages" : ""
"zip_exclude_packages" : "",
"include_msvcr" : True
}

base = None
Expand All @@ -55,6 +56,7 @@ def cleanBuildFolder():
# Remove unneeded files
print("Removing unneeded files")
removeFiles = [
# TODO: these entries can be removed once newer cx_freeze versions dont create these superfluous files anymore
os.path.join("lib", "PySide6", "Qt6Network.dll"),
os.path.join("lib", "PySide6", "Qt6Network.pyd"),
os.path.join("lib", "PySide6", "plugins", "imageformats", "Qt6Core.dll"),
Expand All @@ -75,6 +77,11 @@ def cleanBuildFolder():
except OSError:
os.remove(filepath)

# The python dlls need to be ALSO present inside the lib folder for Sephrasto to work on non-dev PCs
# TODO: remove this once newer cx_freeze versions fix the issue
shutil.copy2(os.path.join(build_path, "python3.dll"), os.path.join(build_path, "lib", "python3.dll"))
shutil.copy2(os.path.join(build_path, "python37.dll"), os.path.join(build_path, "lib", "python37.dll"))

# Copy additional files and folders to build folder
print("Copying additional files and folders to build folder")

Expand Down

0 comments on commit b208105

Please sign in to comment.