In Windows-based applications, it is common to have some of the files that a setup installs to be opened with a specific program. For example, a setup author might want all .npd files to be opened with Windows Notepad. This article provides steps to create association between file extensions and applications by using an InstallAnywhere action that creates Windows Registry keys & sets File Association.
This article provides steps to associate a File Extension to an Application in Windows. Using ‘Associate File Extension – Windows’ action in Install and Post-Install Phase in InstallAnywhere, files can be associated to both Installed Applications , the applications that installer deploys on the target system, and Existing Applications on Windows. New or existing extensions can be associated. Associations will be removed on Uninstall of the associated application.
Here are the Steps to Associate File Extensions to Applications :
2. Configure Installed File/Existing File in Properties Customizer. To Associate an Installed Application, configure 'Installed file'. An .exe File or Launcher the installer deploys on the target system should be selected by clicking the 'Choose Application" button . Attached below InstalledFile.png. To Associate an Existing application that already exists on the target system, enter the path of the .exe file in 'Existing file'. Attached below ExistingFile.png.
3. Configure ‘Extension’ in Properties Customizer. Enter the extension without a Dot. Extension can be any Alpha-Numeric value supported by Windows. New extensions or existing extensions can be configured.
4. Configure ‘Icon’ in Properties Customizer. An Icon that the installer deploys on the target system can be associated to the application. Click the ‘Choose Icon’ button to open the ‘Choose a File’ Dialog box and select the Icon. Transparent .ICO file preferably of 256 X 256 pixels size is ideal. This configuration is optional, if Icon is not configured, the Default Icon of the Application will be retained.
5. Configure an existing MIME Type in properties customizer. This configuration is optional.
6. Configure Friendly name in properties customizer. This configuration is Optional. The default type name will be retained if Friendly name is not specified.
7. Configure Prog ID in properties customizer that should be registered for the File extension. This configuration is Optional. Prog ID is an arbitrary string. But it should be Unique on the target System.
8. Click on Verbs button to configure the below for the extension. Configuring verbs is optional. Command Sequence - Specify an order for the Verbs shown in Right click menu. Verb - Verb to be shown in Right click menu Display Name - Display name for the Verb Argument - Command line argument for the verb Use %1 in the argument in place of the selected filename. For Example, -p %1.
9. Build an Installer for Windows target and install.
10. The Associated file extensions will be opened with the configured application. File Association keys will be created in windows registry under HKEY_CLASSES_ROOT.
The Action for setting File Associations, ‘Associate File Extension - Windows’ , is available only in InstallAnywhere 2021 and later versions .