Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On windows, cannot run game with administrator compatibility mode #1021

Closed
3 tasks done
nicolaspernoud opened this issue Mar 9, 2023 · 4 comments · Fixed by #969
Closed
3 tasks done

On windows, cannot run game with administrator compatibility mode #1021

nicolaspernoud opened this issue Mar 9, 2023 · 4 comments · Fixed by #969
Labels
os:Windows OS is Windows wontfix This will not be worked on

Comments

@nicolaspernoud
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the nightly release?

  • This issue is present in the nightly release

Describe the Bug

On windows 11, with sunshine installed as a service. Starting a binary without the administrator compatibility mode works fine, but gives an error while starting the exact same binary with the exact same configuration but with the administrator compatibility mode enabled (in the compatibility tab of the binary properties).

Expected Behavior

It should work.

Additional Context

Probably related to #764

Host Operating System

Windows

Operating System Version

11

Architecture

64 bit

Sunshine commit or version

0.18.4

Package

Windows - portable

GPU Type

Nvidia

GPU Model

Geforce RTX 3080

GPU Driver/Mesa Version

528.49

Capture Method (Linux Only)

No response

Config

sunshine_name = PC
nv_preset = p4
amd_coder = auto
upnp = disabled
nv_tune = ull
vt_coder = auto
hevc_mode = 0
nv_rc = cbr
dwmflush = enabled
min_log_level = 2
origin_web_ui_allowed = lan
amd_quality = balanced
vt_software = auto
nv_coder = auto
virtual_sink = {0.0.0.00000000}.{a1733155-3b18-42c8-91b8-904a3b0de1a2}
qsv_preset = medium
fps = [10,30,60,90,120]
amd_preanalysis = disabled
amd_rc = vbr_latency
vt_realtime = enabled
key_rightalt_to_key_win = disabled
amd_vbaq = enabled
origin_pin_allowed = pc
amd_usage = ultralowlatency
resolutions = [
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    3440x1440,
    1920x1200,
    3860x2160,
    3840x1600
]
qsv_coder = auto
gamepad = x360

Apps

{
            "name": "Batman: The Telltale Series",
            "output": "",
            "cmd": "\"C:\\Games\\Batman - TTS - Shadows Edition\\Batman.exe\"",
            "image-path": "C:\\_apps\\sunshine\\config\/covers\/igdb_14746.png",
            "working-dir": ""
        }

Relevant log output

[2023:03:09:20:44:50]: Info: Executing: ["C:\_apps\sunshine\Display_Switch.exe" "/External"]
[2023:03:09:20:44:50]: Info: Executing: [RunDll32.exe user32.dll,SetCursorPos]
[2023:03:09:20:44:51]: Info: Executing: ["C:\Games\Batman - TTS - Shadows Edition\Batman.exe"] in ["C:\Games\Batman - TTS - Shadows Edition"]
[2023:03:09:20:44:51]: Error: Failed to launch process: 740
[2023:03:09:20:44:51]: Warning: Couldn't run ["C:\Games\Batman - TTS - Shadows Edition\Batman.exe"]: System: Invalid argument
[2023:03:09:20:44:51]: Info: Executing: ["C:\_apps\sunshine\Display_Switch.exe" "/Internal"]
@Nonary
Copy link
Collaborator

Nonary commented Mar 12, 2023

It doesn't work because by design commands in Sunshine do not run with administrator privileges to prevent escalation of privilege exploits.

These commands are being loaded from a file, which does not even require administrator privileges to modify.

If you need to launch an application with administrator privileges, follow this workaround: https://www.digitalcitizen.life/use-task-scheduler-launch-programs-without-uac-prompts/

@Nonary Nonary added wontfix This will not be worked on os:Windows:10 os:Windows OS is Windows labels Mar 12, 2023
@Nonary Nonary closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2023
@Nonary
Copy link
Collaborator

Nonary commented Mar 12, 2023

Oh forgot to mention, if you create any script that simply opens the shortcut instead of directly executing it, that will work as well.

Like creating a bat file and telling it to
start "file_path"

And then having Sunshine open the bat, will work without the scheduled task.

Scheduled task is more for removing the UAC prompt entirely.

@nicolaspernoud
Copy link
Author

Understood ! Thanks a lot for taking time to suggest workarounds, and for this amazing piece of software.

@Nonary
Copy link
Collaborator

Nonary commented Mar 13, 2023

I have a working proof of concept doing this, #1036

Just need review from someone who is more knowledgeable about the windows API and agree with me that it is a "safe" way of doing it. If it's not safe, then it might not be accepted basically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:Windows OS is Windows wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants