You are here

Idea: NTFS Directory Linking

15 posts / 0 new
Last post
Jeff Savage
Offline
Last seen: 5 years 4 months ago
Joined: 2014-10-05 03:44
Idea: NTFS Directory Linking

Can we add a setting in the launcher.ini to enable NTFS Directory Linking?

MKLink /J "Link" "Target"

Some portable apps have massive databases and their directories cannot be moved to the data folder using our current methods. This forces them to DirectoryMove them to the proper directory on launch and move them back on exit, causing

- An exponential increase in load and exit times.
- More writing to a write limited device, such as a flash drive.

NTFS Directory Linking would fix this entirely. Instead of moving the entire folder, just link to it. Since PortableApps only work on windows anyways, it is sensible that people would use the NTFS file system and we should take full advantage of that.

On launch, it would check if the directory already exists (due to the software being locally installed) and if so, back it up, then create the link, if possible, and if not, fall back to DirectoryMove.

On Exit, if link was successful, just remove the link, if not move the directory back into the data folder. Restore the local backup, if any.

I'm proposing something like:

[NTFSDirectoryLink]
Link=Target
Database=%LocalAppData%\MyPublisher\MySoftware\Database

What do you guys think? I could write a custom loader to enable NTFS Directory Linking but it would be a bodge at best.

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 22 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Admin, Messy

It requires admin rights to set this up and it can get messy with removable media. Plus those apps would be restricted to NTFS which isn't the default for external drives.

Sometimes, the impossible can become possible, if you're awesome!

Jeff Savage
Offline
Last seen: 5 years 4 months ago
Joined: 2014-10-05 03:44
So in other words...

So in other words, its not going to be implemented?

Have an awesome day! Biggrin
Jeff Savage ~ BetaLeaf

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 22 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Never Release An App That Uses It

We'd never release as official an app that required that since it would fail from ExFAT drives (the default for external on Windows) entirely and wouldn't work without admin. We don't release apps that require admin rights unless the app itself requires admin due to its nature (disk tools, hklm registry tools, etc). As such, there wouldn't be much reason to add it to PAL and worry about supporting it since we couldn't make use of it.

What app were you wanting this functionality for?

Sometimes, the impossible can become possible, if you're awesome!

JLim
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-07-17 01:30
No admin rights is required

No admin rights is required if Junction.exe (a 212 KB app. from Sysinternals (https://technet.microsoft.com/en-us/sysinternals/bb896768.aspx)) is used.
Also NTFS is for the link only (I am not sure I use the term correctly or not, just give an example, %AppData% dir) not for the target (eg. %PAL:DataDir%).

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 22 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
No Redistribution

The EULA for Junction forbids redistribution, so that's not an option.

Sometimes, the impossible can become possible, if you're awesome!

Jeff Savage
Offline
Last seen: 5 years 4 months ago
Joined: 2014-10-05 03:44
How about the MkLink.exe that

How about the MkLink.exe that's included with every copy of Windows. I just checked and it works fine with limited permissions. My OS is Windows 10 if that matters.

Working Directory was %UserProfile%
Created the destination folder. "Target"
"Mklink /J Link Target"
Now you have %UserProfile%\Link linked to %UserProfile%\Target

Seems if the user has permission to write there, they also have permission to symlink.

I'm assuming messy means if the device is unplugging before the app closes, then data would be lost. That would be true regardless, as the alternative is using DirectoriesMove which would have the same issue.

Like I said in my op, if the user is using the NTFS file system, we should try to take full advantage. If they aren't using NTFS, then thats totally fine, just read the NTFSLink section as you would DirectoriesMove and it will still work. If you checked if the drive is NTFS and it is not, default back to DirectoriesMove and then apps would still work on ExFat, they would just be moved with DirectoriesMove instead of being symlinked. Do I need to further clarify here or do you understand?

Have an awesome day! Biggrin
Jeff Savage ~ BetaLeaf

JLim
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-07-17 01:30
May be make it an on-line

May be make it an on-line installer as in Autoruns which from Sysinternals too.

Jeff Savage
Offline
Last seen: 5 years 4 months ago
Joined: 2014-10-05 03:44
Junction is not necessary to

Junction is not necessary to symlink. Just use mklink.exe which is included with windows. It doesn't need admin to use if you are creating the junction in a folder that does not need administrator to write to, such as the user's %appdata%.

Have an awesome day! Biggrin
Jeff Savage ~ BetaLeaf

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 22 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Which app?

I'll ask again which specific app this is for. I can't think of any app that we'd include in our directory that would need this functionality at present.

Sometimes, the impossible can become possible, if you're awesome!

Jeff Savage
Offline
Last seen: 5 years 4 months ago
Joined: 2014-10-05 03:44
I don't have a specific app

I don't have a specific app that needs this. It's just an idea.

Have an awesome day! Biggrin
Jeff Savage ~ BetaLeaf

JLim
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-07-17 01:30
eg app Dropbox and Kodi. The

eg app Dropbox and Kodi. The data is very large.

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 22 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Neither

Kodi you'd just have your library on external and point to it. Same with Dropbox. This would only apply to an app that specifically has a hard-coded path for the full library that must be within APPDATA, USERPROFILE, or DOCUMENTS. Every app I've used that has a library of some size, only the actual settings are hard-coded somewhere like APPDATA\Dropbox or similar. That settings file defines the library locations which can be external directly.

Sometimes, the impossible can become possible, if you're awesome!

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 22 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Someone Else

I don't personally have interest or see a need for this, so I won't be taking up the mantle. (I also have a distate for juntions on Windows as they're kinda messy) If someone else is interested, feel free to code it. I wouldn't consider adding it to the main PAL tree without a genuine need, though (aka specific apps that need this feature to function). Features for the sake of features makes for maintenance nightmares.

Sometimes, the impossible can become possible, if you're awesome!

Jeff Savage
Offline
Last seen: 5 years 4 months ago
Joined: 2014-10-05 03:44
Speaking of kodi, Plex has a

Speaking of kodi, Plex has a hard coded library. Also I think you are missing the point. It's about options. Sometimes it's easy to symlink vs directoriesmove and filewrite. I've tried to do this with plex and it used a .db file to manage library locations. I can't filewrite a .db file.

Have an awesome day! Biggrin
Jeff Savage ~ BetaLeaf

Log in or register to post comments