diff --git a/CLAUDE.md b/CLAUDE.md index 6a40ec4..64068fd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -84,7 +84,9 @@ The window is view glue. Logic lives in plain classes that the tests drive with 6. **Elevation.cs**: `LaunchOptions` (command-line parsing) and `Elevation` (admin check, symbolic link privilege probe, the UAC shield icon). 7. **LinkCreator.cs**: The link workflow: replace-existing prompts, and moving an existing file or folder to the target (rename on the same drive, copy with progress across drives, rollback on failure). 8. **LinkRunner.cs**: `ILinkRunner`, which `LinkCreator` uses to create links. `LinkRunner` runs mklink unelevated, except symbolic links that need admin, which go through the elevated helper. `PrepareAsync()` starts the helper (one UAC prompt) before anything on disk changes. -9. **LinkCommand.cs**: `LinkKind`, `LinkRequest`/`LinkResult` and `LinkCommand.RunAsync()`, which runs `cmd.exe /c mklink`. Used unelevated and by the elevated helper. +9. **LinkCommand.cs**: `LinkKind`, `LinkRequest`/`LinkResult` and `LinkCommand.RunAsync()`, which runs `cmd.exe /c mklink`. Used unelevated and by the elevated helper. Success comes from the exit code plus `LinkCheck.IsCreated()` on disk, never from mklink's text (it is in the language of Windows). A failure carries a `LinkError` code from `LinkCheck.Diagnose()`, which travels over the helper's pipe as a number. + - **LinkCheck.cs**: checks on disk that a link exists and leads to its target, and works out why mklink failed (link path taken, hard link across drives, junction to a network folder, no symbolic link privilege, folder access denied). + - **LinkResultMessage.cs**: turns a request and its `LinkResult` into the localized dialog title and text. `Reason()` gives one failure line, for reuse in a list of results. Long paths are shortened in the middle (`CompactPath`). 10. **ElevatedLinker.cs**: Starts `Symlinker.exe --link-helper` as administrator and sends it link requests over a named pipe. `RunHelper()` is the helper's side. 11. **LinkMover.cs**: File system helpers for moving: copy that keeps attributes and recreates nested links, delete that never follows links. 12. **InputValidator.cs**: Field checks behind the inline errors, and `ColorContrast` for text on the accent color. @@ -97,7 +99,7 @@ The window is view glue. Logic lives in plain classes that the tests drive with 2. User fills in the link location, link name and target (typing, browsing, or drag and drop). 3. Create link (or Enter, it is the default button) runs `ValidateInputs()`, which marks the fields `InputValidator` flags. 4. `RefreshSymlinkAccessNow()` probes again whether a symbolic link needs administrator rights. -5. `LinkCreator.CreateAsync()` handles an existing item at the link path (replace it, or move it to the target), then runs mklink and shows the result. `ILinkRunner.PrepareAsync()` is called before the first change on disk. +5. `LinkCreator.CreateAsync()` handles an existing item at the link path (replace it, or move it to the target), then runs mklink and shows the result through `LinkResultMessage`. `ILinkRunner.PrepareAsync()` is called before the first change on disk. ### Administrator rights @@ -135,6 +137,8 @@ Symlinker/ │ ├── LinkCreator.cs # Link workflow │ ├── LinkRunner.cs # Unelevated or elevated mklink │ ├── LinkCommand.cs # Runs mklink +│ ├── LinkCheck.cs # Verifies links on disk, diagnoses failures +│ ├── LinkResultMessage.cs # Localized result dialog text │ ├── ElevatedLinker.cs # Elevated link helper over a named pipe │ ├── LinkMover.cs # Move/copy/delete helpers │ ├── InputValidator.cs # Field checks, accent contrast diff --git a/Symlinker.Tests/ElevatedLinkerTests.cs b/Symlinker.Tests/ElevatedLinkerTests.cs index 3758828..98430bb 100644 --- a/Symlinker.Tests/ElevatedLinkerTests.cs +++ b/Symlinker.Tests/ElevatedLinkerTests.cs @@ -8,8 +8,6 @@ namespace Symlinker.Tests using System.Text; using System.Threading.Tasks; - using Res = Symlinker.Properties.Resources; - /// /// Tests the pipe protocol between the window and the elevated helper, in one process and /// without UAC: the test holds the window's end, and the helper loop runs on a background thread. @@ -56,7 +54,12 @@ public async Task Helper_CreatesEachLinkItIsSent_UntilTheWindowCloses() Assert.True(first.Success, first.Message); Assert.True(second.Success, second.Message); Assert.True(LinkMover.IsLink(new DirectoryInfo(temp.PathOf("second")))); - Assert.Equal((false, Res.InvalidQuoteInPath), (refused.Success, refused.Message)); + Assert.Equal((false, LinkError.InvalidPath), (refused.Success, refused.Error)); + + // The reason comes back over the pipe, with mklink's own text as a detail + var taken = await linker.CreateLinkAsync(Junction(temp.PathOf("first"), target)); + Assert.Equal((false, LinkError.LinkExists), (taken.Success, taken.Error)); + Assert.NotEmpty(taken.Message); linker.Dispose(); Assert.Equal(0, await helper.WaitAsync(TimeSpan.FromMilliseconds(Timeout), TestContext.Current.CancellationToken)); diff --git a/Symlinker.Tests/LinkCheckTests.cs b/Symlinker.Tests/LinkCheckTests.cs new file mode 100644 index 0000000..7cc8c50 --- /dev/null +++ b/Symlinker.Tests/LinkCheckTests.cs @@ -0,0 +1,178 @@ +namespace Symlinker.Tests +{ + using System; + using System.IO; + using System.Security.AccessControl; + using System.Security.Principal; + using System.Threading.Tasks; + + public sealed class LinkCheckTests : IDisposable + { + private readonly TempDir temp = new(); + + public void Dispose() => temp.Dispose(); + + private static LinkRequest Request(string type, string link, string target, bool directory = true) => + new() { Type = type, Link = link, Target = target, Directory = directory }; + + // ---- IsCreated ---- + + [Fact] + public void IsCreated_AcceptsAJunctionToTheTarget_WithOrWithoutATrailingSeparator() + { + var target = temp.Dir("target"); + var link = temp.Junction(temp.PathOf("link"), target).FullName; + + Assert.True(LinkCheck.IsCreated(Request("junction", link, target))); + Assert.True(LinkCheck.IsCreated(Request("junction", link, target + "\\"))); + } + + [Fact] + public void IsCreated_RejectsALinkThatPointsSomewhereElse() + { + var target = temp.Dir("target"); + var link = temp.Junction(temp.PathOf("link"), temp.Dir("other")).FullName; + + Assert.False(LinkCheck.IsCreated(Request("junction", link, target))); + } + + [Fact] + public void IsCreated_RejectsAPlainFolderOrNothing() + { + var target = temp.Dir("target"); + + Assert.False(LinkCheck.IsCreated(Request("junction", temp.Dir("plain"), target))); + Assert.False(LinkCheck.IsCreated(Request("symbolic", temp.PathOf("missing"), target))); + } + + [Fact] + public void IsCreated_ResolvesARelativeSymbolicLinkTarget_AgainstTheLinksFolder() + { + SymlinkSupport.Require(); + temp.File(@"files\target.txt"); + var link = temp.PathOf("links", "link.txt"); + Directory.CreateDirectory(temp.PathOf("links")); + File.CreateSymbolicLink(link, @"..\files\target.txt"); + + Assert.True(LinkCheck.IsCreated(Request("symbolic", link, @"..\files\target.txt", directory: false))); + Assert.False(LinkCheck.IsCreated(Request("symbolic", link, @"..\files\other.txt", directory: false))); + } + + [Fact] + public async Task IsCreated_AcceptsAHardLinkToTheSameFile_Only() + { + var target = temp.File("target.txt"); + var link = temp.PathOf("link.txt"); + Assert.True((await LinkCommand.RunAsync(Request("hard", link, target, directory: false))).Success); + var other = temp.File("other.txt"); + + Assert.True(LinkCheck.IsCreated(Request("hard", link, target, directory: false))); + Assert.False(LinkCheck.IsCreated(Request("hard", other, target, directory: false))); + Assert.False(LinkCheck.IsCreated(Request("hard", temp.PathOf("missing.txt"), target, directory: false))); + } + + [Fact] + public void IsSameFile_AssumesYes_WhenAFileCantBeOpened() + { + var target = temp.File("target.txt"); + var other = temp.File("other.txt"); + + using (new FileStream(other, FileMode.Open, FileAccess.Read, FileShare.None)) + Assert.True(LinkCheck.IsSameFile(target, other)); + + Assert.False(LinkCheck.IsSameFile(target, other)); + } + + // ---- Diagnose ---- + + private static LinkError Diagnose(LinkRequest request, bool existedBefore = false, bool canCreateSymlinks = true, bool canWrite = true) => + LinkCheck.Diagnose(request, existedBefore, () => canCreateSymlinks, _ => canWrite); + + [Fact] + public void Diagnose_ReportsAnExistingLinkPathFirst() + { + Assert.Equal(LinkError.LinkExists, Diagnose(Request("hard", @"C:\a\link", @"D:\b\target"), existedBefore: true, canWrite: false)); + } + + [Theory] + [InlineData(@"D:\b\target", nameof(LinkError.HardLinkAcrossDrives))] + [InlineData(@"C:\b\target", nameof(LinkError.Unknown))] + public void Diagnose_ChecksHardLinksAreOnTheTargetsDrive(string target, string expected) + { + Assert.Equal(Enum.Parse(expected), Diagnose(Request("hard", @"C:\a\link", target, directory: false))); + } + + [Theory] + [InlineData(@"\\server\share\folder", nameof(LinkError.JunctionNeedsLocalFolder))] + [InlineData(@"C:\folder", nameof(LinkError.Unknown))] + public void Diagnose_ChecksJunctionsPointToALocalFolder(string target, string expected) + { + Assert.Equal(Enum.Parse(expected), Diagnose(Request("junction", @"C:\a\link", target))); + } + + [Theory] + [InlineData(false, nameof(LinkError.NeedsAdmin))] + [InlineData(true, nameof(LinkError.Unknown))] + public void Diagnose_ChecksTheSymbolicLinkPrivilege(bool canCreateSymlinks, string expected) + { + Assert.Equal(Enum.Parse(expected), Diagnose(Request("symbolic", @"C:\a\link", @"\\server\share"), canCreateSymlinks: canCreateSymlinks)); + } + + [Fact] + public void Diagnose_ChecksTheLinksFolderCanBeWritten() + { + string folder = null; + var error = LinkCheck.Diagnose(Request("junction", @"C:\a\link", @"C:\b"), false, () => true, f => + { + folder = f; + return false; + }); + + Assert.Equal((LinkError.AccessDenied, @"C:\a"), (error, folder)); + } + + // ---- Helpers ---- + + [Fact] + public void CanWriteTo_IsTrue_ForAWritableFolder_AndLeavesNothingBehind() + { + var folder = temp.Dir("open"); + + Assert.True(LinkCheck.CanWriteTo(folder)); + Assert.Empty(Directory.GetFileSystemEntries(folder)); + } + + [Fact] + public void CanWriteTo_IsTrue_WhenTheProblemIsNotAccess() + { + Assert.True(LinkCheck.CanWriteTo(temp.PathOf("missing"))); + } + + [Fact] + public void CanWriteTo_IsFalse_WhenCreatingFilesIsDenied() + { + var folder = new DirectoryInfo(temp.Dir("locked")); + var security = folder.GetAccessControl(); + var deny = new FileSystemAccessRule(WindowsIdentity.GetCurrent().User, FileSystemRights.CreateFiles, AccessControlType.Deny); + security.AddAccessRule(deny); + folder.SetAccessControl(security); + try + { + Assert.False(LinkCheck.CanWriteTo(folder.FullName)); + } + finally + { + security.RemoveAccessRule(deny); + folder.SetAccessControl(security); + } + } + + [Theory] + [InlineData(@"\\server\share\folder", true)] + [InlineData(@"C:\folder", false)] + public void IsNetworkPath_SpotsShares(string path, bool expected) + { + Assert.Equal(expected, LinkCheck.IsNetworkPath(path)); + } + } +} diff --git a/Symlinker.Tests/LinkCommandTests.cs b/Symlinker.Tests/LinkCommandTests.cs index 83de0fd..8811055 100644 --- a/Symlinker.Tests/LinkCommandTests.cs +++ b/Symlinker.Tests/LinkCommandTests.cs @@ -4,8 +4,6 @@ namespace Symlinker.Tests using System.IO; using System.Threading.Tasks; - using Res = Symlinker.Properties.Resources; - public sealed class LinkCommandTests : IDisposable { private readonly TempDir temp = new(); @@ -52,7 +50,7 @@ public async Task RunAsync_ReportsARefusedRequest_WithoutRunningAnything() { var result = await LinkCommand.RunAsync(Request(target: "D:\\\"x"), temp.PathOf("no-such-shell.exe")); - Assert.Equal((false, Res.InvalidQuoteInPath), (result.Success, result.Message)); + Assert.Equal((false, LinkError.InvalidPath), (result.Success, result.Error)); } [Fact] @@ -60,22 +58,44 @@ public async Task RunAsync_ReportsAMissingShell() { var result = await LinkCommand.RunAsync(Request(), temp.PathOf("no-such-shell.exe")); - Assert.Equal((false, Res.CmdNotFound), (result.Success, result.Message)); + Assert.Equal((false, LinkError.CommandNotFound), (result.Success, result.Error)); + } + + [Theory] + [InlineData("@echo hello", "hello")] + [InlineData("@exit 0", "")] + public async Task RunAsync_ChecksThatTheLinkIsThere_EvenWhenTheShellSaysItWorked(string script, string output) + { + // A stand-in for cmd.exe that ignores the mklink arguments, so no link appears + var shell = temp.File("shell.cmd", script); + + var result = await LinkCommand.RunAsync(Request("junction", temp.PathOf("link"), temp.Dir("target")), shell); + + Assert.Equal((false, LinkError.NotCreated, output), (result.Success, result.Error, result.Message)); + } + + [Fact] + public async Task RunAsync_Succeeds_WhenTheShellWorkedAndTheLinkIsThere() + { + var target = temp.Dir("target"); + var link = temp.Junction(temp.PathOf("link"), target).FullName; + var shell = temp.File("shell.cmd", "@echo made it"); + + var result = await LinkCommand.RunAsync(Request("junction", link, target), shell); + + Assert.Equal((true, LinkError.None, "made it"), (result.Success, result.Error, result.Message)); } [Theory] - [InlineData("@echo hello", true, "hello")] - [InlineData("@exit 0", true, null)] - [InlineData("@echo oops 1>&2\r\n@exit 3", false, "oops")] - [InlineData("@echo plain\r\n@exit 2", false, "plain")] - public async Task RunAsync_UsesTheShellsOutput(string script, bool success, string message) + [InlineData("@echo oops 1>&2\r\n@exit 3", "oops")] + [InlineData("@echo plain\r\n@exit 2", "plain")] + public async Task RunAsync_KeepsTheShellsErrorText_WhenTheReasonIsUnknown(string script, string message) { - // A stand-in for cmd.exe that ignores the mklink arguments var shell = temp.File("shell.cmd", script); - var result = await LinkCommand.RunAsync(Request(), shell); + var result = await LinkCommand.RunAsync(Request("junction", temp.PathOf("link"), temp.Dir("target")), shell); - Assert.Equal((success, message ?? Res.LinkSuccessfullyCreated), (result.Success, result.Message)); + Assert.Equal((false, LinkError.Unknown, message), (result.Success, result.Error, result.Message)); } [Fact] @@ -88,22 +108,47 @@ public async Task RunAsync_CreatesARealJunction() var result = await LinkCommand.RunAsync(Request("junction", link, target)); Assert.True(result.Success, result.Message); + Assert.Equal(LinkError.None, result.Error); Assert.True(LinkMover.IsLink(new DirectoryInfo(link))); Assert.True(File.Exists(Path.Combine(link, "inside.txt"))); } [Fact] - public async Task RunAsync_ReportsMklinkErrors() + public async Task RunAsync_ReportsAnExistingLinkPath_WithMklinksText() { var target = temp.Dir("target"); var link = temp.Dir("taken"); var result = await LinkCommand.RunAsync(Request("junction", link, target)); - Assert.False(result.Success); + Assert.Equal((false, LinkError.LinkExists), (result.Success, result.Error)); Assert.NotEmpty(result.Message); } + [Fact] + public async Task RunAsync_CreatesARealHardLink() + { + var target = temp.File("target.txt", "same"); + var link = temp.PathOf("link.txt"); + + var result = await LinkCommand.RunAsync(Request("hard", link, target, directory: false)); + + Assert.True(result.Success, result.Message); + Assert.Equal("same", File.ReadAllText(link)); + } + + [Fact] + public async Task RunAsync_CreatesARealSymbolicLink() + { + SymlinkSupport.Require(); + var target = temp.Dir("target"); + var link = temp.PathOf("link"); + + var result = await LinkCommand.RunAsync(Request("symbolic", link, target)); + + Assert.True(result.Success, result.Message); + } + [Theory] [InlineData("Symbolic", "symbolic")] [InlineData("Hard", "hard")] diff --git a/Symlinker.Tests/LinkCreatorTests.cs b/Symlinker.Tests/LinkCreatorTests.cs index c0ad23d..7012634 100644 --- a/Symlinker.Tests/LinkCreatorTests.cs +++ b/Symlinker.Tests/LinkCreatorTests.cs @@ -29,6 +29,17 @@ public LinkCreatorTests() private static string Format(string format, params object[] args) => string.Format(CultureInfo.CurrentUICulture, format, args); + private static string Paths(string link, string target) => + Format(Res.ResultLinkPath, LinkResultMessage.CompactPath(link)) + "\n" + Format(Res.ResultTargetPath, LinkResultMessage.CompactPath(target)); + + /// The success text for a symbolic link or junction. + private static string Created(string linkName, string targetName, string link, string target) => + Format(Res.ResultPointsToSentence, linkName, targetName) + "\n\n" + Paths(link, target); + + /// The success text after moving an item and linking it. + private static string Moved(string name, string link, string target) => + Format(Res.MoveSucceeded, name) + "\n\n" + Paths(link, target); + private Task Create(string linkName, string destination, bool isFolder = true, LinkKind kind = LinkKind.Symbolic, string linkLocation = null) => creator.CreateAsync(new LinkInput(linkLocation ?? Links, linkName, destination, isFolder, kind)); @@ -105,7 +116,7 @@ public async Task Create_FolderLink_RunsMklinkWithTrimmedPaths() await creator.CreateAsync(new LinkInput($" {Links} ", " name ", $" {target} ", true, LinkKind.Junction)); AssertLinked("junction", $@"{Links}\name", target, directory: true); - Assert.Equal((Res.MessageBoxSuccessTitle, "created"), dialogs.Last); + Assert.Equal((Res.ResultJunctionCreated, Created("name", "target", $@"{Links}\name", target)), dialogs.Last); Assert.Empty(dialogs.Questions); } @@ -129,7 +140,7 @@ public async Task Create_ShowsMklinkErrors() await Create("name", target); - Assert.Equal((Res.MessageBoxErrorTitle, "access denied"), dialogs.Last); + Assert.Equal((Res.ResultFailedTitle, "access denied"), dialogs.Last); } [Fact] @@ -310,7 +321,7 @@ public async Task Move_Folder_OnTheSameDrive_RenamesAndLinks() AssertLinked("symbolic", $@"{Links}\name", target, directory: true); Assert.Equal("data", File.ReadAllText(Path.Combine(target, "data.txt"))); Assert.False(Directory.Exists(temp.PathOf("links", "name"))); - Assert.Equal((Res.MessageBoxSuccessTitle, Format(Res.MoveSucceeded, "name", target)), dialogs.Last); + Assert.Equal((Res.ResultSymbolicLinkCreated, Moved("name", $@"{Links}\name", target)), dialogs.Last); Assert.True(movingDuringLink); Assert.False(creator.IsMoving); Assert.Null(dialogs.Progress.Shown); @@ -340,7 +351,7 @@ public async Task Move_File_OnTheSameDrive_RenamesAndLinks() Assert.Equal(Format(Res.DialogMoveFile, "name.txt", target), Assert.Single(dialogs.Questions).Message); Assert.Equal("data", File.ReadAllText(target)); Assert.False(File.Exists(temp.PathOf("links", "name.txt"))); - Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title); + Assert.Equal(Res.ResultSymbolicLinkCreated, dialogs.Last.Title); } [Fact] @@ -352,7 +363,7 @@ public async Task Move_IntoAnEmptyFolder_ReplacesIt() await Create("name", target); Assert.True(File.Exists(Path.Combine(target, "data.txt"))); - Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title); + Assert.Equal(Res.ResultSymbolicLinkCreated, dialogs.Last.Title); } [Fact] @@ -382,7 +393,7 @@ public async Task Move_OutOfAppData_Works_InTheStorePackage() await Create("name", target, linkLocation: temp.PathOf("AppData", "Local")); Assert.True(File.Exists(Path.Combine(target, "data.txt"))); - Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title); + Assert.Equal(Res.ResultSymbolicLinkCreated, dialogs.Last.Title); } [Fact] @@ -397,7 +408,7 @@ public async Task Move_IntoAppData_Works_OutsideTheStorePackage() await Create("name", target); Assert.True(File.Exists(Path.Combine(target, "data.txt"))); - Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title); + Assert.Equal(Res.ResultSymbolicLinkCreated, dialogs.Last.Title); } [Fact] @@ -426,7 +437,7 @@ public async Task Move_Folder_ToAnotherDrive_CopiesWithProgressThenRemovesTheOri Assert.Equal("bb", File.ReadAllText(Path.Combine(target, "nested", "b.txt"))); Assert.False(Directory.Exists(temp.PathOf("links", "name"))); Assert.False(Directory.Exists(temp.PathOf("links", "name.symlinker-move"))); - Assert.Equal((Res.MessageBoxSuccessTitle, Format(Res.MoveSucceeded, "name", target)), dialogs.Last); + Assert.Equal((Res.ResultSymbolicLinkCreated, Moved("name", $@"{Links}\name", target)), dialogs.Last); var progress = dialogs.Progress; Assert.Equal((Res.ProgressMoveTitle, Res.ProgressMovePreparing, Res.ButtonCancel), progress.Shown); @@ -449,7 +460,7 @@ public async Task Move_File_ToAnotherDrive_CopiesIt() Assert.Equal("data", File.ReadAllText(target)); Assert.False(File.Exists(temp.PathOf("links", "name.txt"))); - Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title); + Assert.Equal(Res.ResultSymbolicLinkCreated, dialogs.Last.Title); Assert.Equal(new[] { 0d }, dialogs.Progress.Values); } diff --git a/Symlinker.Tests/LinkResultMessageTests.cs b/Symlinker.Tests/LinkResultMessageTests.cs new file mode 100644 index 0000000..fbdfad5 --- /dev/null +++ b/Symlinker.Tests/LinkResultMessageTests.cs @@ -0,0 +1,119 @@ +namespace Symlinker.Tests +{ + using System; + using System.Globalization; + + using Res = Symlinker.Properties.Resources; + + public sealed class LinkResultMessageTests + { + private static LinkRequest Request(string type = "symbolic", string link = @"D:\Games\accounts\Test", string target = @"D:\Games\benchmarks") => + new() { Type = type, Link = link, Target = target, Directory = type != "hard" }; + + private static string Format(string format, params object[] args) => string.Format(CultureInfo.CurrentUICulture, format, args); + + private static string Paths(string link, string target) => + Format(Res.ResultLinkPath, link) + "\n" + Format(Res.ResultTargetPath, target); + + [Theory] + [InlineData("symbolic")] + [InlineData("junction")] + [InlineData(null)] + public void For_ASymbolicLinkOrJunction_SaysWhatItPointsTo(string type) + { + var message = LinkResultMessage.For(Request(type), LinkResult.Created("symbolic link created for ... <<===>> ...")); + + Assert.Equal(type == "junction" ? Res.ResultJunctionCreated : Res.ResultSymbolicLinkCreated, message.Title); + Assert.Equal( + Format(Res.ResultPointsToSentence, "Test", "benchmarks") + "\n\n" + Paths(@"D:\Games\accounts\Test", @"D:\Games\benchmarks"), + message.Message); + } + + [Fact] + public void For_AHardLink_SaysItIsAnotherName() + { + var message = LinkResultMessage.For(Request("hard", @"C:\a\copy.txt", @"C:\b\original.txt"), LinkResult.Created()); + + Assert.Equal(Res.ResultHardLinkCreated, message.Title); + Assert.Equal(Format(Res.ResultHardLinkSentence, "copy.txt", "original.txt") + "\n\n" + Paths(@"C:\a\copy.txt", @"C:\b\original.txt"), message.Message); + } + + [Fact] + public void For_ALinkToADriveRoot_NamesTheDrive() + { + var message = LinkResultMessage.For(Request(target: @"E:\"), LinkResult.Created()); + + Assert.StartsWith(Format(Res.ResultPointsToSentence, "Test", @"E:\"), message.Message); + } + + [Fact] + public void For_LongPaths_ShortensThem() + { + var link = @"D:\Alejandro\Documents\Some Very Long Game Name\Saved Games\accounts\Test"; + var message = LinkResultMessage.For(Request(link: link), LinkResult.Created()); + + Assert.Contains(Format(Res.ResultLinkPath, LinkResultMessage.CompactPath(link)), message.Message); + Assert.DoesNotContain(link, message.Message); + } + + [Fact] + public void ForMove_SaysWhatMoved_AndWhereTheLinkIs() + { + var message = LinkResultMessage.ForMove(Request("junction"), "Test"); + + Assert.Equal(Res.ResultJunctionCreated, message.Title); + Assert.Equal(Format(Res.MoveSucceeded, "Test") + "\n\n" + Paths(@"D:\Games\accounts\Test", @"D:\Games\benchmarks"), message.Message); + } + + [Fact] + public void For_AFailure_UsesThePlainReason() + { + var message = LinkResultMessage.For(Request(), LinkResult.Failed(LinkError.NeedsAdmin, "A required privilege is not held by the client.")); + + Assert.Equal((Res.ResultFailedTitle, Res.ResultNeedsAdmin), (message.Title, message.Message)); + } + + public static TheoryData MappedReasons => new() + { + { nameof(LinkError.InvalidPath), Res.InvalidQuoteInPath }, + { nameof(LinkError.CommandNotFound), Res.CmdNotFound }, + { nameof(LinkError.NotCreated), Res.ResultNotCreated }, + { nameof(LinkError.LinkExists), Format(Res.ResultLinkExists, "Test") }, + { nameof(LinkError.AccessDenied), Format(Res.ResultAccessDenied, @"D:\Games\accounts") }, + { nameof(LinkError.NeedsAdmin), Res.ResultNeedsAdmin }, + { nameof(LinkError.HardLinkAcrossDrives), Res.ResultHardLinkAcrossDrives }, + { nameof(LinkError.JunctionNeedsLocalFolder), Res.ResultJunctionNeedsLocalFolder }, + }; + + [Theory] + [MemberData(nameof(MappedReasons))] + public void Reason_ExplainsKnownFailures_WithoutMklinksText(string error, string expected) + { + Assert.Equal(expected, LinkResultMessage.Reason(Request(), LinkResult.Failed(Enum.Parse(error), "mklink text"))); + } + + [Theory] + [InlineData("Cannot create a file when that file already exists.", "Cannot create a file when that file already exists.")] + [InlineData(" ", null)] + [InlineData(null, null)] + public void Reason_ShowsMklinksText_ForUnknownFailures(string detail, string expected) + { + Assert.Equal(expected ?? Res.ResultUnknownError, LinkResultMessage.Reason(Request(), LinkResult.Failed(detail))); + } + + [Theory] + [InlineData(@"C:\short\path", 60, @"C:\short\path")] + [InlineData(@"D:\Alejandro\Documents\Anno 1800\accounts\Test", 30, "D:\\\u2026\\Anno 1800\\accounts\\Test")] + [InlineData(@"D:\Alejandro\Documents\Anno 1800\accounts\Test", 20, "D:\\\u2026\\accounts\\Test")] + [InlineData(@"D:\Alejandro\Documents\A-very-long-folder-name", 20, "D:\\\u2026\\A-very-long-folder-name")] + [InlineData(@"\\server\share\Documents\Anno 1800\Test", 31, "\\\\server\\share\\\u2026\\Anno 1800\\Test")] + [InlineData(@"\\server\share\Documents\Anno 1800\Test", 30, "\\\\server\\share\\\u2026\\Test")] + [InlineData(@"C:\a-very-long-file-name-here.txt", 20, "C:\\\u2026\\a-very-long-file-name-here.txt")] + [InlineData(@"..\..\Documents\Anno 1800\accounts\Test", 25, "\u2026\\Anno 1800\\accounts\\Test")] + [InlineData(@"\\a-very-long-server-name\share", 20, @"\\a-very-long-server-name\share")] + public void CompactPath_KeepsTheDriveAndTheLastFoldersThatFit(string path, int maxLength, string expected) + { + Assert.Equal(expected, LinkResultMessage.CompactPath(path, maxLength)); + } + } +} diff --git a/Symlinker.Tests/LinkRunnerTests.cs b/Symlinker.Tests/LinkRunnerTests.cs index e111a60..3f1e7a5 100644 --- a/Symlinker.Tests/LinkRunnerTests.cs +++ b/Symlinker.Tests/LinkRunnerTests.cs @@ -141,7 +141,7 @@ public async Task Run_ReportsErrors_AsAFailedLink() var result = await runner.RunAsync(Request("junction")); - Assert.Equal((false, Res.MessageBoxExceptionOcurred + "\npipe broke"), (result.Success, result.Message)); + Assert.Equal((false, LinkError.Unknown, "pipe broke"), (result.Success, result.Error, result.Message)); } [Fact] diff --git a/Symlinker/LinkCheck.cs b/Symlinker/LinkCheck.cs new file mode 100644 index 0000000..f8b037a --- /dev/null +++ b/Symlinker/LinkCheck.cs @@ -0,0 +1,151 @@ +namespace Symlinker +{ + using System; + using System.IO; + using System.Runtime.InteropServices; + + using Microsoft.Win32.SafeHandles; + + /// + /// Checks on disk whether mklink did its job, and works out why it didn't. mklink's own text + /// is in the language of Windows, so it is never parsed. Runs in the process that ran mklink + /// (the window, or the elevated helper), so the checks have the same rights. + /// + internal static class LinkCheck + { + /// + /// Whether the link exists and leads to the requested target: a symbolic link or junction + /// stores that target, a hard link is the same file as it. + /// + public static bool IsCreated(LinkRequest request) + { + // mklink resolves a relative target against its working folder, which is ours + var target = Path.GetFullPath(request.Target); + + var kind = LinkKinds.Parse(request.Type); + if (kind == LinkKind.Hard) + return File.Exists(request.Link) && IsSameFile(request.Link, target); + + FileSystemInfo link = request.Directory ? new DirectoryInfo(request.Link) : new FileInfo(request.Link); + var stored = link.LinkTarget; + if (stored == null) + return false; + + // A symbolic link keeps a relative target as entered, relative to its own folder + var linkFolder = Path.GetDirectoryName(request.Link); + if (kind == LinkKind.Symbolic) + target = Path.GetFullPath(request.Target, linkFolder); + + return SamePath(Path.GetFullPath(stored, linkFolder), target); + } + + /// + /// The most likely reason mklink failed, from what is on disk. Falls back to + /// , so the caller shows mklink's own text. + /// + /// The link that wasn't created. + /// Whether something was at the link path before mklink ran. + /// Whether this process may create symbolic links. + /// Whether this process may create files in a folder. + public static LinkError Diagnose(LinkRequest request, bool existedBefore, Func canCreateSymbolicLinks, Func canWriteTo) + { + if (existedBefore) + return LinkError.LinkExists; + + var kind = LinkKinds.Parse(request.Type); + if (kind == LinkKind.Hard && !LinkMover.IsSameVolume(request.Link, request.Target)) + return LinkError.HardLinkAcrossDrives; + + if (kind == LinkKind.Junction && IsNetworkPath(request.Target)) + return LinkError.JunctionNeedsLocalFolder; + + if (kind == LinkKind.Symbolic && !canCreateSymbolicLinks()) + return LinkError.NeedsAdmin; + + if (!canWriteTo(Path.GetDirectoryName(request.Link))) + return LinkError.AccessDenied; + + return LinkError.Unknown; + } + + /// + /// Whether this process may create files in . Tries for real with a + /// file that deletes itself. Anything other than a denied access (like a missing folder) is + /// not an access problem, so it counts as writable. + /// + public static bool CanWriteTo(string folder) + { + try + { + var probe = Path.Combine(folder, ".symlinker-probe-" + Guid.NewGuid().ToString("N")); + using (File.Create(probe, 1, FileOptions.DeleteOnClose)) + { + } + + return true; + } + catch (UnauthorizedAccessException) + { + return false; + } + catch (Exception) + { + return true; + } + } + + /// Whether a path is on a network share or a mapped network drive. + internal static bool IsNetworkPath(string path) + { + var root = Path.GetPathRoot(Path.GetFullPath(path)); + return root.StartsWith(@"\\", StringComparison.Ordinal) || new DriveInfo(root).DriveType == DriveType.Network; + } + + /// + /// Whether two paths are the same file (same volume and file index). When either can't be + /// opened (locked or no read access), the answer is yes: mklink already said it worked. + /// + internal static bool IsSameFile(string first, string second) + { + try + { + return FileId(first) == FileId(second); + } + catch (Exception) + { + return true; + } + } + + private static bool SamePath(string first, string second) => + string.Equals(Path.TrimEndingDirectorySeparator(first), Path.TrimEndingDirectorySeparator(second), StringComparison.OrdinalIgnoreCase); + + private static (uint Volume, uint High, uint Low) FileId(string path) + { + using var handle = File.OpenHandle(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete); + + // If this fails the info stays zeroed for both files, which reads as the same file + GetFileInformationByHandle(handle, out var info); + return (info.VolumeSerialNumber, info.FileIndexHigh, info.FileIndexLow); + } + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool GetFileInformationByHandle(SafeFileHandle file, out FileInformation information); + + [StructLayout(LayoutKind.Sequential)] + private struct FileInformation + { + public uint FileAttributes; + public System.Runtime.InteropServices.ComTypes.FILETIME CreationTime; + public System.Runtime.InteropServices.ComTypes.FILETIME LastAccessTime; + public System.Runtime.InteropServices.ComTypes.FILETIME LastWriteTime; + public uint VolumeSerialNumber; + public uint FileSizeHigh; + public uint FileSizeLow; + public uint NumberOfLinks; + public uint FileIndexHigh; + public uint FileIndexLow; + } + } +} diff --git a/Symlinker/LinkCommand.cs b/Symlinker/LinkCommand.cs index f0adeb7..8904036 100644 --- a/Symlinker/LinkCommand.cs +++ b/Symlinker/LinkCommand.cs @@ -5,8 +5,6 @@ namespace Symlinker using System.IO; using System.Threading.Tasks; - using Res = Symlinker.Properties.Resources; - /// The kinds of link mklink can create. internal enum LinkKind { @@ -49,14 +47,60 @@ internal sealed class LinkRequest public bool Directory { get; set; } } - /// Outcome of a , with the message to show the user. + /// + /// Why a link wasn't created. Sent over the helper's pipe as a number, so only add values at the end. + /// + internal enum LinkError + { + /// The link was created. + None = 0, + + /// mklink failed for a reason Symlinker can't tell; has its text. + Unknown = 1, + + /// A path has a quote or line break, so mklink wasn't run. + InvalidPath = 2, + + /// cmd.exe couldn't be started. + CommandNotFound = 3, + + /// mklink said it worked, but the link isn't there or points somewhere else. + NotCreated = 4, + + /// Something already exists at the link path. + LinkExists = 5, + + /// Windows denied writing to the folder that holds the link. + AccessDenied = 6, + + /// Symbolic links need administrator rights or Developer Mode. + NeedsAdmin = 7, + + /// A hard link and its target must be on the same drive. + HardLinkAcrossDrives = 8, + + /// A junction can't point to a network folder. + JunctionNeedsLocalFolder = 9, + } + + /// + /// Outcome of a . Only holds plain values, since the elevated helper + /// sends it back as JSON. turns it into text for the user. + /// internal sealed class LinkResult { public bool Success { get; set; } + public LinkError Error { get; set; } + + /// mklink's own output (or an exception's message), in the language of Windows. public string Message { get; set; } - public static LinkResult Failed(string message) => new() { Success = false, Message = message }; + public static LinkResult Created(string message = null) => new() { Success = true, Message = message }; + + public static LinkResult Failed(string message) => Failed(LinkError.Unknown, message); + + public static LinkResult Failed(LinkError error, string message = null) => new() { Success = false, Error = error, Message = message }; } /// Creates links with mklink. Used by the window and by the elevated helper. @@ -64,13 +108,34 @@ internal static class LinkCommand { public static Task RunAsync(LinkRequest request) => RunAsync(request, "cmd"); - /// Runs mklink through , which tests replace to check a missing shell. + /// + /// Runs mklink through , which tests replace to check a missing shell. + /// Success is decided by the exit code and then checked on disk; mklink's text is only kept as a detail. + /// internal static async Task RunAsync(LinkRequest request, string shell) { var arguments = BuildArguments(request); if (arguments == null) - return LinkResult.Failed(Res.InvalidQuoteInPath); + return LinkResult.Failed(LinkError.InvalidPath); + + // Checked first: after a failure, whatever is at the link path was already there + var existedBefore = Path.Exists(request.Link); + + var run = await RunShellAsync(shell, arguments); + if (run == null) + return LinkResult.Failed(LinkError.CommandNotFound); + + var (exitCode, output, error) = run.Value; + if (exitCode == 0) + return LinkCheck.IsCreated(request) ? LinkResult.Created(output) : LinkResult.Failed(LinkError.NotCreated, output); + var reason = LinkCheck.Diagnose(request, existedBefore, Elevation.CanCreateSymbolicLinks, LinkCheck.CanWriteTo); + return LinkResult.Failed(reason, error.Length > 0 ? error : output); + } + + /// Runs the shell and collects its output. Returns null when it can't be started. + private static async Task<(int ExitCode, string Output, string Error)?> RunShellAsync(string shell, string arguments) + { try { var startInfo = new ProcessStartInfo @@ -89,17 +154,11 @@ internal static async Task RunAsync(LinkRequest request, string shel var error = process.StandardError.ReadToEndAsync(); await process.WaitForExitAsync(); - var outputText = (await output).Trim(); - var errorText = (await error).Trim(); - - if (process.ExitCode == 0) - return new LinkResult { Success = true, Message = outputText.Length > 0 ? outputText : Res.LinkSuccessfullyCreated }; - - return LinkResult.Failed(errorText.Length > 0 ? errorText : outputText); + return (process.ExitCode, (await output).Trim(), (await error).Trim()); } catch (Exception) { - return LinkResult.Failed(Res.CmdNotFound); + return null; } } diff --git a/Symlinker/LinkCreator.cs b/Symlinker/LinkCreator.cs index b0ce49d..d755146 100644 --- a/Symlinker/LinkCreator.cs +++ b/Symlinker/LinkCreator.cs @@ -152,8 +152,8 @@ private async Task ReplaceOrCreateAsync(LinkInput request, string linkPath, stri if (existing != null) delete(existing); - var result = await runner.RunAsync(linkRequest); - await dialogs.ShowMessageAsync(result.Success ? Res.MessageBoxSuccessTitle : Res.MessageBoxErrorTitle, result.Message); + var result = LinkResultMessage.For(linkRequest, await runner.RunAsync(linkRequest)); + await dialogs.ShowMessageAsync(result.Title, result.Message); } private static LinkRequest ToLinkRequest(LinkInput input, string linkPath, string target) => new() @@ -264,7 +264,7 @@ private async Task MoveAndLinkAsync(bool isFolder, FileSystemInfo source, LinkRe var linked = await runner.RunAsync(linkRequest); if (!linked.Success) { - await RollBackMoveAsync(originalPath, currentPath, target, copiedToTarget, targetWasEmptyFolder, string.Format(CultureInfo.CurrentUICulture, Res.MoveFailed, linked.Message)); + await RollBackMoveAsync(originalPath, currentPath, target, copiedToTarget, targetWasEmptyFolder, string.Format(CultureInfo.CurrentUICulture, Res.MoveFailed, LinkResultMessage.Reason(linkRequest, linked))); return; } @@ -283,9 +283,8 @@ await dialogs.ShowMessageAsync( } } - await dialogs.ShowMessageAsync( - Res.MessageBoxSuccessTitle, - string.Format(CultureInfo.CurrentUICulture, Res.MoveSucceeded, source.Name, target)); + var moved = LinkResultMessage.ForMove(linkRequest, source.Name); + await dialogs.ShowMessageAsync(moved.Title, moved.Message); } catch (Exception exception) { diff --git a/Symlinker/LinkResultMessage.cs b/Symlinker/LinkResultMessage.cs new file mode 100644 index 0000000..74045fb --- /dev/null +++ b/Symlinker/LinkResultMessage.cs @@ -0,0 +1,104 @@ +namespace Symlinker +{ + using System.Globalization; + using System.IO; + + using Res = Symlinker.Properties.Resources; + + /// + /// The title and text that tell the user how creating one link went. Built from the request + /// and the result code, never from mklink's text (which is in the language of Windows), except + /// as a detail for failures Symlinker can't explain itself. Self-contained so a list of results + /// can reuse it per link. + /// + internal sealed record LinkResultMessage(string Title, string Message) + { + /// + /// Paths longer than this are shortened in the middle so each fits on one line, after the + /// longest label ("Destinazione:" in Italian). + /// + internal const int MaxPathLength = 52; + + private const string Ellipsis = "\u2026"; + + /// The dialog for a finished link: what was created and where, or why it wasn't. + public static LinkResultMessage For(LinkRequest request, LinkResult result) + { + if (!result.Success) + return new LinkResultMessage(Res.ResultFailedTitle, Reason(request, result)); + + var kind = KindOf(request); + var sentence = kind == LinkKind.Hard ? Res.ResultHardLinkSentence : Res.ResultPointsToSentence; + return new LinkResultMessage(CreatedTitle(kind), Format(sentence, NameOf(request.Link), NameOf(request.Target)) + "\n\n" + Paths(request)); + } + + /// The dialog after an existing item was moved to the target and linked from its old place. + public static LinkResultMessage ForMove(LinkRequest request, string movedName) => + new(CreatedTitle(KindOf(request)), Format(Res.MoveSucceeded, movedName) + "\n\n" + Paths(request)); + + /// + /// Why a link wasn't created, in plain words. When Symlinker can't tell, this is mklink's own + /// error text. Also suits a single row in a list of results. + /// + public static string Reason(LinkRequest request, LinkResult result) => result.Error switch + { + LinkError.InvalidPath => Res.InvalidQuoteInPath, + LinkError.CommandNotFound => Res.CmdNotFound, + LinkError.NotCreated => Res.ResultNotCreated, + LinkError.LinkExists => Format(Res.ResultLinkExists, NameOf(request.Link)), + LinkError.AccessDenied => Format(Res.ResultAccessDenied, CompactPath(Path.GetDirectoryName(request.Link))), + LinkError.NeedsAdmin => Res.ResultNeedsAdmin, + LinkError.HardLinkAcrossDrives => Res.ResultHardLinkAcrossDrives, + LinkError.JunctionNeedsLocalFolder => Res.ResultJunctionNeedsLocalFolder, + _ => string.IsNullOrWhiteSpace(result.Message) ? Res.ResultUnknownError : result.Message, + }; + + /// + /// Shortens a long path in the middle, keeping the drive and as many of the last folders as fit: + /// D:\…\Anno 1800\accounts\Test. + /// + internal static string CompactPath(string path, int maxLength = MaxPathLength) + { + if (path.Length <= maxLength) + return path; + + var root = Path.GetPathRoot(path); + var parts = path.Substring(root.Length).Split(new[] { '\\', '/' }, System.StringSplitOptions.RemoveEmptyEntries); + if (parts.Length == 0) + return path; + + var prefix = root.Length > 0 ? root.TrimEnd('\\', '/') + "\\" + Ellipsis + "\\" : Ellipsis + "\\"; + var tail = parts[^1]; + for (var i = parts.Length - 2; i >= 0; i--) + { + var longer = parts[i] + "\\" + tail; + if (prefix.Length + longer.Length > maxLength) + break; + tail = longer; + } + + return prefix + tail; + } + + private static LinkKind KindOf(LinkRequest request) => LinkKinds.Parse(request.Type) ?? LinkKind.Symbolic; + + private static string CreatedTitle(LinkKind kind) => kind switch + { + LinkKind.Hard => Res.ResultHardLinkCreated, + LinkKind.Junction => Res.ResultJunctionCreated, + _ => Res.ResultSymbolicLinkCreated, + }; + + private static string Paths(LinkRequest request) => + Format(Res.ResultLinkPath, CompactPath(request.Link)) + "\n" + Format(Res.ResultTargetPath, CompactPath(request.Target)); + + /// The last part of a path, or the whole path for a drive root like D:\. + private static string NameOf(string path) + { + var name = Path.GetFileName(Path.TrimEndingDirectorySeparator(path)); + return name.Length > 0 ? name : path; + } + + private static string Format(string format, params object[] args) => string.Format(CultureInfo.CurrentUICulture, format, args); + } +} diff --git a/Symlinker/LinkRunner.cs b/Symlinker/LinkRunner.cs index 13eed2d..43c7466 100644 --- a/Symlinker/LinkRunner.cs +++ b/Symlinker/LinkRunner.cs @@ -95,7 +95,7 @@ public async Task RunAsync(LinkRequest request) } catch (Exception exception) { - return LinkResult.Failed(Res.MessageBoxExceptionOcurred + "\n" + exception.Message); + return LinkResult.Failed(exception.Message); } } diff --git a/Symlinker/MainWindow.xaml b/Symlinker/MainWindow.xaml index ffd66b7..1379c9c 100644 --- a/Symlinker/MainWindow.xaml +++ b/Symlinker/MainWindow.xaml @@ -2,6 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:p="clr-namespace:Symlinker.Properties" xmlns:local="clr-namespace:Symlinker" @@ -28,6 +29,12 @@ TextOptions.TextRenderingMode="ClearType"> + + + 10 diff --git a/Symlinker/Properties/Resources.Designer.cs b/Symlinker/Properties/Resources.Designer.cs index b2740b2..7bca9e5 100644 --- a/Symlinker/Properties/Resources.Designer.cs +++ b/Symlinker/Properties/Resources.Designer.cs @@ -298,15 +298,6 @@ public static string LinkCreationAbortedWarning { } } - /// - /// Looks up a localized string similar to Link successfully created.. - /// - public static string LinkSuccessfullyCreated { - get { - return ResourceManager.GetString("LinkSuccessfullyCreated", resourceCulture); - } - } - /// /// Looks up a localized string similar to About. /// @@ -442,6 +433,141 @@ public static string PlaceholderTargetPath { } } + /// + /// Looks up a localized string similar to Windows denied access to this folder: {0}. + /// + public static string ResultAccessDenied { + get { + return ResourceManager.GetString("ResultAccessDenied", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't create the link. + /// + public static string ResultFailedTitle { + get { + return ResourceManager.GetString("ResultFailedTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A hard link has to be on the same drive as its target. Use a symbolic link instead.. + /// + public static string ResultHardLinkAcrossDrives { + get { + return ResourceManager.GetString("ResultHardLinkAcrossDrives", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hard link created. + /// + public static string ResultHardLinkCreated { + get { + return ResourceManager.GetString("ResultHardLinkCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is now another name for the file "{1}".. + /// + public static string ResultHardLinkSentence { + get { + return ResourceManager.GetString("ResultHardLinkSentence", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Junction created. + /// + public static string ResultJunctionCreated { + get { + return ResourceManager.GetString("ResultJunctionCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A junction can only point to a folder on this computer. Use a symbolic link for network folders.. + /// + public static string ResultJunctionNeedsLocalFolder { + get { + return ResourceManager.GetString("ResultJunctionNeedsLocalFolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Something named "{0}" is already in that folder. Pick another link name, or remove it first.. + /// + public static string ResultLinkExists { + get { + return ResourceManager.GetString("ResultLinkExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link: {0}. + /// + public static string ResultLinkPath { + get { + return ResourceManager.GetString("ResultLinkPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Symbolic links need administrator rights or Windows Developer Mode.. + /// + public static string ResultNeedsAdmin { + get { + return ResourceManager.GetString("ResultNeedsAdmin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows reported success, but the link isn't there.. + /// + public static string ResultNotCreated { + get { + return ResourceManager.GetString("ResultNotCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" now points to "{1}".. + /// + public static string ResultPointsToSentence { + get { + return ResourceManager.GetString("ResultPointsToSentence", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Symbolic link created. + /// + public static string ResultSymbolicLinkCreated { + get { + return ResourceManager.GetString("ResultSymbolicLinkCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target: {0}. + /// + public static string ResultTargetPath { + get { + return ResourceManager.GetString("ResultTargetPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows didn't say why.. + /// + public static string ResultUnknownError { + get { + return ResourceManager.GetString("ResultUnknownError", resourceCulture); + } + } + /// /// Looks up a localized string similar to About Symlinker. /// diff --git a/Symlinker/Properties/Resources.de.resx b/Symlinker/Properties/Resources.de.resx index c7668ac..51d5232 100644 --- a/Symlinker/Properties/Resources.de.resx +++ b/Symlinker/Properties/Resources.de.resx @@ -127,8 +127,51 @@ Das zum Erstellen von Links benötigte Befehlszeilentool wurde nicht gefunden. - - Link erfolgreich erstellt. + + Symbolischer Link erstellt + + + Hardlink erstellt + + + Verzeichnisverknüpfung erstellt + + + "{0}" verweist jetzt auf "{1}". + + + "{0}" ist jetzt ein weiterer Name für die Datei "{1}". + + + Link: {0} + + + Ziel: {0} + + + Link nicht erstellt + + + Windows hat Erfolg gemeldet, aber der Link ist nicht vorhanden. + + + In diesem Ordner gibt es bereits etwas namens "{0}". Einen anderen Linknamen wählen oder es zuerst entfernen. + + + Windows hat den Zugriff auf diesen Ordner verweigert: +{0} + + + Symbolische Links benötigen Administratorrechte oder den Windows-Entwicklermodus. + + + Ein Hardlink muss auf demselben Laufwerk wie sein Ziel liegen. Stattdessen einen symbolischen Link verwenden. + + + Eine Verzeichnisverknüpfung kann nur auf einen Ordner auf diesem Computer verweisen. Für Netzwerkordner einen symbolischen Link verwenden. + + + Windows hat keinen Grund genannt. Ein Ordner mit diesem Linknamen existiert bereits im ausgewählten Verzeichnis. Möchten Sie ihn löschen und einen neuen Link erstellen? diff --git a/Symlinker/Properties/Resources.es.resx b/Symlinker/Properties/Resources.es.resx index 069a9bd..5bd1f97 100644 --- a/Symlinker/Properties/Resources.es.resx +++ b/Symlinker/Properties/Resources.es.resx @@ -127,8 +127,51 @@ No se encuentra la herramienta de línea de comandos necesaria para crear enlaces. - - Enlace creado correctamente. + + Enlace simbólico creado + + + Enlace duro creado + + + Unión creada + + + "{0}" ahora apunta a "{1}". + + + "{0}" es ahora otro nombre del archivo "{1}". + + + Enlace: {0} + + + Destino: {0} + + + No se pudo crear el enlace + + + Windows indicó que funcionó, pero el enlace no está. + + + Ya hay algo llamado "{0}" en esa carpeta. Elige otro nombre para el enlace o quítalo primero. + + + Windows denegó el acceso a esta carpeta: +{0} + + + Los enlaces simbólicos requieren permisos de administrador o el Modo de desarrollador de Windows. + + + Un enlace duro debe estar en la misma unidad que su destino. Usa un enlace simbólico en su lugar. + + + Una unión solo puede apuntar a una carpeta de este equipo. Usa un enlace simbólico para carpetas de red. + + + Windows no indicó el motivo. Ya existe una carpeta con este nombre de enlace en el directorio seleccionado. ¿Desea eliminarla y crear un nuevo enlace? diff --git a/Symlinker/Properties/Resources.fr.resx b/Symlinker/Properties/Resources.fr.resx index a0d690b..e89a2df 100644 --- a/Symlinker/Properties/Resources.fr.resx +++ b/Symlinker/Properties/Resources.fr.resx @@ -127,8 +127,51 @@ Impossible de trouver l'outil en ligne de commande nécessaire à la création de liens. - - Lien créé avec succès. + + Lien symbolique créé + + + Lien physique créé + + + Jonction créée + + + « {0} » pointe maintenant vers « {1} ». + + + « {0} » est maintenant un autre nom du fichier « {1} ». + + + Lien : {0} + + + Cible : {0} + + + Impossible de créer le lien + + + Windows a signalé une réussite, mais le lien est introuvable. + + + Un élément nommé « {0} » existe déjà dans ce dossier. Choisissez un autre nom de lien ou supprimez-le d'abord. + + + Windows a refusé l'accès à ce dossier : +{0} + + + Les liens symboliques nécessitent des droits d'administrateur ou le mode développeur de Windows. + + + Un lien physique doit se trouver sur le même lecteur que sa cible. Utilisez plutôt un lien symbolique. + + + Une jonction ne peut pointer que vers un dossier de cet ordinateur. Utilisez un lien symbolique pour les dossiers réseau. + + + Windows n'a pas indiqué de raison. Un dossier portant ce nom de lien existe déjà dans le répertoire sélectionné. Voulez-vous le supprimer et créer un nouveau lien ? diff --git a/Symlinker/Properties/Resources.hi.resx b/Symlinker/Properties/Resources.hi.resx index afb3e33..ec21467 100644 --- a/Symlinker/Properties/Resources.hi.resx +++ b/Symlinker/Properties/Resources.hi.resx @@ -127,8 +127,51 @@ लिंक बनाने के लिए आवश्यक कमांड-लाइन टूल नहीं मिला। - - लिंक सफलतापूर्वक बनाया गया। + + सिम्बॉलिक लिंक बनाया गया + + + हार्ड लिंक बनाया गया + + + जंक्शन बनाया गया + + + "{0}" अब "{1}" की ओर इशारा करता है। + + + "{0}" अब फ़ाइल "{1}" का एक और नाम है। + + + लिंक: {0} + + + लक्ष्य: {0} + + + लिंक नहीं बनाया जा सका + + + Windows ने सफलता बताई, लेकिन लिंक मौजूद नहीं है। + + + उस फ़ोल्डर में "{0}" नाम का कुछ पहले से मौजूद है। लिंक के लिए कोई दूसरा नाम चुनें या पहले उसे हटाएं। + + + Windows ने इस फ़ोल्डर तक पहुंच अस्वीकार कर दी: +{0} + + + सिम्बॉलिक लिंक के लिए व्यवस्थापक अधिकार या Windows डेवलपर मोड चाहिए। + + + हार्ड लिंक उसी ड्राइव पर होना चाहिए जिस पर उसका लक्ष्य है। इसके बजाय सिम्बॉलिक लिंक का उपयोग करें। + + + जंक्शन केवल इसी कंप्यूटर के फ़ोल्डर की ओर इशारा कर सकता है। नेटवर्क फ़ोल्डरों के लिए सिम्बॉलिक लिंक का उपयोग करें। + + + Windows ने कारण नहीं बताया। चयनित निर्देशिका में इस लिंक नाम वाला एक फ़ोल्डर पहले से मौजूद है। क्या आप इसे हटाकर एक नया लिंक बनाना चाहते हैं? diff --git a/Symlinker/Properties/Resources.it.resx b/Symlinker/Properties/Resources.it.resx index ea49193..eb7d66c 100644 --- a/Symlinker/Properties/Resources.it.resx +++ b/Symlinker/Properties/Resources.it.resx @@ -127,8 +127,51 @@ Impossibile trovare lo strumento da riga di comando necessario per creare i collegamenti. - - Collegamento creato con successo. + + Collegamento simbolico creato + + + Collegamento fisico creato + + + Giunzione creata + + + "{0}" ora punta a "{1}". + + + "{0}" è ora un altro nome del file "{1}". + + + Collegamento: {0} + + + Destinazione: {0} + + + Impossibile creare il collegamento + + + Windows ha segnalato la riuscita, ma il collegamento non c'è. + + + In quella cartella c'è già un elemento chiamato "{0}". Scegli un altro nome per il collegamento o rimuovilo prima. + + + Windows ha negato l'accesso a questa cartella: +{0} + + + I collegamenti simbolici richiedono i diritti di amministratore o la Modalità sviluppatore di Windows. + + + Un collegamento fisico deve trovarsi sulla stessa unità della destinazione. Usa invece un collegamento simbolico. + + + Una giunzione può puntare solo a una cartella di questo computer. Per le cartelle di rete usa un collegamento simbolico. + + + Windows non ha indicato il motivo. Una cartella con questo nome di collegamento esiste già nella directory selezionata. Vuoi eliminarla e creare un nuovo collegamento? diff --git a/Symlinker/Properties/Resources.ja.resx b/Symlinker/Properties/Resources.ja.resx index e0ddac6..13d5b45 100644 --- a/Symlinker/Properties/Resources.ja.resx +++ b/Symlinker/Properties/Resources.ja.resx @@ -127,8 +127,51 @@ リンクの作成に必要なコマンドラインツールが見つかりません。 - - リンクが正常に作成されました。 + + シンボリックリンクを作成しました + + + ハードリンクを作成しました + + + ジャンクションを作成しました + + + 「{0}」は「{1}」を指すようになりました。 + + + 「{0}」はファイル「{1}」の別名になりました。 + + + リンク: {0} + + + ターゲット: {0} + + + リンクを作成できませんでした + + + Windows は成功と報告しましたが、リンクが見つかりません。 + + + このフォルダーには「{0}」という名前の項目が既にあります。別のリンク名を選ぶか、先に削除してください。 + + + Windows によってこのフォルダーへのアクセスが拒否されました: +{0} + + + シンボリックリンクには管理者権限または Windows の開発者モードが必要です。 + + + ハードリンクはターゲットと同じドライブに作成する必要があります。代わりにシンボリックリンクを使用してください。 + + + ジャンクションはこのコンピューター上のフォルダーしか指定できません。ネットワークフォルダーにはシンボリックリンクを使用してください。 + + + Windows は理由を示しませんでした。 選択したディレクトリに同じリンク名のフォルダーが既に存在します。削除して新しいリンクを作成しますか? diff --git a/Symlinker/Properties/Resources.pt.resx b/Symlinker/Properties/Resources.pt.resx index 4fa83b1..0930d3d 100644 --- a/Symlinker/Properties/Resources.pt.resx +++ b/Symlinker/Properties/Resources.pt.resx @@ -127,8 +127,51 @@ Não foi possível encontrar a ferramenta de linha de comando necessária para criar links. - - Link criado com sucesso. + + Link simbólico criado + + + Link físico criado + + + Junção criada + + + "{0}" agora aponta para "{1}". + + + "{0}" agora é outro nome para o arquivo "{1}". + + + Link: {0} + + + Destino: {0} + + + Não foi possível criar o link + + + O Windows informou sucesso, mas o link não está lá. + + + Já existe algo chamado "{0}" nessa pasta. Escolha outro nome para o link ou remova-o primeiro. + + + O Windows negou o acesso a esta pasta: +{0} + + + Links simbólicos exigem permissões de administrador ou o Modo de Desenvolvedor do Windows. + + + Um link físico precisa estar na mesma unidade que o destino. Use um link simbólico. + + + Uma junção só pode apontar para uma pasta deste computador. Use um link simbólico para pastas de rede. + + + O Windows não informou o motivo. Uma pasta com este nome de link já existe no diretório selecionado. Deseja excluí-la e criar um novo link? diff --git a/Symlinker/Properties/Resources.resx b/Symlinker/Properties/Resources.resx index 164febe..8b4b5bb 100644 --- a/Symlinker/Properties/Resources.resx +++ b/Symlinker/Properties/Resources.resx @@ -186,8 +186,51 @@ Cannot find the command-line tool needed to create links. - - Link successfully created. + + Symbolic link created + + + Hard link created + + + Junction created + + + "{0}" now points to "{1}". + + + "{0}" is now another name for the file "{1}". + + + Link: {0} + + + Target: {0} + + + Couldn't create the link + + + Windows reported success, but the link isn't there. + + + Something named "{0}" is already in that folder. Pick another link name, or remove it first. + + + Windows denied access to this folder: +{0} + + + Symbolic links need administrator rights or Windows Developer Mode. + + + A hard link has to be on the same drive as its target. Use a symbolic link instead. + + + A junction can only point to a folder on this computer. Use a symbolic link for network folders. + + + Windows didn't say why. A folder with this link name already exists in the selected directory. Would you like to delete it and create a new link? diff --git a/Symlinker/Properties/Resources.zh.resx b/Symlinker/Properties/Resources.zh.resx index 3e11681..fe93834 100644 --- a/Symlinker/Properties/Resources.zh.resx +++ b/Symlinker/Properties/Resources.zh.resx @@ -127,8 +127,51 @@ 找不到创建链接所需的命令行工具。 - - 链接创建成功。 + + 已创建符号链接 + + + 已创建硬链接 + + + 已创建目录联接 + + + “{0}”现在指向“{1}”。 + + + “{0}”现在是文件“{1}”的另一个名称。 + + + 链接:{0} + + + 目标:{0} + + + 无法创建链接 + + + Windows 报告成功,但找不到该链接。 + + + 该文件夹中已有名为“{0}”的项目。请选择其他链接名称,或先将其删除。 + + + Windows 拒绝访问此文件夹: +{0} + + + 创建符号链接需要管理员权限或 Windows 开发人员模式。 + + + 硬链接必须与其目标位于同一驱动器上。请改用符号链接。 + + + 目录联接只能指向此计算机上的文件夹。网络文件夹请使用符号链接。 + + + Windows 未说明原因。 所选目录中已存在同名链接文件夹。是否删除并创建新链接? diff --git a/packaging/msix/store/listings.json b/packaging/msix/store/listings.json index 1f25b11..9bda587 100644 --- a/packaging/msix/store/listings.json +++ b/packaging/msix/store/listings.json @@ -1,6 +1,6 @@ { "common": { - "ReleaseNotesVersion": "4.3.0", + "ReleaseNotesVersion": "4.4.0", "Title": "Symlinker - Symlink Creator", "DevStudio": "Alejandro Mora", "CopyrightTrademarkInformation": "© 2026 Alejandro Mora", @@ -9,7 +9,7 @@ "en-us": { "ShortDescription": "Create symbolic links, hard links and directory junctions on Windows with a few clicks, no command line needed.", "Description": "Symlinker is a simple, free tool for creating symbolic links, hard links and directory junctions on Windows, without typing mklink commands.\n\nPick whether you are linking a folder or a file, choose the kind of link, then fill in where the link should go, its name, and what it points to. Symlinker checks your input as you go, tells you exactly what is wrong, and creates the link with one click.\n\nLink types:\n- Symbolic link: works for files and folders, across drives and network paths.\n- Directory junction: a folder link that most programs treat like a real folder.\n- Hard link: a second name for the same file on the same drive.\n\nHandy for moving game libraries, app data or large folders to another drive while keeping the original path working, sharing one config file between programs, or organizing projects without copying files.\n\nIf something already exists where the link should go, Symlinker can move it to the target first and put the link in its place.\n\nWindows needs administrator rights to create symbolic links unless Developer Mode is on. Symlinker asks for them only when you create one, with the standard Windows prompt, and uses them only to run mklink. Junctions and hard links never need them.\n\nSymlinker is open source (MIT license), has no ads, and collects no data. It has been around since 2009 and has been rebuilt with a modern look that follows your Windows light or dark theme and accent color.", - "ReleaseNotes": "- Asks for administrator rights only when a symbolic link needs them, not when the app starts\n- Drag and drop from File Explorer now works in the Store version\n- Declining the permission prompt leaves everything as it was", + "ReleaseNotes": "- After creating a link, a clear message in your language says what was created and where it points\n- Long paths are shortened so each fits on one line\n- When a link can't be created, the message explains why, for example when a hard link points to another drive\n- Store version: files are no longer moved into AppData, where Windows would hide them from other apps. Linking there still works", "Features": [ "Create symbolic links, hard links and directory junctions", "Link folders or files, across drives and network paths", @@ -39,7 +39,7 @@ "de": { "ShortDescription": "Symbolische Links, Hardlinks und Verzeichnisverknüpfungen unter Windows mit wenigen Klicks erstellen, ganz ohne Kommandozeile.", "Description": "Symlinker ist ein einfaches, kostenloses Tool zum Erstellen von symbolischen Links, Hardlinks und Verzeichnisverknüpfungen (Junctions) unter Windows, ohne mklink-Befehle eintippen zu müssen.\n\nWählen Sie, ob Sie einen Ordner oder eine Datei verknüpfen, wählen Sie die Art des Links und geben Sie dann an, wo der Link liegen soll, wie er heißt und worauf er zeigt. Symlinker prüft Ihre Eingaben laufend, sagt Ihnen genau, was nicht stimmt, und erstellt den Link mit einem Klick.\n\nLink-Typen:\n- Symbolischer Link: für Dateien und Ordner, auch über Laufwerke und Netzwerkpfade hinweg.\n- Verzeichnisverknüpfung (Junction): ein Ordner-Link, den die meisten Programme wie einen echten Ordner behandeln.\n- Hardlink: ein zweiter Name für dieselbe Datei auf demselben Laufwerk.\n\nPraktisch, um Spielebibliotheken, App-Daten oder große Ordner auf ein anderes Laufwerk zu verschieben, während der ursprüngliche Pfad weiter funktioniert, um eine Konfigurationsdatei zwischen Programmen zu teilen oder um Projekte zu organisieren, ohne Dateien zu kopieren.\n\nWenn am Speicherort des Links bereits etwas vorhanden ist, kann Symlinker es zuerst zum Ziel verschieben und den Link an seine Stelle setzen.\n\nWindows benötigt Administratorrechte, um symbolische Links zu erstellen, sofern der Entwicklermodus nicht aktiviert ist. Symlinker fragt erst danach, wenn Sie einen erstellen, über die normale Windows-Abfrage, und verwendet die Rechte nur zum Ausführen von mklink. Verzeichnisverknüpfungen und Hardlinks brauchen sie nie.\n\nSymlinker ist Open Source (MIT-Lizenz), werbefrei und sammelt keine Daten. Das Programm gibt es seit 2009, und es wurde mit einem modernen Design neu aufgebaut, das dem hellen oder dunklen Windows-Design und Ihrer Akzentfarbe folgt.", - "ReleaseNotes": "- Fragt nur noch nach Administratorrechten, wenn ein symbolischer Link sie braucht, nicht mehr beim Start\n- Drag & Drop aus dem Datei-Explorer funktioniert jetzt auch in der Store-Version\n- Wenn Sie die Abfrage ablehnen, bleibt alles unverändert", + "ReleaseNotes": "- Nach dem Erstellen eines Links zeigt eine klare Meldung in Ihrer Sprache, was erstellt wurde und worauf es verweist\n- Lange Pfade werden gekürzt, damit jeder in eine Zeile passt\n- Wenn ein Link nicht erstellt werden kann, erklärt die Meldung den Grund, zum Beispiel bei einem Hardlink auf ein anderes Laufwerk\n- Store-Version: Dateien werden nicht mehr nach AppData verschoben, wo Windows sie vor anderen Apps verbergen würde. Links dorthin funktionieren weiterhin", "Features": [ "Symbolische Links, Hardlinks und Verzeichnisverknüpfungen erstellen", "Ordner oder Dateien verknüpfen, auch über Laufwerke und Netzwerkpfade hinweg", @@ -69,7 +69,7 @@ "es": { "ShortDescription": "Crea enlaces simbólicos, enlaces duros y uniones de directorio en Windows con unos pocos clics, sin usar la línea de comandos.", "Description": "Symlinker es una herramienta sencilla y gratuita para crear enlaces simbólicos, enlaces duros y uniones de directorio en Windows, sin escribir comandos mklink.\n\nElige si vas a enlazar una carpeta o un archivo, elige el tipo de enlace y luego indica dónde debe ir el enlace, su nombre y a qué apunta. Symlinker revisa lo que escribes sobre la marcha, te dice exactamente qué está mal y crea el enlace con un clic.\n\nTipos de enlace:\n- Enlace simbólico: funciona con archivos y carpetas, entre unidades y rutas de red.\n- Unión de directorio: un enlace de carpeta que la mayoría de los programas tratan como una carpeta real.\n- Enlace duro: un segundo nombre para el mismo archivo en la misma unidad.\n\nÚtil para mover bibliotecas de juegos, datos de aplicaciones o carpetas grandes a otra unidad sin que deje de funcionar la ruta original, compartir un archivo de configuración entre programas u organizar proyectos sin copiar archivos.\n\nSi ya existe algo donde debe ir el enlace, Symlinker puede moverlo primero al destino y poner el enlace en su lugar.\n\nWindows necesita permisos de administrador para crear enlaces simbólicos, salvo que el modo de desarrollador esté activado. Symlinker los pide solo cuando creas uno, con el aviso estándar de Windows, y solo los usa para ejecutar mklink. Las uniones y los enlaces duros nunca los necesitan.\n\nSymlinker es de código abierto (licencia MIT), no tiene anuncios y no recopila datos. Existe desde 2009 y se ha renovado con un diseño moderno que sigue el tema claro u oscuro de Windows y tu color de énfasis.", - "ReleaseNotes": "- Pide permisos de administrador solo cuando un enlace simbólico los necesita, no al iniciar la aplicación\n- Ahora se puede arrastrar y soltar desde el Explorador de archivos en la versión de Microsoft Store\n- Si rechazas el aviso de permisos, todo queda como estaba", + "ReleaseNotes": "- Al crear un enlace, un mensaje claro en tu idioma indica qué se creó y a dónde apunta\n- Las rutas largas se acortan para que cada una quepa en una línea\n- Si no se puede crear un enlace, el mensaje explica el motivo, por ejemplo un enlace duro a otra unidad\n- Versión de Microsoft Store: ya no se mueven archivos a AppData, donde Windows los ocultaría a otras aplicaciones. Crear enlaces allí sigue funcionando", "Features": [ "Crea enlaces simbólicos, enlaces duros y uniones de directorio", "Enlaza carpetas o archivos, entre unidades y rutas de red", @@ -99,7 +99,7 @@ "fr": { "ShortDescription": "Créez des liens symboliques, des liens physiques et des jonctions de répertoire sous Windows en quelques clics, sans ligne de commande.", "Description": "Symlinker est un outil simple et gratuit pour créer des liens symboliques, des liens physiques et des jonctions de répertoire sous Windows, sans taper de commandes mklink.\n\nIndiquez si vous liez un dossier ou un fichier, choisissez le type de lien, puis renseignez l'emplacement du lien, son nom et sa cible. Symlinker vérifie votre saisie au fur et à mesure, vous dit exactement ce qui ne va pas et crée le lien en un clic.\n\nTypes de lien :\n- Lien symbolique : pour les fichiers et les dossiers, entre lecteurs et chemins réseau.\n- Jonction de répertoire : un lien de dossier que la plupart des programmes traitent comme un vrai dossier.\n- Lien physique : un deuxième nom pour le même fichier sur le même lecteur.\n\nPratique pour déplacer des bibliothèques de jeux, des données d'applications ou de gros dossiers vers un autre lecteur tout en gardant le chemin d'origine fonctionnel, pour partager un fichier de configuration entre plusieurs programmes ou pour organiser des projets sans copier de fichiers.\n\nSi quelque chose existe déjà à l'emplacement du lien, Symlinker peut d'abord le déplacer vers la cible puis mettre le lien à sa place.\n\nWindows exige les droits d'administrateur pour créer des liens symboliques, sauf si le mode développeur est activé. Symlinker ne les demande qu'au moment où vous en créez un, avec l'invite Windows habituelle, et ne les utilise que pour exécuter mklink. Les jonctions et les liens physiques n'en ont jamais besoin.\n\nSymlinker est open source (licence MIT), sans publicité et ne collecte aucune donnée. Il existe depuis 2009 et a été repensé avec une apparence moderne qui suit le thème clair ou sombre de Windows et votre couleur d'accentuation.", - "ReleaseNotes": "- Ne demande les droits d'administrateur que lorsqu'un lien symbolique en a besoin, et plus au démarrage\n- Le glisser-déposer depuis l'Explorateur de fichiers fonctionne désormais dans la version du Store\n- Si vous refusez l'invite d'autorisation, rien n'est modifié", + "ReleaseNotes": "- Après la création d'un lien, un message clair dans votre langue indique ce qui a été créé et vers quoi il pointe\n- Les chemins longs sont raccourcis pour tenir chacun sur une ligne\n- Si un lien ne peut pas être créé, le message en explique la raison, par exemple un lien physique vers un autre lecteur\n- Version du Store : les fichiers ne sont plus déplacés dans AppData, où Windows les masquerait aux autres applications. Créer des liens vers AppData fonctionne toujours", "Features": [ "Créez des liens symboliques, des liens physiques et des jonctions de répertoire", "Liez des dossiers ou des fichiers, entre lecteurs et chemins réseau", @@ -129,7 +129,7 @@ "hi": { "ShortDescription": "Windows पर कुछ ही क्लिक में सिम्बॉलिक लिंक, हार्ड लिंक और डायरेक्टरी जंक्शन बनाएं, कमांड लाइन की ज़रूरत नहीं।", "Description": "Symlinker, Windows पर सिम्बॉलिक लिंक, हार्ड लिंक और डायरेक्टरी जंक्शन बनाने का एक आसान और मुफ़्त टूल है, जिसमें mklink कमांड टाइप करने की ज़रूरत नहीं पड़ती।\n\nचुनें कि आप फ़ोल्डर लिंक कर रहे हैं या फ़ाइल, लिंक का प्रकार चुनें, फिर बताएं कि लिंक कहाँ बने, उसका नाम क्या हो और वह किसकी ओर इशारा करे। Symlinker आपके इनपुट को साथ-साथ जाँचता है, साफ़ बताता है कि क्या ग़लत है, और एक क्लिक में लिंक बना देता है।\n\nलिंक के प्रकार:\n- सिम्बॉलिक लिंक: फ़ाइलों और फ़ोल्डरों के लिए, अलग-अलग ड्राइव और नेटवर्क पाथ पर भी।\n- डायरेक्टरी जंक्शन: फ़ोल्डर का लिंक, जिसे ज़्यादातर प्रोग्राम असली फ़ोल्डर की तरह मानते हैं।\n- हार्ड लिंक: उसी ड्राइव पर उसी फ़ाइल का दूसरा नाम।\n\nगेम लाइब्रेरी, ऐप डेटा या बड़े फ़ोल्डरों को दूसरी ड्राइव पर ले जाने के लिए उपयोगी, जबकि पुराना पाथ काम करता रहता है। एक कॉन्फ़िग फ़ाइल को कई प्रोग्रामों में साझा करने या फ़ाइलें कॉपी किए बिना प्रोजेक्ट व्यवस्थित करने के लिए भी।\n\nअगर लिंक की जगह पर पहले से कुछ मौजूद है, तो Symlinker उसे पहले लक्ष्य पर ले जा सकता है और उसकी जगह लिंक रख सकता है।\n\nजब तक डेवलपर मोड चालू न हो, Windows को सिम्बॉलिक लिंक बनाने के लिए एडमिनिस्ट्रेटर अधिकार चाहिए। Symlinker इन्हें सिर्फ़ तब माँगता है जब आप सिम्बॉलिक लिंक बनाते हैं, Windows के सामान्य संकेत के ज़रिए, और इनका उपयोग सिर्फ़ mklink चलाने के लिए करता है। जंक्शन और हार्ड लिंक को इनकी कभी ज़रूरत नहीं होती।\n\nSymlinker ओपन सोर्स (MIT लाइसेंस) है, इसमें कोई विज्ञापन नहीं है और यह कोई डेटा इकट्ठा नहीं करता। यह 2009 से उपलब्ध है और इसे एक आधुनिक रूप में दोबारा बनाया गया है जो Windows की लाइट या डार्क थीम और आपके एक्सेंट रंग के साथ चलता है।", - "ReleaseNotes": "- एडमिनिस्ट्रेटर अधिकार अब सिर्फ़ तब माँगे जाते हैं जब सिम्बॉलिक लिंक को उनकी ज़रूरत हो, ऐप शुरू होते समय नहीं\n- Store संस्करण में अब फ़ाइल एक्सप्लोरर से ड्रैग और ड्रॉप काम करता है\n- अनुमति संकेत को अस्वीकार करने पर सब कुछ पहले जैसा रहता है", + "ReleaseNotes": "- लिंक बनाने के बाद आपकी भाषा में एक साफ़ संदेश बताता है कि क्या बनाया गया और वह किसकी ओर इशारा करता है\n- लंबे पथ छोटे कर दिए जाते हैं ताकि हर पथ एक पंक्ति में आ जाए\n- अगर लिंक नहीं बन पाता, तो संदेश कारण बताता है, जैसे किसी दूसरी ड्राइव की ओर हार्ड लिंक\n- Store संस्करण: फ़ाइलें अब AppData में नहीं ले जाई जातीं, जहाँ Windows उन्हें दूसरे ऐप्स से छिपा देता। वहाँ लिंक बनाना अब भी काम करता है", "Features": [ "सिम्बॉलिक लिंक, हार्ड लिंक और डायरेक्टरी जंक्शन बनाएं", "फ़ोल्डर या फ़ाइलें लिंक करें, अलग-अलग ड्राइव और नेटवर्क पाथ पर भी", @@ -159,7 +159,7 @@ "it": { "ShortDescription": "Crea collegamenti simbolici, collegamenti fisici e giunzioni di directory su Windows con pochi clic, senza riga di comando.", "Description": "Symlinker è uno strumento semplice e gratuito per creare collegamenti simbolici, collegamenti fisici e giunzioni di directory su Windows, senza digitare comandi mklink.\n\nScegli se stai collegando una cartella o un file, scegli il tipo di collegamento, poi indica dove deve trovarsi il collegamento, il suo nome e a cosa punta. Symlinker controlla i dati mentre li inserisci, ti dice esattamente cosa non va e crea il collegamento con un clic.\n\nTipi di collegamento:\n- Collegamento simbolico: per file e cartelle, anche tra unità diverse e percorsi di rete.\n- Giunzione di directory: un collegamento a una cartella che la maggior parte dei programmi tratta come una cartella vera.\n- Collegamento fisico: un secondo nome per lo stesso file sulla stessa unità.\n\nUtile per spostare librerie di giochi, dati delle app o cartelle grandi su un'altra unità mantenendo funzionante il percorso originale, per condividere un file di configurazione tra più programmi o per organizzare progetti senza copiare file.\n\nSe nella posizione del collegamento esiste già qualcosa, Symlinker può prima spostarlo nella destinazione e mettere il collegamento al suo posto.\n\nWindows richiede i diritti di amministratore per creare collegamenti simbolici, a meno che la modalità sviluppatore non sia attiva. Symlinker li chiede solo quando ne crei uno, con la normale richiesta di Windows, e li usa solo per eseguire mklink. Giunzioni e collegamenti fisici non ne hanno mai bisogno.\n\nSymlinker è open source (licenza MIT), senza pubblicità e non raccoglie dati. Esiste dal 2009 ed è stato ricostruito con un aspetto moderno che segue il tema chiaro o scuro di Windows e il tuo colore principale.", - "ReleaseNotes": "- Chiede i diritti di amministratore solo quando un collegamento simbolico ne ha bisogno, non più all'avvio\n- Il trascinamento da Esplora file ora funziona anche nella versione dello Store\n- Se rifiuti la richiesta di autorizzazione, non cambia nulla", + "ReleaseNotes": "- Dopo aver creato un collegamento, un messaggio chiaro nella tua lingua indica cosa è stato creato e a cosa punta\n- I percorsi lunghi vengono accorciati per stare ciascuno su una riga\n- Se un collegamento non può essere creato, il messaggio spiega il motivo, ad esempio un collegamento fisico verso un'altra unità\n- Versione dello Store: i file non vengono più spostati in AppData, dove Windows li nasconderebbe alle altre app. Creare collegamenti lì funziona ancora", "Features": [ "Crea collegamenti simbolici, collegamenti fisici e giunzioni di directory", "Collega cartelle o file, anche tra unità diverse e percorsi di rete", @@ -189,7 +189,7 @@ "ja": { "ShortDescription": "Windows でシンボリックリンク、ハードリンク、ディレクトリジャンクションを数クリックで作成。コマンドラインは不要です。", "Description": "Symlinker は、Windows でシンボリックリンク、ハードリンク、ディレクトリジャンクションを作成するためのシンプルな無料ツールです。mklink コマンドを入力する必要はありません。\n\nフォルダーとファイルのどちらをリンクするかを選び、リンクの種類を選んでから、リンクを置く場所、リンクの名前、リンク先を入力します。Symlinker は入力内容をその場で確認し、問題があれば何が違うのかを具体的に示し、ワンクリックでリンクを作成します。\n\nリンクの種類:\n- シンボリックリンク: ファイルとフォルダーに対応し、別のドライブやネットワークパスにも使えます。\n- ディレクトリジャンクション: ほとんどのプログラムが通常のフォルダーとして扱うフォルダーリンクです。\n- ハードリンク: 同じドライブ上の同じファイルに付ける 2 つ目の名前です。\n\nゲームライブラリやアプリのデータ、大きなフォルダーを元のパスのまま別のドライブに移したいとき、1 つの設定ファイルを複数のプログラムで共有したいとき、ファイルをコピーせずにプロジェクトを整理したいときに便利です。\n\nリンクを置く場所にすでに何かがある場合、Symlinker はそれを先にリンク先へ移動し、その場所にリンクを作成できます。\n\n開発者モードがオフの場合、Windows ではシンボリックリンクの作成に管理者権限が必要です。Symlinker は、シンボリックリンクを作成するときにだけ Windows の標準の確認画面で管理者権限を求め、mklink の実行にのみ使用します。ジャンクションとハードリンクには管理者権限は不要です。\n\nSymlinker はオープンソース (MIT ライセンス) で、広告はなく、データも収集しません。2009 年から提供されており、Windows のライトテーマ/ダークテーマとアクセントカラーに合わせたモダンなデザインで作り直されました。", - "ReleaseNotes": "- 管理者権限は、アプリの起動時ではなく、シンボリックリンクに必要なときにだけ求めるようになりました\n- Store 版でもエクスプローラーからのドラッグ アンド ドロップが使えるようになりました\n- 権限の確認を拒否した場合は、何も変更されません", + "ReleaseNotes": "- リンクの作成後、作成した内容とリンク先を、使用中の言語でわかりやすく表示するようになりました\n- 長いパスは 1 行に収まるよう短縮して表示します\n- リンクを作成できなかった場合は、その理由を表示します (別のドライブへのハードリンクなど)\n- Store 版: Windows によって他のアプリから見えなくなるため、ファイルを AppData に移動しないようにしました。AppData へのリンク作成は引き続き使えます", "Features": [ "シンボリックリンク、ハードリンク、ディレクトリジャンクションを作成", "フォルダーやファイルを、別のドライブやネットワークパスにもリンク", @@ -219,7 +219,7 @@ "pt": { "ShortDescription": "Crie links simbólicos, links físicos e junções de diretório no Windows com poucos cliques, sem usar a linha de comando.", "Description": "O Symlinker é uma ferramenta simples e gratuita para criar links simbólicos, links físicos e junções de diretório no Windows, sem digitar comandos mklink.\n\nEscolha se vai vincular uma pasta ou um arquivo, escolha o tipo de link e depois informe onde o link deve ficar, o nome dele e para onde ele aponta. O Symlinker confere o que você digita enquanto você preenche, diz exatamente o que está errado e cria o link com um clique.\n\nTipos de link:\n- Link simbólico: funciona com arquivos e pastas, entre unidades e caminhos de rede.\n- Junção de diretório: um link de pasta que a maioria dos programas trata como uma pasta de verdade.\n- Link físico: um segundo nome para o mesmo arquivo na mesma unidade.\n\nÚtil para mover bibliotecas de jogos, dados de aplicativos ou pastas grandes para outra unidade mantendo o caminho original funcionando, compartilhar um arquivo de configuração entre programas ou organizar projetos sem copiar arquivos.\n\nSe já existir algo no local do link, o Symlinker pode primeiro movê-lo para o destino e colocar o link no lugar.\n\nO Windows exige direitos de administrador para criar links simbólicos, a menos que o modo de desenvolvedor esteja ativado. O Symlinker os solicita apenas quando você cria um, pelo aviso padrão do Windows, e os usa somente para executar o mklink. Junções e links físicos nunca precisam deles.\n\nO Symlinker é de código aberto (licença MIT), não tem anúncios e não coleta dados. Ele existe desde 2009 e foi refeito com um visual moderno que acompanha o tema claro ou escuro do Windows e a sua cor de destaque.", - "ReleaseNotes": "- Pede direitos de administrador apenas quando um link simbólico precisa deles, e não mais ao iniciar\n- Arrastar e soltar a partir do Explorador de Arquivos agora funciona na versão da Store\n- Se você recusar o aviso de permissão, nada é alterado", + "ReleaseNotes": "- Depois de criar um link, uma mensagem clara no seu idioma mostra o que foi criado e para onde ele aponta\n- Caminhos longos são encurtados para caber cada um em uma linha\n- Quando não é possível criar um link, a mensagem explica o motivo, por exemplo um link físico para outra unidade\n- Versão da Store: os arquivos não são mais movidos para AppData, onde o Windows os esconderia de outros apps. Criar links lá continua funcionando", "Features": [ "Crie links simbólicos, links físicos e junções de diretório", "Vincule pastas ou arquivos, entre unidades e caminhos de rede", @@ -249,7 +249,7 @@ "zh-hans": { "ShortDescription": "在 Windows 上点几下即可创建符号链接、硬链接和目录联接,无需使用命令行。", "Description": "Symlinker 是一款简单的免费工具,用于在 Windows 上创建符号链接、硬链接和目录联接,无需输入 mklink 命令。\n\n先选择要链接文件夹还是文件,再选择链接类型,然后填写链接的位置、名称以及它指向的目标。Symlinker 会在你输入时随时检查,准确告诉你哪里有问题,并一键创建链接。\n\n链接类型:\n- 符号链接:适用于文件和文件夹,可跨驱动器和网络路径。\n- 目录联接:一种文件夹链接,大多数程序会把它当作真正的文件夹。\n- 硬链接:同一驱动器上同一文件的第二个名称。\n\n适合把游戏库、应用数据或大文件夹移到另一个驱动器,同时保持原路径可用;也适合在多个程序之间共享同一个配置文件,或在不复制文件的情况下整理项目。\n\n如果链接位置上已经有内容,Symlinker 可以先把它移动到目标位置,再在原处放置链接。\n\n除非开启了开发者模式,否则 Windows 需要管理员权限才能创建符号链接。Symlinker 只在你创建符号链接时通过 Windows 标准提示请求该权限,并且只用它来运行 mklink。目录联接和硬链接从不需要管理员权限。\n\nSymlinker 是开源软件(MIT 许可证),没有广告,也不收集任何数据。它自 2009 年起提供,现已采用全新的现代外观重新打造,会跟随 Windows 的浅色或深色主题以及你的主题色。", - "ReleaseNotes": "- 只在创建符号链接需要时才请求管理员权限,不再在启动时请求\n- Store 版本现在支持从文件资源管理器拖放\n- 拒绝权限提示时,一切保持原样", + "ReleaseNotes": "- 创建链接后,会用你的语言清楚显示创建了什么以及它指向哪里\n- 长路径会被缩短,确保每条路径都能显示在一行内\n- 无法创建链接时,会说明原因,例如硬链接指向了另一个驱动器\n- Store 版本:不再将文件移动到 AppData,因为 Windows 会对其他应用隐藏这些文件。在那里创建链接仍然可用", "Features": [ "创建符号链接、硬链接和目录联接", "链接文件夹或文件,可跨驱动器和网络路径",