Click here to Skip to main content
15,923,222 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: There are times when I hate updaters. Pin
Eddy Vluggen13-Jan-20 1:40
professionalEddy Vluggen13-Jan-20 1:40 
GeneralRe: There are times when I hate updaters. Pin
OriginalGriff13-Jan-20 1:52
mveOriginalGriff13-Jan-20 1:52 
GeneralRe: There are times when I hate updaters. Pin
Eddy Vluggen13-Jan-20 2:04
professionalEddy Vluggen13-Jan-20 2:04 
GeneralRe: There are times when I hate updaters. Pin
musefan13-Jan-20 2:47
musefan13-Jan-20 2:47 
GeneralRe: There are times when I hate updaters. Pin
Eddy Vluggen13-Jan-20 4:46
professionalEddy Vluggen13-Jan-20 4:46 
GeneralRe: There are times when I hate updaters. Pin
kalberts13-Jan-20 22:21
kalberts13-Jan-20 22:21 
GeneralRe: There are times when I hate updaters. Pin
Eddy Vluggen14-Jan-20 1:26
professionalEddy Vluggen14-Jan-20 1:26 
GeneralRe: There are times when I hate updaters. Pin
kalberts14-Jan-20 3:02
kalberts14-Jan-20 3:02 
Eddy Vluggen wrote:
Not in Windows; replacing requires writing (and locking) to a file that is in use.
If the application starts the uninstaller and then terminates, the application executable is not in use. The uninstaller might also check for other instances running, and present a list to the user, offering the user to close down each instance in a controlled way, or optionally killing those processes forcefully. I am regularly handling several uninstallers that do that.

Now that I look it up, I see that with the delete/rename on reboot, the old file name is valid until reboot time. But at that time it certainly disappears. I mixed it up with another OS I worked with, where you could delete the name of a file to make it temporary: On Close() on a file that has no name, the file is deleted. (So you could make a temporary file by creating it with an empty name.)

So, with the Windows delet/rename at reboot mechanism, there is meaning to the question if you want to reboot now: With some uninstallers, some files may not disappear until reboot. But again: Scores of uninstallers manage to remove all relevant files, including itself an the directory where the uninstaller was residing, without a reboot. They are using other mechanisms. It happens, so it must be possible.
Eddy Vluggen wrote:
That's two different things; the progress not being updated by the installer, or Windows not painting because the main-process is busy.
It is obviously possible to set your screen update thread to a very low priority and the worker threads doing the deletion and cleanup to a very high priority. That is a case of "You Asked For It, You Got It". But I wouldn't say that is a recommended way to make your uninstaller, or any program with a progress bar. You give the display update process a high enough priority that it is not significantly delayed - certainly not for minutes, as the original poster experienced - by the background worker process.

Eddy Vluggen wrote:
Usually, it doesn't [know the files to delete].
In that case, I would think it could run into problems deleting them. Sure, at entry to "int main(int arc, char**argv)" it doesn't know, but it should create a list of files to be deleted quite early in the process.
Eddy Vluggen wrote:
That's exactly what the Windows progressbar shows when copying files and where all those people complain about it moving from 10s to 30m to 15s.
First: The jumping up and down continues throughout, it doesn't stabilize as the uninstaller, or whatever, gains experience with how fast the disk and other system components are (although my gut feeling is that it was much worse in earlier versions of Windows). Second: While there may be some flucutations of the estimate, nothing can justify orders of magnitude jumps up and down! We frequently see estimates jumping up or down by a factor of ten or more, indicating a completely crazy estimate of remaining work.
Eddy Vluggen wrote:
Given a FS works, the file may be "all over the place".
The estimate may jump all over the place, from 10 sec to 30 minutes to 15 sec. The files' disc locations doesn't influence that very much (more so on disks thirty years ago, but very little with modern disks).
Eddy Vluggen wrote:
Lots of small files take more than than a single file of the same size.
So, as I wrote, there is a time cost per file delete. Lots of small files will each cost the time of a file delete. When the uninstaller digs up the directory entries to create the file lists, it should also be able to see the actual size of a file: Releasing the space for a gigabyte file takes more time than releasing 2 kbytes of file space. This is particularly true on file systems allocating on a page basis (such as DOS and "classical" *nix file systems); on NTFS (and other files with extent allocation), it is more a function of the number of extents than of disk pages. On a fully defragmented disk (every file has only a single fragment) there will be far less difference in time between deleting a 2k and a 1G file, although there still is some. But if the last three files of 1 Gbyte each took half a second to delete, the uninstaller may assume that number four will take roughly as much time. If the last twenty kilobytes files each were deleted in 10 ms, it may assume that the next fifty kilobyte files will require a similar amount of time each.

It seems like some programmers handling progress bars are not thinking at all! E.g. if you are given a "pause" option, and use it, the clock is not stopped when the operation is paused: If half of the files/megabytes were processed in 10 seconds, and then you pause everything for 30 seconds before continuing with the next file, the time estimate is calculated from the 30.01 seconds it took to handle the first file after the resume, completely ignoring that 30 of 30.01 seconds were not used for processing the file.

It is not easy to get a perfect pre-calculation that will be correct within a margin of, say, 5%. But getting within a factor of two should be easy, within 50% definitely also realistic - at least when the operation is 10% on its way.

I made myself an incremental, deduplicating backup system, that handles all my disks of various technologies and interfaces. In the backup management data, I keep information for each individual disk how much time it typically takes to open a file (in various modes), how long it typically takes to read 10 kbyte, 100 kbyte, 1 Mbyte, 10 Mbyte, how long a create or delete takes. After each backup is performed, these figures are adjusted. They might be somewhat off from the "historical" value, e.g. if I usually plug in the USB3 disk in an USB3 connection, but then one day plug it into an USB2 connection. It is detected quite rapidly during the backup that one disk is slower than the management data indicates, so the estimated time for completion is adjusted. The managed value is adjusted somewhat, being set to 75% old value + 25% new value (percentage was arbitrarily chosen) so that it remains fairly stable but will slowly adapt to e.g. new interfaces.

An uninstaller, being run once or maybe a couple of times, with no place to save former experience, cannot easily save historical data the way I do in my backup system. The application could, though: I have been using several applications that can tune itself by running timing tests on the speed of disks, display cards and other components. These data are saved a configuration file (or in the Registry) for use by the application itself, but it could also be used by any other function that displays a progress bar, such as an unistaller.

Getting a good progress indicator, a lot better than what is typical today, is actually not that difficult. Getting a perfect one may be difficult, but we are not asking for that. Only for something that is reasonably close to real world operations.
GeneralRe: There are times when I hate updaters. Pin
Eddy Vluggen14-Jan-20 3:10
professionalEddy Vluggen14-Jan-20 3:10 
GeneralRe: There are times when I hate updaters. Pin
dandy7213-Jan-20 3:59
dandy7213-Jan-20 3:59 
GeneralRe: There are times when I hate updaters. Pin
Cp-Coder13-Jan-20 7:26
Cp-Coder13-Jan-20 7:26 
GeneralRe: There are times when I hate updaters. Pin
OriginalGriff13-Jan-20 8:07
mveOriginalGriff13-Jan-20 8:07 
GeneralFinally saw The Last Jedi... Pin
glennPattonWork312-Jan-20 22:47
professionalglennPattonWork312-Jan-20 22:47 
GeneralRe: Finally saw The Last Jedi... Pin
Johnny J.12-Jan-20 22:56
professionalJohnny J.12-Jan-20 22:56 
GeneralRe: Finally saw The Last Jedi... Pin
OriginalGriff12-Jan-20 23:01
mveOriginalGriff12-Jan-20 23:01 
GeneralRe: Finally saw The Last Jedi... Pin
glennPattonWork312-Jan-20 23:02
professionalglennPattonWork312-Jan-20 23:02 
GeneralRe: Finally saw The Last Jedi... Pin
OriginalGriff12-Jan-20 23:09
mveOriginalGriff12-Jan-20 23:09 
GeneralRe: Finally saw The Last Jedi... Pin
Johnny J.12-Jan-20 23:22
professionalJohnny J.12-Jan-20 23:22 
GeneralRe: Finally saw The Last Jedi... Pin
Mark_Wallace13-Jan-20 0:17
Mark_Wallace13-Jan-20 0:17 
GeneralRe: Finally saw The Last Jedi... Pin
Mark_Wallace13-Jan-20 0:20
Mark_Wallace13-Jan-20 0:20 
GeneralRe: Finally saw The Last Jedi... Pin
glennPattonWork312-Jan-20 23:01
professionalglennPattonWork312-Jan-20 23:01 
GeneralRe: Finally saw The Last Jedi... Pin
Richard Deeming13-Jan-20 8:18
mveRichard Deeming13-Jan-20 8:18 
GeneralRe: Finally saw The Last Jedi... Pin
glennPattonWork313-Jan-20 12:19
professionalglennPattonWork313-Jan-20 12:19 
GeneralWSO CCC OTD 2020-01-13 Pin
OriginalGriff12-Jan-20 21:41
mveOriginalGriff12-Jan-20 21:41 
GeneralRe: WSO CCC OTD 2020-01-13 Pin
pkfox12-Jan-20 21:51
professionalpkfox12-Jan-20 21:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.