mirror of
https://github.com/HayatoG/iss_pc.git
synced 2026-11-07 10:46:10 -10:00
- packaging/port.env: per-port profile (name, package slug, launcher, icon) read by the Linux and Windows package scripts; same keys for every port - package names gr2-linux-x86_64.tar.gz / gr2-windows-x86_64.zip, frozen launcher 'Gravity Rush 2', the GR2 player README (pt + en, required files), install_desktop.sh from the profile - Play <Game>.exe derives the game executable from its own name - original placeholder icon (packaging/icon/gr2-icon-1024.png, launcher gr2.png/.ico); TLG's icon and launcher left this repo - sceFiber on Windows with Win32 fibers (CreateFiber/SwitchToFiber) - CI: the current TLG workflow (PR builds without publishing, safe nightly swap, old-build cleanup, required files in the release notes), FreeType on Ubuntu and MSYS2, xbyak submodule fallback Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JyWhQUvUQf2YSf8HJWnAtd
39 lines
1.6 KiB
C
39 lines
1.6 KiB
C
/* Play <Game>.exe: starts the game with the settings saved by the launcher, without opening
|
|
* the launcher (it runs `<Game>.exe --play` from its own folder and waits for it, so Steam
|
|
* and other front ends see the game running). Extra arguments are passed on. */
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
#include <wchar.h>
|
|
|
|
int WINAPI wWinMain(HINSTANCE instance, HINSTANCE previous, PWSTR arguments, int show)
|
|
{
|
|
(void)instance, (void)previous, (void)show;
|
|
static wchar_t dir[32768], exe[32768], line[32768];
|
|
DWORD length = GetModuleFileNameW(NULL, dir, 32768);
|
|
if (length == 0 || length >= 32768)
|
|
return 1;
|
|
wchar_t *slash = wcsrchr(dir, L'\\');
|
|
if (slash)
|
|
*slash = 0;
|
|
/* "Play <Game>.exe" starts "<Game>.exe" next to it: the name comes from this file's own. */
|
|
const wchar_t *self = slash ? slash + 1 : dir;
|
|
const wchar_t *game = wcsncmp(self, L"Play ", 5) == 0 ? self + 5 : self;
|
|
swprintf(exe, 32768, L"%ls\\%ls", dir, game);
|
|
swprintf(line, 32768, L"\"%ls\" --play%ls%ls", exe, arguments && *arguments ? L" " : L"",
|
|
arguments ? arguments : L"");
|
|
|
|
STARTUPINFOW startup = {.cb = sizeof(startup)};
|
|
PROCESS_INFORMATION process;
|
|
if (!CreateProcessW(exe, line, NULL, NULL, FALSE, 0, NULL, dir, &startup, &process)) {
|
|
MessageBoxW(NULL, L"The game launcher was not found next to this file.", game,
|
|
MB_OK | MB_ICONERROR);
|
|
return 1;
|
|
}
|
|
CloseHandle(process.hThread);
|
|
WaitForSingleObject(process.hProcess, INFINITE);
|
|
DWORD code = 0;
|
|
GetExitCodeProcess(process.hProcess, &code);
|
|
CloseHandle(process.hProcess);
|
|
return (int)code;
|
|
}
|