fix(installer): use {autodesktop} for per-user desktop shortcut safety and fix IPersistFile 0x80070005 error
Some checks failed
release / test (push) Failing after 13m30s
release / macos (push) Has been cancelled
release / windows (push) Has been cancelled
release / android (push) Has been cancelled
release / linux (push) Has been cancelled

This commit is contained in:
Yun Chan 2026-09-19 08:25:34 +09:00
parent 86e59f1e94
commit 3ac77180b4
9 changed files with 153 additions and 14 deletions

View file

@ -62,4 +62,21 @@ public class DesktopGatewayDaemonCommandLineGateTests
Assert.Equal(52101, config.BeaconUdpPort);
Assert.True(config.AutoStartUdpBeacon);
}
[Fact]
public void Gate157_InstallerScript_MustUseAutoDesktop_And_MustNotContainCommonDesktop_ForPerUserSafety()
{
var installerPath = Path.Combine(SourceTree.Root, "build", "installer.iss");
Assert.True(File.Exists(installerPath), "installer.iss must exist");
var content = File.ReadAllText(installerPath);
// Standard user (PrivilegesRequired=lowest) has no write permission to {commondesktop} (C:\Users\Public\Desktop).
// Saving a shortcut to {commondesktop} throws IPersistFile::Save 0x80070005 (Access is Denied).
// It must use {autodesktop} which resolves to {userdesktop} for standard users.
Assert.DoesNotContain("{commondesktop}", content);
Assert.Contains("{autodesktop}\\{#APP_NAME}", content);
Assert.DoesNotContain("{commonprograms}", content);
}
}