diff --git a/.gitignore b/.gitignore index f00c7b4..667e5e0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,9 @@ desktop.ini # Logs *.log + +# App Config +config.json + +# PyInstaller +*.spec diff --git a/app.ico b/app.ico new file mode 100644 index 0000000..47f4133 Binary files /dev/null and b/app.ico differ diff --git a/build.py b/build.py new file mode 100644 index 0000000..29865c9 --- /dev/null +++ b/build.py @@ -0,0 +1,23 @@ +import PyInstaller.__main__ +import tkinterdnd2 +import os +import shutil + +def build(): + tkdnd_path = os.path.join(os.path.dirname(tkinterdnd2.__file__), 'tkdnd') + + # Ensure dist and build dirs are clean + if os.path.exists('dist'): shutil.rmtree('dist') + if os.path.exists('build'): shutil.rmtree('build') + + PyInstaller.__main__.run([ + 'kobackupdec_gui.py', + '--name=KoBackupDecryptor', + '--onefile', + '--windowed', + '--icon=app.ico', + f'--add-data={tkdnd_path};tkinterdnd2/tkdnd' + ]) + +if __name__ == '__main__': + build() diff --git a/create_icon.py b/create_icon.py new file mode 100644 index 0000000..42d387f --- /dev/null +++ b/create_icon.py @@ -0,0 +1,19 @@ +import sys +from PIL import Image + +def create_ico(input_path, output_path): + img = Image.open(input_path) + # Crop to square if necessary + width, height = img.size + if width != height: + min_dim = min(width, height) + left = (width - min_dim) / 2 + top = (height - min_dim) / 2 + right = (width + min_dim) / 2 + bottom = (height + min_dim) / 2 + img = img.crop((left, top, right, bottom)) + + img.save(output_path, format="ICO", sizes=[(256, 256), (128, 128), (64, 64), (32, 32), (16, 16)]) + +if __name__ == "__main__": + create_ico(sys.argv[1], sys.argv[2])