diff --git a/main.spec b/PyBuild/main.spec similarity index 78% rename from main.spec rename to PyBuild/main.spec index 035f837..831d23e 100644 --- a/main.spec +++ b/PyBuild/main.spec @@ -2,12 +2,12 @@ a = Analysis( - ['__main__.py'], + ['../__main__.py'], pathex=[], binaries=[], datas=[ - ('feedtheforge/lang/zh_CN.json', 'feedtheforge/lang'), - ('feedtheforge/lang/en_US.json', 'feedtheforge/lang') + ('../feedtheforge/lang/zh_CN.json', 'feedtheforge/lang'), + ('../feedtheforge/lang/en_US.json', 'feedtheforge/lang') ], hiddenimports=['aiohttp', 'pick'], hookspath=[], @@ -38,5 +38,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, - icon=['PyBuild/icon.ico'], + icon=['icon.ico'], ) \ No newline at end of file diff --git a/README.md b/README.md index cca664b..368bb33 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ WIP 1. **Package as Executable**: ```bash pip install pyinstaller - pyinstaller main.spec + pyinstaller PyBuild/main.spec ``` 3. **Locate the Executable**: - For **Windows**, the executable will be a `.exe` file located in the `dist` folder. diff --git a/feedtheforge/const.py b/feedtheforge/const.py index aef4b47..ba1efed 100644 --- a/feedtheforge/const.py +++ b/feedtheforge/const.py @@ -1,6 +1,6 @@ import locale -import os import tempfile +from pathlib import Path from feedtheforge.i18n import Locale @@ -10,12 +10,12 @@ current_language = lang.get_language() # 缓存目录设置 -cache_dir = os.path.join(tempfile.gettempdir(), "FeedTheForge") -packlist_path = os.path.join(cache_dir, "packlist.json") -modpack_path = os.path.join(cache_dir, "pack_files") -patch = os.path.join(cache_dir, "patch.zip") -patch_folder = os.path.join(cache_dir, "patch") -mod_path = os.path.join(modpack_path, "overrides", "mods") +cache_dir = Path(tempfile.gettempdir()) / "FeedTheForge" +packlist_path = cache_dir / "packlist.json" +modpack_path = cache_dir / "pack_files" +patch = cache_dir / "patch.zip" +patch_folder = cache_dir / "patch" +mod_path = modpack_path / "overrides" / "mods" I18NUPDATE_LINK = "https://mediafilez.forgecdn.net/files/5335/196/I18nUpdateMod-3.5.5-all.jar"