diff --git a/{{ cookiecutter.project_name }}/public/{{ cookiecutter.project_name }}.ico b/{{ cookiecutter.project_name }}/public/{{ cookiecutter.project_name }}.ico new file mode 100644 index 0000000..8e36272 Binary files /dev/null and b/{{ cookiecutter.project_name }}/public/{{ cookiecutter.project_name }}.ico differ diff --git a/{{ cookiecutter.project_name }}/src/{{ cookiecutter.project_name }}/scripts/build.py b/{{ cookiecutter.project_name }}/src/{{ cookiecutter.project_name }}/scripts/build.py index 41e1f46..63c5af5 100644 --- a/{{ cookiecutter.project_name }}/src/{{ cookiecutter.project_name }}/scripts/build.py +++ b/{{ cookiecutter.project_name }}/src/{{ cookiecutter.project_name }}/scripts/build.py @@ -47,7 +47,7 @@ def run_pyinstaller(): # 添加数据文件 # "--add-data", "resources:resources", # 其他选项 - "--icon", "../resources/{{ cookiecutter.project_name }}.ico", + "--icon", "../public/{{ cookiecutter.project_name }}.ico", "main.py" ] @@ -68,6 +68,9 @@ def run_pyinstaller(): def main(): # 打包模块 + resources_path = Path("resources") + if not resources_path.exists(): + resources_path.mkdir() app_packer = PythonToSQLite("./resources/app.mbank") app_packer.pack_directory("src/{{ cookiecutter.project_name }}/app", "app") app_packer.verify_package_structure()