Files
deepseek-harness/apps/desktop/scripts/windows-directory-installer.d.mts
T
winewill 0981cd5924 fix(desktop): harden the Windows uninstall data removal after review
Pinned directories are now opened with listing access so the handle takes
part in share checks and a rename or replacement of the directory under the
helper fails; a metadata-only handle did not participate. A DSH_HOME published
as an environment variable protects overlapping targets, and /KEEP_APP_DATA
retains data alongside --updated, matching the flags electron-builder passes
to an older uninstaller. The remover clears read-only attributes, keeps
deleting siblings after a locked file, and removes only ordinary empty scope
parents below %APPDATA% instead of an NSIS RMDir that would also unlink a
junction. The redundant un.DataInit extraction is gone.

The native regression now runs from the installer test driver and covers the
protected root, rename blocking, read-only and locked files and parent
removal; the uninstaller smoke uses a per-run scope, polls for the temp-copy
handoff, asserts InstallLocation after each silent install, and adds
/KEEP_APP_DATA and DSH_HOME-inside cases. The Agent Note keeps the topic's
2026-09-08 filename, states the amendment in the decision, and defers macOS.
2026-09-21 17:01:54 +08:00

26 lines
1.0 KiB
TypeScript

/** Types for the pinned NSIS directory installation adapter. */
/**
* Replace payload installation while preserving registration and uninstall UI.
* @param source Pinned electron-builder installSection.nsh contents.
* @returns Section with staged directory replacement.
*/
export function directoryInstallSection(source: string): string
/**
* Clean staged directories on upstream Quit paths, including silent installers.
* @param source Pinned NSIS helper source.
* @returns Helper with cleanup before installer exits.
*/
export function directoryInstallerExits(source: string): string
/**
* Keep user-data removal in the native helper, which refuses unsafe roots and never follows links.
* @param source - Pinned upstream uninstaller source.
* @returns Uninstaller with long-path application removal and no upstream RMDir data removal.
*/
export function directoryUninstaller(source: string): string
/** Install the build-only adapter while retaining signed uninstaller generation. */
export function installWindowsDirectoryInstaller(): void