Files
spice2x.github.io/src/spice2x/util/sysutils.h
T
bicarus e9dcc5717e launcher: option to run as user without elevation (#695)
## Link to GitHub Issue or related Pull Request, if one exists
#694 

## Description of change
Before this change, we have it set in the executable manifest to always
ask for UAC elevation.

This change removes that and instead attempts to prompt for elevation
when we launch, depending on the new developer option that is being
added here to run as current user instead of elevating.

The default behavior continues to run as admin. This is still the safest
in terms of regression risk.

A bit of history on this: while spicecfg never technically needed to
elevate, we continue to do so to avoid difference in behavior when the
game is launched. For example, if the user is using an input remapper
running without elevation, it would inject input into spicecfg running
as user but fail to do so if the game runs elevated.

WinXP builds are unaffected (there is no UAC).

Some features will straight up fail without elevation so this will
remain as a debug option. To name a few (not a complete list):

* reboot/shutdown of PC
* running at realtime process priority
* `-nvprofile` option
* ...

## Testing
2026-05-16 16:27:59 -07:00

33 lines
722 B
C++

#pragma once
#include <string>
#include <vector>
#include <cstdint>
namespace sysutils {
void print_smbios();
void print_gpus();
void print_os();
struct MonitorEntry {
std::string display_name; // \\.\DISPLAY1
std::wstring friendly_name; // Dell S2204T; wstring so that it can be converted to utf8 or string
bool is_primary;
uint32_t adapter_id_LowPart;
int32_t adapter_id_HighPart;
uint32_t id;
};
const std::vector<MonitorEntry> &enumerate_monitors();
extern std::string SECOND_MONITOR_OVERRIDE;
void hook_EnumDisplayDevicesA();
#if !SPICE_XP
bool is_running_as_admin();
bool relaunch_as_admin();
#endif // !SPICE_XP
}