• fdoray's avatar
    Delete old files after an update. · 32c0f60f
    fdoray authored
    This is a variation of r378802 which was reverted because of
    a Dr Memory error (solved by using GenerateAlternatePEFileVersion
    instead of GenerateSpecificPEFileVersion). r378802 also caused
    problems with shortcuts crbug.com/592040 (solved by not letting
    the deletion of old files cause a rollback).
    
    With this CL, the installer deletes all files that belong to old
    versions of Chrome that are not in use after an update.
    
    Eventually, the DeleteOldVersions() will be invoked again to delete
    old versions that were in use at time of the update.
    
    BUG=451546
    TEST=
    -- Not-in-use --
    1. Run mini_installer.exe --chrome --multi-install --verbose-logging --do-not-launch-chrome
    - The install directory should contain chrome.exe and a matching version directory.
    - There should be no other executable or version directory in the install directory.
    2. Run next_version_mini_installer.exe --multi-install --verbose-logging --do-not-launch-chrome
    - The install directory should contain chrome.exe and a matching version directory. The version should be higher than at the previous step.
    - There should be no other executable or version directory in the install directory.
    
    -- In-use --
    1. Run mini_installer.exe --chrome --multi-install --verbose-logging --do-not-launch-chrome
    - The install directory should contain chrome.exe and a matching version directory.
    - There should be no other executable or version directory in the install directory.
    2. Launch Chrome.
    3. Run next_version_mini_installer.exe --multi-install --verbose-logging --do-not-launch-chrome.
    - The install directory should contain chrome.exe and a matching version directory + new_chrome.exe and a matching version directory.
    - There should be no other executable or version directory in the install directory.
    
    Review-Url: https://codereview.chromium.org/2273113002
    Cr-Commit-Position: refs/heads/master@{#414842}
    32c0f60f
installer_state_unittest.cc 18.2 KB