5,139,275 members and growing! (11,688 online)
Email Password   helpLost your password?
Web Development » Applications & Tools » Tools with source code     Intermediate

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

By .dan.g.

Zip your VC6 and .NET workspace and project files using a Standalone Executable, an Explorer shell extension or an updated VC6 Addin
VC6, VC7, VC7.1, C++Windows, Win2K, WinXP, Win2003, MFC, VS6, VS, Dev

Posted: 23 Nov 2003
Updated: 31 Mar 2004
Views: 54,725
Announcements



Search    
Advanced Search
Sitemap
40 votes for this Article.
Popularity: 7.18 Rating: 4.48 out of 5
0 votes, 0.0%
1
2 votes, 5.0%
2
2 votes, 5.0%
3
3 votes, 7.5%
4
33 votes, 82.5%
5

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

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:

  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)

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

.dan.g.


.dan.g. is a former chartered structural engineer from the uk. He's been programming for 25 years since university and has been developing commercial windows software in Australia since 1998. He has a shaved head and assorted whiskers should you want to recognize him. [update] Dan has now grown his hair and removed his whiskers in an attempt to appear more normal. However he can still be recognized (in the summer months) by the aqua nail-polish he uses on his big toes. [/update]

For all his latest freeware visit http://www.abstractspoon.com/
Occupation: Software Developer (Senior)
Location: Australia Australia

Other popular Applications & Tools articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 50 (Total in Forum: 50) (Refresh)FirstPrevNext
Subject  Author Date 
QuestionVS 2005memberDoug Van Natter5:34 3 May '07  
GeneralDoes it work with VS2005?memberValery A. Boronin14:04 9 May '06  
GeneralQuestion, Other Usage.membersfdougl1:58 31 Jul '05  
GeneralRe: Question, Other Usage.member.dan.g.22:42 31 Jul '05  
GeneralRe: Question, Other Usage.member.dan.g.17:38 10 Aug '05  
GeneralSome suggestions for a batch mode usagesussanonymous2:29 14 Jul '05  
GeneralSome suggestions for a batch mode usagesussanonymous2:25 14 Jul '05  
GeneralZipStudio Article on CodeProjectmemberWillem Fourie21:25 20 May '04  
GeneralRe: ZipStudio Article on CodeProjectmember.dan.g.20:34 7 Sep '04  
GeneralRe: ZipStudio Article on CodeProjectmemberWillem Fourie23:43 7 Sep '04  
GeneralRe: ZipStudio Article on CodeProjectmemberalbionrulesok14:27 23 Nov '04  
GeneralRe: ZipStudio Article on CodeProjectmemberWillem Fourie20:08 23 Nov '04  
GeneralRe: ZipStudio Article on CodeProjectmemberalbionrulesok21:05 23 Nov '04  
Generalcommand linememberWolframEhnert2:06 19 Apr '04  
GeneralRe: command linemember.dan.g.20:31 7 Sep '04  
GeneralLatest executablememberGagnon Claude16:40 6 Apr '04  
GeneralRe: Latest executablemember.dan.g.21:52 6 Apr '04  
GeneralTwo questions..memberDmitriy Yakovlev of Foss Software, Inc.23:19 8 Mar '04  
GeneralRe: Two questions..member.dan.g.22:13 1 Apr '04  
GeneralRelative vs Absolute Pathnamesmembergjr13:30 7 Mar '04  
GeneralRe: Relative vs Absolute Pathnamesmember.dan.g.17:07 7 Mar '04  
GeneralRe: Relative vs Absolute Pathnamesmembergjr17:47 7 Mar '04  
GeneralRe: Relative vs Absolute Pathnamesmember.dan.g.12:30 8 Mar '04  
GeneralRe: Relative vs Absolute Pathnamesmembergjr13:08 8 Mar '04  
GeneralRe: Relative vs Absolute Pathnamesmember.dan.g.13:16 8 Mar '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 31 Mar 2004
Editor: Barry Lapthorn
Copyright 2003 by .dan.g.
Everything else Copyright © CodeProject, 1999-2008
Web17 | Advertise on the Code Project