Advanced Installer Best Practice Pages

This section contains examples of Advanced Installer best practice scenario for helping users to choose the best way in creating their packages and avoid problems.
ICE Validators

ICE validators that test if the Advanced Installer guidelines for package generation are infringed.
This validation suite contains a set of ICE validators that test if the Advanced Installer guidelines for package generation are infringed.
The following best practice rules are tested:
| ICE Name | Description | Resolution | Automatic Fix |
|---|---|---|---|
| AI_ICE01 | Tests whether the SelfReg table was authored in the MSI database. There are several drawbaks when using this method. For more details please see SelfReg table documentation in MSDN. | It is recommended using the Registry. To fix it, go to the Files and Folders view and enable Extract registration info from native library option. To acces it, use the file's context menu and select the “Properties...” item. | Yes |
| AI_ICE02 | Tests whether the TypeLib table was authored in the MSI database. There are several drawbacks when using this method. For more details please see TypeLib table documentation in MSDN. | It is recommended using the Registry. To fix it, go to the Files and Folders view and enable Extract registration info from native library option. To acces it, use the file's context menu and select the “Properties...” item. | Yes |
| AI_ICE03 | Tests whether VBScript or JScript custom actions are authored in the MSI database. Script custom actions are difficult to write, also debugging them is not an easy task. Some anti-virus programs may kill them. | Use an executable file or dynamic-link library. | No |
| AI_ICE04 | Tests whether nested install custom actions are authored in the MSI database. This Windows Installer feature is deprecated. | Use Prerequistes or chained package instead. | No |
| AI_ICE05 | Tests whether the custom actions authored in the Wizard Dialogs Stage is also present in Install Execution Stage. A custom action present only in UI will not be executed during an un-managed install (basic or no user interface). | To fix it, go to the Custom Actions view and add the custom action under Install Execution Stage | Yes |
| AI_ICE06 | Tests whether the properties associted with dialog controls are public. A non-public property will not be available durring the execute phase of the installation. | To fix it, go to the Dialogs view, select the control, and in the Properties pane make the associated property public (app caps). | Yes |
| AI_ICE07 | Tests whether the properties associted with dialog controls have a default value. The default value will be used durring an un-managed install (basic or no user interface). | To fix it, go to the Dialogs view, select the control, and in the Properties pane edit the “Default Value” field. | No |
Using the "Save as template" option

This section describes the benefits of 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.
Topics
- Build Validation
Automatic validations performed before the build process to ensure package correctness, security, and reliability.