Hacker News new | ask | show | jobs
by mduggles 1040 days ago
On Windows it isn't possible to remove or rename files and directories that are being used. In order to handle this, you typically have to run some sort of helper application outside of the installation directory. This renames the existing installation directory to a new directory with ".tmp" (often, not always, but this is my guess). If that rename operation fails in the middle of the operation because a file being opened, either by another process or sometimes by an add-on, then the background update fails.

On Mac and Linux it's less complicated which is why they never get the "download the new version" prompt, but Chrome and Firefox have evolved systems for managing how these silent updates work. On Chrome the update button you talk talking about means you haven't closed the browser in awhile. If you see green that means an update has been available for 2 days, orange – 4 days and red – 7 or more days.

My guess is that you are encountering a situation in which the Chrome background helper can't successfully run the update process and then asks you to download the whole thing again so they don't need to rely on the updater and can just move your user files over.

2 comments

For Chrome, the behavior for me on Windows is exactly as you describe for Mac and Linux. The update happens in the background and button color is used to notify me that a restart is needed to move to the new version.

Firefox on Windows gives me a pop-up indicating a new version is available for download and providing a button to do that now. A restart is still required to get the new version, but AFAIK there's no default visible prompt to indicate the need to restart. If I go to Help -> About Firefox, that tells me I should restart to update...but that's not terribly obvious.

I turn on Linux and Windows machines after 3-6 months of inactivity somewhat often and never hit the issues OP describes, so I feel they are either misinterpreting what they / their relatives are seeing or they have performed other changes to these systems that block the standard behaviors.

> On Windows it isn't possible to remove or rename files and directories that are being used

Besides some access modes you can rename files in use. I did even bothered and tried on firefox.exe I'm typing this - it works fine.

My information might be old. I haven’t worked on a Windows application in 5+ years. At that point you couldn’t.
... it worked like that since Windows XP
You absolutely sure about that? https://www.biology-it.iastate.edu/solution-cannot-rename-fi...

https://answers.microsoft.com/en-us/windows/forum/all/renami...

https://superuser.com/questions/54193/how-can-i-rename-files...

From Mozilla: On Windows, it is not possible to remove or rename files and directories which are being used. In order to handle this, we need to add a little complexity.

The Firefox executable will launch a helper application copied to somewhere outside of the installation directory, most likely the system's temporary directory. The helper application renames the existing installation directory to a new directory with ".tmp" appended to its path name. If the rename operation fails in the middle of the operation because of a file being open by another application, it reverts the change.

Source: https://wiki.mozilla.org/Background_Updates

Yes, see https://imgur.com/a/8XdMVmF

FF tries to rename a directory with files opened under it. No sane OS should allow that.