You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
desktop: same-path upgrade deletes user files stored inside the installation directory
#10244
A same-path desktop upgrade replaces the whole installation directory and deletes files the installer did not create. In my case the nightly updater replaced D:\DeepSeek Harness and removed D:\DeepSeek Harness\Harness工作区, including a skill under its .dsh\skills. The files were not in the Recycle Bin and were not recoverable.
Five attempts failed while the app was running (10:38, 11:03, 12:05, 12:07, 12:22). After the app exited the rename succeeded: D:\DeepSeek Harness has a fresh creation time (12:26:28) while its payload files still carry the 10/17 build timestamp, and no .old-{GUID} directory remains.
Root cause
apps/desktop/scripts/installer-directories.nsh:
dshStageApplication stages the payload in $INSTDIR.new-{GUID}.
dshPromoteDirectories renames $INSTDIR to $INSTDIR.old-{GUID} and the staging directory to $INSTDIR.
Removing the old tree is what drops obsolete payload files, but the installer keeps no record of which entries it owns, so anything a user created inside the installation directory is deleted with it. The uninstaller has the same class of problem (RMDir /r "\\?\$INSTDIR").
Expected
An upgrade must not delete files the installer did not create - preserve them (preferred) or refuse the update with a clear message. Uninstall should follow the same rule.
Proposed fix (patch available, PRs are not accepted per CONTRIBUTING)
I implemented the fix on a fork branch; the diff is 5 files:
new apps/desktop/installer/installed-files.h: records .dsh-install-manifest at install time; on upgrade, moves every entry the previous manifest does not name back into the new directory, leaves payload entries in place, and treats previous-manifest-only entries as obsolete payload files
Legacy installations (no manifest) preserve everything the new payload does not name on their first upgrade; later upgrades are exact. Same-path collisions keep the new payload file (a user-modified application file is still treated as application-owned).
I could not run the Windows build or NSIS smoke locally (no Visual Studio C++ Build Tools, no makensis, no 7za), so the branch is unverified by CI. Any Windows test results would be welcome.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
A same-path desktop upgrade replaces the whole installation directory and deletes files the installer did not create. In my case the nightly updater replaced
D:\DeepSeek Harnessand removedD:\DeepSeek Harness\Harness工作区, including a skill under its.dsh\skills. The files were not in the Recycle Bin and were not recoverable.Environment
resources/app-update.yml), installerdeepseek-harness-0.2.1-rc.2-win-x64.exeD:\DeepSeek HarnessEvidence from the updater's own logs
%LOCALAPPDATA%\@deepseek-aidsh-desktop-updater\installer-logs\directory-failure-*.log:Five attempts failed while the app was running (10:38, 11:03, 12:05, 12:07, 12:22). After the app exited the rename succeeded:
D:\DeepSeek Harnesshas a fresh creation time (12:26:28) while its payload files still carry the 10/17 build timestamp, and no.old-{GUID}directory remains.Root cause
apps/desktop/scripts/installer-directories.nsh:dshStageApplicationstages the payload in$INSTDIR.new-{GUID}.dshPromoteDirectoriesrenames$INSTDIRto$INSTDIR.old-{GUID}and the staging directory to$INSTDIR.dshFinishDirectoriesrunsRMDir /r "$dshOldDirectory".Removing the old tree is what drops obsolete payload files, but the installer keeps no record of which entries it owns, so anything a user created inside the installation directory is deleted with it. The uninstaller has the same class of problem (
RMDir /r "\\?\$INSTDIR").Expected
An upgrade must not delete files the installer did not create - preserve them (preferred) or refuse the update with a clear message. Uninstall should follow the same rule.
Proposed fix (patch available, PRs are not accepted per CONTRIBUTING)
I implemented the fix on a fork branch; the diff is 5 files:
apps/desktop/installer/installed-files.h: records.dsh-install-manifestat install time; on upgrade, moves every entry the previous manifest does not name back into the new directory, leaves payload entries in place, and treats previous-manifest-only entries as obsolete payload fileswindow-frame.cpp: exportsInstallerFinalizeDirectoriesinstaller-directories.nsh: finalizes before deleting the backup; on failure keeps the complete backup instead of deleting anythinginstaller.nsh: wires the new exportsmoke-installer-directories.ps1: preserves, obsolete-removal, and legacy-migration casesBranch / compare view:
hs666-ai/deepseek-harness@master...fix/desktop-preserve-install-directory-files
Legacy installations (no manifest) preserve everything the new payload does not name on their first upgrade; later upgrades are exact. Same-path collisions keep the new payload file (a user-modified application file is still treated as application-owned).
I could not run the Windows build or NSIS smoke locally (no Visual Studio C++ Build Tools, no
makensis, no7za), so the branch is unverified by CI. Any Windows test results would be welcome.All reactions