alroyso 4 months ago
parent
commit
42c4f853b7
2 changed files with 4 additions and 18 deletions
  1. 4 1
      lib/app/controller/GlobalController.dart
  2. 0 17
      windows/runner/main.cpp

+ 4 - 1
lib/app/controller/GlobalController.dart

@@ -62,7 +62,10 @@ class GlobalController extends GetxController {
     await SharedPreferencesUtil().delete("last_successful_url");
     await controllers.tray.initTray();
     controllers.window.initWindow();
-    await controllers.cc_service.isCanOperationService();
+    if(Platform.isWindows){
+      await controllers.cc_service.isCanOperationService();
+    }
+
   }
 
   Future<bool> checkAllCoresStopped() async {

+ 0 - 17
windows/runner/main.cpp

@@ -41,24 +41,7 @@ void runAsAdmin() {
 int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
                       _In_ wchar_t *command_line, _In_ int show_command) {
 
-    if(!::IsDebuggerPresent()){
-         if (!isRunAsAdmin()) {
-            runAsAdmin();
-            exit(0);
-          }
-          if (wcsstr(command_line, L"--runas-admin") != NULL) {
 
-          }
-          else {
-            HWND hwnd = ::FindWindow(L"FLUTTER_RUNNER_WIN32_WINDOW", L"naiyouwl");
-            if (hwnd != NULL) {
-            DispatchToProtocolHandler(hwnd);
-            ::ShowWindow(hwnd, SW_NORMAL);
-            ::SetForegroundWindow(hwnd);
-            return EXIT_FAILURE;
-           }
-          }
-    }