Merge pull request #2427 from Kingtous/master
opt: add os.system wrapper & fix tray manager
This commit is contained in:
		
						commit
						12bdd57a45
					
				
							
								
								
									
										11
									
								
								build.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								build.py
									
									
									
									
									
								
							| @ -8,6 +8,7 @@ import urllib.request | |||||||
| import shutil | import shutil | ||||||
| import hashlib | import hashlib | ||||||
| import argparse | import argparse | ||||||
|  | import sys | ||||||
| 
 | 
 | ||||||
| windows = platform.platform().startswith('Windows') | windows = platform.platform().startswith('Windows') | ||||||
| osx = platform.platform().startswith( | osx = platform.platform().startswith( | ||||||
| @ -17,6 +18,14 @@ exe_path = 'target/release/' + hbb_name | |||||||
| flutter_win_target_dir = 'flutter/build/windows/runner/Release/' | flutter_win_target_dir = 'flutter/build/windows/runner/Release/' | ||||||
| skip_cargo = False | skip_cargo = False | ||||||
| 
 | 
 | ||||||
|  | def custom_os_system(cmd): | ||||||
|  |     err = os._system(cmd) | ||||||
|  |     if err != 0: | ||||||
|  |         print(f"Error occured when executing: {cmd}. Exiting.") | ||||||
|  |         sys.exit(-1) | ||||||
|  | # replace prebuilt os.system | ||||||
|  | os._system = os.system | ||||||
|  | os.system = custom_os_system | ||||||
| 
 | 
 | ||||||
| def get_version(): | def get_version(): | ||||||
|     with open("Cargo.toml", encoding="utf-8") as fh: |     with open("Cargo.toml", encoding="utf-8") as fh: | ||||||
| @ -243,7 +252,7 @@ def build_flutter_deb(version, features): | |||||||
|     os.system('mkdir -p tmpdeb/usr/share/rustdesk/files/systemd/') |     os.system('mkdir -p tmpdeb/usr/share/rustdesk/files/systemd/') | ||||||
|     os.system('mkdir -p tmpdeb/usr/share/applications/') |     os.system('mkdir -p tmpdeb/usr/share/applications/') | ||||||
|     os.system('mkdir -p tmpdeb/usr/share/polkit-1/actions') |     os.system('mkdir -p tmpdeb/usr/share/polkit-1/actions') | ||||||
|     os.system('rm tmpdeb/usr/bin/rustdesk') |     os.system('rm tmpdeb/usr/bin/rustdesk || true') | ||||||
|     os.system( |     os.system( | ||||||
|         'cp -r build/linux/x64/release/bundle/* tmpdeb/usr/lib/rustdesk/') |         'cp -r build/linux/x64/release/bundle/* tmpdeb/usr/lib/rustdesk/') | ||||||
|     os.system( |     os.system( | ||||||
|  | |||||||
| @ -10,7 +10,7 @@ import package_info_plus_macos | |||||||
| import path_provider_macos | import path_provider_macos | ||||||
| import screen_retriever | import screen_retriever | ||||||
| import sqflite | import sqflite | ||||||
| import tray_manager | // import tray_manager | ||||||
| import uni_links_desktop | import uni_links_desktop | ||||||
| import url_launcher_macos | import url_launcher_macos | ||||||
| import wakelock_macos | import wakelock_macos | ||||||
| @ -39,7 +39,7 @@ class MainFlutterWindow: NSWindow { | |||||||
|             FLTPackageInfoPlusPlugin.register(with: controller.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) |             FLTPackageInfoPlusPlugin.register(with: controller.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) | ||||||
|             PathProviderPlugin.register(with: controller.registrar(forPlugin: "PathProviderPlugin")) |             PathProviderPlugin.register(with: controller.registrar(forPlugin: "PathProviderPlugin")) | ||||||
|             SqflitePlugin.register(with: controller.registrar(forPlugin: "SqflitePlugin")) |             SqflitePlugin.register(with: controller.registrar(forPlugin: "SqflitePlugin")) | ||||||
|             TrayManagerPlugin.register(with: controller.registrar(forPlugin: "TrayManagerPlugin")) |             // TrayManagerPlugin.register(with: controller.registrar(forPlugin: "TrayManagerPlugin")) | ||||||
|             UniLinksDesktopPlugin.register(with: controller.registrar(forPlugin: "UniLinksDesktopPlugin")) |             UniLinksDesktopPlugin.register(with: controller.registrar(forPlugin: "UniLinksDesktopPlugin")) | ||||||
|             UrlLauncherPlugin.register(with: controller.registrar(forPlugin: "UrlLauncherPlugin")) |             UrlLauncherPlugin.register(with: controller.registrar(forPlugin: "UrlLauncherPlugin")) | ||||||
|             WakelockMacosPlugin.register(with: controller.registrar(forPlugin: "WakelockMacosPlugin")) |             WakelockMacosPlugin.register(with: controller.registrar(forPlugin: "WakelockMacosPlugin")) | ||||||
|  | |||||||
| @ -63,7 +63,7 @@ dependencies: | |||||||
|     desktop_multi_window: |     desktop_multi_window: | ||||||
|         git: |         git: | ||||||
|             url: https://github.com/Kingtous/rustdesk_desktop_multi_window |             url: https://github.com/Kingtous/rustdesk_desktop_multi_window | ||||||
|             ref: 65a6acfdee49d6fc56c4c89ebb214d308543eb2b |             ref: 82f9eab81cb2c7bfb938def7a1b399a6279bbc75 | ||||||
|     freezed_annotation: ^2.0.3 |     freezed_annotation: ^2.0.3 | ||||||
|     flutter_custom_cursor: |     flutter_custom_cursor: | ||||||
|         git: |         git: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user