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

[Bug]: CKAN First time URLHandlersPrompt fails due to running as root protection #4139

Closed
1 task done
Lewis98 opened this issue Aug 1, 2024 · 3 comments
Closed
1 task done
Labels
Bug Something is not working as intended Duplicate Duplicate of another issue GUI Issues affecting the interactive GUI

Comments

@Lewis98
Copy link

Lewis98 commented Aug 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Windows 10 Home V22H2 (OS Build 19045.4651)

CKAN Version

v1.34.4

Games

KSP 1

Game Version

1.12.5.3190

Did you make any manual changes to your game folder (i.e., not via CKAN)?

None, Fresh KSP Install, should be unrelated

Describe the bug

Received the following prompt on first time launching CKAN:
image

Responding yes provides the following command prompt warning:
image

The action attempted by the CKAN launcher appears to be unsuccessful.

Steps to reproduce

Pre-requisite: Machine with no prior installation or usage of CKAN

  1. Download CKAN executable

  2. Run CKAN

  3. Respond yes to the following prompt:
    image

  4. Warning is displayed on command prompt

Relevant log output

Couldn't find any relevant log output

@Lewis98 Lewis98 changed the title [Bug]: CKAN First time permission prompt to add handler fails due to running w/ root protection [Bug]: CKAN First time URLHandlersPrompt fails due to running as root protection Aug 1, 2024
@Lewis98
Copy link
Author

Lewis98 commented Aug 1, 2024

Checked \CKAN\GUI\URLHandlers.cs lines 69-80 and there seems to be a workaround for this issue already implemented, not entirely sure what's causing it to fail

Running ckan.exe manually as administrator with the '--asroot' flag appears to function fine, without warning, and resolves the issue on future launches (without admin perms).

CKAN/GUI/URLHandlers.cs

Lines 69 to 80 in 701afa1

if (user.RaiseYesNoDialog(Properties.Resources.URLHandlersPrompt))
{
// we need elevation to write to the registry
Process.Start(new ProcessStartInfo(Assembly.GetEntryAssembly().Location)
{
// trigger a UAC prompt (if UAC is enabled)
Verb = "runas",
// .NET ignores Verb without this
UseShellExecute = true,
Arguments = $"gui --asroot {UrlRegistrationArgument}"
});
}

@HebaruSan
Copy link
Member

Hi @Lewis98, thanks for the report. You're right, this was already fixed in #3996, but there hasn't been a major release since then. If you like, you can try the dev build to see the fix in action:

@HebaruSan
Copy link
Member

Duplicate of #4032

@HebaruSan HebaruSan marked this as a duplicate of #4032 Aug 1, 2024
@HebaruSan HebaruSan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI Duplicate Duplicate of another issue labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Duplicate Duplicate of another issue GUI Issues affecting the interactive GUI
Projects
None yet
Development

No branches or pull requests

2 participants