• Greg Thompson's avatar
    Create mini_installer.exe's work directory next to the binary. · 3fca0043
    Greg Thompson authored
    mini_installer.exe requires a temporary directory in which to write
    files during processing. Historically, this has been a directory under
    %TMP%. While mini_installer does its level best to delete this directory
    before terminating, it cannot always do so (e.g., third-party software
    may have some files open, or the machine may lose power).
    mini_installer.exe scans %TMP% at process startup to delete any stale
    directories from previous runs to prevent unbounded accumulation said
    directories.
    
    In this CL, mini_installer.exe now creates its work directory in the
    directory containing the executable itself. In the case of installations
    driven by a variant of Omaha (e.g., Google Chrome), Omaha will
    eventually clean any files/directories left behind.
    
    This CL also results in successful runs sending up either 0x10000 or
    0x20000 in ExtraCode1 based on whether or not the fallback to %TMP% was
    used. This will inform us as to whether or not it's safe to remove that
    fallback.
    
    A note to the authors of other Chromium forks: this change in behavior
    may impact you. Audit how your variant of mini_installer.exe is run and
    ensure that any files or directories left in the same directory as it
    are cleaned up.
    
    BUG=516207,1100280
    
    Change-Id: I7a8dd7981b26dbac10553747cfe32a40fb11f37b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351989Reviewed-by: default avatarS. Ganesh <ganesh@chromium.org>
    Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Commit-Queue: Greg Thompson <grt@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#798844}
    3fca0043
mini_installer.cc 37.7 KB