我一直试图修改一些参数在maker-dmg,到目前为止,我得到了我想要的,但图标的位置。
这是我目前拥有的:
name: "@electron-forge/maker-dmg",
config: {
title: "Gallery",
background: "src/assets/installer-assets/installBackground.png",
format: "ULFO",
icon: "src/assets/installer-assets/brand-icon.icns",
contents: [
{ x: 192, y: 344, type: "file", path: "Gallery.app" },
{ x: 428, y: 344, type: "link", path: "/Applications" }
]
}但是我收到一个错误,说它找不到Gallery.app。
为目标制作时发生错误: dmg "Gallery.app“未在:Gallery.app中找到
我知道制造者只将信息转发给阿普库。我一直在查看他们的文档,我发现所有这些都被视为相对路径。
基本上,我不知道临时安装位置是什么,我只想从content对象中指定x和y变量,但它迫使我指定类型和路径。
以前有人改变过dmg的风格吗?如有任何帮助,敬请垂询。
警局。当我在没有指定内容的情况下挂载dmg,然后添加以下内容时,这是可行的:
{ x: 192, y: 344, type: "file", path: "/Volumes/Gallery/Gallery.app" },但是,一旦我弹出它并更新forge配置以包括上面的行,它就会中断。
发布于 2021-08-18 22:33:47
如果有人通过相同的bs,只需使用process.cwd()。
见示例:
contents: [
{
x: 192,
y: 240,
type: "file",
path: `${process.cwd()}/out/Gallery-darwin-x64/Gallery.app`
},
{ x: 466, y: 240, type: "link", path: "/Applications" }
]我终于可以玩图标的位置了!编码愉快。
https://stackoverflow.com/questions/68839448
复制相似问题