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

support Win8 / win10 / modern / metro / uwp apps #198

Closed
jesperbjerke opened this issue Oct 21, 2014 · 44 comments
Closed

support Win8 / win10 / modern / metro / uwp apps #198

jesperbjerke opened this issue Oct 21, 2014 · 44 comments
Assignees
Milestone

Comments

@jesperbjerke
Copy link

No description provided.

@qianlifeng
Copy link
Member

I don't have Win8/10 environment now, I will try above solutions when I got one.

@bao-qian bao-qian added this to the V1.2.0 milestone Nov 3, 2015
@bao-qian bao-qian changed the title Make Win8/10 apps searchable support Win8/10 / modern / metro / uwp apps May 30, 2016
@bao-qian bao-qian changed the title support Win8/10 / modern / metro / uwp apps support Win8 / win10 / modern / metro / uwp apps May 30, 2016
@zizhengwu
Copy link

I am wondering whether this feature is under development. If implemented, it would be a huge advantage over Hain (https://github.com/appetizermonster/hain) for example.

@bao-qian
Copy link
Member

bao-qian commented Jul 21, 2016

WIP:

notes:

https://github.com/ljw1004/uwp-desktop
https://blogs.msdn.microsoft.com/lucian/2015/10/23/how-to-call-uwp-apis-from-a-desktop-vbc-app/

http://stackoverflow.com/a/21610315/2833083
http://nicksnettravels.builttoroam.com/post/2015/07/24/launching-windows-store-applications-from-code-in-windows-10.aspx

http://stackoverflow.com/questions/32122679/getting-icon-of-modern-windows-app-from-a-desktop-application

AppxPackaging

http://clrprofiler.codeplex.com/
https://github.com/jimschubert/clr-profiler/blob/master/src/CLRProfiler45Source/WindowsStoreAppHelper/WindowsStoreAppHelper.cs
CLRProfiler45Source\MidlOut\readme.txt

cd dir
midl "C:\Program Files (x86)\Windows Kits\8.1\Include\winrt\AppxPackaging.idl"
tlbimp AppxPackaging.tlb /namespace:AppxPackaging /out:AppxPackagingTlb.dll

what have done

  1. Name
    1.1 AppxManifest.xml -> Properties -> DisplayName
    1.2 AppxManifest.xml -> xxx:VisualElements -> DisplayName
    1.3 package.Id.Name
  2. ms-resource in 1.1 and 1.2:
    2.1 SystemApps -> pris -> resources.lan.pri -> ms-resource:xxx
    2.2 WindowsApps -> resources.pri -> ms-resource:xxx
    2.3 WindowsApps -> all xxx.language-en_xxx in WindowsApps directory -> resources.pri -> ms-resource:xxx
  3. using FindPackagesForUser to get all packages
  4. parse AppxManifest.xml in 1
  5. parse different *.pri files in 2 using makepri.exe. IndexFileContentsAsync can't be used because of problems 2 and 3

problems

  1. if we want to use await with IAsyncOperation, then we must reference System.Runtime.Windowsruntime.dll. and Windows.winmd.
    But the size of windows.winmd is 4mb, same as wox, too big.
  2. IndexFileContentsAsync with Microsoft.Windows.Cortana_cw5n1h2txyewy\pris\resources.en-US.pri will throw Value does not fall within the expected range
  3. C:\Program Files\WindowsApps\Microsoft.BingWeather_4.11.156.0_neutral_split.language-zh-hans_8wekyb3d8bbwe\resources.pri: System.Exception: Load/UnloadPriFiles cannot be used with resource packages. (Exception from HRESULT: 0x80073B26)
  4. IAppListEntry.LaunchAsync() will throw {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null}

todo

  1. will .net 4.6 solve problem 1 and 4?
  2. use app id to solve mail calendar mismatch issue

@talynone
Copy link

talynone commented Aug 15, 2016

I have a plugin that does this that is 99% working, without needing to include the .winmd dependency. I'll try to post it to github tonight.

@bao-qian
Copy link
Member

@talynone that would be great. I'd like to merge your code.

@talynone
Copy link

It's still very raw/unorganized as I just wrote it 2 days ago. It mostly works, I want to refine the icon getting logic more and turn some methods into async/parallels tasks, you can check out what I have so far here:

https://github.com/talynone/Wox.Plugin.WindowsUniversalAppLauncher

@bao-qian
Copy link
Member

I remember SHLoadIndirectString has some problems, I will test again.

@talynone
Copy link

Well anything can be done alternate ways, but so far it works in resolving the DisplayName properly for all my store applications. I can even remove the dependency on packagemanager by getting the full names via "%LOCALAPPDATA%\Microsoft\Windows\Application Shortcuts" folder and or "HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages" registry key.

@talynone
Copy link

There were a few cases where LoadIndirectString wasn't properly extracting the DisplayName/Description, that has been fixed. So for my computer all of them are resolving properly now. Check repository for latest changes.

@jhdxr
Copy link
Member

jhdxr commented Aug 17, 2016

@talynone , could you provide a release version of your plugin so we can help testing it. if you have trouble in packaging, you may only offer the dll file and I'll help to pack it.

@bao-qian
Copy link
Member

bao-qian commented Aug 17, 2016

@talynone your code truly inspired me to find a better set of APIs.
I will copy part of your code into the program plugin and add your name in the commit message and release description.

updates to all:
It's finally done, I got a small working program with about 200 lines of code.
UWP support will coming out this weekends, support win8.1+ win10.
no manual COM import
no manual DisplayName parsing for multi language.

@jhdxr
Copy link
Member

jhdxr commented Aug 17, 2016

@happlebao I'm not sure about the things behind your and @talynone 's code, so I have a question. As i said in #857 , I have an app named Netease Music in the startup menu, and if I open it the name displayed in the task manger (process) is 网易云音乐. so which keyword(s) can I use to find that app? the english name or the chinese name? or both?

@bao-qian
Copy link
Member

bao-qian commented Aug 17, 2016

@jhdxr

should be 网易云音乐. as same as shown in start menu. (at least my pc will display 网易云音乐 instead of Netease Music in start menu.).
or yyy \ wangyiyunyinyue for pinyin.

should be Netease Music, same as shown in start menu

@talynone
Copy link

Did you decide to just catalog "%LOCALAPPDATA%\Microsoft\Windows\Application Shortcuts" folder and parse the .lnk file?

bao-qian added a commit that referenced this issue Aug 18, 2016
1. basic support, better than nothing...
2. thanks great contribution from @talynone
3. #198
@bao-qian
Copy link
Member

bao-qian commented Aug 18, 2016

@jhdxr
dll from @talynone UWP.zip
wox with uwp supprt: https://ci.appveyor.com/project/happlebao/wox/build/1.3.254/artifacts

I know the icon is ugly, but at least it is working...
https://www.tallcomponents.com/blog/opacity-masks-in-wpf

@talynone
Copy link

talynone commented Aug 18, 2016

Nice! A few things I noticed:

You don't have a few fixes I have implemented:

Try to search for "calendar" or "mail". In your version "mail" doesn't even show up and "calendar" launches the mail client. In my latest code I enumerate all AppIds that belong to a package with multiple apps defined, then I pass along the AppId at launch time and match against it to make sure it launches the right item in a multi app package.

Also there should be no reason to filter against a publisher. Look at my code that rejects a package if the AppListEntry property is set to "none":

https://github.com/talynone/Wox.Plugin.WindowsUniversalAppLauncher/blob/master/StoreAppLauncher/Helpers/NativeApiManifestHelpers.cs

That way if an app is specified not to show up on the Start Menu, we ignore it and that seems to filter out the nonsense packages.

You seem to be also grabbing the wrong icon (I grab the right one 95% of the cases, the spec is actually quite complex on multi app packages) : (Look at my GetBestLogo method).

https://msdn.microsoft.com/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets

Also I have preliminary code to generate an icon cache and overlay the current windows accent color as a background color when none/transparent is defined, or a background color specified by the app manifest when it's defined (Check out console tester app) which is what the start menu does.

@talynone
Copy link

Also when testing my plugin on a friend's computer it crashed, apparently she had a semi corrupt store app which caused looking up the "InstalledLocation.Path" property to throw an exception. You'll see in my code I have a try catch to just go to the next package if that happens.

@jhdxr
Copy link
Member

jhdxr commented Aug 18, 2016

@happlebao thx, @talynone 's plugin works well with 1.3.231 on my laptop. and the question I asked above, 网易云音乐 or wangyiyunyinyue does work, but neither Netease Music nor yyy works. (and I'm curious why yyy fails as wangyiyunyinyue works fine.

@bao-qian
Copy link
Member

@jhdxr how about updated wox?

bao-qian added a commit that referenced this issue Sep 5, 2016
e.g. mail and calendar, skype video and messaging

#198 (comment)
@bao-qian
Copy link
Member

bao-qian commented Sep 5, 2016

@talynone @Megasware128
please try again for mail / calendar problems.
the "cut the rope" problems should also be fixed.

@jhdxr
could you test mail / calendar uwp apps in chinese local?

https://ci.appveyor.com/project/happlebao/wox/build/1.3.292/artifacts

@talynone
Copy link

talynone commented Sep 6, 2016

@happlebao mail/calendar works fine now. Thanks. As mentioned before you may want to do the app launch async, so the wox dialog dismisses quickly.

Btw my code can deal with mail/calendar just fine, and uses no hacks. Look at my app launch code to see how I deal with it.

@Megasware128
Copy link
Contributor

Same for me. Calander and Mail fixed

@quericy
Copy link

quericy commented Oct 30, 2016

@happlebao Hi, I install the Wox-1.3.292.exe ,but it doesn't work.
The log file show the wrong folder path of Wox Plugins ,and the memory usage is abnormal:

memory

log file

@bao-qian bao-qian self-assigned this Nov 9, 2016
@bao-qian
Copy link
Member

bao-qian commented Nov 30, 2016

hi @quericy
sorry for late fix,
try again with 1.3.321
upload your whole log file (%APPDATA%\Log\1.3.319\date) once wox startup

@bao-qian
Copy link
Member

close due to no more new issue.
reopen if you found one.

bao-qian added a commit that referenced this issue Dec 19, 2017
1. basic support, better than nothing...
2. thanks great contribution from @talynone
3. #198
bao-qian added a commit that referenced this issue Dec 19, 2017
bao-qian added a commit that referenced this issue Dec 19, 2017
bao-qian added a commit that referenced this issue Dec 19, 2017
bao-qian added a commit that referenced this issue Dec 19, 2017
bao-qian added a commit that referenced this issue Dec 19, 2017
bao-qian added a commit that referenced this issue Dec 19, 2017
e.g. mail and calendar, skype video and messaging

#198 (comment)
@llinfeng
Copy link

I would like to step in with a quick "manual" fix, as I did not find clear instruction on what to do from the lengthy discussion above.

  • Source: https://lifehacker.com/how-to-create-a-shortcut-for-any-modern-windows-app-1722569853
  • Core steps:
    1. To open a magic folder that contains all "icon" to any registered programs on Windows. Note, this thankfully include those troublesome Windows Store Apps.
    2. Create shortcuts for these Apps, and give them literal names;
    3. Move those shortcuts to some folder that has been included in your PATH, and make Wox aware of such folder of shortcuts (the PATH step may be unnecessary, but I will press Win + R at times, when calling those shortcuts that I have created);
      image
    4. Restarting Wox will do the magic: now the shortcut you've created, however it is named, is several keystrokes away from you.
      image

In case one is curious (as I did myself), here goes what goes into that "shortcut to Windows Store App": something junky, un-editable and un-copy-able.
image

@Fooughhy
Copy link

Can this become a priority for Wox? I would really like this functionality.

@bao-qian
Copy link
Member

@Fooughhy
try new release, it has already been supported.
https://github.com/Wox-launcher/Wox/releases

@bao-qian bao-qian reopened this May 19, 2020
@Fooughhy
Copy link

I have a UWP app called "Microsoft Fjärrskrivbord" (Microsoft Remote Desktop as a direct translation) and it is still not showing up though... I just downloaded 1.4.1115.

I reindexed the "Programs" plugin. Do I require anything else?

Hxss7C6JKp
YPjUydEkQ9

@bao-qian
Copy link
Member

@Fooughhy
please open new issue for this bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests