Two mouse clicks 7-Zip archives for a developer

I have been frequently troubleshooting remote systems and otherwise provide various temporary binary files to remote production sites with fixes or beta versions of new features etc. The software  is such that that customer sites have specific combination of hardware, configuration, hardware on LAN, software conflicts and there is a number of things that are very much easier troubleshooted directly on the production server, through remote connection. Typically I am using TightVNC and Windows Remote Desktop, sometimes LogMeIn, RAdmin and more rare alternatives (among such I would like to specially note TeamViewer).

Obviously except for released versions of binaries (which also exist in several versions from different configuration builds), there appear a number of intermediate files, DLLs and EXEs which are addressed to specific problems and fixes. The problem with multitude of different versions of the same DLL is widely known as DLL hell.

It is not actually a big hell since we are trying to follow simple rules:

  • DLLs should be backward compatible, or if the compatibility is ever broken, DLL version mismatch scenario should be handled as gracefully as possible
  • DLLs and other binaries should have VERSIONINFO resource
  • version information file version’s least significant number is incremented with each and every build; in particular this allows to keep privately program databases (PDB) and immediately find the corresponding database by file version
  • newer binaries should always have greated file version than older ones

The problem however has been that the typical process of building a temporary build of a library and uploading it to remote location required too many clicks. Considering a number of times I have been through these operations, an automation and a productivity tool should have appeared long ago. Finally this is solved by a shell extension that compresses binaries into a transferrable archive in two clicks:

Context Menu Shell Extension

Compression formats of 7-Zip (.7z), 7-ZIP SFX (.exe) and ZIP (.zip) are at user’s choice.

Because of great number of versions it is very useful to have file version as a part of file name (actual binary name won’t have the version because typically DLL name does not change through versions and creating copies such as for example using hard links is possible but not quite convenient) in order to be able to locate a file and/or version of interest using file search.

The shell extension locates an installed copy of 7-Zip and uses its command line interface to create archives.

If a binary with VERSIONINFO resource is found among selected files (undefined behavior is multiple binaries selected), its name and version is used for archive name. If there is also a program database (.pdb) file selected, archive name will receive and additional suffix “-pdb”.

A partial Visual C++ .NET 2008 source code is available from SVN, release binary included [Win32, x64].

One Reply to “Two mouse clicks 7-Zip archives for a developer”

Leave a Reply