#pragma once

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <string>
#include <filesystem>

namespace GModTeach {
namespace Platform {

struct ProcessResult {
    bool executed = false;
    DWORD exitCode = 0;
};

class Process {
public:
    static ProcessResult Execute(
        const std::filesystem::path& executable,
        const std::wstring& arguments,
        bool hidden = false,
        DWORD timeoutMs = INFINITE
    );

    static ProcessResult ExecuteCommandLine(
        const std::wstring& commandLine,
        bool hidden = false,
        DWORD timeoutMs = INFINITE
    );

    static void OpenBrowserURL(const std::string& url);
    static void RestartSelf();
};

} 
} 
