Files icon indicating copy to clipboard operation
Files copied to clipboard

Bug: Opening items doesn't pass correct path to launched application

Open tacogerbil opened this issue 3 years ago • 5 comments

[!Important] Current workaround: https://github.com/files-community/Files/issues/12950#issuecomment-1704396874

Description

I have a .jar file for Minceraft java edition. It a custom launcher that I compile and I run from a folder on my desktop. https://github.com/SKCraft/Launcher After using FIles to access this folder and launching the file.. normally what happens is the jar file accesses the configuration files saved locally in the same folder as the jar file. One in particular is the accounts.dat file with the credentials for my Microsoft account.
When using "Files" it fails to register anything in this folder. Somehow through some registered variable in windows (I assume) it creates a folder in the same general folder location for the launcher project it was compiled in. It does NOT use the Desktop folder I created for the launcher. I have never in any other computer (including OSX or Linux) seen the jar file not being able to access these local files.... FYI, I use a bat file located on my NAS to compile the SKCraft Launcher Minecraft .jar file. This jar file is shared with my son and other nephews to use on their computers as is.. They simply run it and it creates all the local files you see in the included image.

image

Steps To Reproduce

  1. Run a program file in C:/Users/<name>/downloads
  2. See the program get path C:/Windows/System32

Requirements

  • e.g. Fix crash that occurs when... Behave as Windows Explorer does. When the jar file is double clicked it uses the java env. to run and accesses the configuration files the .jar file created in the same local folder. It then opens the Launcher and the user is able to play Minecraft from this folder as they do when using Explorer.

Files Version

3.5.10.0

Windows Version

10.0.22000.2176

Log File

debug.log

tacogerbil avatar Jul 14 '23 20:07 tacogerbil

Thanks for the report, I've added this to the project board.

I've also had this behavior with python files when getting path. I assume this would apply to any file type that does this

Josh65-2201 avatar Jul 15 '23 20:07 Josh65-2201

Wanted to let you know there is a workaround by making a shortcut of the file and having start in target blank.

Josh65-2201 avatar Sep 03 '23 20:09 Josh65-2201

@Josh65-2201 is this the same as #12139?

yair100 avatar Oct 25 '23 20:10 yair100

Not sure since this one has issue with the path defaulting to system32 folder and that one is with the username not being correct. Could be related though.

Josh65-2201 avatar Oct 26 '23 01:10 Josh65-2201

I have found that running a file from the recent files section does give it the correct path.

Josh65-2201 avatar Mar 29 '24 00:03 Josh65-2201

I tested opening a file in VS Code and I'm having trouble reproducing this issue. The command ling args passed by Files are identical to the ones passed by File Explorer.

yair100 avatar Aug 29 '24 17:08 yair100

Still an issue with python and java files. Here's a python file that outputs the working directory getWorkingDirectory.zip

Josh65-2201 avatar Aug 29 '24 18:08 Josh65-2201

Do you have a way to test that doesn't require installing python or java?

yair100 avatar Aug 29 '24 18:08 yair100

I can't repro with a batch file

@echo off
echo Current working directory: %cd%
pause

yair100 avatar Aug 29 '24 18:08 yair100

Python and Java are the only ones I know that has the issue

Josh65-2201 avatar Aug 29 '24 18:08 Josh65-2201

I don't know if it will help much but here is my comparison of the behavior in Files vs Explorer.

https://github.com/user-attachments/assets/7ff4fac5-d094-4936-83d0-36d8c3ccbd98

A-Loot avatar Aug 29 '24 18:08 A-Loot

A fix will be included in the next release.

yair100 avatar Aug 30 '24 14:08 yair100