electron builder fileAssociations does not take effect
Reasons why fileAssociations configuration does not take effect
It is a window permission problem. Because of the permission problem, the configuration related to fileAssociations in the window is blocked.
Solution
Set perMachine in the nsis configuration to false (which is the default value).
nsis: {
//nsis安装器配置
oneClick: false, // 是否需要点击安装,自动更新需要关掉
allowToChangeInstallationDirectory:true, //是否能够选择安装路径
perMachine: false
},
fileAssociations: {
ext: ["md","markdown","mmd","mdown","mdtxt","mdtext"],
name: "Markdown",
description: "Markdown document",
icon: "./resource/icons/md.png"
},