Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

Change target to nsis, create windows prod boot task, update readme #946

Closed
wants to merge 4 commits into from

Conversation

cjsauer
Copy link
Contributor

@cjsauer cjsauer commented Jul 8, 2019

Very small tweaks to Windows production desktop builds.

  • Target changed to NSIS from AppX (this is much simpler)
  • Boot has some issues with paths on Windows and so there's now a new boot task with a trivial configuration difference to make it work on Windows.
  • Updated readme with Windows-specific build instructions

There aren't really any explicit test instructions for this. If you're feeling so inclined and have a Windows box laying around, please try producing a Windows production artifact locally and make sure the instructions are clear. To do this without publishing the build to GitHub Releases, use this:

boot prod-electron-windows
cd target/
yarn install
npx electron-builder --win

The resulting EXE should then be located in the dist folder.

@cjsauer cjsauer self-assigned this Jul 8, 2019
@bago2k4 bago2k4 self-requested a review July 9, 2019 12:19
@bago2k4
Copy link
Member

bago2k4 commented Jul 9, 2019

@cjsauer last command give me this output

bago@bagoPro:target (windows-electron)*
$ npx electron-builder --win
  • electron-builder version=20.44.4
  • loaded configuration file=package.json ("build" field)
  • description is missed in the package.json appPackageFile=/Users/bago/Documents/code/open-company-web/target/package.json
  • writing effective config file=dist/builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=win32 arch=x64 electron=5.0.5 appOutDir=dist/win-unpacked
  • downloading     parts=8 size=61 MB url=https://github.com/electron/electron/releases/download/v5.0.5/electron-v5.0.5-win32-x64.zip
  • downloaded      duration=1m59.311s url=https://github.com/electron/electron/releases/download/v5.0.5/electron-v5.0.5-win32-x64.zip
Error: Application entry file "index.js" in the "/Users/bago/Documents/code/open-company-web/target/dist/win-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration.
    at error (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/out/asar/asarFileChecker.js:44:14)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:30:4
    at Generator.next (<anonymous>)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:160:5)
From previous event:
    at _checkFileInArchive (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:36:17)
    at checkFileInArchive (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/out/asar/asarFileChecker.js:40:30)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:409:13
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.checkFileInPackage (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:406:110)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:460:16
    at Generator.next (<anonymous>)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:160:5)
From previous event:
    at WinPackager.sanityCheckPackage (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:446:92)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:249:16
    at Generator.next (<anonymous>)
    at processImmediate (timers.js:632:19)
From previous event:
    at WinPackager.doPack (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:167:165)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:113:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:430:24
    at Generator.next (<anonymous>)
    at xfs.stat (/Users/bago/Documents/code/open-company-web/target/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:160:5)
From previous event:
    at Packager.doBuild (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:396:24)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:366:57
    at Generator.next (<anonymous>)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/graceful-fs.js:111:16
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqCallback.args [as oncomplete] (fs.js:146:20)
From previous event:
    at Packager._build (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:335:133)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:331:23
    at Generator.next (<anonymous>)
    at processImmediate (timers.js:632:19)
From previous event:
    at Packager.build (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:288:14)
    at build (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/Users/bago/Documents/code/open-company-web/target/node_modules/electron-builder/src/builder.ts:228:10)
    at then (/Users/bago/Documents/code/open-company-web/target/node_modules/electron-builder/src/cli/cli.ts:49:19)

@cjsauer
Copy link
Contributor Author

cjsauer commented Jul 9, 2019

@bago2k4 that usually means that the electron cljs was never compiled. Are you sure you ran the windows-specific boot task?

boot prod-electron-windows

The reason for this is that boot does not handle backslashes in file paths very well, and so the standard configuration doesn't work on Windows. See here: https://github.com/open-company/open-company-web/pull/946/files#diff-0a1425bd66240468daf4c256a411ce75R314

@bago2k4
Copy link
Member

bago2k4 commented Jul 9, 2019

yes, just tried again.

I don't really know what could be, maybe a different version of yarn or other tools?

Here is the full output @cjsauer :

bago@bagoPro:open-company-web (windows-electron)
$ boot prod-electron-windows
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: fipp.visit, being replaced by: #'fipp.visit/boolean?
Writing electron\main.cljs.edn...
Compiling ClojureScript...
• electron\main.js
WARNING: var: clojure.string/replace-with is not public at line 327 /Users/bago/.boot/cache/tmp/Users/bago/Documents/code/open-company-web/1mw3/pb3fs2/electron\main.out/cuerdas/core.cljc
WARNING: Use of undeclared Var oc.web.actions.nav-sidebar/show-reminders at line 88 src/oc/web/utils/user.cljs
Writing target dir(s)...
bago@bagoPro:open-company-web (windows-electron)*
$ cd target/
bago@bagoPro:target (windows-electron)*
$ yarn install
yarn install v1.15.2
warning package.json: No license field
warning [email protected]: No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
✨  Done in 11.00s.
bago@bagoPro:target (windows-electron)*
$ npx electron-builder --win
  • electron-builder version=20.44.4
  • loaded configuration file=package.json ("build" field)
  • description is missed in the package.json appPackageFile=/Users/bago/Documents/code/open-company-web/target/package.json
  • writing effective config file=dist/builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=win32 arch=x64 electron=5.0.5 appOutDir=dist/win-unpacked
Error: Application entry file "index.js" in the "/Users/bago/Documents/code/open-company-web/target/dist/win-unpacked/resources/app.asar" does not exist. Seems like a wrong configuration.
    at error (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/out/asar/asarFileChecker.js:44:14)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:30:4
    at Generator.next (<anonymous>)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:160:5)
From previous event:
    at _checkFileInArchive (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/asar/asarFileChecker.ts:36:17)
    at checkFileInArchive (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/out/asar/asarFileChecker.js:40:30)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:409:13
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.checkFileInPackage (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:406:110)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:460:16
    at Generator.next (<anonymous>)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:160:5)
From previous event:
    at WinPackager.sanityCheckPackage (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:446:92)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:249:16
    at Generator.next (<anonymous>)
    at processImmediate (timers.js:632:19)
From previous event:
    at WinPackager.doPack (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:167:165)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:113:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:430:24
    at Generator.next (<anonymous>)
    at xfs.stat (/Users/bago/Documents/code/open-company-web/target/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqCallback.oncomplete (fs.js:160:5)
From previous event:
    at Packager.doBuild (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:396:24)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:366:57
    at Generator.next (<anonymous>)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/graceful-fs.js:111:16
    at /Users/bago/Documents/code/open-company-web/target/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqCallback.args [as oncomplete] (fs.js:146:20)
From previous event:
    at Packager._build (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:335:133)
    at /Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:331:23
    at Generator.next (<anonymous>)
    at processImmediate (timers.js:632:19)
From previous event:
    at Packager.build (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/packager.ts:288:14)
    at build (/Users/bago/Documents/code/open-company-web/target/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/Users/bago/Documents/code/open-company-web/target/node_modules/electron-builder/src/builder.ts:228:10)
    at then (/Users/bago/Documents/code/open-company-web/target/node_modules/electron-builder/src/cli/cli.ts:49:19)

@bago2k4
Copy link
Member

bago2k4 commented Jul 9, 2019

Here is my versions (on a different branch but still the same):

ago@bagoPro:open-company-web (follow-ups)*
$ yarn --version
1.15.2
bago@bagoPro:open-company-web (follow-ups)*
$ boot --version
#http://boot-clj.com
#Tue Jul 09 20:43:44 CEST 2019
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.10.1-RC1
BOOT_VERSION=2.7.2
bago@bagoPro:open-company-web (follow-ups)*
$ npx --version
6.5.0

@cjsauer
Copy link
Contributor Author

cjsauer commented Jul 9, 2019

Closing this PR in favor of #949

@cjsauer cjsauer closed this Jul 9, 2019
@cjsauer cjsauer deleted the windows-electron branch July 9, 2019 20:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants