Bug 20489 – Installer deleting files after install
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
installer
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2020-01-08T12:16:06Z
Last change time
2020-02-12T21:50:44Z
Keywords
pull
Assigned to
No Owner
Creator
Simen Kjaeraas
Comments
Comment #0 by simen.kjaras — 2020-01-08T12:16:06Z
Something seems to be wrong with the 2.090.0 Windows installer. After successfully installing, it proceeds to delete every file it has just added.
Looking closely at how it happens, it seems that it might actually be caused by the uninstaller deleting itself and the directory it's in. If I wait long after the previous version has been uninstalled before clicking 'next', it doesn't happen.
So, how to reproduce:
1) have a previous DMD version installed
2) start the 2.090.0 installer
3) answer yes to uninstalling the previous version
4) quickly finish installing 2.090.0
If you do this with the install folder open in an explorer window, you should see the files disappearing during the uninstall of the previous version, until the only item in the D folder is uninstall.exe. As the new install proceeds more files and folders will be added, and finally they will all be deleted again, sometimes leaving an empty folders, other times a partial installation (I've only once managed to get a partial installation).
It seems that the installer is not waiting for the uninstall to finish before installing things, or conversely that the uninstaller signals completion before it's actually done.
Comment #1 by r.sagitario — 2020-01-08T21:34:06Z
I tried to reproduce this, but for me, the uninstaller is blocking the installer until it is finished. The NSIS script is using an ExecWait statement to run the uninstaller.
Maybe ExecWait doesn't work for some reason. What Windows version are you running? Mine is Win 10 1903. What version are you uninstalling?
Comment #2 by simen.kjaras — 2020-01-09T08:43:37Z
Win10 1903, so that shouldn't be it. Could be work's overzealous antivirus or somesuch, I guess. Tested it both upgrading from 2.089.0 and just reinstalling 2.090.0 over the botched 2.090.0 install I ended up with. In total I tried it 7 or 8 times, and managed to recreate the issue 4 or 5 times.
I tried it again on a different computer today (but still a work machine, so could still be their antivirus - I'll be trying it at home tomorrow), and after seven installs didn't manage to get it to remove every single file even once, but had partial installs five times. I tried this with both 2.090.0 and 2.078.0 with identical results.
Comment #3 by simen.kjaras — 2020-01-10T23:03:52Z
Tested at home today, and I'm unable to recreate the issue. Looking at the install folder uninstall.exe is deleted within a quarter second of the uninstaller completing, while this would take several seconds at work.
Looking at the .nsi script there is a 1s sleep after the uninstaller returns before the uninstaller is invoked again in an Exec statement, which doesn't wait for its completion.
Conceivably this could be an ExecWait, or uninstall.exe's existence could be tested before the copying of files starts.
Comment #4 by dlang-bot — 2020-02-08T09:15:14Z
@rainers created dlang/installer pull request #428 "[WIP] fix Issue 20489 - Installer deleting files after install" fixing this issue:
- fix Issue 20489 - Installer deleting files after install
wait for uninstaller to terminate
https://github.com/dlang/installer/pull/428
Out of 15 attempts, I've managed to get a borked install once. That's even stranger, so I'm prepared to call it a fluke and say the fix works - at the very least the incidence rate is a lot lower.
Comment #7 by dlang-bot — 2020-02-12T09:21:29Z
dlang/installer pull request #428 "[WIP] fix Issue 20489 - Installer deleting files after install" was merged into master:
- d65cac1c1c699cc55dc38af76b634a043c3c1ac3 by Rainer Schuetze:
fix Issue 20489 - Installer deleting files after install
wait for uninstaller to terminate
https://github.com/dlang/installer/pull/428