Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pythonw instead of hiding window on startup #1633

Merged
merged 6 commits into from Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion backend/requirements_windows.txt

This file was deleted.

8 changes: 0 additions & 8 deletions backend/setup.py
@@ -1,6 +1,5 @@
"""Setup"""
import io
import platform

from setuptools import find_packages, setup

Expand All @@ -12,13 +11,6 @@
with io.open("requirements.txt", encoding="utf-8") as f:
requirements = f.read().splitlines()

if platform.system() == "Windows":
with io.open("requirements_windows.txt", encoding="utf-8") as f:
requirements = [
*requirements,
*f.read().splitlines(),
]

package_data = ["icon.png", "icon.ico"]

setup(
Expand Down
3 changes: 2 additions & 1 deletion backend/systembridgebackend/autostart/windows.py
@@ -1,4 +1,5 @@
"""System Bridge: Autostart Windows"""
import os
import platform
import sys

Expand Down Expand Up @@ -52,6 +53,6 @@ def autostart_windows_enable():
"systembridgebackend",
0,
REG_SZ,
f'"{sys.executable}" -m systembridgebackend --silent',
f'"{os.path.join(os.path.dirname(sys.executable), "pythonw.exe")}" -m systembridgebackend --silent',
)
CloseKey(key)
1 change: 0 additions & 1 deletion backend/systembridgebackend/server/__init__.py
Expand Up @@ -358,6 +358,5 @@ def stop_server(self) -> None:
pending_task.cancel()
self._logger.info("Stop the event loop")
loop.stop()
# self._server.enable_websocket(False)
self._listeners.remove_all_listeners()
self._server.stop()
2 changes: 1 addition & 1 deletion backend/systembridgebackend/shortcut/windows.py
Expand Up @@ -37,6 +37,6 @@ def create_windows_shortcuts():
shortcut.Arguments = "-m systembridgebackend --silent"
shortcut.Description = "System Bridge"
shortcut.IconLocation = os.path.join(os.path.dirname(__file__), "../icon.ico")
shortcut.Targetpath = sys.executable
shortcut.Targetpath = os.path.join(os.path.dirname(sys.executable), "pythonw.exe")
shortcut.WorkingDirectory = sys.prefix
shortcut.save()
Expand Up @@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{058EAD2E-13C9-4586-9039-AE097F3AC080}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<RootNamespace>SystemBridgeWindowsSensors</RootNamespace>
<AssemblyName>SystemBridgeWindowsSensors</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
Expand Down