Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
柴进
/
GoogleNanoBananaApp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bd9acb17
authored
2025-12-02 15:54:47 +0800
by
shady
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
准备最终的打包版本
1 parent
80827101
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
9 deletions
ZB100ImageGenerator.spec
build_mac.sh
build_windows.bat
image_generator.py
ZB100ImageGenerator.spec
View file @
bd9acb1
...
...
@@ -19,21 +19,33 @@ pyz = PYZ(a.pure)
exe
=
EXE
(
pyz
,
a
.
scripts
,
a
.
binaries
,
a
.
datas
,
[],
exclude_binaries
=
True
,
name
=
'ZB100ImageGenerator'
,
debug
=
False
,
bootloader_ignore_signals
=
False
,
strip
=
False
,
upx
=
True
,
upx_exclude
=
[],
runtime_tmpdir
=
None
,
console
=
False
,
disable_windowed_traceback
=
False
,
argv_emulation
=
False
,
target_arch
=
None
,
codesign_identity
=
None
,
entitlements_file
=
None
,
icon
=
[
'zb100_kehuan.ico'
],
icon
=
[
'zb100_mac.icns'
],
)
coll
=
COLLECT
(
exe
,
a
.
binaries
,
a
.
datas
,
strip
=
False
,
upx
=
True
,
upx_exclude
=
[],
name
=
'ZB100ImageGenerator'
,
)
app
=
BUNDLE
(
coll
,
name
=
'ZB100ImageGenerator.app'
,
icon
=
'zb100_mac.icns'
,
bundle_identifier
=
None
,
)
...
...
build_mac.sh
100644 → 100755
View file @
bd9acb1
...
...
@@ -27,9 +27,10 @@ rm -rf build dist *.spec
# Build executable
echo
"Building executable..."
pyinstaller --name
=
"ZB100ImageGenerator"
\
--one
file
\
--one
dir
\
--windowed
\
--add-data
"config.json:."
\
--icon
=
zb100_mac.icns
\
image_generator.py
# Check if build was successful
...
...
build_windows.bat
View file @
bd9acb1
...
...
@@ -29,17 +29,17 @@ if exist "*.spec" del /q *.spec
REM Build executable
echo Building executable...
pyinstaller --name="ZB100ImageGenerator" ^
--one
file
^
--one
dir
^
--windowed ^
--icon=zb100_kehuan.ico ^
--add-data "config.json;." ^
image_generator.py
REM Check if build was successful
if exist "dist\ZB100ImageGenerator.exe" (
if exist "dist\ZB100ImageGenerator
\ZB100ImageGenerator
.exe" (
echo ================================
echo Build successful!
echo Executable: dist\ZB100ImageGenerator.exe
echo Executable: dist\ZB100ImageGenerator
\ZB100ImageGenerator
.exe
echo ================================
) else (
echo ================================
...
...
image_generator.py
View file @
bd9acb1
...
...
@@ -19,6 +19,7 @@ import io
import
json
import
os
import
sys
import
shutil
import
tempfile
import
platform
from
pathlib
import
Path
...
...
@@ -982,6 +983,26 @@ def main():
config_dir
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
config_path
=
config_dir
/
'config.json'
# If config doesn't exist in user directory, copy from bundled resources
if
not
config_path
.
exists
():
if
getattr
(
sys
,
'frozen'
,
False
):
# Running as bundled app - look in Resources folder (macOS .app bundle)
if
platform
.
system
()
==
'Darwin'
:
# macOS: Contents/Resources/config.json
bundled_config
=
Path
(
sys
.
executable
)
.
parent
.
parent
/
'Resources'
/
'config.json'
else
:
# Windows/Linux: same directory as executable
bundled_config
=
Path
(
sys
.
executable
)
.
parent
/
'config.json'
if
bundled_config
.
exists
():
try
:
shutil
.
copy2
(
bundled_config
,
config_path
)
print
(
f
"✓ Copied config from {bundled_config} to {config_path}"
)
except
Exception
as
e
:
print
(
f
"✗ Failed to copy bundled config: {e}"
)
else
:
print
(
f
"✗ Bundled config not found at {bundled_config}"
)
db_config
=
None
last_user
=
""
saved_password_hash
=
""
...
...
Please
register
or
sign in
to post a comment