diff --git a/CLAUDE.md b/CLAUDE.md
index 62c1330..af15c6e 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -67,8 +67,8 @@ dotnet test --project Symlinker.Tests
- Upload the `.msixbundle` in Partner Center > Symlinker > the submission > Packages. Store ID `9P8H93Z0TGK4`.
- Manifest template and tile assets live in `packaging/msix/`. Identity values there must match Partner Center.
- `Properties/DisplayName` must be a name reserved in Partner Center (Manage app names). "Symlinker" alone is taken, so it is "Symlinker - Symlink Creator". The Start menu name (`VisualElements DisplayName`) stays "Symlinker".
-- The Store build behaves like the others: the window starts unelevated and only the link helper elevates. The `allowElevation` capability lets it show the UAC prompt. The script fails if the built exe asks for admin at launch.
-- The manifest disables file/registry write virtualization so links created under AppData land in the real location.
+- The Store build behaves like the others: the window starts unelevated and only the link helper elevates, with a UAC prompt. The script fails if the built exe asks for admin at launch.
+- The only capability is `runFullTrust`. The Store denied `allowElevation` and `unvirtualizedResources`, and neither is needed (tested with Developer Mode off): the helper's `runas` launch works without `allowElevation`, and mklink runs in `cmd.exe`, a child process that writes to the real `AppData`. Only new files and folders that Symlinker's own process creates under `AppData` go to the package's private copy (renames and deletes of existing items are fine). So in the Store package, `LinkCreator` refuses to move files into `AppData` (`MoveIntoAppDataUnsupported`); moving out of it works. The script fails if the package declares any other capability.
## Architecture
@@ -171,6 +171,7 @@ Releases are automated via GitHub Actions:
## Known Limitations
- **Drag and drop**: Works because the window always runs unelevated. It does not work if the user starts Symlinker as administrator themselves, because Windows blocks drops from a lower-privilege Explorer.
+- **Store version, moving into AppData**: the Microsoft Store version can't move existing files into a target under `AppData` (see "Publishing (Microsoft Store / MSIX)"). Linking there without moving works.
- **Platform**: Windows 10/11 only.
## Localization
diff --git a/Symlinker.Tests/ElevationTests.cs b/Symlinker.Tests/ElevationTests.cs
index 2737933..d6b08b5 100644
--- a/Symlinker.Tests/ElevationTests.cs
+++ b/Symlinker.Tests/ElevationTests.cs
@@ -86,5 +86,11 @@ public void CanCreateSymbolicLinks_ProbesForReal()
{
Assert.Equal(SymlinkSupport.Available, Elevation.CanCreateSymbolicLinks());
}
+
+ [Fact]
+ public void IsPackaged_IsFalse_OutsideAnMsixPackage()
+ {
+ Assert.False(Elevation.IsPackaged());
+ }
}
}
diff --git a/Symlinker.Tests/LinkCreatorTests.cs b/Symlinker.Tests/LinkCreatorTests.cs
index f1808b2..c0ad23d 100644
--- a/Symlinker.Tests/LinkCreatorTests.cs
+++ b/Symlinker.Tests/LinkCreatorTests.cs
@@ -355,6 +355,51 @@ public async Task Move_IntoAnEmptyFolder_ReplacesIt()
Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title);
}
+ [Fact]
+ public async Task Move_IntoAppData_IsRefused_InTheStorePackage()
+ {
+ temp.File(@"links\name\data.txt");
+ creator.IsPackaged = () => true;
+ creator.AppDataFolder = temp.Dir("AppData");
+
+ await Create("name", temp.PathOf("AppData", "Local", "moved"));
+
+ Assert.Equal((Res.MessageBoxErrorTitle, Res.MoveIntoAppDataUnsupported), dialogs.Last);
+ Assert.Empty(dialogs.Questions);
+ Assert.Empty(runner.Prepared);
+ Assert.True(File.Exists(temp.PathOf("links", "name", "data.txt")));
+ Assert.False(Directory.Exists(temp.PathOf("AppData", "Local", "moved")));
+ }
+
+ [Fact]
+ public async Task Move_OutOfAppData_Works_InTheStorePackage()
+ {
+ temp.File(@"AppData\Local\name\data.txt");
+ var target = temp.PathOf("elsewhere");
+ creator.IsPackaged = () => true;
+ creator.AppDataFolder = temp.PathOf("AppData");
+
+ 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);
+ }
+
+ [Fact]
+ public async Task Move_IntoAppData_Works_OutsideTheStorePackage()
+ {
+ temp.File(@"links\name\data.txt");
+ creator.IsPackaged = () => false;
+ creator.AppDataFolder = temp.PathOf("AppData");
+ temp.Dir("AppData", "Local");
+ var target = temp.PathOf("AppData", "Local", "moved");
+
+ await Create("name", target);
+
+ Assert.True(File.Exists(Path.Combine(target, "data.txt")));
+ Assert.Equal(Res.MessageBoxSuccessTitle, dialogs.Last.Title);
+ }
+
[Fact]
public async Task Move_IsRefused_WhenTheTargetIsInsideTheSource()
{
diff --git a/Symlinker/Elevation.cs b/Symlinker/Elevation.cs
index f8597a4..71e807f 100644
--- a/Symlinker/Elevation.cs
+++ b/Symlinker/Elevation.cs
@@ -88,6 +88,18 @@ public static bool IsElevated
///
public static bool CanCreateSymbolicLinks() => CanCreateSymbolicLinks(IsElevated, File.CreateSymbolicLink);
+ /// Whether this process runs from an MSIX package (the Microsoft Store version).
+ public static bool IsPackaged()
+ {
+ var length = 0;
+ return GetCurrentPackageFullName(ref length, null) != AppModelErrorNoPackage;
+ }
+
+ private const int AppModelErrorNoPackage = 15700;
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ private static extern int GetCurrentPackageFullName(ref int packageFullNameLength, char[] packageFullName);
+
/// The check behind , with the link creation replaceable in tests.
internal static bool CanCreateSymbolicLinks(bool isElevated, Func createSymbolicLink)
{
diff --git a/Symlinker/LinkCreator.cs b/Symlinker/LinkCreator.cs
index ba61a9f..b0ce49d 100644
--- a/Symlinker/LinkCreator.cs
+++ b/Symlinker/LinkCreator.cs
@@ -37,6 +37,13 @@ public LinkCreator(IDialogService dialogs, ILinkRunner runner)
/// Minimum time between progress updates while copying.
internal TimeSpan ProgressInterval { get; set; } = TimeSpan.FromMilliseconds(100);
+ /// Whether this copy runs from the Microsoft Store package.
+ internal Func IsPackaged { get; set; } = Elevation.IsPackaged;
+
+ /// The user's AppData folder (the parent of Local and Roaming).
+ internal string AppDataFolder { get; set; } =
+ Path.GetDirectoryName(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
+
public async Task CreateAsync(LinkInput request)
{
try
@@ -159,6 +166,15 @@ private async Task ReplaceOrCreateAsync(LinkInput request, string linkPath, stri
private async Task OfferMoveAsync(LinkInput request, FileSystemInfo existing, string linkPath, string target)
{
+ // In the Store package, Windows keeps files this process creates under AppData in a
+ // private per-package copy: other apps can't see them and uninstalling deletes them.
+ // Links are fine (mklink runs in cmd.exe), but moved files would end up hidden there.
+ if (IsPackaged() && LinkMover.IsSameOrInside(target, AppDataFolder))
+ {
+ await dialogs.ShowMessageAsync(Res.MessageBoxErrorTitle, Res.MoveIntoAppDataUnsupported);
+ return;
+ }
+
var message = string.Format(
CultureInfo.CurrentUICulture,
request.IsFolder ? Res.DialogMoveFolder : Res.DialogMoveFile,
diff --git a/Symlinker/Properties/Resources.Designer.cs b/Symlinker/Properties/Resources.Designer.cs
index f32ad70..b2740b2 100644
--- a/Symlinker/Properties/Resources.Designer.cs
+++ b/Symlinker/Properties/Resources.Designer.cs
@@ -679,5 +679,14 @@ public static string MoveTargetInsideSource {
return ResourceManager.GetString("MoveTargetInsideSource", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to The Microsoft Store version can't move files into the AppData folder: Windows would keep them in a private copy that only Symlinker sees. Pick a target outside AppData, or move the files there yourself and create the link again..
+ ///
+ public static string MoveIntoAppDataUnsupported {
+ get {
+ return ResourceManager.GetString("MoveIntoAppDataUnsupported", resourceCulture);
+ }
+ }
}
}
diff --git a/Symlinker/Properties/Resources.de.resx b/Symlinker/Properties/Resources.de.resx
index 91d3f06..c7668ac 100644
--- a/Symlinker/Properties/Resources.de.resx
+++ b/Symlinker/Properties/Resources.de.resx
@@ -276,4 +276,7 @@ Ins Ziel verschieben und an ihrer Stelle einen Link anlegen? Alles, was den alte
Das Ziel darf nicht innerhalb des zu verschiebenden Elements liegen und umgekehrt.
+
+ Die Microsoft Store-Version kann keine Dateien in den AppData-Ordner verschieben: Windows würde sie in einer privaten Kopie ablegen, die nur Symlinker sieht. Wählen Sie ein Ziel außerhalb von AppData, oder verschieben Sie die Dateien selbst dorthin und erstellen Sie den Link erneut.
+
diff --git a/Symlinker/Properties/Resources.es.resx b/Symlinker/Properties/Resources.es.resx
index 7047db6..069a9bd 100644
--- a/Symlinker/Properties/Resources.es.resx
+++ b/Symlinker/Properties/Resources.es.resx
@@ -276,4 +276,7 @@ o modo carpeta (enlazar una carpeta a otra carpeta).
El destino no puede estar dentro del elemento que se mueve, ni al revés.
+
+ La versión de Microsoft Store no puede mover archivos a la carpeta AppData: Windows los guardaría en una copia privada que solo ve Symlinker. Elige un destino fuera de AppData, o mueve tú los archivos allí y vuelve a crear el enlace.
+
diff --git a/Symlinker/Properties/Resources.fr.resx b/Symlinker/Properties/Resources.fr.resx
index 0d57fad..a0d690b 100644
--- a/Symlinker/Properties/Resources.fr.resx
+++ b/Symlinker/Properties/Resources.fr.resx
@@ -276,4 +276,7 @@ Le déplacer vers la cible et laisser un lien à sa place ? Tout ce qui utilise
La cible ne peut pas se trouver dans l'élément déplacé, ni l'inverse.
+
+ La version Microsoft Store ne peut pas déplacer de fichiers dans le dossier AppData : Windows les garderait dans une copie privée que seul Symlinker voit. Choisissez une cible en dehors d'AppData, ou déplacez vous-même les fichiers puis recréez le lien.
+
diff --git a/Symlinker/Properties/Resources.hi.resx b/Symlinker/Properties/Resources.hi.resx
index 2f1adb0..afb3e33 100644
--- a/Symlinker/Properties/Resources.hi.resx
+++ b/Symlinker/Properties/Resources.hi.resx
@@ -276,4 +276,7 @@
लक्ष्य, ले जाए जा रहे आइटम के अंदर नहीं हो सकता, और न ही इसका उल्टा।
+
+ Microsoft Store संस्करण फ़ाइलों को AppData फ़ोल्डर में नहीं ले जा सकता: Windows उन्हें एक निजी कॉपी में रखेगा जिसे सिर्फ़ Symlinker देख सकता है। AppData के बाहर कोई लक्ष्य चुनें, या फ़ाइलों को खुद वहाँ ले जाएं और फिर से लिंक बनाएं।
+
diff --git a/Symlinker/Properties/Resources.it.resx b/Symlinker/Properties/Resources.it.resx
index 636669d..ea49193 100644
--- a/Symlinker/Properties/Resources.it.resx
+++ b/Symlinker/Properties/Resources.it.resx
@@ -276,4 +276,7 @@ Spostarlo nella destinazione e lasciare un link al suo posto? Tutto ciò che usa
La destinazione non può trovarsi all'interno dell'elemento da spostare, né viceversa.
+
+ La versione di Microsoft Store non può spostare file nella cartella AppData: Windows li terrebbe in una copia privata visibile solo a Symlinker. Scegli una destinazione fuori da AppData, oppure sposta tu i file e crea di nuovo il collegamento.
+
diff --git a/Symlinker/Properties/Resources.ja.resx b/Symlinker/Properties/Resources.ja.resx
index 85b19ec..e0ddac6 100644
--- a/Symlinker/Properties/Resources.ja.resx
+++ b/Symlinker/Properties/Resources.ja.resx
@@ -276,4 +276,7 @@
ターゲットを移動対象の中に置くことはできません。その逆もできません。
+
+ Microsoft Store 版では、AppData フォルダーにファイルを移動できません。Windows がファイルを Symlinker だけが見えるプライベートなコピーに保存してしまうためです。AppData の外にあるターゲットを選ぶか、ファイルを自分で移動してからもう一度リンクを作成してください。
+
diff --git a/Symlinker/Properties/Resources.pt.resx b/Symlinker/Properties/Resources.pt.resx
index eff44e9..4fa83b1 100644
--- a/Symlinker/Properties/Resources.pt.resx
+++ b/Symlinker/Properties/Resources.pt.resx
@@ -276,4 +276,7 @@ Movê-lo para o destino e deixar um link no lugar dele? Tudo que usa o caminho a
O destino não pode estar dentro do item que está sendo movido, nem o contrário.
+
+ A versão da Microsoft Store não pode mover arquivos para a pasta AppData: o Windows os guardaria em uma cópia privada que só o Symlinker vê. Escolha um destino fora da AppData ou mova você mesmo os arquivos e crie o link novamente.
+
diff --git a/Symlinker/Properties/Resources.resx b/Symlinker/Properties/Resources.resx
index 5c6342a..164febe 100644
--- a/Symlinker/Properties/Resources.resx
+++ b/Symlinker/Properties/Resources.resx
@@ -335,4 +335,7 @@ Move it to the target and leave a link in its place? Anything using the old path
The target can't be inside the item being moved, or the other way around.
+
+ The Microsoft Store version can't move files into the AppData folder: Windows would keep them in a private copy that only Symlinker sees. Pick a target outside AppData, or move the files there yourself and create the link again.
+
\ No newline at end of file
diff --git a/Symlinker/Properties/Resources.zh.resx b/Symlinker/Properties/Resources.zh.resx
index 558769b..3e11681 100644
--- a/Symlinker/Properties/Resources.zh.resx
+++ b/Symlinker/Properties/Resources.zh.resx
@@ -276,4 +276,7 @@
目标位置不能位于要移动的项目内部,反之亦然。
+
+ Microsoft Store 版本无法将文件移动到 AppData 文件夹:Windows 会把它们保存在只有 Symlinker 能看到的私有副本中。请选择 AppData 以外的目标,或者自己移动文件后再重新创建链接。
+
diff --git a/build-msix.ps1 b/build-msix.ps1
index 0968645..1e1c889 100644
--- a/build-msix.ps1
+++ b/build-msix.ps1
@@ -137,7 +137,7 @@ foreach ($arch in $Architectures) {
Set-Content -Path (Join-Path $layout "AppxManifest.xml") -Encoding utf8
# The window must start unelevated so drag and drop works. Only the link helper
- # (Symlinker.exe --link-helper) elevates, through allowElevation.
+ # (Symlinker.exe --link-helper) elevates, with a UAC prompt.
$exeManifest = Join-Path $outDir "$arch/Symlinker.exe.manifest"
& $mt -nologo -inputresource:"$(Join-Path $layout 'Symlinker.exe');#1" -out:$exeManifest | Out-Null
if ($LASTEXITCODE -ne 0 -or -not (Select-String -Path $exeManifest -Pattern 'level="asInvoker"' -Quiet)) {
@@ -164,10 +164,13 @@ foreach ($arch in $Architectures) {
}
$capabilities = @($built.Package.Capabilities.ChildNodes |
Where-Object { $_.NodeType -eq 'Element' } | ForEach-Object { $_.GetAttribute('Name') })
- foreach ($needed in 'runFullTrust', 'allowElevation', 'unvirtualizedResources') {
- if ($capabilities -notcontains $needed) {
- Write-Error "The package doesn't declare the $needed capability."
- }
+ if ($capabilities -notcontains 'runFullTrust') {
+ Write-Error "The package doesn't declare the runFullTrust capability."
+ }
+ # The Store denied allowElevation and unvirtualizedResources, and the app works without them.
+ $extra = @($capabilities | Where-Object { $_ -ne 'runFullTrust' })
+ if ($extra) {
+ Write-Error "The package declares $($extra -join ', '). The Store only approved runFullTrust."
}
Write-Output "Packed $msix"
}
diff --git a/packaging/msix/AppxManifest.xml b/packaging/msix/AppxManifest.xml
index f13c7ab..b618492 100644
--- a/packaging/msix/AppxManifest.xml
+++ b/packaging/msix/AppxManifest.xml
@@ -11,8 +11,7 @@
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
- xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
- IgnorableNamespaces="uap rescap desktop6">
+ IgnorableNamespaces="uap rescap">
Symlinker - Symlink Creator
Alejandro MD
Assets\StoreLogo.png
-
- disabled
- disabled
@@ -60,10 +56,11 @@
+
-
-
-
-
diff --git a/packaging/msix/store/README.md b/packaging/msix/store/README.md
index 9bfd0ec..0705022 100644
--- a/packaging/msix/store/README.md
+++ b/packaging/msix/store/README.md
@@ -28,12 +28,10 @@ Upload folder with `listingData.csv` would do both at once, but it failed with a
```
runFullTrust: Symlinker is a WPF desktop app packaged as a full-trust desktop app. It runs the Windows mklink command (cmd.exe) to create symbolic links, hard links and directory junctions at paths the user chooses, which is not possible from an AppContainer.
-
-allowElevation: Windows requires administrator rights to create symbolic links unless Developer Mode is on. The app itself runs unelevated. Only when the user creates a symbolic link that needs admin, it starts a hidden helper with the standard UAC prompt, and the helper only runs mklink on the paths the user entered. It makes no other system changes.
-
-unvirtualizedResources: Users create links in any folder they choose, including under AppData. With write virtualization on, links created there would silently land in the package's private folder instead of the real location the user picked, so the app turns off file and registry write virtualization.
```
+That is the only one. The first submission also asked for `allowElevation` and `unvirtualizedResources`, and both were denied. Neither is needed: the elevated link helper still gets its UAC prompt without `allowElevation`, and links made through `cmd.exe` land in the real `AppData` without `unvirtualizedResources`. `build-msix.ps1` fails if either comes back.
+
## Notes for certification (Additional Testing Information)
```