Closed ianchanning closed 5 years ago
Ignore me I see it in the future plans
I'll reopen this issue, I'm happy to track and discuss the Windows/Linux versions here.
Can you test on Linux? I actually would expect it to just work on Linux. I can put up a build if you can test it... or you can build it yourself:
Install yarn, then:
## Download source code
git clone git@github.com:mb21/panwriter.git
cd panwriter
## Install npm dependencies, PureScript compiler, etc
yarn install
## Build the PureScript project
yarn build
## To build distributable app package (goes to ./dist):
yarn dist
Yes, I can test it on both Linux (Ubuntu and Fedora) and Windows 10/7.
I'll give it a shot building - might be at the weekend though.
Made a quick stab (I'm running Ubuntu 18.04). I get the following error, I'll do some investigating why I get it but recording it here:
channi16@ICT0115123:~/panwriter$ yarn dist
yarn run v1.12.3
$ electron-builder -m
• electron-builder version=20.31.2
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• no native production dependencies
• packaging platform=darwin arch=x64 electron=2.0.13 appOutDir=dist/mac
• downloading parts=8 size=49 MB url=https://github.com/electron/electron/releases/download/v2.0.13/electron-v2.0.13-darwin-x64.zip
• downloaded duration=18.286s url=https://github.com/electron/electron/releases/download/v2.0.13/electron-v2.0.13-darwin-x64.zip
• skipped macOS application code signing reason=supported only on macOS
• building target=macOS zip arch=x64 file=dist/PanWriter-0.5.0-mac.zip
• building target=DMG arch=x64 file=dist/PanWriter-0.5.0.dmg
• building embedded block map file=dist/PanWriter-0.5.0-mac.zip
Error: spawn hdiutil ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
From previous event:
at _createStageDmg (/home/channi16/panwriter/node_modules/dmg-builder/out/dmg.js:364:26)
at createStageDmg (/home/channi16/panwriter/node_modules/dmg-builder/out/dmg.js:352:26)
at /home/channi16/panwriter/node_modules/dmg-builder/src/dmg.ts:31:27
at Generator.next (<anonymous>)
at LOOP (fs.js:1753:14)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
From previous event:
at DmgTarget.build (/home/channi16/panwriter/node_modules/dmg-builder/src/dmg.ts:21:42)
at Function.buildAsyncTargets (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:139:36)
at MacPackager.packageInDistributableFormat (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:118:24)
at nonMasPromise.then.then (/home/channi16/panwriter/node_modules/app-builder-lib/src/macPackager.ts:90:26)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at /home/channi16/panwriter/node_modules/app-builder-lib/src/macPackager.ts:90:10
at Generator.next (<anonymous>)
From previous event:
at MacPackager.pack (/home/channi16/panwriter/node_modules/app-builder-lib/src/macPackager.ts:80:95)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:375:24
at Generator.next (<anonymous>)
at xfs.stat (/home/channi16/panwriter/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /home/channi16/panwriter/node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
at Packager.doBuild (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:343:39)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:313:57
at Generator.next (<anonymous>)
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:111:16
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
at Packager._build (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:284:133)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:280:23
at Generator.next (<anonymous>)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at Packager.build (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:237:14)
at build (/home/channi16/panwriter/node_modules/app-builder-lib/src/index.ts:58:28)
at build (/home/channi16/panwriter/node_modules/electron-builder/src/builder.ts:227:10)
at then (/home/channi16/panwriter/node_modules/electron-builder/src/cli/cli.ts:46:19)
at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Hmm - that looks like it's trying to build the dmg for mac.
• building target=macOS zip arch=x64 file=dist/PanWriter-0.5.0-mac.zip
• building target=DMG arch=x64 file=dist/PanWriter-0.5.0.dmg
• building embedded block map file=dist/PanWriter-0.5.0-mac.zip
Thanks! Ah yes, remove the -m
in the package.json
where you have "dist": "electron-builder -m"
.
I'll push a fix with that shortly.
Progress, but still fails:
channi16@ICT0115123:~/panwriter$ yarn dist
yarn run v1.12.3
$ electron-builder
• electron-builder version=20.31.2
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• no native production dependencies
• packaging platform=linux arch=x64 electron=2.0.13 appOutDir=dist/linux-unpacked
• downloading parts=8 size=49 MB url=https://github.com/electron/electron/releases/download/v2.0.13/electron-v2.0.13-linux-x64.zip
• downloaded duration=17.787s url=https://github.com/electron/electron/releases/download/v2.0.13/electron-v2.0.13-linux-x64.zip
• building target=snap arch=x64 file=dist/panwriter_0.5.0_amd64.snap
• building target=AppImage arch=x64 file=dist/panwriter-0.5.0-x86_64.AppImage
• application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
• application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
⨯ appimage.AppImageConfiguration.FileAssociations: []appimage.FileAssociation: appimage.FileAssociation.Ext: ReadString: expects " or n, but found [, error found in #10 byte of ...|:[{"ext":["md","mark|..., bigger context ...|/icon.png","size":0}],"fileAssociations":[{"ext":["md","markdown","txt","html","docx","odt","tex"]}]|...
• downloading path=/home/channi16/.cache/electron-builder/snap/snap-template-electron-2.4 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/snap-template-2.4/snap-template-electron-2.4.tar.7z
• downloading parts=8 size=47 MB url=https://github.com/electron-userland/electron-builder-binaries/releases/download/snap-template-2.4/snap-template-electron-2.4.tar.7z
• downloaded duration=17.65s url=https://github.com/electron-userland/electron-builder-binaries/releases/download/snap-template-2.4/snap-template-electron-2.4.tar.7z
• downloading path=/home/channi16/.cache/electron-builder/appimage/appimage-9.1.0 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-9.1.0/appimage-9.1.0.7z
• downloading parts=1 size=1.5 MB url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-9.1.0/appimage-9.1.0.7z
• downloaded duration=2.064s url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-9.1.0/appimage-9.1.0.7z
Error: /home/channi16/panwriter/node_modules/app-builder-bin/linux/x64/app-builder exited with code 1
at ChildProcess.childProcess.once.code (/home/channi16/panwriter/node_modules/builder-util/src/util.ts:253:14)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Socket.stream.socket.on (internal/child_process.js:336:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:561:12)
From previous event:
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:111:16
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
at AppImageTarget.build (/home/channi16/panwriter/node_modules/app-builder-lib/src/targets/AppImageTarget.ts:28:44)
at Function.buildAsyncTargets (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:139:36)
at LinuxPackager.packageInDistributableFormat (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:118:24)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:113:10
at Generator.next (<anonymous>)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at LinuxPackager.pack (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:110:95)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:375:24
at Generator.next (<anonymous>)
at xfs.stat (/home/channi16/panwriter/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /home/channi16/panwriter/node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
at Packager.doBuild (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:343:39)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:313:57
at Generator.next (<anonymous>)
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:111:16
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
at Packager._build (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:284:133)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:280:23
at Generator.next (<anonymous>)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at Packager.build (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:237:14)
at build (/home/channi16/panwriter/node_modules/app-builder-lib/src/index.ts:58:28)
at build (/home/channi16/panwriter/node_modules/electron-builder/src/builder.ts:227:10)
at then (/home/channi16/panwriter/node_modules/electron-builder/src/cli/cli.ts:46:19)
at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The only concrete error I see is this:
⨯ appimage.AppImageConfiguration.FileAssociations: []appimage.FileAssociation: appimage.FileAssociation.Ext: ReadString: expects " or n, but found [, error found in #10 byte of ...|:[{"ext":["md","mark|..., bigger context ...|/icon.png","size":0}],"fileAssociations":[{"ext":["md","markdown","txt","html","docx","odt","tex"]}]|...
Oh this looks like it might be more of the issue:
• application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
• application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
Can you try replacing to the following?
"build": {
"appId": "com.panwriter.app",
"fileAssociations": [
{"ext": "md"},
{"ext": "markdown"},
{"ext": "txt"},
{"ext": "html"},
{"ext": "docx"},
{"ext": "odt"},
{"ext": "tex"}
]
},
I'm giving that a try now - it failed with the basic array of fileAssociations, but I guessed the same as you've just put there with the array of objects from the errors you get.
That works!
This is what I have in the package.json
:
"build": {
"appId": "com.panwriter.app",
"fileAssociations": [
{ "ext": "md" },
{ "ext": "markdown" },
{ "ext": "txt" },
{ "ext": "html" },
{ "ext": "docx" },
{ "ext": "odt" },
{ "ext": "tex" }
],
"mac": {
"fileAssociations": [
{
"ext": [
"md",
"markdown",
"txt",
"html",
"docx",
"odt",
"tex"
]
}
]
}
},
Generaes a runnable AppImage for me:
channi16@ICT0115123:~/panwriter/dist$ ll
total 214984
drwxr-xr-x 5 channi16 channi16 4096 Nov 26 12:44 ./
drwxr-xr-x 11 channi16 channi16 4096 Nov 26 12:17 ../
-rw-r--r-- 1 channi16 channi16 356 Nov 26 12:44 builder-effective-config.yaml
drwxr-xr-x 2 channi16 channi16 4096 Nov 26 12:18 .icon-icns/
-rw-r--r-- 1 channi16 channi16 382 Nov 26 12:44 latest-linux.yml
drwxr-xr-x 4 channi16 channi16 4096 Nov 26 12:44 linux-unpacked/
drwxr-xr-x 3 channi16 channi16 4096 Nov 26 12:18 mac/
-rw-r--r-- 1 channi16 channi16 111841280 Nov 26 12:44 panwriter_0.5.0_amd64.snap
-rw-r--r-- 1 channi16 channi16 52844233 Nov 26 12:18 PanWriter-0.5.0-mac.zip
-rwxr-xr-x 1 channi16 channi16 55381583 Nov 26 12:44 panwriter-0.5.0-x86_64.AppImage*
Screenshots from running ./panwriter-0.5.0-x86_64.AppImage
:
Haha awesome! Looks like we don't need the "mac": {"fileAssociations"
... builder works fine withe the array of objects on the mac as well.
And you can drag and drop txt and html files on the app icon as well?
Gets installed into the app menu:
Dragging onto the App Icon doesn't work - at least not in the menu.
You can drag and drop onto the application itself:
Also dragging on to the .AppImage
file doesn't work either (but I don't think anyone would use that after it's been installed to the Applications menu):
Okay, so since the dragging on the application window works, the fileAssociations
seems to work on Linux and I'm guessing dragging on the app icon in the sidebar/dock is not something Ubuntu supports?
Also, there should be an app icon. I don't quite get the documentation, maybe add to package.json
:
"files": ["build/icon.png"]
Edit: ah, or maybe we need to add icon
to the BrowserWindow
constructor in main.js
... I'll take a look later..
Tried various options, it seems like you do need the build.files
config, but if I include that I just get errors:
channi16@ICT0115123:~/panwriter/build$ yarn dist
yarn run v1.12.3
$ electron-builder
• electron-builder version=20.31.2
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist/builder-effective-config.yaml
• no native production dependencies
• packaging platform=linux arch=x64 electron=2.0.13 appOutDir=dist/linux-unpacked
Error: Application entry file "src/main.js" in the "/home/channi16/panwriter/dist/linux-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration.
at error (/home/channi16/panwriter/node_modules/app-builder-lib/out/asar/asarFileChecker.js:44:14)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:30:4
at Generator.next (<anonymous>)
at /home/channi16/panwriter/node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
at _checkFileInArchive (/home/channi16/panwriter/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:36:17)
at checkFileInArchive (/home/channi16/panwriter/node_modules/app-builder-lib/out/asar/asarFileChecker.js:40:30)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:395:13
at Generator.next (<anonymous>)
From previous event:
at LinuxPackager.checkFileInPackage (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:392:110)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:444:16
at Generator.next (<anonymous>)
at /home/channi16/panwriter/node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
at LinuxPackager.sanityCheckPackage (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:431:70)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:235:16
at Generator.next (<anonymous>)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at LinuxPackager.doPack (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:166:165)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:112:16
at Generator.next (<anonymous>)
From previous event:
at LinuxPackager.pack (/home/channi16/panwriter/node_modules/app-builder-lib/src/platformPackager.ts:110:95)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:375:24
at Generator.next (<anonymous>)
at xfs.stat (/home/channi16/panwriter/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /home/channi16/panwriter/node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
at Packager.doBuild (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:343:39)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:313:57
at Generator.next (<anonymous>)
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:111:16
at /home/channi16/panwriter/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
at Packager._build (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:284:133)
at /home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:280:23
at Generator.next (<anonymous>)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at Packager.build (/home/channi16/panwriter/node_modules/app-builder-lib/src/packager.ts:237:14)
at build (/home/channi16/panwriter/node_modules/app-builder-lib/src/index.ts:58:28)
at build (/home/channi16/panwriter/node_modules/electron-builder/src/builder.ts:227:10)
at then (/home/channi16/panwriter/node_modules/electron-builder/src/cli/cli.ts:46:19)
at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
channi16@ICT0115123:~/panwriter/build$
I've tried adding a few extra options, in theory it's the Desktop config that needs setting, but none of them have changed the Application icon that I get. This is my current package.json
, it fails on the files
config with both "./build/icon.png"
and "build/icon.png"
:
"build": {
"appId": "com.panwriter.app",
"icon": "build/icon.png",
"files": ["./build/icon.png"],
"fileAssociations": [
{ "ext": "md" },
{ "ext": "markdown" },
{ "ext": "txt" },
{ "ext": "html" },
{ "ext": "docx" },
{ "ext": "odt" },
{ "ext": "tex" }
],
"linux": {
"icon": "build/icon.png",
"desktop": {
"Name": "PanWriter",
"Icon": "build/icon.png",
"Comment": "Markdown editor with pandoc integration and paginated preview",
"Categories": "Utilities"
},
"category": "Utilities"
}
},
I've looked at the Linux Icons config and that suggests that the builder should just pick up the build/icon.png
by default.
This was the most promising solution thing that I saw, which does also suggest the BrowserWindow
setting, but also the files
config.
But there's quite a few open issues for getting Linux icons to work: https://github.com/electron-userland/electron-builder/issues?utf8=%E2%9C%93&q=is%3Aissue+icon
Stole the desktop icon config from here: https://github.com/electron-userland/electron-builder/issues/3404
You're saying you got the icon to work? Meanwhile, I pushed some changes...
No, just fumbling around :) Still trying to figure it out.
Plus I actually made things worse, the linux config results in a 'icon missing' icon in the applications menu and it doesn't allow me to properly add it to the favourite applications bar any more:
I'm hunting around to see if I can find the desktop file that it creates but nothing so far.
I figured out what was knackering the icon - it was because I set "category": "Utilities"
in the build.linux
part of package.json
. If I switch it to "category": "Utility"
(which is the default category I get in the warning message if I don't set it) then I get the same icon as initially - which is better than the broken icon from my previous comment.
I've managed to produce a .desktop
file, but that still doesn't contain a proper icon, here's what I've got so far:
"linux": {
"desktop": {
"Name": "PanWriter",
"Icon": "build/icon.png",
"Comment": "Markdown editor with pandoc integration and paginated preview"
},
"category": "Utility"
}
This creates ~/.local/share/applications/appimagekit-panwriter.desktop
:
[Desktop Entry]
Name=PanWriter
Comment=Markdown editor with pandoc integration and paginated preview
Exec="/home/channi16/panwriter/dist/panwriter-0.5.0-x86_64.AppImage" %U
Terminal=false
Type=Application
Icon=appimagekit-panwriter
StartupWMClass=PanWriter
X-AppImage-Version=0.5.0
Categories=Utility;
X-AppImage-BuildId=1DX1uzKQgLrBzQIxMImZJ74Bpda
X-Desktop-File-Install-Version=0.23
X-AppImage-Comment=Generated by /tmp/.mount_panwriHixXhl/AppRun
TryExec=/home/channi16/panwriter/dist/panwriter-0.5.0-x86_64.AppImage
That's progress! Yeah, the Icon=appimagekit-panwriter
seems wrong, that should probably be a filename. Maybe try "Icon": "icon.png"
?
btw. so what is it building? .deb
package, or?
It's building an AppImage
file (panwriter-0.5.0-x86_64.AppImage
) which is a relatively new linux binary that includes all it's dependencies and should work on any modern linux system. You can specify to build a .deb
, but AppImage
is the default.
Unfortunately "Icon": "icon.png"
makes no difference, produces the same desktop
file:
[Desktop Entry]
Name=PanWriter
Comment=Markdown editor with pandoc integration and paginated preview
Exec="/home/channi16/panwriter/dist/panwriter-0.5.0-x86_64.AppImage" %U
Terminal=false
Type=Application
Icon=appimagekit-panwriter
StartupWMClass=PanWriter
X-AppImage-Version=0.5.0
Categories=Utility;
X-AppImage-BuildId=1DZAB5bTF7KZ8RFiQBffh7SztJx
X-Desktop-File-Install-Version=0.23
X-AppImage-Comment=Generated by /tmp/.mount_panwribzDhzd/AppRun
TryExec=/home/channi16/panwriter/dist/panwriter-0.5.0-x86_64.AppImage
I'm pretty sure that none of these app icons are cached in some way - which it could be (and would knacker all my attempts). But it doesn't seem like it.
I found a helpful Arch Linux wiki on the Desktop entries, which has
The freedesktop.org standard specifies in which order and directories programs should look for icons:
- $HOME/.icons (for backwards compatibility)
- $XDG_DATA_DIRS/icons
- /usr/share/pixmaps
The desktop
file contains:
Icon=appimagekit-panwriter
So I took a guess and created ~/.icons/appimagekit-panwriter.png
and that works:
But I don't know how you then get that into the build process.
Hm... information online is really sparse and contradictory... I can think of trying a few things:
Icon
in the .desktop file in the generated app image and see whether some values work..icon.png
to e.g. appimagekit-panwriter
?From this comment on electron-builder/#748:
We've been investigating this and we see that the icon is copied to: ~/.local/share/icons/hicolor/32x32/apps.
I hunted around in the hicolor
directory and found this:
For some reason it creates a 0x0 icon instead of an e.g. 256x256 icon.
ah, wow! maybe rename build/icon.png
to build/icons/512.png
? (from https://github.com/electron-userland/electron-builder/issues/2577)
That comment refers through to the original Icons documentation that I was looking at and I think that comment is slightly incorrect. From the doc
The filename must contain the size (e.g. 32x32.png) of the icon). Recommended sizes: 16, 24, 32, 48, 64, 96, 128, 256. (or just 512).
I think they took "or just 512" to mean 512.png
when I think it actually means you want xxx512x512.png
, I tested this and created
build/icons/panwriter-512x512.png
which works!
Out of curiosity I also tested:
build/icons/512.png
- this works toobuild/icons/icon-512x512.png
- this works tooThese all created ~/.local/share/icons/hicolor/512x512/apps/appimagekit-panwriter.png
.
(I made sure to delete the icons from the hicolor
directory before I renamed the icon and re-ran yarn dist
)
Then I tried the following:
build/icons/icon.png
and this creates icons for all sizes!:
channi16@ICT0115123:~/.local/share/icons/hicolor$ fd panwriter
128x128/apps/appimagekit-panwriter.png
16x16/apps/appimagekit-panwriter.png
24x24/apps/appimagekit-panwriter.png
256x256/apps/appimagekit-panwriter.png
32x32/apps/appimagekit-panwriter.png
48x48/apps/appimagekit-panwriter.png
512x512/apps/appimagekit-panwriter.png
64x64/apps/appimagekit-panwriter.png
96x96/apps/appimagekit-panwriter.png
N.B. I had also deleted the build/icon.png
and removed any mention of the icon from package.json
:
"build": {
"appId": "com.panwriter.app",
"fileAssociations": [
{ "ext": "md" },
{ "ext": "markdown" },
{ "ext": "txt" },
{ "ext": "html" },
{ "ext": "docx" },
{ "ext": "odt" },
{ "ext": "tex" }
],
"linux": {
"desktop": {
"Name": "PanWriter",
"Comment": "Markdown editor with pandoc integration and paginated preview"
},
"category": "Utility"
}
Small icon works too now:
Awesome! I just pushed a commit with your changes, thanks for your help!
I'll try to publish a Linux build soon...
Good to hear :)
btw. the app just might work on windows as well. I'm sure there is some more package.json magic for Windows, and you cannot create a ~/.panwriter/default.css
file (I'll have to adapt that part of the code for windows), but other than that... it should work :-)
I'll see if I can have look at it this weekend.
I've just tried building it on Windows and it fails at yarn install
:
C:\inetpub\wwwroot\panwriter>yarn install
yarn install v1.5.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
⠁
⠁
⠁
⠁
error An unexpected error occurred: "C:\\inetpub\\wwwroot\\panwriter\
ode_modules\\psc-package-bin-simple: Command failed.
Exit code: 1
Command: C:\\WINDOWS\\system32\\cmd.exe
Arguments: /d /s /c .\\install
Directory: C:\\inetpub\\wwwroot\\panwriter\
ode_modules\\psc-package-bin-simple
Output:
'.\\install' is not recognized as an internal or external command,
I had a pretty old version of yarn installed, upgraded to v1.12.3 but still get the same error:
C:\inetpub\wwwroot\panwriter>yarn install
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/3] ⠂ electron
[2/3] ⠂ psc-package-bin-simple
error C:\inetpub\wwwroot\panwriter\node_modules\psc-package-bin-simple: Command failed.
Exit code: 1
Command: .\install
Arguments:
Directory: C:\inetpub\wwwroot\panwriter\node_modules\psc-package-bin-simple
Output:
'.\install' is not recognized as an internal or external command,
But it looks like a fairly simple error of assuming that ./install
will work on Windows.
Hmm, maybe not a simple fix. https://github.com/justinwoo/npm-psc-package-bin-simple has the following in its README:
A simple distribution of psc-package using NPM. Assumes almost nothing other than Linux/OSX.
Might be able to update the version of the library though as it looks like there was a recent commit that adds Windows support: https://github.com/justinwoo/npm-psc-package-bin-simple/commit/4d4efa6a4e2008c8a0a71f0b189c14c31b88e47b
Upgrading to v3.0.0 of the psc-package-bin-simple seems to get past the error:
"psc-package-bin-simple": "^3.0.0",
Onto the next error:
C:\inetpub\wwwroot\panwriter>yarn install
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ psc-package install
'psc-package' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Seems that I can install it via Chocolatey on Windows https://github.com/purescript/psc-package#installation:
choco install psc-package
Success with building:
C:\inetpub\wwwroot\panwriter>yarn install
yarn install v1.12.3
[1/4] Resolving packages...
success Already up-to-date.
$ psc-package install
Installing 58 new packages...
Installing aff
Installing argonaut-core
Installing console
Installing bifunctors
Installing arrays
Installing contravariant
Installing const
Installing control
Installing distributive
Installing datetime
Installing effect
Installing either
Installing exceptions
Installing enums
Installing foldable-traversable
Installing foreign
Installing functions
Installing foreign-object
Installing gen
Installing globals
Installing functors
Installing integers
Installing js-date
Installing lazy
Installing identity
Installing lists
Installing invariant
Installing math
Installing maybe
Installing media-types
Installing newtype
Installing nonempty
Installing now
Installing nullable
Installing orders
Installing parallel
Installing ordered-collections
Installing proxy
Installing prelude
Installing partial
Installing record
Installing refs
Installing psci-support
Installing react-basic
Installing st
Installing strings
Installing transformers
Installing tailrec
Installing tuples
Installing type-equality
Installing unsafe-coerce
Installing unfoldable
Installing web-file
Installing typelevel-prelude
Installing web-dom
Installing web-events
Installing web-storage
Installing web-html
Install complete
Done in 27.50s.
Get errors when running yarn build
:
C:\inetpub\wwwroot\panwriter>yarn build
yarn run v1.12.3
$ psc-package build
psc-package.exe: purs: runProcess: does not exist (No such file or directory)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So this problem appears to be that Windows can't find the purs.exe
, supposedly there is a fix in v0.5.0, but chocolatey only has 0.4.2:
C:\WINDOWS\system32>choco list -lo psc-package
Chocolatey v0.10.11
psc-package 0.4.2
1 packages installed.
I made a stab at just overriding the binaries that chocolatey uses with downloaded ones from the psc-package releases page. Rather wonderfully the fixes they've done for v5.0.0 fix the problem and it now builds:
C:\inetpub\wwwroot\panwriter>yarn build
yarn run v1.12.3
$ psc-package build
Compiling Web.Event.Internal.Types
Compiling Unsafe.Coerce
Compiling Web.DOM.Internal.Types
Compiling Type.Data.Row
Compiling Type.Data.RowList
Compiling Type.Equality
Compiling Record.Unsafe
Compiling Partial
Compiling Math
Compiling Global
Compiling Data.Traversable.Accum
Compiling Global.Unsafe
Compiling Data.Symbol
Compiling Data.String.Unsafe
Compiling Data.NaturalTransformation
Compiling Data.Int.Bits
Compiling Data.Boolean
Compiling Control.Semigroupoid
Compiling Partial.Unsafe
Compiling Control.Category
Compiling Data.Show
Compiling Data.Bifunctor
Compiling Data.Unit
Compiling Data.Void
Compiling Control.Lazy
Compiling Data.HeytingAlgebra
Compiling Data.Semiring
Compiling Data.Function.Uncurried
Compiling Data.Semigroup
Compiling Record.Unsafe.Union
Compiling Data.Ring
Compiling Data.Eq
Compiling Data.BooleanAlgebra
Compiling Data.CommutativeRing
Compiling Data.EuclideanRing
Compiling Data.Ordering
Compiling Data.Ord.Unsafe
Compiling Data.Ord
Compiling Data.DivisionRing
Compiling Data.Field
Compiling Data.Monoid
Compiling Data.Bounded
Compiling Data.Function
Compiling Control.Biapply
Compiling Data.Functor
Compiling Control.Alt
Compiling Control.Extend
Compiling Control.Apply
Compiling Control.Biapplicative
Compiling Control.Plus
Compiling Control.Comonad
Compiling Control.Comonad.Trans.Class
Compiling Control.Applicative
Compiling Control.Alternative
Compiling Control.Bind
Compiling Control.Monad
Compiling Control.MonadZero
Compiling Prelude
Compiling Control.MonadPlus
Compiling Effect
Compiling Data.Bifunctor.Product
Compiling Control.Monad.Cont.Class
Compiling Data.Monoid.Alternate
Compiling Data.Semigroup.Last
Compiling Data.Monoid.Additive
Compiling Control.Monad.Trans.Class
Compiling Data.Monoid.Disj
Compiling Control.Monad.Reader.Class
Compiling Data.Monoid.Multiplicative
Compiling Data.Monoid.Dual
Compiling Data.Traversable.Accum.Internal
Compiling Data.Monoid.Endo
Compiling Type.Proxy
Compiling Data.Semigroup.First
Compiling Data.Functor.Contravariant
Compiling Data.Monoid.Conj
Compiling Control.Monad.Gen.Class
Compiling Panwriter.File
Compiling Web.HTML.Navigator
Compiling React.Basic.PreviewRenderer
Compiling Electron.IpcRenderer
Compiling Effect.Console
Compiling Effect.Uncurried
Compiling Effect.Class
Compiling Effect.Unsafe
Compiling Effect.Ref
Compiling Web.HTML.Location
Compiling Web.DOM.ChildNode
Compiling Type.Data.Boolean
Compiling Data.Newtype
Compiling Data.Functor.Invariant
Compiling PSCI.Support
Compiling Effect.Class.Console
Compiling Web.HTML.ValidityState
Compiling Type.Data.Ordering
Compiling Data.Maybe
Compiling Type.Data.Symbol
Compiling Type.Row
Compiling Data.Bifunctor.Join
Compiling Data.Comparison
Compiling Data.Predicate
Compiling Data.Bifunctor.Wrap
Compiling Data.Bifunctor.Flip
Compiling Data.Bifunctor.Clown
Compiling Control.Comonad.Traced.Trans
Compiling Data.Bifunctor.Joker
Compiling Data.Ord.Max
Compiling Data.Ord.Min
Compiling Data.MediaType
Compiling Data.Ord.Down
Compiling Data.Time.Duration
Compiling Data.String.Pattern
Compiling Data.Op
Compiling Type.Row.Homogeneous
Compiling Record
Compiling Record.Builder
Compiling Type.Prelude
Compiling Data.Equivalence
Compiling Data.Nullable
Compiling Data.Maybe.Last
Compiling Web.HTML.HTMLMediaElement.CanPlayType
Compiling Web.HTML.SelectionMode
Compiling Web.Internal.FFI
Compiling Data.Int
Compiling Web.HTML.HTMLDocument.ReadyState
Compiling Data.Maybe.First
Compiling Data.MediaType.Common
Compiling Data.String.CodeUnits
Compiling Data.String.Common
Compiling React.Basic.Events
Compiling Web.DOM.DOMTokenList
Compiling Web.DOM.HTMLCollection
Compiling Web.Storage.Storage
Compiling Web.DOM.NodeList
Compiling Web.DOM.NonDocumentTypeChildNode
Compiling Web.File.Blob
Compiling Data.Foldable
Compiling Data.FunctorWithIndex
Compiling Web.DOM.ParentNode
Compiling React.Basic.DOM.Events
Compiling Web.File.File
Compiling Web.File.FileList
Compiling Web.HTML.Event.DataTransfer
Compiling Data.Bifoldable
Compiling Data.FoldableWithIndex
Compiling Data.Traversable
Compiling Data.Semigroup.Foldable
Compiling Data.Const
Compiling Data.Semigroup.Traversable
Compiling Data.Bitraversable
Compiling Data.Identity
Compiling Data.TraversableWithIndex
Compiling Data.Either
Compiling Data.Functor.App
Compiling Data.Lazy
Compiling Data.Distributive
Compiling Data.Tuple
Compiling Data.Either.Nested
Compiling Control.Monad.Error.Class
Compiling Data.Either.Inject
Compiling Control.Monad.Rec.Class
Compiling Effect.Exception
Compiling Data.Functor.Coproduct
Compiling Data.Tuple.Nested
Compiling Control.Comonad.Env.Trans
Compiling Control.Monad.Writer.Class
Compiling Control.Monad.State.Class
Compiling Control.Comonad.Traced.Class
Compiling Data.Functor.Compose
Compiling Data.Divide
Compiling Data.Unfoldable1
Compiling Control.Comonad.Store.Trans
Compiling Data.Functor.Product
Compiling Control.Monad.ST.Internal
Compiling Effect.Exception.Unsafe
Compiling Data.Functor.Coproduct.Nested
Compiling Data.Functor.Coproduct.Inject
Compiling Control.Comonad.Env.Class
Compiling Data.Divisible
Compiling Control.Monad.RWS.Trans
Compiling Control.Monad.Maybe.Trans
Compiling Data.Decide
Compiling Control.Monad.Cont.Trans
Compiling Control.Comonad.Traced
Compiling Control.Monad.State.Trans
Compiling Control.Monad.Reader.Trans
Compiling Control.Monad.Except.Trans
Compiling Control.Monad.Writer.Trans
Compiling Control.Comonad.Store.Class
Compiling Data.Unfoldable
Compiling Data.Array.NonEmpty.Internal
Compiling Control.Monad.ST
Compiling Control.Monad.ST.Ref
Compiling Control.Comonad.Env
Compiling Data.Functor.Product.Nested
Compiling Data.Decidable
Compiling Control.Monad.Cont
Compiling Control.Monad.Except
Compiling Control.Monad.RWS
Compiling Record.ST
Compiling Data.Array.ST
Compiling Foreign.Object.ST
Compiling Data.Enum
Compiling Control.Monad.List.Trans
Compiling Control.Monad.Gen
Compiling Data.NonEmpty
Compiling Control.Comonad.Store
Compiling Control.Monad.Reader
Compiling Control.Monad.State
Compiling Control.Parallel.Class
Compiling Control.Monad.Writer
Compiling Data.Array.ST.Partial
Compiling Data.Array.ST.Iterator
Compiling Data.Time.Duration.Gen
Compiling Data.List.Lazy.Types
Compiling Data.List.Types
Compiling Control.Monad.Gen.Common
Compiling Data.Enum.Gen
Compiling Data.Char.Gen
Compiling Web.File.FileReader.ReadyState
Compiling Data.Date.Component
Compiling Web.HTML.HTMLMediaElement.ReadyState
Compiling Data.Time.Component
Compiling Web.DOM.NodeType
Compiling Data.Char
Compiling Web.HTML.HTMLMediaElement.NetworkState
Compiling Web.Event.EventPhase
Compiling Web.HTML.HTMLTrackElement.ReadyState
Compiling Data.Array
Compiling Control.Parallel
Compiling Data.String.Gen
Compiling Data.Time.Component.Gen
Compiling Data.Time
Compiling Data.List.Lazy
Compiling Effect.Aff
Compiling Data.Time.Gen
Compiling Data.List
Compiling Data.Date.Component.Gen
Compiling Data.Date
Compiling Foreign.Object
Compiling Data.String.CodePoints
Compiling Data.Array.NonEmpty
Compiling Data.Array.Partial
Compiling Effect.Aff.Compat
Compiling Effect.Aff.Class
Compiling React.Basic
Compiling Data.List.Lazy.NonEmpty
Compiling Data.List.ZipList
Compiling Data.DateTime
Compiling Data.Date.Gen
Compiling Data.DateTime.Instant
Compiling Data.DateTime.Gen
Compiling React.Basic.Components.Async
Compiling React.Basic.CodeMirror
Compiling React.Basic.DOM.Components.LogLifecycles
Compiling React.Basic.DOM.Internal
Compiling React.Basic.Compat
Compiling Data.List.Partial
Compiling Data.List.NonEmpty
Compiling Data.Map.Internal
Compiling Data.Argonaut.Core
Compiling Foreign.Object.Unsafe
Compiling Foreign.Object.Gen
Compiling Foreign.Object.ST.Unsafe
Compiling Data.String
Compiling Web.Event.Event
Compiling Effect.Now
Compiling React.Basic.DOM.Generated
Compiling Data.String.CaseInsensitive
Compiling Data.String.NonEmpty.Internal
Compiling Data.String.Regex.Flags
Compiling Data.Argonaut.Gen
Compiling Panwriter.Document
Compiling Data.Argonaut.Parser
Compiling Web.HTML.Event.BeforeUnloadEvent
Compiling Web.HTML.Event.ErrorEvent
Compiling Web.Event.EventTarget
Compiling Web.HTML.Event.TrackEvent.EventTypes
Compiling Web.Storage.Event.StorageEvent
Compiling Web.Event.CustomEvent
Compiling Web.HTML.Event.TrackEvent
Compiling Web.HTML.Event.HashChangeEvent
Compiling Web.HTML.Event.PopStateEvent.EventTypes
Compiling Web.HTML.Event.PageTransitionEvent.EventTypes
Compiling Web.HTML.Event.HashChangeEvent.EventTypes
Compiling Web.HTML.Event.DragEvent
Compiling Web.HTML.Event.EventTypes
Compiling Web.HTML.Event.DragEvent.EventTypes
Compiling Web.HTML.Event.BeforeUnloadEvent.EventTypes
Compiling Web.HTML.Event.PageTransitionEvent
Compiling Data.String.NonEmpty.CodePoints
Compiling Data.String.NonEmpty.CodeUnits
Compiling Data.String.Regex
Compiling Foreign
Compiling Web.DOM.DocumentType
Compiling Web.DOM.CharacterData
Compiling Web.DOM.Element
Compiling Data.String.Regex.Unsafe
Compiling Data.String.NonEmpty
Compiling Web.DOM.Text
Compiling Web.DOM.Comment
Compiling Web.DOM.ProcessingInstruction
Compiling Web.DOM.NonElementParentNode
Compiling Data.String.NonEmpty.CaseInsensitive
Compiling Data.Set
Compiling Web.DOM.DocumentFragment
Compiling Data.JSDate
Compiling Web.File.FileReader
Compiling Foreign.Index
Compiling Web.HTML.Event.PopStateEvent
Compiling Foreign.Keys
Compiling Web.HTML.History
Compiling Web.DOM.Document
Compiling Web.DOM.Node
Compiling Data.Set.NonEmpty
Compiling Data.Map
Compiling Data.Interval.Duration
Compiling Data.Map.Gen
Compiling Web.DOM.MutationRecord
Compiling Web.DOM
Compiling React.Basic.DOM.Components.Ref
Compiling Web.DOM.MutationObserver
Compiling React.Basic.DOM
Compiling Web.HTML.HTMLElement
Compiling Data.Interval.Duration.Iso
Compiling Data.Interval
Compiling Web.HTML.HTMLHRElement
Compiling Web.HTML.HTMLScriptElement
Compiling Web.HTML.HTMLParamElement
Compiling Web.HTML.HTMLTableCaptionElement
Compiling Web.HTML.HTMLBaseElement
Compiling Web.HTML.HTMLModElement
Compiling Web.HTML.HTMLBRElement
Compiling Web.HTML.HTMLDivElement
Compiling Web.HTML.HTMLTemplateElement
Compiling Web.HTML.HTMLImageElement
Compiling Web.HTML.HTMLAreaElement
Compiling Web.HTML.HTMLDataElement
Compiling Web.HTML.HTMLOptGroupElement
Compiling Web.HTML.HTMLStyleElement
Compiling Web.HTML.HTMLMediaElement
Compiling Web.HTML.HTMLTableCellElement
Compiling Web.HTML.HTMLEmbedElement
Compiling Web.HTML.HTMLTableRowElement
Compiling Web.HTML.HTMLUListElement
Compiling Web.HTML.HTMLLinkElement
Compiling Web.HTML.HTMLMetaElement
Compiling Web.HTML.HTMLSourceElement
Compiling Web.HTML.HTMLBodyElement
Compiling Web.HTML.HTMLTimeElement
Compiling Web.HTML.HTMLDataListElement
Compiling Web.HTML.HTMLSpanElement
Compiling Web.HTML.HTMLPreElement
Compiling Web.HTML.HTMLTitleElement
Compiling Web.HTML.HTMLTrackElement
Compiling Web.HTML.HTMLHeadingElement
Compiling Web.HTML.HTMLHeadElement
Compiling Web.HTML.HTMLProgressElement
Compiling Web.HTML.HTMLFormElement
Compiling Web.HTML.HTMLMapElement
Compiling Web.HTML.HTMLQuoteElement
Compiling Web.HTML.HTMLCanvasElement
Compiling Web.HTML.HTMLLIElement
Compiling Web.HTML.HTMLAnchorElement
Compiling Web.HTML.HTMLOListElement
Compiling Web.HTML.HTMLTableSectionElement
Compiling Web.HTML.HTMLParagraphElement
Compiling Web.HTML.HTMLMeterElement
Compiling Web.HTML.HTMLTableColElement
Compiling Web.HTML.HTMLDListElement
Compiling Panwriter.Button
Compiling Panwriter.Preview
Compiling Web.HTML.HTMLDocument
Compiling Web.HTML.HTMLTableDataCellElement
Compiling Web.HTML.HTMLTableHeaderCellElement
Compiling Web.HTML.HTMLVideoElement
Compiling Web.HTML.HTMLAudioElement
Compiling Web.HTML.HTMLInputElement
Compiling Web.HTML.HTMLButtonElement
Compiling Web.HTML.HTMLSelectElement
Compiling Web.HTML.HTMLObjectElement
Compiling Web.HTML.HTMLLabelElement
Compiling Web.HTML.HTMLOptionElement
Compiling Web.HTML.HTMLFieldSetElement
Compiling Web.HTML.HTMLLegendElement
Compiling Web.HTML.HTMLKeygenElement
Compiling Web.HTML.HTMLTextAreaElement
Compiling Web.HTML.HTMLOutputElement
Compiling Web.HTML.HTMLTableElement
Compiling Panwriter.Toolbar
Compiling Web.HTML.Window
Compiling Web.HTML.HTMLIFrameElement
Compiling Web.HTML
Compiling Panwriter.Formatter
Compiling React.Basic.DOM.Components.GlobalEvents
Compiling Panwriter.App
Compiling AppRenderer
Done in 41.61s.
yarn dist
fails too. It was looking promising for a while but then got all panicky. Possibly because it can't find an icon??
C:\inetpub\wwwroot\panwriter>yarn dist
yarn run v1.12.3
$ electron-builder
• electron-builder version=20.31.2
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• no native production dependencies
• packaging platform=win32 arch=x64 electron=2.0.13 appOutDir=dist\win-unpacked
• downloading parts=8 size=51 MB url=https://github.com/electron/electron/releases/download/v2.0.13/electron-v2.0.13-win32-x64.zip
• downloaded duration=13.189s url=https://github.com/electron/electron/releases/download/v2.0.13/electron-v2.0.13-win32-x64.zip
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/develar/app-builder/pkg/icons.ConvertIcon(0xc0000491c0, 0x4, 0x4, 0xc00022aa80, 0x2, 0x2, 0xc00001e0c8, 0x3, 0xc0000189f0, 0x2b, ...)
/Users/develar/go/src/github.com/develar/app-builder/pkg/icons/icon-converter.go:153 +0xe69
github.com/develar/app-builder/pkg/icons.ConfigureCommand.func1(0xc0001f8900, 0x409eba, 0xa75ba0)
/Users/develar/go/src/github.com/develar/app-builder/pkg/icons/icon-converter.go:27 +0xa0
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*actionMixin).applyActions(0xc0000aec18, 0xc0001f8900, 0x0, 0x0)
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/actions.go:28 +0x74
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*Application).applyActions(0xc0000b0690, 0xc0001f8900, 0x0, 0x0)
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:557 +0xe6
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*Application).execute(0xc0000b0690, 0xc0001f8900, 0xc000204910, 0x1, 0x1, 0x0, 0x0, 0xc000204750, 0xc000229f10)
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:390 +0x96
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*Application).Parse(0xc0000b0690, 0xc000080010, 0x11, 0x1f, 0x405547, 0xc000024118, 0x0, 0x2)
/Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:222 +0x201
main.main()
/Users/develar/go/src/github.com/develar/app-builder/main.go:74 +0x1a1
Error: C:\inetpub\wwwroot\panwriter\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code 2
at ChildProcess.childProcess.once.code (C:\inetpub\wwwroot\panwriter\node_modules\builder-util\src\util.ts:253:14)
at Object.onceWrapper (events.js:273:13)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:978:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
From previous event:
at WinPackager.resolveIcon (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:570:69)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:554:31
at Generator.next (<anonymous>)
From previous event:
at WinPackager.getOrConvertIcon (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:542:54)
at Lazy.WinPackager._iconPath (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:71:43)
at Lazy.get value [as value] (C:\inetpub\wwwroot\panwriter\node_modules\lazy-val\src\main.ts:18:23)
at WinPackager.getIconPath (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:203:27)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:300:33
at Generator.next (<anonymous>)
From previous event:
at WinPackager.signAndEditResources (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:273:158)
at _bluebirdLst.default.map.file (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:372:21)
at go$readdir$cb (C:\inetpub\wwwroot\panwriter\node_modules\graceful-fs\graceful-fs.js:162:14)
at FSReqCallback.oncomplete (fs.js:148:20)
From previous event:
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:370:27
at Generator.next (<anonymous>)
From previous event:
at WinPackager.signApp (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\winPackager.ts:364:73)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:236:16
at Generator.next (<anonymous>)
at processImmediate (timers.js:632:19)
From previous event:
at WinPackager.doPack (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:166:165)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:112:16
at Generator.next (<anonymous>)
From previous event:
at WinPackager.pack (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\platformPackager.ts:110:95)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\packager.ts:375:24
at Generator.next (<anonymous>)
at xfs.stat (C:\inetpub\wwwroot\panwriter\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16)
at C:\inetpub\wwwroot\panwriter\node_modules\graceful-fs\polyfills.js:285:20
at FSReqCallback.oncomplete (fs.js:162:5)
From previous event:
at Packager.doBuild (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\packager.ts:343:39)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\packager.ts:313:57
at Generator.next (<anonymous>)
at C:\inetpub\wwwroot\panwriter\node_modules\graceful-fs\graceful-fs.js:111:16
at C:\inetpub\wwwroot\panwriter\node_modules\graceful-fs\graceful-fs.js:45:10
at FSReqCallback.oncomplete (fs.js:148:20)
From previous event:
at Packager._build (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\packager.ts:284:133)
at C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\packager.ts:280:23
at Generator.next (<anonymous>)
at processImmediate (timers.js:632:19)
From previous event:
at Packager.build (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\packager.ts:237:14)
at build (C:\inetpub\wwwroot\panwriter\node_modules\app-builder-lib\src\index.ts:58:28)
at build (C:\inetpub\wwwroot\panwriter\node_modules\electron-builder\src\builder.ts:227:10)
at then (C:\inetpub\wwwroot\panwriter\node_modules\electron-builder\src\cli\cli.ts:46:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Doing some searching for panic: runtime error: index out of range
gives (https://stackoverflow.com/a/26126255/327074):
If the user does not provide any input, the inp array is empty. This means that even the index 0 is out of range, i.e. inp[0] can't be accessed.
So possibly it's because package.json
is missing a specification for the Windows icon? But it seems kind of crazy that it would error out just because it can't find an icon.
I made another guess and added a build.win.icon
config setting to package.json
and amazingly that works.
"build": {
"appId": "com.panwriter.app",
"fileAssociations": [
{
"ext": "md"
},
{
"ext": "markdown"
},
{
"ext": "txt"
},
{
"ext": "html"
},
{
"ext": "docx"
},
{
"ext": "odt"
},
{
"ext": "tex"
}
],
"mac": {
"icon": "build/icons/icon.png"
},
"win": {
"icon": "build/icons/icon.png"
},
"linux": {
"desktop": {
"Name": "PanWriter",
"Comment": "Markdown editor with pandoc integration and paginated preview"
},
"category": "Utility"
}
},
Given that icon should be an optional config I'm a bit surprised. Anyway:
C:\inetpub\wwwroot\panwriter>yarn dist
yarn run v1.12.3
$ electron-builder
• electron-builder version=20.31.2
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• no native production dependencies
• packaging platform=win32 arch=x64 electron=2.0.13 appOutDir=dist\win-unpacked
• downloading path=C:\Users\Ian\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.3.2 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.3.2/winCodeSign-2.3.2.7z
• downloading parts=1 size=4.9 MB url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.3.2/winCodeSign-2.3.2.7z
• downloaded duration=3.381s url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.3.2/winCodeSign-2.3.2.7z
• building target=nsis file=dist\PanWriter Setup 0.5.0.exe archs=x64 oneClick=true
• downloading path=C:\Users\Ian\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.3.2 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.3.2/nsis-3.0.3.2.7z
• downloading parts=1 size=1.4 MB url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.3.2/nsis-3.0.3.2.7z
• downloaded duration=2.275s url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.3.2/nsis-3.0.3.2.7z
• downloading path=C:\Users\Ian\AppData\Local\electron-builder\Cache\nsis\nsis-resources-3.3.0 url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
• downloading parts=1 size=1.0 MB url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
• downloaded duration=2.388s url=https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.3.0/nsis-resources-3.3.0.7z
• building block map blockMapFile=dist\PanWriter Setup 0.5.0.exe.blockmap
Done in 50.50s.
This builds the following files:
It adds Panwriter to the application menu when you search for it, with the relevant icons too (you can see the application menu icon and also the taskbar icon):
The downer is that the icon in the application itself is bizarrely cut off:
I'm guessing you'll want the contents of the dist
folder. I've copied them into a dropbox folder: https://www.dropbox.com/sh/215jatb80n27uq7/AAAp5gL6JImHam4qITYb6KuFa?dl=0
Wow, that's quite an odyssey!
About the icon: can you try adding:
"target": ["portable"]
to build.win?
Ok, I'll give it a try tonight.
Also I'm uploaded the Linux builds to dropbox to: https://www.dropbox.com/sh/gaw96oik4ah6po8/AACD0tZP1_BfD2yqp_xs-_vxa?dl=0
Hi there, this looks a great project. Seeing as it's electron based, is there a chance you'll release Linux and Windows builds?