Skip to content

Commit 0487cfb

Browse files
committed
requirement updates
1 parent 163aaca commit 0487cfb

File tree

5 files changed

+71
-25
lines changed

5 files changed

+71
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ from time to time, but you as a community member can also create your own plugin
7373
| Scheduler | Autostart / -stop of servers or missions, modify missions, etc. | yes[^1] | Mission | [README](./plugins/scheduler/README.md) |
7474
| Cloud | Cloud-based statistics and connection to the [DGSA](#dgsa) global ban system. | yes[^1] | Userstats | [README](./plugins/cloud/README.md) |
7575
| MissionStats | Detailed users statistics / mission statistics. | yes[^1] | Userstats | [README](./plugins/missionstats/README.md) |
76-
| Monitoring | Monitoring and sstatistics for your DCS servers. | yes[^1] | Userstats | [README](plugins/monitoring/README.md) |
76+
| Monitoring | Monitoring and statistics for your DCS servers. | yes[^1] | Userstats | [README](plugins/monitoring/README.md) |
7777
| Backup | Create a backup of your database, server or bot configurations. | yes | | [README](./plugins/backup/README.md) |
7878
| Battleground | Support for [DCS Battleground](https://github.com/Frigondin/DCSBattleground) | yes | | [README](./plugins/battleground/README.md) |
7979
| Battleground2 | Support for the new version of [DCS Battleground](https://github.com/Frigondin/DCSBattleground) | yes | | [README](./plugins/battleground2/README.md) |

core/utils/os.py

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import win32console
3030
import winreg
3131

32-
from pywinauto.win32defines import SEE_MASK_NOCLOSEPROCESS, SW_HIDE
32+
from pywinauto.win32defines import SEE_MASK_NOCLOSEPROCESS, SW_HIDE, SW_SHOWMINNOACTIVE
3333

3434
API_URLS = [
3535
'https://api4.my-ip.io/ip',
@@ -62,7 +62,8 @@
6262
"get_win32_error_message",
6363
"CloudRotatingFileHandler",
6464
"run_elevated",
65-
"is_uac_enabled"
65+
"is_uac_enabled",
66+
"start_elevated"
6667
]
6768

6869
logger = logging.getLogger(__name__)
@@ -388,7 +389,7 @@ def run_elevated(exe_path, cwd, *args):
388389
sei.fMask = SEE_MASK_NOCLOSEPROCESS
389390
sei.lpVerb = "runas"
390391
sei.lpFile = os.path.abspath(exe_path)
391-
sei.lpDirectory = os.path.abspath(cwd)
392+
sei.lpDirectory = os.path.abspath(cwd) if cwd else os.path.dirname(exe_path)
392393
sei.lpParameters = ' '.join(map(str, args))
393394
sei.nShow = SW_HIDE
394395

@@ -429,3 +430,44 @@ def is_uac_enabled() -> bool:
429430
except (FileNotFoundError, PermissionError):
430431
# if not found or permission is denied, fall back to a safe default.
431432
return True
433+
434+
435+
def start_elevated(exe_path: str, cwd: str, *args) -> Optional[psutil.Process]:
436+
"""
437+
Start exe_path as Administrator and return a psutil.Process for the started process (Popen-like).
438+
Returns None on non-Windows platforms.
439+
440+
Note: The returned handle refers to the primary process created by ShellExecuteExW.
441+
"""
442+
if sys.platform != 'win32':
443+
return None
444+
445+
sei = SHELLEXECUTEINFO()
446+
sei.cbSize = ctypes.sizeof(sei)
447+
sei.fMask = SEE_MASK_NOCLOSEPROCESS
448+
sei.lpVerb = "runas"
449+
sei.lpFile = os.path.abspath(exe_path)
450+
sei.lpDirectory = os.path.abspath(cwd) if cwd else os.path.dirname(exe_path)
451+
sei.lpParameters = ' '.join(map(str, args))
452+
sei.nShow = SW_SHOWMINNOACTIVE
453+
454+
# noinspection PyUnresolvedReferences
455+
if not ctypes.windll.shell32.ShellExecuteExW(ctypes.byref(sei)):
456+
raise ctypes.WinError()
457+
458+
hproc = sei.hProcess
459+
460+
# Try to get PID from the handle to wrap in psutil.Process.
461+
# Kernel32 GetProcessId returns DWORD PID.
462+
GetProcessId = ctypes.windll.kernel32.GetProcessId # type: ignore[attr-defined]
463+
GetProcessId.argtypes = [ctypes.c_void_p]
464+
GetProcessId.restype = ctypes.c_ulong
465+
pid = GetProcessId(hproc)
466+
467+
if pid:
468+
try:
469+
return psutil.Process(pid)
470+
except psutil.NoSuchProcess:
471+
return None
472+
else:
473+
return None

extensions/srs/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ __Optional__ parameters (will change server.cfg if necessary):</br>
6161
* **autostart** If true, the SRS server will be auto-started (default).
6262
6363
> [!IMPORTANT]
64-
> You need to disable User-Access-Control (UAC) to use SRS-autoupdate.
64+
> You need to give the bot-user write permission on the SRS installation directory to use SRS-autoupdate.
65+
66+
> [!WARNING]
67+
> The new REST service for SRS is not supported yet, as it needs administrative elevation.
68+
> I am in contact with Ciribob already to remove this requirement.
6569
6670
> [!TIP]
6771
> You can rename the SRS extension in your server status embed by setting a "name" in the configuration like so:

requirements.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AIOFiles: File support for python's asyncio
2-
aiofiles==24.1.0
2+
aiofiles==25.1.0
33

44
# Astral: Get times for solar events (morning, noon, etc.)
55
astral==3.2
@@ -8,7 +8,7 @@ astral==3.2
88
audioop-lts==0.2.2 ; python_version >= "3.13"
99

1010
# AIOHTTP: Uses asyncio for async/await native coroutines for establishing and handling HTTP connections
11-
aiohttp==3.12.15
11+
aiohttp==3.13.0
1212

1313
# Certifi: Python package for providing Mozilla's CA Bundle
1414
certifi>=2025.8.3
@@ -17,13 +17,13 @@ certifi>=2025.8.3
1717
croniter==6.0.0
1818

1919
# discord.py: The python interface for the Discord API
20-
discord.py==2.6.3
20+
discord.py==2.6.4
2121

2222
# eyeD3: Python module and program for processing ID3 tags (metadata) in MP3 files
2323
eyeD3==0.9.8
2424

2525
# FastAPI: A modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints
26-
fastapi==0.118.0
26+
fastapi==0.118.2
2727

2828
# FuzzyWuzzy: Python library that uses Levenshtein Distance to calculate the differences between strings
2929
fuzzywuzzy==0.18.0
@@ -98,7 +98,7 @@ pywinauto==0.6.9; sys_platform == 'win32'
9898
requests==2.32.5
9999

100100
# Rich: Python library for rich text and beautiful formatting in the terminal
101-
rich==14.1.0
101+
rich==14.2.0
102102

103103
# ruamel-yaml: YAML parser/emitter supporting roundtrip comment preservation
104104
ruamel.yaml==0.18.15
@@ -113,7 +113,7 @@ sqlparse==0.5.3
113113
timezonefinder[numba]==6.5.9
114114

115115
# tomli: Python TOML parser
116-
tomli==2.2.1
116+
tomli==2.3.0 ; python_version < "3.11"
117117
tomli_w==1.2.0
118118

119119
# TrueSkill: Python module implementing the TrueSkill rating system

requirements.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
#
55
# pip-compile --no-annotate --output-file=requirements.txt --pip-args='--prefer-binary' --strip-extras requirements.in
66
#
7-
aiofiles==24.1.0
7+
aiofiles==25.1.0
88
aiohappyeyeballs==2.6.1
9-
aiohttp==3.12.15
9+
aiohttp==3.13.0
1010
aiosignal==1.4.0
1111
annotated-types==0.7.0
1212
anyio==4.11.0
1313
astral==3.2
1414
async-timeout==5.0.1
15-
attrs==25.3.0
15+
attrs==25.4.0
1616
audioop-lts==0.2.2 ; python_version >= "3.13"
1717
certifi==2025.10.5
1818
cffi==1.17.1
@@ -24,15 +24,15 @@ contourpy==1.3.2
2424
croniter==6.0.0
2525
cycler==0.12.1
2626
deprecation==2.1.0
27-
discord-py==2.6.3
27+
discord-py==2.6.4
2828
docopt==0.6.2
2929
et-xmlfile==2.0.0
3030
exceptiongroup==1.3.0
3131
eyed3==0.9.8
32-
fastapi==0.118.0
32+
fastapi==0.118.2
3333
filetype==1.2.0
3434
fonttools==4.60.1
35-
frozenlist==1.7.0
35+
frozenlist==1.8.0
3636
fuzzywuzzy==0.18.0
3737
gitdb==4.0.12
3838
gitpython==3.1.45
@@ -48,28 +48,28 @@ llvmlite==0.45.1
4848
lupa==2.5
4949
markdown-it-py==4.0.0
5050
markupsafe==3.0.3
51-
matplotlib==3.10.6
51+
matplotlib==3.10.7
5252
mdurl==0.1.2
5353
mgrs==1.5.0 ; python_version < "3.13"
5454
minidump==0.0.24 ; sys_platform == "win32"
5555
miniupnpc==2.3.3
56-
multidict==6.6.4
56+
multidict==6.7.0
5757
numba==0.62.1
5858
numpy==2.2.6
5959
openpyxl==3.1.5
6060
packaging==25.0
6161
pandas==2.3.3
6262
pid==3.0.4
6363
pillow==11.3.0
64-
propcache==0.4.0
64+
propcache==0.4.1
6565
psutil==7.1.0
6666
psycopg==3.2.10
6767
psycopg-binary==3.2.10
6868
psycopg-pool==3.2.6
6969
pyarrow==21.0.0
7070
pycparser==2.23
71-
pydantic==2.11.10
72-
pydantic-core==2.33.2
71+
pydantic==2.12.0
72+
pydantic-core==2.41.1
7373
pygments==2.19.2
7474
pykwalify==1.8.0
7575
pyparsing==3.2.5
@@ -82,7 +82,7 @@ pywinauto==0.6.9 ; sys_platform == "win32"
8282
rapidfuzz==3.14.1
8383
referencing==0.36.2
8484
requests==2.32.5
85-
rich==14.1.0
85+
rich==14.2.0
8686
rpds-py==0.27.1
8787
ruamel-yaml==0.18.15
8888
ruamel-yaml-clib==0.2.14
@@ -93,7 +93,7 @@ sniffio==1.3.1
9393
sqlparse==0.5.3
9494
starlette==0.48.0
9595
timezonefinder==6.5.9
96-
tomli==2.2.1
96+
tomli==2.3.0 ; python_version < "3.11"
9797
tomli-w==1.2.0
9898
trueskill==0.4.5
9999
typing-extensions==4.15.0
@@ -102,4 +102,4 @@ tzdata==2025.2
102102
urllib3==2.5.0
103103
uvicorn==0.37.0
104104
watchdog==6.0.0
105-
yarl==1.21.0
105+
yarl==1.22.0

0 commit comments

Comments
 (0)