Frequently Asked Questions about files and folders

How do I register a Font?

You can register a Font by taking these steps:

  • add the Font in the Files and Folders page.
  • double click it or from the context menu select “Properties”.
  • select the Registration Tab.
  • enable the "Register font" checkbox.
  • write the "Registration Name" only if the font is not True-Type.

How do I register a file?

In an Advanced Installer project, you can register a file by following these steps:

  • add the file in the Files and Folders page
  • double click it or from the context menu select “Properties”.
  • in the Edit File dialog check the Auto register file (DLL, OCX, etc.) option
  • select the registration method supported by your file

How do I create a shortcut?

A shortcut can be created through the Shortcut Wizard. This wizard can be launched by clicking on the "New Shortcut Wizard" button on the toolbar of the "Files and Folders" page. Also, you can use the "Wizards" -> "Shortcut" menu. The target of the shortcut can be a URL, a file, a folder or the uninstaller of the package.

How do I place a folder in a specific feature?

The first step is to create the feature in the Organization page. After that, in the Files and Folders page, the Feature combo on the toolbar can be used to select the target feature. Finally, adding the folder will make Advanced Installer place all the resulted components into the selected feature.

Why do all EXE files open with my application?

Most likely you created a file association for the EXE extension. In order to remove this file association you can try to uninstall the package. If this doesn't work, you can follow these steps:

  • open Windows Explorer
  • use the "Tools" -> "Folder Options" menu to open the "Folder Options" dialog
  • go to the "File Types" tab
  • Press the [ New ] button
  • In the "File extension" field write exe
  • Press the [ Advanced>> ] button
  • From the list of the "Associated File Type" field select Application and hit the [ OK ] button.

This way, the EXE file association is re-created to open applications.

How can I share a file between multiple packages so when one of the packages is uninstalled the file is not deleted?

For this you can use the Organization page to share the component of the file between packages. The following conditions must be met:

  • the component uses the same name and same GUID in all packages
  • the file is installed in the same location by all packages (it is recommended to use a public location)

This way, Windows Installer will see the component as shared between packages and it will use a reference count for it. Installing a package with the shared component will increase the reference count and uninstalling one will decrease the reference count. The component is removed when the last package which contains it is uninstalled (the reference count reaches 0).

Why files are left behind after package uninstall?

Every resource from an installation package have a component assigned. A component is a piece of the application or product to be installed. Examples of components include single files, a group of related files, registry keys, resources, etc.

If, during an uninstall operation, there is any file left behind the next step to troubleshoot this is to create a verbose log of the uninstall process.

If you can find the following message Disallowing uninstallation of component: GUID's component since another client exists in your log, then this is the reason why your files or registry entries are not removed.
Basically, this can happen if the same components are shared between multiple packages installed on the same machine. Windows Installer keeps a refcount for the components and does allow removing them until all the applications that use them are removed.

You can find the other product using the same component GUIDs and remove that application as well (it may be a broken old version of your own product that could not be removed). In this case, you will be able to find the component under HKEY_CLASSES_ROOT\Installer\Components. The component keyname is the GUID re-packed.

A packed GUID can be obtained by applying a transform to a standard GUID. This transform performs the following operations:

  • removes the curly braces and separating dashes from a standard GUID
  • writes each group of the first three groups of hexadecimals characters in a standard GUID in reverse order
  • switches every two characters in the fourth and fifth group in a standard GUID

Let's consider the following example:
Original Product Code:
{12345678-ABCD-WXYZ-1234-ABCDEFGHIJKL}
The packed GUID:
87654321DCBAZYXW2134BADCFEHGJILK

NoteManually deleting some registry enrties doesn't make a really clean machine. It is highly recommended using virtual machine software, so you can easily reset the virtual machine to a known clean state (and also don't have to worry if your install breaks the machine).

Why some files are missing from the installation folder when performing an upgrade?

Usually, this behaviour occurs when performing an upgrade for versioned files (e.g. .DLLs, .EXEs, etc) when the file from the destination folder has a higher version than the source file.

If during an upgrade operation there are files missing from the installation folder, then the next step to troubleshoot this is to create a verbose log of the installation process.

If you can find the following message: Disallowing installation of component: GUID's component since the same component with higher versioned keyfile exists in your log, then this is the reason why your file is not copied on the target machine.
The upgrade process performs the following actions:

  • Detect and completely remove older products. During this operation the file will be removed from the machine.
  • Install the new product. The file from the upgraded version will not be installed since its component was not marked for installation.

To overcome this behaviour, you can enable the Always overwrite existing file option from the File Operations Tab of the File Properties.

How to create a shortcut which launches the target file as administrator?

For launching a file as administrator Microsoft recommends, starting with Windows Vista, to embed in your EXE a manifest file which specifies the execution level. In the following MSDN article you can find described all the steps required for creating a manifest and how to include it in your EXE file.

Why do my folders and registry keys look disabled (grayed out)?

The folders and registry keys that are grayed out are not disabled. Those folders and registry keys are, in fact, empty. They are not used in your project and they will not be created during the installation of the package.

All folders/keys are accessible and the files/registry values cannot be disabled.

Why the initial installation folder is not remembered on repair/modify?

This happens when the application folder does not contain any files in it or it contains only subfolders and the "Create folder on target machine" option from the Folder Properties Tab is not selected. A component is not created for this folder, thus the installation path is not saved in the registry by Windows Installer, so on maintenance it uses the default.

How does the installer handle file replacement logic for versioned and unversioned files?

Windows Installer has a specific set of rules for file replacement operation when a file already exists in the destination location. Here are the possible permutations for file versioning:

  • In case when the source file and the destination file are both versioned files, the rules are straightforward: Highest Version Wins.
  • In case when only one of the file is versioned. Here are two cases:
    • a) source file is versioned and the destination file is not versioned: the unversioned file will be replaced with the versioned file;
    • b) source file is unversioned and the destination file is versioned: the versioned file will not be replaced with the unversioned file;
  • In case the source file and the destination file are both unversioned files: Windows Installer will compare the created time and the last modified time of the destination file.

Read more about this in the File Versioning article.

Why the temporary files are not available during the upgrade process?

Temporary Files are copied during the CostFinalize standard action, at the beginning of the setup and removed during the InstallFinalize standard action, ensuring you have access to them throughout the entire install process.

An upgrade installation consists in two parts:

  • the uninstall of the old product version
  • the installation of the new product version

The problem is that the same extraction path for the temp files in both versions of the application is used, i.e. TempFolder. The solution is to create a sub-folder with a unique name for each version, for example this name: [|ProductVersion], and place all the temp files in this folder. This will prevent the old version to accidentally remove the extracted files of the new version.

Why the program icons that are pinned to the taskbar are missing on Windows 7?

This behaviour may occur during an upgrade on a Windows 7 machine. The pinned program icon may be missing or be displayed incorrectly due to the a Windows issue. For details, see the following article.

How do I update an XML file from my package?

Having two XML files with the same name in the same folder of a project (one added as a regular file and one in the Windows Installer format) is the recommended approach when you want to update an XML file that will be created on the machine during the installation. This is possible because a regular XML file is installed on the target machine before the XML changes are applied. In order to achieve this behaviour, first add the XML file as a "regular file". Then, simply add the same XML file in the Windows Installer format and by using the XML Editor modify the elements that you want to create, update or remove.

However, if a folder from the project that contains an XML file is synchronized with a folder from the local disk that also contains an XML file with the same name, both XML files (the one from the project and the one from the local disk) will be combined into one during the installation and may generate undesired content in the installed XML file.