@@ -32,9 +32,11 @@ def compile_gui():
3232        "--macos-create-app-bundle" , # Create macOS app bundle 
3333        "--macos-app-icon="  +  os .path .join (current_dir ,"AppIcon.icns" ), # App icon 
3434        "--include-data-file="  +  os .path .join (current_dir ,"zip.png" )+  f"=./zip.png" ,
35+         "--include-data-file="  +  os .path .join (current_dir ,"update" ,"update_apply.command" )+  f"=./update_apply.command" ,
3536        "--include-data-file="  +  os .path .join (current_dir ,"zipd.png" )+  f"=./zipd.png" ,
3637        "--include-data-file="  +  os .path .join (current_dir ,"AppIcon.png" )+  f"=./AppIcon.png" ,
3738        "--include-data-file="  +  os .path .join (current_dir ,"AppIcond.png" )+  f"=./AppIcond.png" ,
39+         "--include-data-dir=" + os .path .join (current_dir ,"qss" )+ "=./qss" ,
3840        "--macos-app-name=Converter" , # App name 
3941        "--macos-app-mode=gui" ,
4042        "--macos-app-version=2.0" ,
@@ -74,86 +76,7 @@ def compile_gui():
7476        print (f"Unexpected error during compilation: { e }  )
7577        return  False 
7678
77- def  compile_cli ():
78-     """Compile the CLI application using Nuitka""" 
79-     print ("Compiling CLI application with Nuitka..." )
80-     
81-     # Get the current directory 
82-     current_dir  =  os .path .dirname (os .path .abspath (__file__ ))
83-     
84-     # Define the main script to compile 
85-     main_script  =  os .path .join (current_dir , "support" , "convert.py" )
86-     
87-     # Check if the main script exists 
88-     if  not  os .path .exists (main_script ):
89-         print (f"Error: Main script not found at { main_script }  )
90-         return  False 
91-     
92-     # Nuitka compilation command for CLI 
93-     cmd  =  [
94-         sys .executable , "-m" , "nuitka" ,
95-         "--standalone" ,           # Create standalone executable 
96-         "--onefile" ,              # Create single file executable 
97-         "--output-dir=dist" ,      # Output directory 
98-         "--remove-output" ,        # Remove build directory after compilation 
99-         "--quiet" ,                # Reduce output verbosity 
100-         main_script 
101-     ]
102-     
103-     try :
104-         print ("Running Nuitka compilation for CLI..." )
105-         result  =  subprocess .run (cmd , check = True , capture_output = True , text = True )
106-         print ("CLI Compilation successful!" )
107-         print ("Executable created in dist/ directory" )
108-         return  True 
109-     except  subprocess .CalledProcessError  as  e :
110-         print ("CLI Compilation failed!" )
111-         print (f"Error: { e }  )
112-         print (f"stderr: { e .stderr }  )
113-         return  False 
114-     except  Exception  as  e :
115-         print (f"Unexpected error during CLI compilation: { e }  )
116-         return  False 
117- def  compile_cli_zip ():
118-     """Compile the CLI application using Nuitka""" 
119-     print ("Compiling CLI (Zip_Converter) application with Nuitka..." )
120-     
121-     # Get the current directory 
122-     current_dir  =  os .path .dirname (os .path .abspath (__file__ ))
123-     
124-     # Define the main script to compile 
125-     main_script  =  os .path .join (current_dir , "support" , "convertzip.py" )
126-     
127-     # Check if the main script exists 
128-     if  not  os .path .exists (main_script ):
129-         print (f"Error: Main script not found at { main_script }  )
130-         return  False 
131-     
132-     # Nuitka compilation command for CLI 
133-     cmd  =  [
134-         sys .executable , "-m" , "nuitka" ,
135-         "--standalone" ,           # Create standalone executable 
136-         "--onefile" ,              # Create single file executable 
137-         "--output-dir=dist" ,      # Output directory 
138-         "--remove-output" ,        # Remove build directory after compilation 
139-         "--quiet" ,                # Reduce output verbosity 
140-         main_script 
141-     ]
142-     
143-     try :
144-         print ("Running Nuitka compilation for CLI..." )
145-         result  =  subprocess .run (cmd , check = True , capture_output = True , text = True )
146-         print ("CLI Compilation successful!" )
147-         print ("Executable created in dist/ directory" )
148-         return  True 
149-     except  subprocess .CalledProcessError  as  e :
150-         print ("CLI Compilation failed!" )
151-         print (f"Error: { e }  )
152-         print (f"stderr: { e .stderr }  )
153-         return  False 
154-     except  Exception  as  e :
155-         print (f"Unexpected error during CLI compilation: { e }  )
156-         return  False 
79+ 
15780
15881def  main ():
15982    print ("PNG to ICNS Converter - Compilation Script" )
@@ -167,21 +90,14 @@ def main():
16790    # Compile both versions 
16891    gui_success  =  compile_gui ()
16992    print ()
170-     cli_success  =  compile_cli ()
171-     print ()
172-     zip_success  =  compile_cli_zip ()
93+ 
17394    print ("\n "  +  "="  *  40 )
174-     if  gui_success   and   cli_success   and   zip_success :
95+     if  gui_success :
17596        print ("All compilations completed successfully!" )
17697        print ("Executables are located in the 'dist' directory:" )
17798        print ("- GUI application: dist/launcher.app" )
178-         print ("- CLI application: dist/convert.bin" )
17999    else :
180100        print ("Some compilations failed. Please check the error messages above." )
181101        if  not  gui_success :
182102            print ("- GUI compilation failed" )
183-         if  not  cli_success :
184-             print ("- CLI compilation failed" )
185-         if  not  zip_success :
186-             print ("- CLI (Zip_Converter) compilation failed" )
187103
0 commit comments