[译]ProjectZip Remoded 1.6-用于压缩VC6和.NET工作区和项目文件的"三合一"工具包
By robot-v1.0
本文链接 https://www.kyfws.com/applications/projectzip-remoded-1-6-a-3-in-1-tools-package-for-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 9 分钟阅读 - 4195 个词 阅读量 0[译]ProjectZip Remoded 1.6-用于压缩VC6和.NET工作区和项目文件的"三合一"工具包
原文地址:https://www.codeproject.com/Articles/5510/ProjectZip-Remoded-1-6-A-3-in-1-tools-package-for
原文作者:.dan.g.
译文由本站 robot-v1.0 翻译
前言
Zip your VC6 and .NET workspace and project files using a Standalone Executable, an Explorer shell extension or an updated VC6 Addin
使用独立的可执行文件,Explorer Shell扩展或更新的VC6插件压缩VC6和.NET工作区和项目文件 资料下载(Downloads)
- 最新的源文件-155 Kb(Latest Source files - 155 Kb)
- 最新可执行文件-54 Kb(Latest Executable - 54 Kb)
- 最新的Explorer Shell扩展-65 Kb(Latest Explorer Shell Extension - 65 Kb)
- 最新的VC6插件-71 Kb(Latest VC6 Addin - 71 Kb)
介绍(Introduction)
我要衷心感谢所有那些向我发送有关.NET端口的提醒的邮件.(I should like to extend my sincere thanks to all those for mailing me reminders about the .NET port of) 项目压缩(ProjectZip) 在最初对VC6插件感兴趣之后,我"承诺"要编写该代码.(which I had ‘promised’ to write following the initial interest in the VC6 addin.)
我曾希望这个问题能悄悄消失,因为我对.NET插件编写的早期尝试并没有使我充满热情.此外,还有.NET 2002插件与.NET 2003不兼容的问题,这使我感到.NET端口是一堆我真的不想打开的蠕虫,更不用说把手伸进去了!(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!)
不过,一个承诺就是一个承诺,如果没有别的事情,我将很荣幸,因此,我大力考虑了可能需要.NET社区而不需要实际.NET端口的替代方案.(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).)
结果是一个"三合一"解决方案-具有相同核心功能的三个工具-提供了多种方法来压缩Visual Studio 6和Windows XP的工作区或项目文件.(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)**Visual Studio .NET.(of Visual Studio .NET.)
我重新设计核心功能的方式还应该允许它扩展为支持来自其他开发环境(例如Borland C ++,Delphi和Visual Basic)的项目文件.(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可执行文件(新)(1. ProjectZip Executable (New))
这是.NET用户的两个解决方案之一,尽管它也可以直接从资源管理器运行,或者更有可能从快速启动栏(或所谓的任何名称)运行.(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-使用当前选项进行快速压缩(/q - quick zip using the current options)
-
/o-仅显示选项对话框(/o - show the options dialog only)
-
/u-从.zip文件解压缩工作区或项目(/u - unzip a workspace or project from a .zip file) 压缩时,文件名可以具有以下扩展名之一:(The filename can have the one of following extensions when zipping:)
-
.dsp(.dsp)
-
.dsw(.dsw)
-
.sln(.sln)
-
.vcproj(.vcproj) 和.zip解压缩时.(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扩展(新)(2. ProjectZip Shell Extension (New))
这是.NET用户的第二种解决方案,尽管它也可能成为VC6用户的首选选项,因为它不需要运行VC6.(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(ProjectZipShExt.dll)*到您选择的文件夹(to your folder of choice)
- 关闭所有资源管理器窗口(Close all explorer windows)
- 注册如下:(Register it as follows:)
regsvr32 "<path>\ProjectZipShExt.dll"
然后,每当在资源管理器中右键单击VC6/7工作区或项目文件时,您都可以选择压缩该文件.(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.)
VC6的ProjectZip插件(已更新)(ProjectZip Addin for VC6 (Updated))
它已被实质性地重写,以支持重新架构的核心功能,现在具有5个按钮,而不是原来的3个按钮.另外两个按钮允许压缩整个工作区,而不仅仅是活动项目.(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.)
按钮上的" W"和" P"表示两种形式-工作区和项目.(The two forms - Workspace and Project - are denoted by ‘W’ and ‘P’ on the buttons.)
我还删除了必须打开工作区或项目才能使用插件的限制.相反,如果无法确定当前的Workspace或Project,则会提示您浏览到所需的文件.(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:)
- 如果VC6已打开,则将其关闭.(Close VC6 if its is open.)
- 复制(Copy)**ProjectZip6Addin.dll(ProjectZip6Addin.dll)**到" .. \ Microsoft Visual Studio \ Common \ MSDev98 \ AddIns"(to “..\Microsoft Visual Studio\Common\MSDev98\AddIns”)
- 重启VC6(Restart VC6)
- 从"工具|自定义"对话框中选择"加载项和宏文件"选项卡.(Select the ‘Add-ins and Macro Files’ tab from the ‘Tools|Customize’ dialog box.)
- 选中" ProjectZip6Addin"条目旁边的复选框.(Select the checkbox next to the the ‘ProjectZip6Addin’ entry.)
- 当关闭对话框时,将出现ProjectZip工具栏,您可以将其拖放到VC6主窗口中.(When you close the dialog the ProjectZip toolbar should appear which you can drag and drop onto the VC6 main window.) 注意:向现有用户重命名该插件表示歉意,但是对于3个都提供相似服务的项目,我不得不加以区分.(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年)显示了ProjectZip工具集的核心功能的体系结构.(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:)
- 只需从CProjectZipBase派生并实现3个纯虚函数即可添加新的工作区/项目文件格式,其中两个是单行的.(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(占代码的95%)对特定的文件格式一无所知,从而保护了文件格式.(CProjectZipBase (accounting for 95% of the code) knows nothing about specific file formats which protects it from file format tinkering.)
- 前面描述的工具只需要与IProjectZip交互,就可以进一步保护它们免受对CProjectZipBase及其派生类的内部更改.(The tools described earlier need only interface with IProjectZip, further protecting them from internal changes to CProjectZipBase and its derived classes.) 如果您不使用Visual Studio,并且想为您使用的特定开发系统开发解析器,那么我很乐意回答您可能遇到的任何问题,并提供有关需要做什么的指导.(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(1.6)(2004年4月2日)((2 Apr 2004))
- 选项添加到允许压缩非必需的项目文件(例如.clw,.ncb,.opt,.suo)(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(1.5.2)(2004年3月9日)((9 Mar 2004))
- 添加的代码以处理格式为(\ file.cpp)的项目文件路径,这些文件路径是驱动器根目录中包含proejct文件的文件(感谢(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(1.5.1)(2004年3月5日)((5 Mar 2004))
- 对.NET项目文件解析进行小的调整以使其更强大(small adjustment to .NET project file parsing to make it more robust)
-
1.5(1.5)(2004年3月4日)((4 Mar 2004))
- 重组以允许多个项目文件扩展名(.NET工作区很重要)(restructured to allow for multiple project file extensions (important for .NET workspaces))
- 为.NET2003项目文件添加了支持(Microsoft细微更改了格式)(support added for .NET2003 project files (microsoft subtlely changed the format))
-
1.4(1.4)(2004年3月3日)((3 Mar 2004))
- 添加选项以将zip文件名设置为小写(option added to set zip filename to lowercase)
- 保存到注册表或从注册表还原的zip路径(由工作区路径键入)(zip paths saved and restored to/from registry (keyed by workspace path))
-
1.0(1.0)
- 初始发行(Initial Release)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VC7.0 VC7.1 C++ VC6 WinXP Win2003 Win2K MFC Visual-Studio Dev 新闻 翻译