-
-
Notifications
You must be signed in to change notification settings - Fork 239
Windows: 10x faster shortcut creation and fixed emoji folder name issues (also fix broken shortcuts in Win) #390
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
base: master
Are you sure you want to change the base?
Conversation
…h emojis in Windows
Tested this out, can confirm it works well, this fixed saved me from making my own tool to do this 💀 |
I write you here because I don't see any other way to contact you from your forked repository (there is no discussion section enabled). I I have an error during Copying photos but I cannot debug it more. Could you please try to point me what is happening with this log messages? 2025-03-19 05:55:14 [INFO ] - Finding albums (this may take some time, dont worry :) ... |
Thanks for the report! The fork now has an issue section. Could you post it there so we can discuss it? This issue is not related to this PR (it's about the date structure option #299) |
When folder names contain emojis (like 💖🤖🚀), the PowerShell Shell.CreateShortcut method has an encoding issue:
https://stackoverflow.com/questions/74728834/copy-the-target-of-a-shortcut-file-lnk-when-the-target-path-contains-emoji-c
After trying different encoding and decoding methods, it was impossible to fix this issue in PowerShell.
Using FFI, which allows interaction with OS APIs (win32 in this case), turned out to be the solution.
The advantage is that it is 10x faster at creating shortcuts than using PowerShell on Windows!
Current Method -> PowerShell (105 seconds) [473 shortcuts]

New Method -> FFI (12 seconds) [473 shortcuts]

The code doesn't discard the use of PowerShell, if FFI fails to create the shortcut on Windows, it falls back to the old PowerShell method.
This fixes: #389
It also fixes: #276 (because on Windows shortcuts are created with absolute path)