Click here to Skip to main content
15,867,453 members
Articles / Desktop Programming / MFC
Article

ProjectZip Remoded 1.6 - A '3-in-1' tools package for zipping VC6 and .NET workspace and project files

Rate me:
Please Sign up or sign in to vote.
4.87/5 (40 votes)
31 Mar 2004CC (ASA 2.5)5 min read 164.8K   3.7K   52   50
Zip your VC6 and .NET workspace and project files using a Standalone Executable, an Explorer shell extension or an updated VC6 Addin

Downloads

Sample Image - pzoptions.jpg

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).

Image 2

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.

Image 3

To install all you have to do is:

  1. Copy ProjectZipShExt.dll to your folder of choice
  2. Close all explorer windows
  3. 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)

Image 4

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.

To install and use the addin:

  1. Close VC6 if its is open.
  2. Copy ProjectZip6Addin.dll to "..\Microsoft Visual Studio\Common\MSDev98\AddIns"
  3. Restart VC6
  4. Select the 'Add-ins and Macro Files' tab from the 'Tools|Customize' dialog box.
  5. Select the checkbox next to the the 'ProjectZip6Addin' entry.
  6. When you close the dialog the ProjectZip toolbar should appear which you can drag and drop onto the VC6 main window.

Note: Apologies to existing users for renaming the addin but with 3 projects all providing similar services I had to differentiate between them.

Restructuring the Code

The following diagram (drawn with CodePlotter © AbstractSpoon 2003) shows the architecture of the core functionality of the ProjectZip toolset.

{{DIAGRAM_START

: ProjectZip Core Functionality Architecture

                                                .------------------.
                                                |CProjectZip6      |
                                                |__________________|
                                                |                  |
                                                |overides virtual m|
                                                |ethods to provide |
                                                |parsing of the dsp|
                                                | and dsw files    |
                                        -------->------------------·
                                        |
  .-------------.    .------------------^.
  |IProjectZip  >---->CProjectZipBase    >------>------------------.
  |_____________|    |___________________|      |CProjectZip7      |
  |             |    |                   |      |__________________|
  |pure virtual |    |contains generic zi|      |                  |
  | interface   |    |p code with key met|      |overides virtual m|
  ·-------------·    |hods declared as pu|      |ethods to provide |
                     |re virtual to handl|      |parsing of the vcp|
                     |e different file fo|      |roj and sln files |
                     |rmats              |      ·------------------·
                     ·------------------v·
                                        |
                                        -------->------------------.
                                                |Other Formats...  |
                                                |                  |
                                                |                  |
                                                ·------------------·
}}DIAGRAM_END

This architecture affords me a number of benefits:

  • 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.

History

  • 1.6 (2 Apr 2004)
    • option added to allow zipping of 'non-essential' project files such as .clw, .ncb, .opt, .suo
    • various bugs fixed relating to using the correct user preferences
    • filter index is now saved after browsing for a file to zip (affects executable only)
  • 1.5.2 (9 Mar 2004)
    • code added to handle project file paths of the form ('\file.cpp') which are files in the root of the drive containing the proejct file (thanks to gjr)
    • registry code fixed where direct registry access was failing (thanks to Peter Boulton)
  • 1.5.1 (5 Mar 2004)
    • small adjustment to .NET project file parsing to make it more robust
  • 1.5 (4 Mar 2004)
    • restructured to allow for multiple project file extensions (important for .NET workspaces)
    • support added for .NET2003 project files (microsoft subtlely changed the format)
  • 1.4 (3 Mar 2004)
    • option added to set zip filename to lowercase
    • zip paths saved and restored to/from registry (keyed by workspace path)
  • 1.0
    • Initial Release

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-ShareAlike 2.5 License


Written By
Software Developer Maptek
Australia Australia
.dan.g. is a naturalised Australian and has been developing commercial windows software since 1998.

Comments and Discussions

 
QuestionVS 2005 Pin
Doug Van Natter3-May-07 4:34
Doug Van Natter3-May-07 4:34 
QuestionDoes it work with VS2005? Pin
Valery A. Boronin9-May-06 13:04
Valery A. Boronin9-May-06 13:04 
GeneralQuestion, Other Usage. Pin
S Douglas31-Jul-05 0:58
professionalS Douglas31-Jul-05 0:58 
GeneralRe: Question, Other Usage. Pin
.dan.g.31-Jul-05 21:42
professional.dan.g.31-Jul-05 21:42 
GeneralRe: Question, Other Usage. Pin
.dan.g.10-Aug-05 16:38
professional.dan.g.10-Aug-05 16:38 
GeneralSome suggestions for a batch mode usage Pin
Anonymous14-Jul-05 1:29
Anonymous14-Jul-05 1:29 
GeneralSome suggestions for a batch mode usage Pin
Anonymous14-Jul-05 1:25
Anonymous14-Jul-05 1:25 
GeneralZipStudio Article on CodeProject Pin
Willem Fourie20-May-04 20:25
Willem Fourie20-May-04 20:25 
GeneralRe: ZipStudio Article on CodeProject Pin
.dan.g.7-Sep-04 19:34
professional.dan.g.7-Sep-04 19:34 
GeneralRe: ZipStudio Article on CodeProject Pin
Willem Fourie7-Sep-04 22:43
Willem Fourie7-Sep-04 22:43 
GeneralRe: ZipStudio Article on CodeProject Pin
albionrulesok23-Nov-04 13:27
albionrulesok23-Nov-04 13:27 
GeneralRe: ZipStudio Article on CodeProject Pin
Willem Fourie23-Nov-04 19:08
Willem Fourie23-Nov-04 19:08 
GeneralRe: ZipStudio Article on CodeProject Pin
albionrulesok23-Nov-04 20:05
albionrulesok23-Nov-04 20:05 
Generalcommand line Pin
WolframEhnert19-Apr-04 1:06
WolframEhnert19-Apr-04 1:06 
GeneralRe: command line Pin
.dan.g.7-Sep-04 19:31
professional.dan.g.7-Sep-04 19:31 
GeneralLatest executable Pin
Gagnon Claude6-Apr-04 15:40
Gagnon Claude6-Apr-04 15:40 
GeneralRe: Latest executable Pin
.dan.g.6-Apr-04 20:52
professional.dan.g.6-Apr-04 20:52 
GeneralTwo questions.. Pin
Dmitriy Yakovlev8-Mar-04 22:19
Dmitriy Yakovlev8-Mar-04 22:19 
GeneralRe: Two questions.. Pin
.dan.g.1-Apr-04 21:13
professional.dan.g.1-Apr-04 21:13 
GeneralRelative vs Absolute Pathnames Pin
gjr7-Mar-04 12:30
gjr7-Mar-04 12:30 
GeneralRe: Relative vs Absolute Pathnames Pin
.dan.g.7-Mar-04 16:07
professional.dan.g.7-Mar-04 16:07 
GeneralRe: Relative vs Absolute Pathnames Pin
gjr7-Mar-04 16:47
gjr7-Mar-04 16:47 
GeneralRe: Relative vs Absolute Pathnames Pin
.dan.g.8-Mar-04 11:30
professional.dan.g.8-Mar-04 11:30 
GeneralRe: Relative vs Absolute Pathnames Pin
gjr8-Mar-04 12:08
gjr8-Mar-04 12:08 
GeneralRe: Relative vs Absolute Pathnames Pin
.dan.g.8-Mar-04 12:16
professional.dan.g.8-Mar-04 12:16 

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.