Skip to main content

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

PropertyTypeRequiredDefaultDescription
fileTypestringyesFile extension without the leading dot, e.g., "MyApp".
executablestringyesThe exe that opens the file. Usually $.installDir\\….
iconstringnoSource .ico/.png/.exe/.dll for the document icon. Append ,index for exe/dll.
progIdstringno<fileType>_auto_fileThe Programmatic ID. Override with a brand prefix (e.g., "MyApp.Document.1") to avoid collisions when multiple installers register the same extension.
verbsarray of Verbno[ { "name": "Open", "arguments": "\"%1\"" } ]Verbs the user can invoke ("Open", "Edit", "Print", …).

Verb

PropertyTypeRequiredDefaultDescription
namestringyesThe verb name shown in Explorer ("Open", "Edit", "Print", …).
argumentsstringnoArguments 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

AspectMSIMSIX
fileAssociationsImplemented via Win32 file association registry entries.Declared in the MSIX manifest under Extensions.
Multiple verbsSupported.Supported (Open verb is mandatory for the package).

Validation rules

ValidatorCatch
requiredfileType, executable are mandatory.
valid pathexecutable must be a syntactically valid path.
valid icon sourceicon must be .ico/.png/.exe/.dll.