jensroth-git / WinLaunch

macOS Launchpad for Windows
MIT License
156 stars 56 forks source link

Relative Paths #43

Open prettydiff opened 8 months ago

prettydiff commented 8 months ago

I am using WinLaunch in portable form so that data is saved in Data/Items.xml relative to the project's directory. I have difference instances of WinLaunch running relative to where it is executing, so that other locations are backups or redundancies.

When I add applications using the GUI the applications are added to Items.xml using absolute paths. When I open that file in a code editor and change the absolute paths to relative paths the application icons continue to display perfectly, but nothing executes when clicking on the application icons.

In the case of the relative path I am running WinLaunch from a directory at \\network\games\tools\WinLaunch

jensroth-git commented 8 months ago

Why would you want relative paths? When you are running it from a different directory it wouldn't work at all anymore?

prettydiff commented 8 months ago

Why I want relative paths.

I backed up a variety of personal media and applications to various different storage devices so that I may access it across the network at my house or on an external hard disk I can travel with. I store and run WinLaunch as part of that backed up data. It would be nice to allow relative paths, so that if WinLaunch is executed from an external hard disk it is only referencing applications stored on that hard disk relative to the location of WinLaunch's Items.xml file.

What happens

  1. I manually convert the pasts in Items.xml to relative paths I launch WinLaunch by opening the file in a code editor and using a find and replace all feature to convert \\network\games\ to ..\..\.
  2. WinLaunch loads up and presents the application icons perfectly fine from the specified relative path.
  3. I attempt to load one of the applications by clicking one of the application icons the respective application fails to open. This failure only occurs for some application icons. As far as I can tell the only difference between success and failure is directory name of the given application.

Examples of success and failure paths

Success

Failure

Summary

It looks like relative paths are already unintentionally working, aside from what appears to be an edge case defect. I have no idea why some paths fail and others work. Everything works when the paths are absolute.

Update

I have added some additional items to the example lists. I have verified its not permissions related and these success and failure lists behave identically in different locations (data backup repositories).

I have also noticed when I attempt to open an application for the first time at a given location Windows throws up a window about granting firewall (Windows Defender) access. I am not sure if this could be a factor. I have tried disabling the firewall and there is no change in behavior.

prettydiff commented 8 months ago

I have confirmed at least part of the problem is depth. When I changed:

To:

It then worked. I did duplicate that directory and modify its path to the new path. I am not sure why the others, such as ..\..\Playstation1\ePSXe.exe are not working. I did validate the relative path was used in the UI via the edit menu both times. The proper icon displayed on load of WinLaunch with both paths. I cannot edit to a relative path in the UI so I am closing out of WinLaunch entirely, manually altering Items.xml in a code editor, and then launching WinLaunch again.