Using the "Save as template" option

The "Save as Template" option is very useful when you already created a project with many configurations and want to duplicate it for creating another similar project. By using this option for a project, a new entry is added in the "Custom Templates" tab where you can go and create the new project. The template file is saved to the templates repository path, which path can be edited using the "Repository Manager".

All information and settings in the template will be added to the new project, except for all the GUIDs which will be changed. This way, the resulted package will be seen as a completely different package compared to other packages created from the same template.

Using the "copy-paste" method when you want to duplicate a project may lead to many problems, these can be avoided if you use the option "Save as Template". All these issues appear because the project created using the "copy-paste" method will have the same GUIDs (Upgrade Code, Product Code, components ID) as the source/original project.

Below, you can see a list with the problems that you may encounter if you do not use the "Save as Template" option when you duplicate a project:

  • Another version of this product is already installed.
As long as the Upgrade Code and the Product Code of the original and the duplicated project are the same the following error is displayed:
"Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Programs and Features in the Control Panel."
  • Files and shortcuts are not installed.
The two project will contain components with the same GUIDs and when they will be built and installed, only one of the components that have the same GUID will be installed and it will be shared between the two packages. The value SharedDllRefCount attribute will be increased for that component.
  • Files and shortcuts are not removed.
When two packages that contain components with the same GUIDs are installed, those components will be shared between packages as mentioned above. Then, when one of the packages is uninstalled, it will not remove any of the components and files that are shared between packages because the other package may need these resources in the future. In this case a line similar to the one below can be found in the verbose log of the uninstalled package:
"Disallowing uninstallation of component: {CED7B6A0-2035-37FB-9F32-8C5C38AC6535} since another client exists."
All the resources will be removed when the second package will be uninstalled, too.

Considering the fact that other problems may also be encountered, you should pay close attention when you create your packages and you should use the "Save as Template" option anytime you want to create a new project based on an already configured one.