Introduction

I should like to extend my sincere thanks to all those for mailing me reminders about the .NET port of ProjectZip which I had 'promised' to write following the initial interest in the VC6 addin.

I had hoped the issue would quietly go away as my early forays into .NET addin-writing did not fill me with enthusiasm. Additionally there was the problem of .NET 2002 addins not being compatible with .NET 2003 which left me feeling that a .NET port was a can of worms that I really did not want to open, let alone plunge my hands into!

Nevertheless, a promise is a promise, and I'm fairly honourable if nothing else, so I vigorously thought of alternatives that might satisfy the .NET community without requiring an actual .NET port.

There was also some unfinished work relating to being able to zip entire workspaces and not just the active project that prompted me to get on and finish the job, which I think I now have (more or less).

The result is a '3-in-1' solution - three tools with the same core functionality - providing a multiplicity of ways to zip a workspace or project file for Visual Studio 6 and all versions of Visual Studio .NET.

The way I've re-architected the core functionality should also allow it to be extended to support project files from other development environments such as Borland C++, Delphi and Visual Basic.

1. ProjectZip Executable (New)

This is one of two solutions for .NET users, although it can also be run directly from explorer, or more likely from the Quick-Start-Bar (or whatever it's called).

Apart from a filename on the commandline, the executable also accepts the following parameters:

/q - quick zip using the current options

/o - show the options dialog only

/u - unzip a workspace or project from a .zip file

The filename can have the one of following extensions when zipping:

.dsp

.dsw

.sln

.vcproj

and .zip when unzipping.

If you pass no parameters except a filename then the assumption is that you want to zip the file.

If an inappropriate file is passed on the commandline then you will just get the options dialog

And finally, if you run the executable with no commandline (i.e. from explorer) then you will be prompted to browse for the file you want to zip.

2. ProjectZip Shell Extension (New)

This is the second solution for .NET users, although it may also become the prefered option for VC6 users since it does not require VC6 to be run.

To install all you have to do is:

Copy ProjectZipShExt.dll to your folder of choice

Close all explorer windows

Register it as follows: regsvr32 "<path>\ProjectZipShExt.dll"

Then whenever you right-click on a VC6/7 workspace or project file in explorer you will have the option to zip that file.

Note: at present you always get the options dialog because I wanted to limit the number of menu items that get added to the explorer context menu.

ProjectZip Addin for VC6 (Updated)

This has been substantially re-written to support the re-architected core functionality and now sports 5 buttons instead of the original 3. The two extra buttons allow the zipping of entire workspaces rather than just the active project.

The two forms - Workspace and Project - are denoted by 'W' and 'P' on the buttons.

I've also removed the restriction on having to have a workspace or project open to use the addin. Instead, if the current Workspace or Project cannot be determined, you will be prompted to browse to the file you want.

New workspace/project file formats can be added by simply deriving from CProjectZipBase and implementing 3 pure virtual functions, two of which are one-liners.

CProjectZipBase (accounting for 95% of the code) knows nothing about specific file formats which protects it from file format tinkering.

The tools described earlier need only interface with IProjectZip, further protecting them from internal changes to CProjectZipBase and its derived classes.

If you don't use Visual Studio and would like to develop parsers for the particular development system you do use then I would be happy to answer any questions you may have and provide guidance on what would need to be done.

Copyright

The code is supplied here for you to use and abuse without restriction, except that you may not modify it and pass it off as your own.

Comments and Discussions

Good Job,Projectzip can deal with multiple projects but all the projects have to be included in a single main project.I have a more general configuration:Many projects but a single application.Some of the project are included in the main oneOther are external projects

I would like to save all the projects automaticly.I can use projectzip in a batch mode.Then i need any prompt at the end of rhe zipping process. Its cant be disabled in the actual project.

I need also to save all the project at the same location.An option to give the output directory will be usefull

So here are my suggestions-Provide an option to disable the final message-Provide an option to give the output directory-provide all the options on the command line for more flexibility-provide an options to put all the processed projects internal and external in a single zip fileSo that a batch file for example can launch projectzip on all the projects and save all the zip files at a single automation without requiring me to click at each time.

But you can also enhance projectzip to take a list of project instead of a single project as input.

/u/o/q/D gives the output directory/m no message at the end /s put in a single zip/a display save as/l make lowercase/i include workspace ../v after ... verification/p prompt to select/w open the most likely../x prompt before .../? display the help