File associations
Tell Windows that a given file extension opens with your app (e.g., .MyApp opens in My Application).
Applies to: MSI and MSIX.
fileAssociations – open-with handlers
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
fileType | string | yes | – | File extension without the leading dot, e.g., "MyApp". |
executable | string | yes | – | The exe that opens the file. Usually $.installDir\\…. |
icon | string | no | – | Source .ico/.png/.exe/.dll for the document icon. Append ,index for exe/dll. |
progId | string | no | <fileType>_auto_file | The Programmatic ID. Override with a brand prefix (e.g., "MyApp.Document.1") to avoid collisions when multiple installers register the same extension. |
verbs | array of Verb | no | [ { "name": "Open", "arguments": "\"%1\"" } ] | Verbs the user can invoke ("Open", "Edit", "Print", …). |
Verb
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | – | The verb name shown in Explorer ("Open", "Edit", "Print", …). |
arguments | string | no | – | Arguments passed to executable for this verb. %1 is the selected file. |
Examples
Single-extension association
"fileAssociations": [
{
"fileType": "My Company",
"executable": "$.installDir\\MyApp.exe",
"icon": "installer-assets\\My Company-doc.ico"
}
]
Default verb is Open with "%1".
Multiple verbs (Open, Edit, Print)
"fileAssociations": [
{
"fileType": "My Company",
"executable": "$.installDir\\MyApp.exe",
"icon": "installer-assets\\My Company-doc.ico",
"verbs": [
{ "name": "Open", "arguments": "\"%1\"" },
{ "name": "Edit", "arguments": "--edit \"%1\"" },
{ "name": "Print", "arguments": "--print \"%1\"" }
]
}
]
Multiple extensions handled the same way
fileAssociations is an array, so repeat the entry per extension:
"fileAssociations": [
{ "fileType": "My Company", "executable": "$.installDir\\MyApp.exe" },
{ "fileType": "My Companynote","executable": "$.installDir\\MyApp.exe" }
]
If you want the same ProgID across extensions, set progId explicitly on each entry.
MSI vs MSIX behavior
| Aspect | MSI | MSIX |
|---|---|---|
fileAssociations | Implemented via Win32 file association registry entries. | Declared in the MSIX manifest under Extensions. |
| Multiple verbs | Supported. | Supported (Open verb is mandatory for the package). |
Validation rules
| Validator | Catch |
|---|---|
required | fileType, executable are mandatory. |
valid path | executable must be a syntactically valid path. |
valid icon source | icon must be .ico/.png/.exe/.dll. |