Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 3221225781 with nsis target #1097

Closed
noahbenham opened this issue Jan 8, 2017 · 12 comments
Closed

Error 3221225781 with nsis target #1097

noahbenham opened this issue Jan 8, 2017 · 12 comments
Labels

Comments

@noahbenham
Copy link

noahbenham commented Jan 8, 2017

  • Version: 8.6.0
  • Target: win/nsis

I'm able to build my application for all platforms on a mac, but attempting a Win build on a Windows machine is throwing error 3221225781. More specifically, this is happening within a cygwin environment on Windows Server 2008 R2, so I suspect a dll/package could be missing from the cygwin install, but I'm not sure.

I believe error 3221225781 == 0xC0000135. So STATUS_DLL_NOT_FOUND?

If this is indeed the issue, I've tried tracking down what's missing from makensis.exe with Dependency Walker but didn't get any meaningful results.

The following is output with the DEBUG flag. Sorry if this isn't the best place for this issue; I've already tried getting help in the Slack channel. Could someone help me track this down please?

c:\jenkins\workspace\desktop-shell-dev>call npm install   && npm run lint   && npm run dist_win 

> [email protected] postinstall c:\jenkins\workspace\desktop-shell-dev
> install-app-deps

Installing app dependencies for arch x64 to c:\jenkins\workspace\desktop-shell-dev\app
Sun, 08 Jan 2017 19:03:21 GMT electron-builder Spawning C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js install --production --cache-min 999999999 --build-from-source
Sun, 08 Jan 2017 19:03:24 GMT electron-builder C:\Program Files\nodejs\node.exe (1188) exited with code 0
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 [email protected]: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
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 [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

> [email protected] lint c:\jenkins\workspace\desktop-shell-dev
> eslint .


> [email protected] dist_win c:\jenkins\workspace\desktop-shell-dev
> npm run less && build -w


> [email protected] less c:\jenkins\workspace\desktop-shell-dev
> lessc --clean-css less/main.less app/styles.min.css

Packaging for win32 x64 using electron 1.4.13 to dist\win-unpacked
Sun, 08 Jan 2017 19:03:43 GMT electron-builder Found existing nsis C:\Windows\system32\config\systemprofile\AppData\Local\electron-builder\cache\nsis\nsis-3.0.2
Sun, 08 Jan 2017 19:03:44 GMT electron-builder Spawning c:\jenkins\workspace\desktop-shell-dev\node_modules\7zip-bin-win\x64\7za.exe x -bd C:\Windows\system32\config\systemprofile\.electron\electron-v1.4.13-win32-x64.zip -oc:\jenkins\workspace\desktop-shell-dev\dist\win-unpacked

7-Zip (a) [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04

Scanning the drive for archives:
1 file, 54339658 bytes (52 MiB)

Extracting archive: C:\Windows\system32\config\systemprofile\.electron\electron-v1.4.13-win32-x64.zip
--
Path = C:\Windows\system32\config\systemprofile\.electron\electron-v1.4.13-win32-x64.zip
Type = zip
Physical Size = 54339658

Everything is Ok

Files: 74
Size:       137832472
Compressed: 54339658
Sun, 08 Jan 2017 19:03:46 GMT electron-builder c:\jenkins\workspace\desktop-shell-dev\node_modules\7zip-bin-win\x64\7za.exe (5360) exited with code 0
Sun, 08 Jan 2017 19:03:46 GMT electron-builder Pruned dev or extraneous dependencies: 
Sun, 08 Jan 2017 19:03:47 GMT electron-builder Found existing winCodeSign C:\Windows\system32\config\systemprofile\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.4.2
Sun, 08 Jan 2017 19:03:47 GMT electron-builder Executing C:\Windows\system32\config\systemprofile\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.4.2\rcedit.exe c:\jenkins\workspace\desktop-shell-dev\dist\win-unpacked\Application.exe --set-version-string CompanyName Application Development --set-version-string FileDescription Application desktop application --set-version-string ProductName Application --set-version-string InternalName Application --set-version-string LegalCopyright Copyright 2016 company Corporation. All rights reserved. --set-version-string OriginalFilename  --set-file-version 0.0.1.71 --set-product-version 0.0.1 --set-icon c:\jenkins\workspace\desktop-shell-dev\build\icon.ico
Packaging NSIS installer for arch x64
Building NSIS installer
Sun, 08 Jan 2017 19:03:47 GMT electron-builder Spawning c:\jenkins\workspace\desktop-shell-dev\node_modules\7zip-bin-win\x64\7za.exe a -bd -mx=9 -mfb=64 -md=64m -ms=on c:\jenkins\workspace\desktop-shell-dev\dist\desktop-0.0.1-x64.nsis.7z .

7-Zip (a) [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04

Scanning the drive:
2 folders, 73 files, 138061471 bytes (132 MiB)

Creating archive: c:\jenkins\workspace\desktop-shell-dev\dist\desktop-0.0.1-x64.nsis.7z

Items to compress: 75


Files read from disk: 73
Archive size: 33304280 bytes (32 MiB)
Everything is Ok
Sun, 08 Jan 2017 19:05:23 GMT electron-builder c:\jenkins\workspace\desktop-shell-dev\node_modules\7zip-bin-win\x64\7za.exe (1908) exited with code 0
Sun, 08 Jan 2017 19:05:23 GMT electron-builder { APP_ID: 'com.company.app.bundle58128',
  APP_GUID: 'f7def604-4244-547a-9074-469b594dc85a',
  PRODUCT_NAME: 'Application',
  PRODUCT_FILENAME: 'Application',
  APP_DESCRIPTION: 'Application desktop application',
  VERSION: '0.0.1',
  COMPANY_NAME: 'Application Development',
  PROJECT_DIR: 'c:\\jenkins\\workspace\\desktop-shell-dev',
  BUILD_RESOURCES_DIR: 'c:\\jenkins\\workspace\\desktop-shell-dev\\build',
  MUI_ICON: 'c:\\jenkins\\workspace\\desktop-shell-dev\\build\\icon.ico',
  MUI_UNICON: 'c:\\jenkins\\workspace\\desktop-shell-dev\\build\\icon.ico',
  APP_64: 'c:\\jenkins\\workspace\\desktop-shell-dev\\dist\\desktop-0.0.1-x64.nsis.7z',
  INSTALL_MODE_PER_ALL_USERS: null,
  INSTALL_MODE_PER_ALL_USERS_REQUIRED: null,
  RUN_AFTER_FINISH: null,
  COMPRESS: 'auto',
  ONE_CLICK: null }
Sun, 08 Jan 2017 19:05:23 GMT electron-builder { OutFile: '"c:\\jenkins\\workspace\\desktop-shell-dev\\dist\\Application Setup 0.0.1.exe"',
  VIProductVersion: '0.0.1.71',
  VIAddVersionKey: 
   [ '/LANG=1033 ProductName "Application"',
     '/LANG=1033 ProductVersion "0.0.1"',
     '/LANG=1033 CompanyName "Application Development"',
     '/LANG=1033 LegalCopyright "Copyright 2016 company Corporation. All rights reserved."',
     '/LANG=1033 FileDescription "Application desktop application"',
     '/LANG=1033 FileVersion "0.0.1.71"' ],
  Unicode: true,
  SetCompressor: 'lzma',
  SetCompressorDictSize: '64' }


NSIS script:

!include "common.nsh"
!include "MUI2.nsh"
!include "multiUser.nsh"
!include "allowOnlyOneInstallerInstance.nsh"

!ifdef INSTALL_MODE_PER_ALL_USERS
  !ifdef BUILD_UNINSTALLER
    RequestExecutionLevel user
  !else
    RequestExecutionLevel admin
  !endif
!else
  RequestExecutionLevel user
!endif

!ifdef ONE_CLICK
  !include "oneClick.nsh"
!else
  !include "boringInstaller.nsh"
!endif

!ifmacrodef customHeader
  !insertmacro customHeader
!endif

Var startMenuLink
Var desktopLink

!ifdef BUILD_UNINSTALLER
  SilentInstall silent
!else
  Var appExe
!endif

Function .onInit
  !ifdef BUILD_UNINSTALLER
    WriteUninstaller "${UNINSTALLER_OUT_FILE}"
    !insertmacro quitSuccess
  !else
    !insertmacro check64BitAndSetRegView

    !ifdef ONE_CLICK
      !insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE
    !else
      ${IfNot} ${UAC_IsInnerInstance}
        !insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE
      ${EndIf}
    !endif

    !insertmacro initMultiUser

    !ifmacrodef customInit
      !insertmacro customInit
    !endif
  !endif
FunctionEnd

Section "install"
  !ifndef BUILD_UNINSTALLER
    !include "installSection.nsh"
  !endif
SectionEnd

!ifdef BUILD_UNINSTALLER
  !include "uninstaller.nsh"
!endif

---
End of NSIS script.

Sun, 08 Jan 2017 19:05:23 GMT electron-builder Spawning C:\Windows\system32\config\systemprofile\AppData\Local\electron-builder\cache\nsis\nsis-3.0.2\Bin\makensis.exe -WX -DAPP_ID=com.company.app.bundle58128 -DAPP_GUID=f7def604-4244-547a-9074-469b594dc85a -DPRODUCT_NAME=Application -DPRODUCT_FILENAME=Application -DAPP_DESCRIPTION=Application desktop application -DVERSION=0.0.1 -DCOMPANY_NAME=Application Development -DPROJECT_DIR=c:\jenkins\workspace\desktop-shell-dev -DBUILD_RESOURCES_DIR=c:\jenkins\workspace\desktop-shell-dev\build -DMUI_ICON=c:\jenkins\workspace\desktop-shell-dev\build\icon.ico -DMUI_UNICON=c:\jenkins\workspace\desktop-shell-dev\build\icon.ico -DAPP_64=c:\jenkins\workspace\desktop-shell-dev\dist\desktop-0.0.1-x64.nsis.7z -DINSTALL_MODE_PER_ALL_USERS -DINSTALL_MODE_PER_ALL_USERS_REQUIRED -DRUN_AFTER_FINISH -DCOMPRESS=auto -DONE_CLICK -DBUILD_UNINSTALLER -DUNINSTALLER_OUT_FILE=c:\temp\electron-builder-n8hQkZ\t-16fc-0-uninstaller.exe -XOutFile "c:\jenkins\workspace\desktop-shell-dev\dist\Application Setup 0.0.1.exe" -XVIProductVersion 0.0.1.71 -XVIAddVersionKey /LANG=1033 ProductName "Application" -XVIAddVersionKey /LANG=1033 ProductVersion "0.0.1" -XVIAddVersionKey /LANG=1033 CompanyName "Application Development" -XVIAddVersionKey /LANG=1033 LegalCopyright "Copyright 2016 company Corporation. All rights reserved." -XVIAddVersionKey /LANG=1033 FileDescription "Application desktop application" -XVIAddVersionKey /LANG=1033 FileVersion "0.0.1.71" -XUnicode true -XSetCompressor lzma -XSetCompressorDictSize 64 -
Error: C:\Windows\system32\config\systemprofile\AppData\Local\electron-builder\cache\nsis\nsis-3.0.2\Bin\makensis.exe exited with code 3221225781
    at ChildProcess.childProcess.once.code (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\util\util.ts:125:14)
    at ChildProcess.g (events.js:291:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
From previous event:
    at c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\targets\nsis.ts:325:5
    at next (native)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)
From previous event:
    at NsisTarget.executeMakensis (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\targets\nsis.js:371:11)
    at c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\targets\nsis.ts:198:62
From previous event:
    at NsisTarget.buildInstaller (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\targets\nsis.js:292:11)
    at c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\targets\nsis.ts:71:18
    at next (native)
From previous event:
    at NsisTarget.finishBuild (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\targets\nsis.js:147:11)
    at c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\packager.ts:136:31
From previous event:
    at Packager.doBuild (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\packager.js:256:11)
    at c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\packager.ts:100:38
    at next (native)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)
From previous event:
    at Packager.build (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\packager.js:208:11)
    at c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\src\builder.ts:240:40
    at next (native)
From previous event:
    at build (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\builder.js:89:21)
    at Object.<anonymous> (c:\jenkins\workspace\desktop-shell-dev\node_modules\electron-builder\out\build-cli.js:62:41)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dist_win"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dist_win: `npm run less && build -w`
npm ERR! Exit status 4294967295
npm ERR! 
npm ERR! Failed at the [email protected] dist_win script 'npm run less && build -w'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the desktop package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run less && build -w
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs desktop
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls desktop
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\jenkins\workspace\desktop-shell-dev\npm-debug.log
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

Build and devDependencies sections of package.json:

"build": {
    "appId": "com.company.application",
    "copyright": "Copyright 2016 Corporation. All rights reserved.",
    "productName": "Application",
    "mac": {
      "category": "public.app-category.business"
    },
    "win": {
      "target": "nsis"
    },
    "nsis": {
      "perMachine": true
    }
  },
"devDependencies": {
    "electron": "^1.4.7",
    "electron-builder": "^8.6.0",
    "electron-packager": "^8.3.0",
    "esdoc": "^0.4.8",
    "esdoc-node": "^1.0.0",
    "eslint": "^3.10.2",
    "husky": "^0.12.0",
    "less": "^2.7.1",
    "less-plugin-clean-css": "^1.5.1"
  }
@develar
Copy link
Member

develar commented Jan 9, 2017

Please use latest electron-builder.

@develar develar closed this as completed Jan 9, 2017
@noahbenham
Copy link
Author

@develar Thanks for the prompt reply. I've updated to electron-builder 11.2.0 and electron-packager 8.4.0. I'm still getting the same error.

"devDependencies": {
    "electron": "^1.4.13",
    "electron-builder": "^11.2.0",
    "electron-packager": "^8.4.0",
    "esdoc": "^0.4.8",
    "esdoc-node": "^1.0.0",
    "eslint": "^3.10.2",
    "husky": "^0.12.0",
    "less": "^2.7.2",
    "less-plugin-clean-css": "^1.5.1"
  }

@develar develar reopened this Jan 9, 2017
@develar
Copy link
Member

develar commented Jan 9, 2017

jenkins... Please try #503 (comment)

@noahbenham
Copy link
Author

@McPo's solution didn't solve it..failing with same error code. I'm able to ssh into my box and build with success. Building from Jenkins fails, but locale returns the same results from both. From my build script,

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

@develar
Copy link
Member

develar commented Jan 9, 2017

I'm able to ssh into my box and build with success

So, yet another jenkins issue. Please compare env "Building from Jenkins" vs "I'm able to ssh into my box and build with success."

@noahbenham
Copy link
Author

Env vars present via shell but not Jenkins:

HOMEPATH
PS1
LOGONSERVER
EXECIGNORE=*.dll
USERDNSDOMAIN
HOMEDRIVE
SESSIONNAME

Env vars present via Jenkins but not shell:

BUILD_URL
HUDSON_SERVER_COOKIE
WINSW_EXECUTABLE
BASE
BUILD_TAG
GIT_PREVIOUS_COMMIT
ROOT_BUILD_CAUSE
WORKSPACE
JOB_URL
JENKINS_HOME
GIT_COMMIT
BUILD_CAUSE
HUDSON_URL
JOB_NAME
FORTIFY_CLOUDCONTROLLER_URL
BUILD_DISPLAY_NAME
JENKINS_URL
BUILD_ID
BUILD_CAUSE
GIT_BRANCH
JENKINS_SERVER_COOKIE
EXECUTOR_NUMBER
NODE_LABELS
GIT_URL
SERVICE_ID
HUDSON_HOME
NODE_NAME
BUILD_NUMBER
ROOT_BUILD_CAUSE_MANUALTRIGGER
HUDSON_COOKIE
DEBUG

Env vars differing between Jenkins & shell:

APPDATA
OLDPWD
ORIGINAL_PATH
USER
USERNAME
PATH
USERPROFILE
LOCALAPPDATA
HOME

PATH diff: https://www.diffchecker.com/6GXksrjQ

I injected env EXECIGNORE=*.dll when running the Jenkins job, but it made no difference.

Any idea if a discrepancy between any of those could be causing makensis.exe to fail?

@noahbenham
Copy link
Author

This issue is resolved and I have no idea why. I originally thought the resolution was related to shortening the build.appId property in my package.json, as I had another issue where I could build a Mac bundle, but it would crash immediately upon startup whenever this property was over 43 characters. Again, this is probably an issue specific to my environment & project, so I'm not even sure how I could go about helping you reproduce either the issue I just described or the original one here.

Regardless, great work @develar. We really appreciate it.

@develar
Copy link
Member

develar commented Jan 19, 2017

In the future maybe it will more reliable to use our docker image to build windows on Linux. Because MS just ***.

@nicowiggersiv
Copy link

@noahbenham have you set LOCALAPPDATA in your Jenkins environment to match the one from your shell environment? I'm having similar issue (the exact same return code in case of makensis.exe) in #1164 and it looks like the DLL the exe need can not be found when the exe are in the systemprofile folder (user profile of SYSTEM user, i.e. LOCALAPPDATA when running as SYSTEM).

@develar
Copy link
Member

develar commented Jan 25, 2017

@nicowiggersiv You can set LOCALAPPDATA only for electron-builder process. LOCALAPPDATA is used on Windows to compute cache directory.

@noahbenham
Copy link
Author

@nicowiggersiv Give me a few days to look into this when I have some spare time and hopefully I'll be able to help you out.

@develar
Copy link
Member

develar commented Jan 27, 2017

Latest electron-builder doesn't create cache directory in the SYSTEM user directory anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants