Skip to content

[windows] When creating explorer favorite use more specific windows functions #2719

Closed

Description

@remixtj

I'm experiencing problems with the creation of the favourite on Windows 7, using folder redirection. I made some research for the problem and found out that client tries to create a link on the wrong place. My "Links" directory is on a cifs share: \server\homes\username\Links. This wrong behavior is caused by the function setupFavLink_private in utility_win.cpp

At the moment in function setupFavLink_private at line 24 the function

    SHGetSpecialFolderPath(0, path, CSIDL_PROFILE, FALSE);

is used.
MSDN documentation says that ShGetFolderPath should be used. But says also that ShGetFolderPath is deprecated. A note states:

Note As of Windows Vista, this function is merely a wrapper for SHGetKnownFolderPath. The CSIDL value is translated to its associated KNOWNFOLDERID and then SHGetKnownFolderPath is called.
New applications should use the known folder system rather than the older CSIDL system, which is supported only for backward compatibility.

Please note that SHGetKnownFolder is a function available only on Vista and later. But, you can also note that also favourites on explorer are available since that windows release.

I made a test and tried to print the path value that is returned by the function call:

    SHGetKnownFolderPath(FOLDERID_Links, 0, NULL, path);

and i get (correctly) the value of \server\homes\username\Links.
I printed also the output of

    SHGetSpecialFolderPath(0, path, CSIDL_PROFILE, FALSE);

and i got _C:\Users\username_, that is correctly my profile home, but the path where the function will create the link is C:\Users\username\Links, that is wrong.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. remixtj commented on Mar 11, 2015

    @remixtj
    ContributorAuthor

    @danimo what do you think about this new patch? better?

  2. jturcotte commented on Aug 6, 2015

    @jturcotte
    Contributor

    Reopening since we had to revert this in #3562

  3. hodyroff commented on Dec 12, 2016

    @hodyroff

    Is this current in master? What exactly is the issue from a UX perspective?

  4. remixtj commented on Dec 12, 2016

    @remixtj
    ContributorAuthor

    Hi,
    this has been reverted. I had no possibility to have contributor terms signed, but since my company is a customer of owncloud, this patch is for sure interesting.

    The UX impact is that the user on windows, if using a Group Policy that sets its Links directory to a path different to %USERPROFILE%, the link to ownCloud directory on Explorer's Favourites is not available.

  5. guruz commented on Mar 29, 2017

    @guruz
    Contributor

    @remixtj Any news from your side?

  6. remixtj commented on Mar 29, 2017

    @remixtj
    ContributorAuthor

    @guruz got a mail 3 months ago from @hodyroff and i replied saying that i can sign personally CLA if is not an issue from owncloud side since is a my own contribution, even if done during worktime.

    If is ok, i can sign and then submit the patch again.

  7. hodyroff commented on Mar 29, 2017

    @hodyroff

    Works, thank you!

  8. remixtj commented on Apr 10, 2017

    @remixtj
    ContributorAuthor

    @guruz PR is now available, with signed CLA

  9. added this to the 2.4.0 milestone on Apr 26, 2017
  10. added
    ReadyToTest
    on Apr 27, 2017
  11. SamuAlfageme commented on May 4, 2017

    @SamuAlfageme
    Contributor

    Just tested current master and ownCloud shorcut is back in the Favorites 🎉 looks like we can cross one of #455 (comment) items.

    @remixtj would there be a way to set the folder icon to owncloud.exe's?. I've read about Desktop.ini files but, doesn't seem elegant enough:

    [.ShellClassInfo]
    IconFile=%ProgramFiles%\ownCloud\owncloud.exe
    IconIndex=0
    

    I'll repeat the test on W8.1 & 10 and close here if everything continues smooth there!

  12. remixtj commented on May 4, 2017

    @remixtj
    ContributorAuthor

    Hello,

    as far as i know, through QT is not possible to set the link icon, since that qt functions is cross platform and makes symlinks in linux and .lnk files in Windows.

    I'll take a look if some other options are available

  13. SamuAlfageme commented on May 25, 2017

    @SamuAlfageme
    Contributor

    👍

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

Metadata

Metadata

Assignees

Labels

ReadyToTestsev3-mediumtype:bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions