Originally posted by Christianb:
"Hi Gang,
I need a program will replace all instances of a file on a drive or drives with a newer version if there is one. Does anyone know of such an app?
Thanks,
Christian Blackburn"
I just wrote one up CB, & if you're still around, you can give it a shot!
Our conversation above "inspired" me to do this in fact... why not?
It's a NICE add-on to my toolset that has alot of uses! In fact, for you in particular in this thread? Should be perfect!
(And, designed just as I describe it above pretty much as far as its architecture/theory, & works fine in practice!)
ANYHOW, on purpose:
It's main purpose really is to just find repeated occurance of files, a duplicated file finder!
However, unlike others out there that only really check on filename & datestamp, mine goes a LOT further to verify file duplication results veracity...
ANYHOW, on technical-superiority vs. other dup filefinderse:
How so, as far as "superior"?
Well, it finds dups/dopplegangers using the usual name & filesize data stamps first, but then digging deeper into optional Version stamp info. (if file carries it, .exe types usually only), CRC-32 calculation, + checksum calcs & time/date stamps...
(ALL on by default, but you can turn them off with checkboxes & it saves your settings for next run as well as filemasks you used for next run!)
It finds them on a disk you scan, & offers file mgt. tools like copy, delete, move, rename, etc. & more once they are found, so SHOULD fit the bill for you because of those functions that will allow you to perform the tasks you wish!
Heck, even if the file is locked many times because of being loaded (rename it first, then copy over the one you wish to the folder concerned) it can replace it.
* If that does not cut it, then a file like that that is constantly being called can be replaced by using inuse.exe (during explorer.exe shell uptime), OR crashing explorer.exe via taskmgr.exe & doing the move/rename/copy, OR using Recovery Console to do it (manual, but those are your workarounds).
This is the ONE THING I could probably improve on it: The ability to replace ANY file with any type of lock on it... if inuse.exe can do it, so can I... I know the API for it or can find it pretty fast & implement it!
ANYHOW, on detailed help & rules of replacement:
This is a GOOD idea to do manually instead of en-masse/automatic...
There ARE rules, especially with .DLL files (or, .ocx but not as important here with ocx or OLEServer type DLL's because they're marshalled by GUID, rather than by filename like old-school type DLL's are).
The program in its HELP menu has a help file to enumerate the rules of "DLL HELL" & replacement techniques/procedures/things to watch for etc.
How it works, & what to look out for if you decide to replace files (like local app dir .dll version vs. system32 public accessible via system %path% variable & why that is done sometimes to avoid 'dll-hell', to help you make decisions on what to move, where, when &/or why etc.)
It's important to do MANUALLY, rather than 'en-masse' because sometimes as you probably know, dup named files are stored on disk in folders for a reason by coders!
E.G.-> For version mismatch-DLLHell avoidance & so their programs run right by getting proper return vals off API calls, all based on rules of search for files by .exe files ordering & also tunings to it as well...
(All explained in MASSIVE detail! VERY "to-the-point" too, as much as possible in 4 modal popup help dialogs!)
ANYHOW, on performance:
It is VERY fast (uses FindFirst Win32 API call for recursive scans) & is FULLY customizeable which will help YOU alot in your task! How? By providing first, generic filemasks you can search files for like *.dll, *.exe, (a list you can edit no less that it loads @ startup) & then it allows you to customize it (for specific filenames like mydlltoreplace*.dl* etc.).
The algorithms/engines for CRC-32 & CheckSum are VERY fast as well, I spent a ton of time on this & they come back with results on the files as fast as the GetFileVersion API does from Win32 API in fact.. a nanosecond!
Written in multithreaded/multitasking FULLY optimized Borland Delphi Object Pascal, with Win32 API use, & inline assembler code for speed + uses an Assembler written DLL file for fast copy functions!
Lastly, as a "+": It offers CPU priority level control REALTIME, HIGH, NORMAL, & LOW for scanning speed "manual transmission" levels of control as well during scans for more speed of operation still yet... "bonus"!
ANYHOW, on flexibility:
It comes with a filelist (.txt type, easy edit via notepad.exe but has own editor) that it loads @ startup which you can edit addto/removefrom extensions or WHOLE filesnames masks for search/replace as well... then, ontop of that, it has a manual filter entry field that allows even more 'fine-grained' control of the mask!
Plus, the right-click menu it has not only offers copy, move, rename, delete functions but also attributes checks (can remove or apply them +r +h +s +a & reversal too for remove of them) & manual checks on version, time/date, checksum, crc-32, & filesize as well for manual re-verify so you are 110% sure you have duplicates listed!
Any settings you make/prefer during operations you would like to use/reuse, like what algorithm/engine for duplication check to use of the 6 it has in extras above & beyond sizecheck & filename (defaults) of CRC-32/CheckSumming/Time-Date Stamp/VersionCheck for instance?
It saves for subsequent/future runs as the defaults @ startup!
Plus, lastly, it allows you to check/uncheck which of the file checks it uses of the 6 algorithms I employ for veracity of duplication as well!
(In other words, You have choice using it... on alot of its abilities!)
(So bottom-line: She performs, is flexible, & does what you ask for & more!)
* Let me know if you still need a tool like this... apk4776239@hotmail.com OR here in "PM" section!
407kb zipped!
With .exe you put in %WinDir% (or really anyplace on disk, it's intelligent & can self-guide itself) & .dll you put into %SystemRoot%\system32 (used Stamina32.dll assembler coded DLL file for FAST copies function, faster even than Borland Delphi Object Pascal native code speed, which is the fastest there is except for Assembler or straight C (not C++)).
APK
P.S.=> Example: Using it, I found 227mb of repeated .DLL files alone using it, & guaranteed repeats due to the 6 known & respected algorithms she uses... good stuff, got me more room (heck, 5 games/major programs worth of room!)...
It's not 'half-assed' by any means which you said you felt yours was @ this point... keep @ yours though, make it "un-half-assed", if you need code or help, let me know!
Oh, on my advice to use ListBoxes instead of arrays (or other data structures) if you don't like that OR need mixed data types (collections work here possibly, or custom records/data struct TYPES you declare)?
I used string lists in mine this round... very fast, no Listbox control .vcl or .ocx overheads of object instancing or size either! apk
[Edited by AlecStaar on 2004-05-21 11:07:49]