Open hankyusa opened 4 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Possible duplicate of #31803.
I can't find Arc on the Microsoft Store, but according to u/itmeBlurb "it installs using Microsoft's App Installer format, which is ran through the MS Store."
This makes me believe the issue is Wox.Plugin.Common.DefaultBrowserInfo.Path
since that had a similar issue (#19260) when Firefox was installed through the Microsoft Store. I think the fix (#20350) should be similar.
I was going to submit a pull request, but don't really know what I'm doing. Here's my the change I'd make to src/modules/launcher/Wox.Plugin/Common/DefaultBrowserInfo.cs.
// HACK: for browsers installed through Microsoft Store
// When installed through Microsoft Store the commandPattern does not have
// quotes for the path. As the Program Files does have a space
// the extracted path would be invalid, here we add the quotes to fix it.
const string ArcExecutableName = "arc.exe";
const string FirefoxExecutableName = "firefox.exe";
string executableName = commandPattern.Contains(ArcExecutableName) ? ArcExecutableName : commandPattern.Contains(FirefoxExecutableName) ? FirefoxExecutableName : '';
if (!string.IsNullOrEmpty(executableName) && commandPattern.Contains(@"\WindowsApps\") && (!commandPattern.StartsWith('\"')))
{
var pathEndIndex = commandPattern.IndexOf(executableName, StringComparison.Ordinal) + executableName.Length;
commandPattern = commandPattern.Insert(pathEndIndex, "\"");
commandPattern = commandPattern.Insert(0, "\"");
}
I can't find Arc on the Microsoft Store, but according to u/itmeBlurb "it installs using Microsoft's App Installer format, which is ran through the MS Store."
This makes me believe the issue is
Wox.Plugin.Common.DefaultBrowserInfo.Path
since that had a similar issue (#19260) when Firefox was installed through the Microsoft Store. I think the fix (#20350) should be similar.I was going to submit a pull request, but don't really know what I'm doing. Here's my the change I'd make to src/modules/launcher/Wox.Plugin/Common/DefaultBrowserInfo.cs.
// HACK: for browsers installed through Microsoft Store // When installed through Microsoft Store the commandPattern does not have // quotes for the path. As the Program Files does have a space // the extracted path would be invalid, here we add the quotes to fix it. const string ArcExecutableName = "arc.exe"; const string FirefoxExecutableName = "firefox.exe"; string executableName = commandPattern.Contains(ArcExecutableName) ? ArcExecutableName : commandPattern.Contains(FirefoxExecutableName) ? FirefoxExecutableName : ''; if (!string.IsNullOrEmpty(executableName) && commandPattern.Contains(@"\WindowsApps\") && (!commandPattern.StartsWith('\"'))) { var pathEndIndex = commandPattern.IndexOf(executableName, StringComparison.Ordinal) + executableName.Length; commandPattern = commandPattern.Insert(pathEndIndex, "\""); commandPattern = commandPattern.Insert(0, "\""); }
@hankyusa, @jaimecbernardo might be able to help consult here if you submit a PR, does look similar to https://github.com/microsoft/PowerToys/issues/19260 and the fix https://github.com/microsoft/PowerToys/pull/20350
I tried fixing this in the code, but it's seemingly impossible. To fix this follow these simple steps:
@echo off
setlocal enabledelayedexpansion
set "input=%*"
if "%input:~0,1%"=="?" (
set "search=%input:~2%"
if /i "!search:~0,4!"=="http" (
set "url=!search!"
) else (
set "url=https://www.google.com/search?q=!search: =+!"
)
) else (
set "url=%input%"
)
C:\Windows\System32\rundll32.exe url.dll,FileProtocolHandler !url!
endlocal
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
ProgId
, double click it and copy the value data.HKEY_CLASSES_ROOT\[INSERT YOUR COPIED VALUE DATA HERE]\shell\open\command
. Remember to insert your copied value data.left-click
> Copy as path
on Windows 11 or Home
> Copy path
on Windows 10.(Default)
and paste in the path you just copied.@TheRedDeveloper, cool solution, thank you! The only pity is that the Cyrillic alphabet is not processed, because it needs to be encoded
As far as I know, batch doesn't have any easy solutions for this, so I'm trying to rewrite it in another language
@sonniydsgn Yeah, this was just a quick and dirty solution, using .bat files in production is generally a horrible idea. They're literally called batch because they're for quickly batching programs together. Somebody should make a quick .exe with Rust or Python, maybe I'll do that.
@sonniydsgn I coded a clean solution in Rust. https://github.com/TheRedDeveloper/ArcRunner Everyone, go use it. It's super easy to use, and has proper URL-Encoding.
[!IMPORTANT]
Don't forget to leave the repository a star.
Microsoft PowerToys version
0.80.1
Installation method
Microsoft Store
Running as admin
No
Area(s) with issue?
PowerToys Run
Steps to reproduce
✔️ Expected Behavior
Open a new tab in Arc and navigate to search results page for "my search query".
❌ Actual Behavior
Sometimes an error message appears saying "Failed to open Arc". Other times focus switches to Arc, but no new tab is opened.
Other Software
Arc from The Browser Company