electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.61k stars 1.74k forks source link

Not a valid Win32 application #844

Closed keverw closed 7 years ago

keverw commented 7 years ago

I've able to package my app for macOS successful. Linux I haven't got around to checking yet but on Windows 10 I drag the file "SteemWrite Setup 0.0.1.exe" to my Windows 10 VM and installs it. Then it goes to open and I get this error message:

image

I'm not sure why, I'm building the Windows version on my Mac since I installed wine. Here's my project: https://github.com/keverw/SteemWrite

I'm not really sure what I'm doing wrong here, any help would be appreciated.

develar commented 7 years ago

One of your dependency is native and, so, you must build app for win only on win. Do you have native dependencies?

keverw commented 7 years ago

sqlite3 I know is off the top of my head. Might be others. So I guess I'll have to install the dev tools on my Windows VM and build it on Windows then. Would I have to build Linux on Linux too? It'd be amazing to just be able to run one command for all the platforms :)

develar commented 7 years ago

Please see https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build

Electron team officially recommends always build native dependencies from sources.

So I guess I'll have to install the dev tools on my Windows VM and build it on Windows then.

It is nightmare. Windows ***, I understand. Easy solution — use AppVeyor — it is free and fully supported by electron-builder (see sample configs on the page Multi-Platform-Build)

Would I have to build Linux on Linux too

Yes. It is price of native deps :( But! electron-builder offers you easy solution — use Docker image https://github.com/electron-userland/electron-builder/wiki/Docker So, you can build it on macOS inside Docker. Or, again, just use CI server — Travis.

keverw commented 7 years ago

Thanks for the explanation :) I got it built. I did it in my Windows VM since I wanted to learn how to do it without any CI. The 64 bit version works, the 32 bit one won't... So I guess I'd have to build that one on 32 bit Windows too when using native dependencies, but I think 64 bit would be good enough for most people.

One strange thing I notice about building on Windows is it won't tell you it's done even if it's done until you resize the CMD or PowerShell Window. Seems odd. Maybe there's a better terminal to use when I'm on Windows.

Also while Avast scans it, I get a popup saying "Update has stopped working" but then once the scan is done it installs and works fine. I'm guessing I'd probably have to pay to sign it to get around that issue? This is a open source project, so I can put up with it - plus using this to learn. In the future I might use this tech for a closed source app idea where I would want to have it signed.

develar commented 7 years ago

So I guess I'd have to build that one on 32 bit Windows too when using native dependencies,

No. 64-bit OS can be used to produce 32-bit binaries. Should be ok.

CMD or PowerShell Window

Windows * All windows tools *. Please see http://cmder.net

Also while Avast scans it, I get a popup saying "Update has stopped working"

Please use NSIS target instead of Squirrel.Windows. Set build.win.target to nsis.

keverw commented 7 years ago

I switched to the two package.json's and that seemed to get some progress. Instead of not invalid for win32, I get a error the module isn't found. Also don't need to use the rebuild anymore, so less things to install :)

Win64 works fine now. but 32bit no luck.

image

What I've attempted to resolve it:

  1. Did what's in this, but didn't fix it https://github.com/electron-userland/electron-packager/issues/217#issuecomment-168223915
  2. set "asar": false, in the build section, but no luck either.

cmder looks nice and really polished. Thanks!

Please use NSIS target instead of Squirrel.Windows. Set build.win.target to nsis.

Yeah I probably should since I'm not using the updater right now. I was looking at it, and last time I noticed no option of using your own server for updates - which it looks like that's planned for the future

develar commented 7 years ago

@keverw Does 32bit work as packed application?

keverw commented 7 years ago

I just gave the installer a try from my last build. Instead of that error message about the module not being found I get this:

image

SquirrelSetup.log.txt

Also another thing I noticed is if theres any errors installing or opening the app the process stays open even when you press okay... which I guess isn't a big deal as I think these types of errors only happen when developing.

develar commented 7 years ago

@keverw Please use NSIS.

no option of using your own server for updates - which it looks like that's planned for the future

It will be fixed soon. So, no reason to use Squirrel.Windows.

keverw commented 7 years ago

Okay I'll go ahead and try NSIS. Then I guess I can see what that installer says for 32bit. The unpackaged version gives an issue, so I assume the new installer would too but only one way to know :)

develar commented 7 years ago

@keverw Please attach here your package.json — how do you build win 32-bit?

keverw commented 7 years ago

Okay build just got done. I deleted the dist folder before so I'd be a clean one.

win-ia32-unpacked gives the same error as before about the missing module win-unpacked works great

I like how it's now one installer, but it popped this up during the install:

image

and then the app opens and the spinner never stops. I closed it and reopened it after installed to see if that made a different, but same. The win-unpacked one loads fully and is functional.

https://github.com/keverw/SteemWrite/blob/master/package.json is the dev one, https://github.com/keverw/SteemWrite/blob/master/app/package.json is the app one

I build it by running npm run distwin

keverw commented 7 years ago

Hi again,

I rebooted my VM and updated Node.js to v6.9.1, removed both node_modules folders to give it another try... Then I did npm install and then after that was completed successfully npm run distwin and waited for it to build.

Interestingly, Win 32 works now finally! So I went to check 64 bit next, but Win 64 does not work now - when it used to work...

image

Win 64 version gives me that "cannot find module", just like the 32 version was doing before.

Also no longer getting an error while the installer runs now either. Just that when it done it loads the Win 64 build which is broken now. So I'd say that's a little bit of progress.

C:\Users\Kevin\Documents\GitHub\SteemWrite (master)
λ npm run distwin

> @ distwin C:\Users\Kevin\Documents\GitHub\SteemWrite
> build --dir --ia32 --x64 -w NSIS

Rebuilding app dependencies for arch x64 to C:\Users\Kevin\Documents\GitHub\SteemWrite\app

Packaging for platform win32 x64 using electron 1.4.4 to dist\win-unpacked

Building nsis x64 installer

Rebuilding app dependencies for arch ia32 to C:\Users\Kevin\Documents\GitHub\SteemWrite\app

Packaging for platform win32 ia32 using electron 1.4.4 to dist\win-ia32-unpacked

Building nsis ia32 installer

Building NSIS installer

It looks like its building the dependencies both too.

keverw commented 7 years ago

I just updated electron-builder to 7.15.2 from 7.24.2 to see if it makes any difference. I did npm cache clear, then I went in and deleted the node_modules in my root, then I deleted node_modules along with the dist folder in the root. I went went back to the root of my project, I did npm install and then I ran run dist win which runs build --dir --ia32 --x64 -w NSIS

Here's my root package.json now: https://github.com/keverw/SteemWrite/blob/master/package.json

Then my app one is the same as the one I linked earlier.

It seems like every time I build either 32 bit or 64 bit works but not both... I don't know what's going wrong but getting that can't find module error. This whole project is on GitHub here: https://github.com/keverw/SteemWrite

Really frustrated and can't seem to find much on this issue already.

image

Here's the build log:

PS C:\Users\Kevin> npm cache clean
PS C:\Users\Kevin> cd C:\Users\Kevin\Documents\GitHub\SteemWrite
PS C:\Users\Kevin\Documents\GitHub\SteemWrite> npm install

> electron@1.4.4 postinstall C:\Users\Kevin\Documents\GitHub\SteemWrite\node_modules\electron
> node install.js

> undefined postinstall C:\Users\Kevin\Documents\GitHub\SteemWrite
> install-app-deps

Installing app dependencies for arch x64 to C:\Users\Kevin\Documents\GitHub\SteemWrite\app

C:\Users\Kevin\Documents\GitHub\SteemWrite
+-- debug-menu@0.4.0
| `-- electron-debug@0.5.2
|   `-- electron-localshortcut@0.6.1
+-- electron@1.4.4
| +-- electron-download@3.0.1
| | +-- fs-extra@0.30.0
| | | +-- jsonfile@2.4.0
| | | +-- klaw@1.3.1
| | | `-- rimraf@2.5.4
| | +-- home-path@1.0.3
| | +-- minimist@1.2.0
| | +-- nugget@2.0.1
| | | +-- pretty-bytes@1.0.4
| | | | +-- get-stdin@4.0.1
| | | | `-- meow@3.7.0
| | | |   +-- camelcase-keys@2.1.0
| | | |   +-- loud-rejection@1.6.0
| | | |   | +-- currently-unhandled@0.4.1
| | | |   | | `-- array-find-index@1.0.2
| | | |   | `-- signal-exit@3.0.1
| | | |   +-- map-obj@1.0.1
| | | |   +-- redent@1.0.0
| | | |   | +-- indent-string@2.1.0
| | | |   | `-- strip-indent@1.0.1
| | | |   `-- trim-newlines@1.0.0
| | | +-- request@2.76.0
| | | | +-- aws-sign2@0.6.0
| | | | +-- aws4@1.5.0
| | | | +-- caseless@0.11.0
| | | | +-- combined-stream@1.0.5
| | | | | `-- delayed-stream@1.0.0
| | | | +-- extend@3.0.0
| | | | +-- forever-agent@0.6.1
| | | | +-- form-data@2.1.1
| | | | | `-- asynckit@0.4.0
| | | | +-- har-validator@2.0.6
| | | | | `-- is-my-json-valid@2.15.0
| | | | |   +-- generate-function@2.0.0
| | | | |   +-- generate-object-property@1.2.0
| | | | |   | `-- is-property@1.0.2
| | | | |   +-- jsonpointer@4.0.0
| | | | |   `-- xtend@4.0.1
| | | | +-- hawk@3.1.3
| | | | | +-- boom@2.10.1
| | | | | +-- cryptiles@2.0.5
| | | | | +-- hoek@2.16.3
| | | | | `-- sntp@1.0.9
| | | | +-- http-signature@1.1.1
| | | | | +-- assert-plus@0.2.0
| | | | | +-- jsprim@1.3.1
| | | | | | +-- extsprintf@1.0.2
| | | | | | +-- json-schema@0.2.3
| | | | | | `-- verror@1.3.6
| | | | | `-- sshpk@1.10.1
| | | | |   +-- asn1@0.2.3
| | | | |   +-- assert-plus@1.0.0
| | | | |   +-- bcrypt-pbkdf@1.0.0
| | | | |   +-- dashdash@1.14.0
| | | | |   | `-- assert-plus@1.0.0
| | | | |   +-- ecc-jsbn@0.1.1
| | | | |   +-- getpass@0.1.6
| | | | |   | `-- assert-plus@1.0.0
| | | | |   +-- jodid25519@1.0.2
| | | | |   +-- jsbn@0.1.0
| | | | |   `-- tweetnacl@0.14.3
| | | | +-- is-typedarray@1.0.0
| | | | +-- isstream@0.1.2
| | | | +-- json-stringify-safe@5.0.1
| | | | +-- mime-types@2.1.12
| | | | | `-- mime-db@1.24.0
| | | | +-- node-uuid@1.4.7
| | | | +-- oauth-sign@0.8.2
| | | | +-- qs@6.3.0
| | | | +-- stringstream@0.0.5
| | | | `-- tough-cookie@2.3.2
| | | |   `-- punycode@1.4.1
| | | +-- single-line-log@1.1.2
| | | `-- throttleit@0.0.2
| | +-- path-exists@2.1.0
| | | `-- pinkie-promise@2.0.1
| | |   `-- pinkie@2.0.4
| | +-- rc@1.1.6
| | | +-- deep-extend@0.4.1
| | | `-- strip-json-comments@1.0.4
| | `-- sumchecker@1.2.0
| |   `-- es6-promise@3.3.1
| `-- extract-zip@1.5.0
|   +-- concat-stream@1.5.0
|   | +-- readable-stream@2.0.6
|   | | `-- isarray@1.0.0
|   | `-- typedarray@0.0.6
|   +-- debug@0.7.4
|   +-- mkdirp@0.5.0
|   | `-- minimist@0.0.8
|   `-- yauzl@2.4.1
|     `-- fd-slicer@1.0.1
|       `-- pend@1.2.0
+-- electron-builder@7.15.2
| +-- 7zip-bin@2.0.4
| | `-- 7zip-bin-win@2.0.2
| +-- ansi-escapes@1.4.0
| +-- archiver@1.1.0
| | +-- async@2.1.2
| | +-- buffer-crc32@0.2.5
| | +-- glob@7.1.1
| | | +-- fs.realpath@1.0.0
| | | +-- inflight@1.0.6
| | | | `-- wrappy@1.0.2
| | | `-- once@1.4.0
| | +-- lodash@4.16.4
| | +-- readable-stream@2.1.5
| | | +-- buffer-shims@1.0.0
| | | +-- core-util-is@1.0.2
| | | +-- isarray@1.0.0
| | | +-- process-nextick-args@1.0.7
| | | +-- string_decoder@0.10.31
| | | `-- util-deprecate@1.0.2
| | +-- tar-stream@1.5.2
| | | +-- bl@1.1.2
| | | | `-- readable-stream@2.0.6
| | | |   `-- isarray@1.0.0
| | | +-- end-of-stream@1.1.0
| | | | `-- once@1.3.3
| | | +-- readable-stream@2.1.5
| | | | `-- isarray@1.0.0
| | | `-- xtend@4.0.1
| | `-- zip-stream@1.1.0
| |   +-- compress-commons@1.1.0
| |   | +-- crc32-stream@1.0.0
| |   | | `-- readable-stream@2.1.5
| |   | |   `-- isarray@1.0.0
| |   | `-- readable-stream@2.1.5
| |   |   `-- isarray@1.0.0
| |   `-- readable-stream@2.1.5
| |     `-- isarray@1.0.0
| +-- archiver-utils@1.3.0
| | +-- graceful-fs@4.1.9
| | +-- lazystream@1.0.0
| | | `-- readable-stream@2.1.5
| | |   `-- isarray@1.0.0
| | +-- normalize-path@2.0.1
| | `-- readable-stream@2.1.5
| |   `-- isarray@1.0.0
| +-- asar-electron-builder@0.13.5
| | +-- commander@2.9.0
| | | `-- graceful-readlink@1.0.1
| | `-- mkdirp@0.5.1
| |   `-- minimist@0.0.8
| +-- bluebird-lst-c@1.0.2
| | `-- bluebird@3.4.6
| +-- chalk@1.1.3
| | +-- ansi-styles@2.2.1
| | +-- escape-string-regexp@1.0.5
| | +-- has-ansi@2.0.0
| | | `-- ansi-regex@2.0.0
| | +-- strip-ansi@3.0.1
| | `-- supports-color@2.0.0
| +-- chromium-pickle-js@0.2.0
| +-- cli-cursor@1.0.2
| | `-- restore-cursor@1.0.1
| |   +-- exit-hook@1.1.1
| |   `-- onetime@1.1.0
| +-- cuint@0.2.2
| +-- debug@2.2.0
| | `-- ms@0.7.1
| +-- electron-download@2.1.2
| | +-- mv@2.1.1
| | | +-- mkdirp@0.5.1
| | | | `-- minimist@0.0.8
| | | +-- ncp@2.0.0
| | | `-- rimraf@2.4.5
| | |   `-- glob@6.0.4
| | +-- nugget@1.6.2
| | | `-- single-line-log@0.4.1
| | `-- path-exists@1.0.0
| +-- electron-osx-sign-tf@1.0.1
| | +-- compare-version@0.1.2
| | `-- tempfile@1.1.1
| |   +-- os-tmpdir@1.0.2
| |   `-- uuid@2.0.3
| +-- fs-extra-p@2.0.3
| | `-- fs-extra-tf@0.30.4
| +-- hosted-git-info@2.1.5
| +-- ini@1.3.4
| +-- isbinaryfile@3.0.1
| +-- js-yaml@3.6.1
| | +-- argparse@1.0.9
| | | `-- sprintf-js@1.0.3
| | `-- esprima@2.7.3
| +-- lodash.template@4.4.0
| | +-- lodash._reinterpolate@3.0.0
| | `-- lodash.templatesettings@4.1.0
| +-- mime@1.3.4
| +-- minimatch@3.0.3
| | `-- brace-expansion@1.1.6
| |   +-- balanced-match@0.4.2
| |   `-- concat-map@0.0.1
| +-- normalize-package-data@2.3.5
| | +-- is-builtin-module@1.0.0
| | | `-- builtin-modules@1.1.1
| | `-- validate-npm-package-license@3.0.1
| |   +-- spdx-correct@1.0.2
| |   | `-- spdx-license-ids@1.2.2
| |   `-- spdx-expression-parse@1.0.4
| +-- parse-color@1.0.0
| | `-- color-convert@0.5.3
| +-- plist@2.0.1
| | +-- base64-js@1.1.2
| | +-- xmlbuilder@8.2.2
| | `-- xmldom@0.1.22
| +-- pretty-ms@2.1.0
| | +-- is-finite@1.0.2
| | | `-- number-is-nan@1.0.1
| | +-- parse-ms@1.0.1
| | `-- plur@1.0.0
| +-- progress@1.1.8
| +-- progress-stream@1.2.0
| | +-- speedometer@0.1.4
| | `-- through2@0.2.3
| |   +-- readable-stream@1.1.14
| |   | `-- isarray@0.0.1
| |   `-- xtend@2.1.2
| |     `-- object-keys@0.4.0
| +-- read-installed@4.0.3
| | +-- debuglog@1.0.1
| | +-- read-package-json@2.0.4
| | | +-- glob@6.0.4
| | | `-- json-parse-helpfulerror@1.0.3
| | |   `-- jju@1.3.0
| | +-- readdir-scoped-modules@1.0.2
| | | `-- dezalgo@1.0.3
| | |   `-- asap@2.0.5
| | +-- slide@1.1.6
| | `-- util-extend@1.0.3
| +-- sanitize-filename@1.6.1
| | `-- truncate-utf8-bytes@1.0.2
| |   `-- utf8-byte-length@1.0.4
| +-- semver@5.3.0
| +-- source-map-support@0.4.5
| | `-- source-map@0.5.6
| +-- tunnel-agent@0.4.3
| +-- update-notifier@1.0.2
| | +-- boxen@0.6.0
| | | +-- ansi-align@1.1.0
| | | +-- camelcase@2.1.1
| | | +-- cli-boxes@1.0.0
| | | +-- filled-array@1.1.0
| | | +-- object-assign@4.1.0
| | | +-- repeating@2.0.1
| | | `-- widest-line@1.0.0
| | +-- configstore@2.1.0
| | | +-- dot-prop@3.0.0
| | | | `-- is-obj@1.0.1
| | | +-- osenv@0.1.3
| | | `-- write-file-atomic@1.2.0
| | |   `-- imurmurhash@0.1.4
| | +-- is-npm@1.0.0
| | +-- latest-version@2.0.0
| | | `-- package-json@2.4.0
| | |   +-- got@5.6.0
| | |   | +-- create-error-class@3.0.2
| | |   | | `-- capture-stack-trace@1.0.0
| | |   | +-- duplexer2@0.1.4
| | |   | | `-- readable-stream@2.1.5
| | |   | |   `-- isarray@1.0.0
| | |   | +-- is-plain-obj@1.1.0
| | |   | +-- is-redirect@1.0.0
| | |   | +-- is-retry-allowed@1.1.0
| | |   | +-- is-stream@1.1.0
| | |   | +-- lowercase-keys@1.0.0
| | |   | +-- node-status-codes@1.0.0
| | |   | +-- parse-json@2.2.0
| | |   | | `-- error-ex@1.3.0
| | |   | |   `-- is-arrayish@0.2.1
| | |   | +-- read-all-stream@3.1.0
| | |   | | `-- readable-stream@2.1.5
| | |   | |   `-- isarray@1.0.0
| | |   | +-- readable-stream@2.1.5
| | |   | | `-- isarray@1.0.0
| | |   | +-- timed-out@2.0.0
| | |   | +-- unzip-response@1.0.1
| | |   | `-- url-parse-lax@1.0.0
| | |   |   `-- prepend-http@1.0.4
| | |   +-- registry-auth-token@3.1.0
| | |   `-- registry-url@3.1.0
| | +-- lazy-req@1.1.0
| | +-- semver-diff@2.1.0
| | `-- xdg-basedir@2.0.0
| |   `-- os-homedir@1.0.2
| +-- uuid-1345@0.99.6
| | `-- macaddress@0.2.8
| `-- yargs@6.3.0
|   +-- camelcase@3.0.0
|   +-- cliui@3.2.0
|   | `-- wrap-ansi@2.0.0
|   +-- decamelize@1.2.0
|   +-- get-caller-file@1.0.2
|   +-- os-locale@1.4.0
|   | `-- lcid@1.0.0
|   |   `-- invert-kv@1.0.0
|   +-- read-pkg-up@1.0.1
|   | +-- find-up@1.1.2
|   | `-- read-pkg@1.1.0
|   |   +-- load-json-file@1.1.0
|   |   | +-- pify@2.3.0
|   |   | `-- strip-bom@2.0.0
|   |   |   `-- is-utf8@0.2.1
|   |   `-- path-type@1.1.0
|   +-- require-directory@2.1.1
|   +-- require-main-filename@1.0.1
|   +-- set-blocking@2.0.0
|   +-- string-width@1.0.2
|   | +-- code-point-at@1.0.1
|   | `-- is-fullwidth-code-point@1.0.0
|   +-- which-module@1.0.0
|   +-- window-size@0.2.0
|   +-- y18n@3.2.1
|   `-- yargs-parser@4.0.2
|     `-- camelcase@3.0.0
`-- electron-reload@1.0.2
  `-- chokidar@1.6.1
    +-- anymatch@1.3.0
    | +-- arrify@1.0.1
    | `-- micromatch@2.3.11
    |   +-- arr-diff@2.0.0
    |   | `-- arr-flatten@1.0.1
    |   +-- array-unique@0.2.1
    |   +-- braces@1.8.5
    |   | +-- expand-range@1.8.2
    |   | | `-- fill-range@2.2.3
    |   | |   +-- is-number@2.1.0
    |   | |   +-- isobject@2.1.0
    |   | |   | `-- isarray@1.0.0
    |   | |   +-- randomatic@1.1.5
    |   | |   `-- repeat-string@1.6.1
    |   | +-- preserve@0.2.0
    |   | `-- repeat-element@1.1.2
    |   +-- expand-brackets@0.1.5
    |   | `-- is-posix-bracket@0.1.1
    |   +-- extglob@0.3.2
    |   +-- filename-regex@2.0.0
    |   +-- kind-of@3.0.4
    |   | `-- is-buffer@1.1.4
    |   +-- object.omit@2.0.1
    |   | +-- for-own@0.1.4
    |   | | `-- for-in@0.1.6
    |   | `-- is-extendable@0.1.1
    |   +-- parse-glob@3.0.4
    |   | +-- glob-base@0.3.0
    |   | `-- is-dotfile@1.0.2
    |   `-- regex-cache@0.4.3
    |     +-- is-equal-shallow@0.1.3
    |     `-- is-primitive@2.0.0
    +-- async-each@1.0.1
    +-- glob-parent@2.0.0
    +-- inherits@2.0.3
    +-- is-binary-path@1.0.1
    | `-- binary-extensions@1.7.0
    +-- is-glob@2.0.1
    | `-- is-extglob@1.0.0
    +-- path-is-absolute@1.0.1
    `-- readdirp@2.1.0
      +-- readable-stream@2.1.5
      | `-- isarray@1.0.0
      `-- set-immediate-shim@1.0.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@^1.0.1 (node_modules\7zip-bin\node_modules\7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":
"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-linux@^1.0.3 (node_modules\7zip-bin\node_modules\7zip-bin-linux
):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-linux@1.0.3: wanted {"os":"linux","arch"
:"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"an
y"} (current: {"os":"win32","arch":"x64"})
PS C:\Users\Kevin\Documents\GitHub\SteemWrite> npm run distwin

> @ distwin C:\Users\Kevin\Documents\GitHub\SteemWrite
> build --dir --ia32 --x64 -w NSIS

Rebuilding app dependencies for arch x64 to C:\Users\Kevin\Documents\GitHub\SteemWrite\app

Packaging for platform win32 x64 using electron 1.4.4 to dist\win-unpacked

Building nsis x64 installer

Rebuilding app dependencies for arch ia32 to C:\Users\Kevin\Documents\GitHub\SteemWrite\app

Packaging for platform win32 ia32 using electron 1.4.4 to dist\win-ia32-unpacked

Building nsis ia32 installer

Building NSIS installer

PS C:\Users\Kevin\Documents\GitHub\SteemWrite>

Edit:

So I searched in the one that's working and node_sqlite3.node is found, the other one it isn't...

So for some reason one of the builds is erroring out and it's not being caught or a file isn't being copied by the builder. Not sure which.

Just as soon as I switched back to my Windows VM after posting this, it showed up... So maybe Windows didn't build it Index yet at that point. Double checked to run it and see if I got the same error and I do... I don't know what's going on. It seems like somthing like this should just be fairly simple and work. Switched to the two package.json as recomdned and everything. I don't know what I could be doing wrong... I wish I knew.

keverw commented 7 years ago

I've just updated the modules and gave it another try after taking a break for a while. Still no luck on Win32. :(

develar commented 7 years ago

Sorry that I didn't yet investigate (but rebuild was rewritten by in the 8). I will try to take a look soon.

keverw commented 7 years ago

Okay sounds good :) Any chance yet? I haven't attempted updating and trying again yet. Didn't know if anything chanced much in the past couple days.

develar commented 7 years ago

npm_config_target_arch is required in addition to npm_config_arch because node-pre-gup doesn't support npm_config_arch.

develar commented 7 years ago

@keverw You are not forced to use 2-package.json structure — see commit https://github.com/develar/SteemWrite

NirLevanon-zz commented 7 years ago

I've updated electron-builder to v10.2.0, I've built a Windows exe file for both arch 64 and ia32 platforms from my Linux machine, but I still receive the same %1 is not a valid Win32 application. error for both installations.

I've ran the export commands for npm_config_target_arch and npm_config_arch` but no dice.

Will I really have to build the project on a Windows platform to get a working exe...?

develar commented 7 years ago

@NirLevanon Issue is closed by commit. It means that you need to wait next electron-builder version. Currently, build is not yet ready due to Travis issue https://travis-ci.org/electron-userland/electron-builder/builds/180033471

keverw commented 7 years ago

Interesting. so you fixed my issue? Thanks for looking into it btw

I like the two package structure but interesting. I was thinking it was forced to natively compile as that what is highly recommended it seems without any third party rebuild plugin.

npm_config_target_arch is required in addition to npm_config_arch because node-pre-gup doesn't support npm_config_arch

What are those for? Did a quick Google search and they look like some sort of ENV var but in the example they are set to x64... I wonder how that would work - I was hoping one command to build for both archs on Windows.

develar commented 7 years ago

so you fixed my issue?

Yes. Please try 10.3.0

What are those for?

Don't worry. It was internal comment. You, as user, don't need to know about it.

keverw commented 7 years ago

Nice :) I got it to compile and run both versions successfully. Thank you 👍

NirLevanon-zz commented 7 years ago

I'm sorry to report that I've upgraded electron-builder to 10.4.0 in my global modules and 10.3.0 in my local module and I'm still receiving the same error.

I'm using the build --win configuration which builds win32 x64.

My development machine is a Linux x64, my target paltform is a win32 x64

develar commented 7 years ago

@NirLevanon You can build native deps only for the same platform. If you build for win — you must build on win. Please see https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build

derwaldgeist commented 7 years ago

@develar Why is electron builder allowing me to build a Windows app with native dependencies on macOS, if this is not supported? Wouldn't it be better if it just showed an error if you tried? I just ran into this with an app that includes https://github.com/justinlatimer/node-midi and only found this issue here by chance.

develar commented 7 years ago

@derwaldgeist https://github.com/electron-userland/electron-builder/issues/1812#issuecomment-314677072

Ask module author to use prebuild. And set buildDependenciesFromSource to true as workaround.

cotufaloschiflones commented 6 years ago

This was my experience with this same issue (using node-printer from @tojocky) from my mac compiling for windows.

https://github.com/electron/electron/issues/1075#issuecomment-362220859