|
1 | 1 | import sys
|
2 | 2 | from cx_Freeze import setup, Executable
|
3 | 3 |
|
| 4 | +# base="Win32GUI" should be used only for Windows GUI app |
| 5 | +base = None |
| 6 | +if sys.platform == "win32": |
| 7 | + base = "Win32GUI" |
| 8 | + |
| 9 | +version = "" |
| 10 | +with open("version.txt") as f: |
| 11 | + version = f.read().rstrip("\n") |
| 12 | + |
4 | 13 | sys.path.insert(0, "src")
|
5 | 14 |
|
| 15 | +shortcut_table = [ |
| 16 | + ("DesktopShortcut", # Shortcut |
| 17 | + "DesktopFolder", # Directory_ |
| 18 | + "Tomography Analysis Tool", # Name |
| 19 | + "TARGETDIR", # Component_ |
| 20 | + "[TARGETDIR]tat.exe", # Target |
| 21 | + None, # Arguments |
| 22 | + None, # Description |
| 23 | + None, # Hotkey |
| 24 | + None, # Icon |
| 25 | + None, # IconIndex |
| 26 | + None, # ShowCmd |
| 27 | + 'TARGETDIR' # WkDir |
| 28 | + ) |
| 29 | +] |
| 30 | + |
| 31 | +msi_data = { |
| 32 | + "Shortcut": shortcut_table |
| 33 | +} |
| 34 | + |
| 35 | +bdist_msi_options = { |
| 36 | + "summary_data": { |
| 37 | + "author": "Hugo Haldi", |
| 38 | + "comments": "Tomography Analysis Tool", |
| 39 | + "keywords": "TAT Tomography Analysis Tool" |
| 40 | + }, |
| 41 | + "data": msi_data, |
| 42 | + "upgrade_code": "{22872b66-f52b-40fd-b973-951a9cac3620}" |
| 43 | +} |
| 44 | + |
6 | 45 | build_exe_options = {
|
7 | 46 | "packages": [
|
8 | 47 | "PySide6",
|
|
16 | 55 | "path": sys.path
|
17 | 56 | }
|
18 | 57 |
|
19 |
| -# base="Win32GUI" should be used only for Windows GUI app |
20 |
| -base = None |
21 |
| -if sys.platform == "win32": |
22 |
| - base = "Win32GUI" |
23 |
| - |
24 |
| -version = "" |
25 |
| -with open("version.txt") as f: |
26 |
| - version = f.read().rstrip("\n") |
| 58 | +executables = [ |
| 59 | + Executable("src/tat/__main__.py", |
| 60 | + copyright="Copyright (C) 2022 TAT", |
| 61 | + base=base, |
| 62 | + target_name="tat", |
| 63 | + shortcut_name="Tomography Analysis Tool") |
| 64 | +] |
27 | 65 |
|
28 | 66 | setup(
|
29 | 67 | name="tat",
|
30 | 68 | version=version,
|
31 | 69 | description="Tomography Analysis Tool",
|
32 |
| - options={"build_exe": build_exe_options}, |
33 |
| - executables=[Executable("src/tat/__main__.py", |
34 |
| - base=base, target_name="tat")] |
| 70 | + options={ |
| 71 | + "build_exe": build_exe_options, |
| 72 | + "bdist_msi": bdist_msi_options |
| 73 | + }, |
| 74 | + executables=executables |
35 | 75 | )
|
0 commit comments