Navigation:  »No topics above this level«

CopyWiz - Visual Studio Project Copy Wizard

Return to chapter overviewNext page

CopyWiz can perform one or more of the following operations on Microsoft Visual Studio (versions 5 through 2022), SQL Server Management Studio, Visual Studio Tools for Office, Embarcadero Delphi, C++Builder and RAD Studio (2007 through 11), Delphi Prism, Intel C++ Compiler and Visual Fortran, and other Visual Studio Shell projects and solutions:

 

Copy a project or solution to a new location, optionally with a new name
Rename an existing project
Fix up project directories
Replace all GUIDs in a project

 

Important: Always backup your files before using the wizard, especially when renaming an existing project (the existing project files will be modified in this case).

 

Launch CopyWiz from the Windows Start menu, or by right-clicking on a project or solutions file in Explorer and choosing Copy with CopyWiz to copy or rename the project.  An add-in/extension for launching CopyWiz is also added to the Visual Studio .NET 2002 thru 2019 IDE during installation (if checked).  To enable the extension in Visual Studio 2015 thru 2019, choose Tools | Extensions and Updates on the menu, enable the CopyWiz extension, and restart Visual Studio. To enable the add-in in Visual Studio 2002 thru 2013, choose Tools | Add-In Manager on the menu and check CopyWiz Add-in (also check the Startup checkbox to make the add-in available each time the IDE is started).  Then, CopyWiz can be launched by choosing Tools | CopyWiz from the Visual Studio menu bar (CopyWiz will launch pre-populated with the filename of the current solution).

 

Step 1

 

Use the first wizard screen to select the project or solution file to process.  You can choose from a list of recent projects or enter or browse to choose a file.  CopyWiz supports .sln, .*proj (all extensions ending with proj), .oxygene, .vbp, .dsp, .vcp, and .ebp files.

 

Step 2

 

After choosing a project filename and clicking Next, CopyWiz parses the file to determine its name and displays the name on the second wizard step.  The following selections are provided:

 

Copy files to a different location: This option determines if the selected project or solution will be copied to a new location.  If checked, a destination folder must be selected or entered (it will be created if it doesn't already exist), and the project and its files will be copied to the new location (the original project will not be modified).  If unchecked, the selected project will be modified in place.

 

New name of the project or solution: If copying, this option determines if the project filename and name will be changed when the project is copied. If not copying, this specifies how to rename an existing project.  In addition to changing all project name occurrences within the project files, all project filenames that are prefixed with the project name are modified to match the new project name (and any references to these files are also updated).

 

Also rename project path: When processing a multi-project solution file, renaming can be ambiguous, and if this option is unchecked, a project in a folder with the same name as the solution will not be renamed.  To rename a folder with the same name as the project/solution, check this option.

 

Do not rename in file extensions: Specifies file extensions to skip when renaming.

 

Retain uppercase names: If checked, CopyWiz will retain all-uppercase strings and filenames when renaming.  If unchecked, all uppercase strings and filenames will not be retained.

 

Fix up directories: If this option is checked, when copying or renaming the project, the wizard also fixes up all absolute and relative paths and filenames in the project files.  Any absolute paths are first converted to paths that are relative to the project’s location; existing relative paths are converted to the minimum necessary relative path. This can be useful for updating existing projects to fix up include paths and file paths that were incorrectly specified as absolute paths or relative paths that specified more levels than necessary.  For instance, the following table shows how path/filename strings encountered in a project located at \app1\test1\source\project1 would be fixed up:

 

Original Value

Fixed Up Value

\app1\test1\executables

..\..\executables

..\..\..\executables

..\..\executables

\app1\test1\source\common

..\common

..\..\common

..\common

\app2\common

..\..\..\..\app2\common

 

 

Point relative directories back to original location: This option is when copying to a new location and fixing up directories.  When copying to a new location, the wizard can either:

 

1)If checked, make relative paths in the project point to their original path.  For instance, if a project was copied from \app1\source\test1 to \app1\test1\source, and one of the files in the project was located at ..\common (\app1\source\common), that path would be changed to ..\..\source\common in the copied project.  This choice can be handy for moving existing projects up or down one or more levels in your project directories.
 
2)If unchecked, leave the canonical relative path as it was after fixing up.  In the previous sample, the path would be copied as ..\common.  Since the path would no longer point to the original file, the files in the path \app1\source\common would also be copied to a new folder \app1\test1\common by CopyWiz.

 

Note: Paths that specify the location of the project’s executable filename or compatible EXE are always fixed up using option 2, regardless of how this question is answered.

 

Replace GUIDs with new ones: If checked, when processing a project, GUIDs in the project are identified and replaced with new GUIDs.  This is very useful when copying an existing project to prevent the old and new projects from clashing when registered; it can also be used to modify an existing project that was copied manually (if the GUIDs were not updated).

 

Lowercase GUIDs: For compatibility with SharePoint projects, all new GUIDs will be lowercased by default.  To prevent lowercasing of GUIDs, uncheck this option.

 

Look for GUIDs in file extensions: If any GUIDs are defined in files with other extensions, add the file extensions here so that CopyWiz will look for them.

 

GUID identifiers to ignore: CopyWiz will ignore any GUIDs on lines that also contain one of the specified strings (separate multiple values with a semi-colon).

 

Step 3

 

The third wizard step is used to review and process your selections.  After reviewing the changes that will be made, click Next to begin processing.  The wizard parses the project file to determine the files that comprise the project.  Only project files located in the project directory or one of its subdirectories are processed (project files in common include directories in a lower or parallel directory level will not be copied).  C++ include files that are not part of the project will not be copied (it is recommended that these files be added to the project first).  If the project is being renamed, each filename in the project that begins with the project filename root is renamed to match the new project name.  For instance, in a project MyApp.dsp being copied and renamed to NewApp, the project files MyApp.cpp and MyAppView.cpp would be copied as NewApp.cpp and NewAppView.cpp.

 

The project file and its constituent files are traversed, and if the project name is being changed, any instances of the old project name/filename root are replaced with the new project name (any binary files in the project are copied unchanged); any path/filename strings are updated as necessary; and all GUIDs are replaced with new ones (VC++ projects only).  If the project is being copied to a new location, the original files are not modified, and the new files are written to the destination path; if the project is not being copied, the existing project files are modified.

 

Step 4

 

After processing is complete, the last wizard step is displayed.  To open the new or updated project immediately, check the checkbox and click Finish.  The project will be opened in its associated application, where it can be built, modified, and debugged as needed.

 

Notes:

The first time a new .dsp is opened, the Visual C++ IDE will create a .dsw for it and display a message about it finding an associated workspace file and opening it instead.
When a new Visual Studio .NET 2002 (or newer) project is opened, it will prompt to create a new .sln file for the project when first saving or building.