Skip to content

Запуск в один клик: zip с BiStudent.exe, сервер стартует сам - #26

Merged
Felorez merged 6 commits into
Felorez:mainfrom
logreus-cloud:feature/one-click
Oct 19, 2026
Merged

Felorez merged 6 commits into
Felorez:mainfrom
logreus-cloud:feature/one-click

Conversation

@logreus-cloud

@logreus-cloud logreus-cloud commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Зачем

Сейчас для запуска нужен установщик и отдельное консольное окно сервера. Если окно закрыть, клиент перестаёт отвечать, а после повторного запуска сервер не поднимается. Теперь всё как в релизах до v0.4.0: скачал zip, распаковал, запустил BiStudent.exe, вошёл.

Что сделано

  • Клиент сам запускает встроенный сервер. Если рядом с BiStudent.exe лежит папка Server, клиент запускает сервер без окна и привязывает его к Job Object Windows. Сервер завершается вместе с клиентом, даже если клиент упал или его закрыли через диспетчер задач. Поле «Адрес сервера» на форме входа в этом случае скрыто, вход дожидается готовности сервера. Второй экземпляр клиента не запускается.
  • Релиз — zip вместо установщика. scripts/package.ps1 собирает BiStudent-win-x64.zip: в корне BiStudent.exe одним файлом, Models, README.txt, в папке Server сервер. CI публикует этот zip в релиз после каждого слияния в main. Inno Setup и installer/ удалены.
  • При запуске из исходников (run-demo.ps1, dotnet run) всё работает как раньше.

Проверка

  • dotnet build -warnaserror без предупреждений, dotnet test: 208 из 208.
  • Собрал zip локально, распаковал в чистую папку, запустил BiStudent.exe на пустой базе:
    • окно входа открылось без консольных окон, сервер работает дочерним процессом клиента;
    • teacher / teacher123 входит;
    • при закрытии клиента и при его принудительном завершении сервер тоже завершается;
    • первый запуск занимает около 22 секунд (распаковка встроенных библиотек), повторный открывает окно за секунду.

logreus-cloud and others added 6 commits October 19, 2026 18:27
When a Server folder sits next to BiStudent.exe, the client starts the
server itself without a console window and ties it to a job object, so
the server stops when the client exits or crashes. The login form hides
the server address and waits for the server on sign-in. Only one client
instance runs at a time, since the server lives with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKfFePzqcEUGQQ4JyA4NQn
The release is now BiStudent-win-x64.zip, laid out like the earlier
releases: unpack, run BiStudent.exe, sign in. The client is a single-file
exe with Models next to it; the server sits in the Server folder.
scripts/package.ps1 builds the zip locally and in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKfFePzqcEUGQQ4JyA4NQn
- Native libraries ship next to the exe instead of being self-extracted:
  the first launch spent ~20 s unpacking ~200 MB into %TEMP%. Now the
  login window opens in about a second, first run included.
- ReadyToRun for the client and server, and the request delegate
  generator for minimal APIs: the server is ready in ~1.8 s instead of
  ~4.5 s.
- The client no longer pulls in WPF (OpenCvSharp4.Windows ->
  OpenCvSharp4.runtime.win), and the unused OpenCV ffmpeg plugin is not
  published. The client exe went from 259 MB to 130 MB.
- The server listens on all IPv4 and IPv6 addresses. Bound to 0.0.0.0,
  every new connection to localhost first waited ~2 s for ::1 to be
  refused.
- The client checks that the port is listening before polling /health,
  since a refused connection on Windows also takes ~2 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKfFePzqcEUGQQ4JyA4NQn
The lesson context menu was disposed inside its own Closed handler.
WinForms was still closing it and then touched the disposed menu, which
killed the app with ObjectDisposedException after a click outside the
menu or on one of its items. The menu is now disposed after the close
completes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKfFePzqcEUGQQ4JyA4NQn
- ApiClient.Dispose no longer disposes the token semaphore: a refresh
  still in flight after sign-out would call Release() on a disposed
  object.
- ClientSettings.Save logs IO errors instead of throwing. A locked or
  read-only client.json killed the app from Program.Main or broke a
  request during token refresh.
- MainForm does not switch pages once closing has started: closing the
  window while the camera was stopping and clicking a section went on
  building a page inside the disposed form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKfFePzqcEUGQQ4JyA4NQn
@Felorez
Felorez merged commit 94e1ebd into Felorez:main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants