Skip to content

Can't follow windows shortcut (.lnk)  #7327

Closed

Description

@M3IT

System details

RStudio Edition : Desktop
RStudio Version : 1.3.959 
OS Version      : Win 10 v2004 (19041.329)
R Version       :  4.0.2

Steps to reproduce the problem

  • Create a windows shortcut (.lnk file) in the default working directory. The shortcut points to a folder containing R projects.
  • In RStudio, File | Open Project. R opens a file browser window in the default working directory.
  • Double click on the shortcut
  • Error appears
    image

Describe the problem in detail/the behaviour you expected

I use a number shortcuts in my default working directory and Documents folder to redirect apps opening/saving files to various locations. In other windows apps, double-clicking on these links when opening files moves the file browser window directly to the folder in the shortcut.
RStudio is not recognising the shortcut as a link, but is instead trying to open the .lnk file as a project and failing.

Activity

  1. gtritchie commented on Jul 13, 2020

    @gtritchie
    Member

    Reproduces with 1.3.1056, and also with 1.2.5033.

    Works as expected with 1.1.463.

    Closely-related bug, do File / Open File... instead of Open Project, double-click on shortcut, and it opens a File Explorer window with the shortcut destination instead of following it in-place.

  2. kevinushey commented on Jul 13, 2020

    @kevinushey
    Collaborator

    Might be caused by this:

    #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
    dialog.setResolveSymlinks(false);
    #else
    dialog.setOption(QFileDialog::DontResolveSymlinks, true);
    #endif

    It looks like Qt also interprets this flag on Windows to mean "don't resolve shortcuts". Since we do want that behavior on Windows, we probably need to scope that check to not-Windows.

  3. kevinushey commented on Jul 13, 2020

    @kevinushey
    Collaborator

    From https://code.woboq.org/qt5/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp.html#993:

        if (options & QFileDialogOptions::DontResolveSymlinks)
            flags |= FOS_NODEREFERENCELINKS;
    

    so there's a pretty good chance this is indeed the cause.

  4. added this to the v1.4 milestone on Jul 13, 2020
  5. kevinushey commented on Jul 13, 2020

    @kevinushey
    Collaborator

    Marking as v1.4 just because the associated fix should be simple.

  6. gtritchie commented on Jul 13, 2020

    @gtritchie
    Member

    #2476 prompted addition of this code back in 1.2

  7. R-Hannibal commented on Aug 27, 2020

    @R-Hannibal

    @M3IT, thanks again for finding and reporting this issue.

    We have a fix in place in our latest Daily build of the upcoming 1.4 release of RStudio (available HERE). If you get the chance will you let us know if the issue is resolved for you in that build?

  8. self-assigned this
    on Aug 27, 2020
  9. M3IT commented on Aug 28, 2020

    @M3IT
    Author

    @R-Hannibal, it is resolved in the linked version.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions