Bug 448472 - [MS Store/msix] "Open Resource Folder" opens non-existent directory
Summary: [MS Store/msix] "Open Resource Folder" opens non-existent directory
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: 5.0.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Alvin Wong
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-14 15:57 UTC by Michael Sullivan
Modified: 2022-02-04 10:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Error message when Krita tries to open the directory. (254.84 KB, image/png)
2022-01-14 15:57 UTC, Michael Sullivan
Details
Default setting (60.09 KB, image/png)
2022-01-14 16:03 UTC, Michael Sullivan
Details
Shows that the directory doesn't exist. (109.08 KB, image/png)
2022-01-14 16:04 UTC, Michael Sullivan
Details
Krita's file picker lying >:P (63.32 KB, image/png)
2022-01-14 16:07 UTC, Michael Sullivan
Details
About window (825.75 KB, image/png)
2022-01-14 16:21 UTC, Michael Sullivan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Sullivan 2022-01-14 15:57:58 UTC
Created attachment 145461 [details]
Error message when Krita tries to open the directory.

SUMMARY

The Microsoft Store version of Krita's buttons redirect to the free/normal application directories. (I'm not sure if this is intended or not)
It also

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Michael Sullivan 2022-01-14 16:03:27 UTC
Created attachment 145462 [details]
Default setting
Comment 2 Michael Sullivan 2022-01-14 16:04:07 UTC
Created attachment 145463 [details]
Shows that the directory doesn't exist.
Comment 3 Michael Sullivan 2022-01-14 16:07:47 UTC
Created attachment 145464 [details]
Krita's file picker lying >:P
Comment 4 Michael Sullivan 2022-01-14 16:19:17 UTC
(Remind me to add attachments AFTER writing the description... -_-)

SUMMARY:
The Microsoft Store version of Krita's buttons redirect to the free/normal application directories. (I'm not sure if this is intended or not)

STEPS TO REPRODUCE:
1. Install the Microsoft Store version of Krita.
2. Try to open the resources folder.

OBSERVED RESULT:
Error: Nonexistent directory.

EXPECTED RESULT:
Resources folder opens.

SOFTWARE/OS VERSIONS:
Build ABI: x86_64-little_endian-llp64
Build CPU: x86_64
CPU: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19042
Pretty Productname: Windows 10 (10.0)
Product Type: windows
Product Version: 10
Krita: 5.0.1
Qt Version: 5.12.12
Comment 5 Michael Sullivan 2022-01-14 16:21:18 UTC
Created attachment 145465 [details]
About window
Comment 6 Alvin Wong 2022-01-14 16:59:13 UTC
Um, so this is a result of Desktop Bridge (the official technology used to package traditional desktop applications for the Microsoft Store) applying filesystem virtualization (technical info: [1]). If you have not used the normal version (installer or portable package) before, the files will be actually placed under apackage-local location:

    %LOCALAPPDATA%\Packages\49800Krita_<RANDOM STRING>\LocalCache\Roaming\krita

... where <RANDOM STRING> is a bunch of random letters and numbers. (By the way I don't think it is actually random if you installed from the Store, so try `%LOCALAPPDATA%\Packages\49800KritaProject.Krita_n3kgb906j1zjg\LocalCache\Roaming\krita`.)

From the perspective of Krita (and by extension its file picker), it will appear as if the files are actually inside `AppData\Local\krita`. Unfortunately, there is no way for Krita to tell whether this folder actually exists in the per-user global AppData location or inside the package-local location, so I don't think there is a way to really fix the button in this case. (I need to do some digging to confirm this.)

[1]: https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes#file-system
Comment 7 Michael Sullivan 2022-01-14 17:31:36 UTC
(In reply to Alvin Wong from comment #6)
> If you have not used the
> normal version (installer or portable package) before,
I have, I recently bought it through the MS Store to support Krita's developers.

>     %LOCALAPPDATA%\Packages\49800Krita_<RANDOM
> STRING>\LocalCache\Roaming\krita
I tried that, Windows refuses to let me access %LOCALAPPDATA%\Packages in anyway...
Comment 8 Michael Sullivan 2022-01-14 17:33:26 UTC
Nevermind, now I can access it...
Comment 9 Alvin Wong 2022-01-22 13:40:44 UTC
Merge request to improve it: https://invent.kde.org/graphics/krita/-/merge_requests/1304
Comment 10 Alvin Wong 2022-02-04 10:23:41 UTC
Git commit 71a3c0fdc47a5f4718b8ab03b84dea12249c27db by Alvin Wong.
Committed on 04/02/2022 at 10:13.
Pushed by alvinwong into branch 'master'.

win: Add info on redirected AppData dir when running packaged

The packaged Desktop Bridge app redirects certain writes to the AppData
directories to a private app location, which makes "Open Resources
Folder" fail to work normally in some cases. This tries to detect if
such private app location is being used and informs the user about it,
also allows the user to choose to open the user AppData location or the
private app location.

M  +56   -0    libs/global/KisWindowsPackageUtils.cpp
M  +10   -0    libs/global/KisWindowsPackageUtils.h
M  +64   -1    libs/ui/KisViewManager.cpp
M  +50   -0    libs/ui/dialogs/kis_dlg_preferences.cc
M  +35   -1    libs/ui/forms/wdggeneralsettings.ui

https://invent.kde.org/graphics/krita/commit/71a3c0fdc47a5f4718b8ab03b84dea12249c27db