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

Building on Windows for Windows creates a dummy executable #5

Closed
adam-lynch opened this issue Apr 17, 2014 · 17 comments
Closed

Building on Windows for Windows creates a dummy executable #5

adam-lynch opened this issue Apr 17, 2014 · 17 comments

Comments

@adam-lynch
Copy link
Contributor

It just creates a nw.exe which shows "node-webkit" in ASCII art.

My usage:

var nwBuilder = new (require('node-webkit-builder'))({
    files: './_public/**/**',
    plattforms: ['win', 'osx'],
    version: '0.9.2',
    buildDir: './dist'
});

It is at least taking some information from dist/package.json because in dist there's a directory with the name field as its name (and then a directory per platform inside, of course).

@adam-lynch adam-lynch changed the title Building on Windows for Windows creates a dummy exe Building on Windows for Windows creates a dummy executable Apr 17, 2014
@steffenmllr
Copy link
Contributor

need to setup a windows vm to test this - are the tests running on windows? npm test

@adam-lynch
Copy link
Contributor Author

Oh I forgot to mention that! No, they're not.

>TAP version 13
# checkCache
ok 1 (unnamed assert)
ok 2 (unnamed assert)
# downloadAndUnpack: zip
ok 3 file1 unpacked
ok 4 file2 unpacked
ok 5 file3 unpacked
ok 6 444 file permission
ok 7 666 file permission
not ok 8 644 file permission
  ---
    operator: ok
    expected: true
    actual:   false
  ...
# downloadAndUnpack: tar
ok 9 file1 unpacked
ok 10 file2 unpacked
ok 11 file3 unpacked
not ok 12 444 file permission
  ---
    operator: ok
    expected: true
    actual:   false
  ...
ok 13 666 file permission
not ok 14 644 file permission
  ---
    operator: ok
    expected: true
    actual:   false
  ...
# Throw files
ok 15 Check for files
# Throw plattforms
ok 16 Check for plattforms
# Should check if we have some files
ok 17 should be equivalent
ok 18 should be equal
# Should check if we have some files: rejection
ok 19 should be equal
# Should check the version
ok 20 should log version
ok 21 should be equal
# Should not zip mac apps by default
ok 22 (unnamed assert)
# getPackageInfo invalid
ok 23 (unnamed assert)
# getPackageInfo valid
ok 24 get package name
ok 25 get package version
# editPlist
not ok 26 generate and write a valid plist file
  ---
    operator: equal
    expected:
      '<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\r\n<plist version="1.0">\r\n  <dict>\r\n    <key>CFBundleDevelopmentRegion</key>\r\n    <string>en</string>\r\n    <key>CFBundleDisplayName</key>\r\n    <string>TestApp</string>\r\n    <key>CFBundleDocumentTypes</key>\r\n    <array/>\r\n    <key>CFBundleExecutable</key>\r\n    <string>node-webkit</string>\r\n    <key>CFBundleIconFile</key>\r\n    <string>nw.icns</string>\r\n    <key>CFBundleIdentifier</key>\r\n    <string>com.intel.nw</string>\r\n    <key>CFBundleInfoDictionaryVersion</key>\r\n    <string>6.0</string>\r\n    <key>CFBundleName</key>\r\n    <string>TestApp</string>\r\n    <key>CFBundlePackageType</key>\r\n    <string>APPL</string>\r\n    <key>CFBundleShortVersionString</key>\r\n    <string>Version 1.3.3.7</string>\r\n    <key>CFBundleVersion</key>\r\n    <string>1.3.3.7</string>\r\n    <key>LSFileQuarantineEnabled</key>\r\n    <true/>\r\n    <key>LSMinimumSystemVersion</key>\r\n    <string>10.6.0</string>\r\n    <key>NSPrincipalClass</key>\r\n    <string>NSApplication</string>\r\n    <key>NSSupportsAutomaticGraphicsSwitching</key>\r\n    <true/>\r\n    <key>SCMRevision</key>\r\n    <string>222137</string>\r\n    <key>UTExportedTypeDeclarations</key>\r\n    <array/>\r\n    <key>NSHumanReadableCopyright</key>\r\n    <string>(c) by me</string>\r\n  </dict>\r\n</plist>\r\n'
    actual:
      '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n  <dict>\n    <key>CFBundleDevelopmentRegion</key>\n    <string>en</string>\n    <key>CFBundleDisplayName</key>\n    <string>TestApp</string>\n    <key>CFBundleDocumentTypes</key>\n    <array/>\n    <key>CFBundleExecutable</key>\n    <string>node-webkit</string>\n    <key>CFBundleIconFile</key>\n    <string>nw.icns</string>\n    <key>CFBundleIdentifier</key>\n    <string>com.intel.nw</string>\n    <key>CFBundleInfoDictionaryVersion</key>\n    <string>6.0</string>\n    <key>CFBundleName</key>\n    <string>TestApp</string>\n    <key>CFBundlePackageType</key>\n    <string>APPL</string>\n    <key>CFBundleShortVersionString</key>\n    <string>Version 1.3.3.7</string>\n    <key>CFBundleVersion</key>\n    <string>1.3.3.7</string>\n    <key>LSFileQuarantineEnabled</key>\n    <true/>\n    <key>LSMinimumSystemVersion</key>\n    <string>10.6.0</string>\n    <key>NSPrincipalClass</key>\n    <string>NSApplication</string>\n    <key>NSSupportsAutomaticGraphicsSwitching</key>\n    <true/>\n    <key>SCMRevision</key>\n    <string>222137</string>\n    <key>UTExportedTypeDeclarations</key>\n    <array/>\n    <key>NSHumanReadableCopyright</key>\n    <string>(c) by me</string>\n  </dict>\n</plist>\n'
  ...
# getFileList
not ok 27 figure out the right json
  ---
    operator: equal
    expected: 'test/fixtures/nwapp/package.json'
    actual:   'test\\fixtures\\nwapp\\package.json'
  ...
not ok 28 should be equivalent
  ---
    operator: deepEqual
    expected:
      [ { dest: 'images/imagefile.img', src: 'test/fixtures/nwapp/images/imagefile.img' }, { dest: 'index.html', src: 'test/fixtures/nwapp/index.html' }, { dest: 'javascript/bower_packages/simple/package.json', src: 'test/fixtures/nwapp/javascript/bower_packages/simple/package.json' }, { dest: 'javascript/jsfile.js', src: 'test/fixtures/nwapp/javascript/jsfile.js' }, { dest: 'node_modules/package/package.json', src: 'test/fixtures/nwapp/node_modules/package/package.json' }, { dest: 'package.json', src: 'test/fixtures/nwapp/package.json' } ]
    actual:
      [ { dest: 'images\\imagefile.img', src: 'test\\fixtures\\nwapp\\images\\imagefile.img' }, { dest: 'index.html', src: 'test\\fixtures\\nwapp\\index.html' }, { dest: 'javascript\\bower_packages\\simple\\package.json', src: 'test\\fixtures\\nwapp\\javascript\\bower_packages\\simple\\package.json' }, { dest: 'javascript\\jsfile.js', src: 'test\\fixtures\\nwapp\\javascript\\jsfile.js' }, { dest: 'node_modules\\package\\package.json', src: 'test\\fixtures\\nwapp\\node_modules\\package\\package.json' }, { dest: 'package.json', src: 'test\\fixtures\\nwapp\\package.json' } ]
  ...
ok 29 throw an error if there is no package json
ok 30 should be equal
not ok 31 should be equivalent
  ---
    operator: deepEqual
    expected:
      [ { dest: 'images/imagefile.img', src: 'test/fixtures/nwapp/images/imagefile.img' }, { dest: 'index.html', src: 'test/fixtures/nwapp/index.html' }, { dest: 'package.json', src: 'test/fixtures/nwapp/package.json' } ]
    actual:
      [ { dest: 'images\\imagefile.img', src: 'test\\fixtures\\nwapp\\images\\imagefile.img' }, { dest: 'index.html', src: 'test\\fixtures\\nwapp\\index.html' }, { dest: 'package.json', src: 'test\\fixtures\\nwapp\\package.json' } ]
  ...
# should zip the app and create the app.nw file + log it
ok 32 LOG: Zipping images/imagefile.img
ok 33 LOG: Zipping javascript/bower_packages/simple/package.json
ok 34 LOG: Zipping javascript/jsfile.js
ok 35 LOG: Zipping node_modules/package/package.json
ok 36 LOG: Zipping package.json
not ok 37 should be equivalent
  ---
    operator: deepEqual
    expected:
      [ 'images\\imagefile.img', 'javascript\\bower_packages\\simple\\package.json', 'javascript\\jsfile.js', 'node_modules\\package\\package.json', 'package.json' ]
    actual:
      [ 'images/imagefile.img', 'javascript/bower_packages/simple/package.json', 'javascript/jsfile.js', 'node_modules/package/package.json', 'package.json' ]
  ...
# mergeFiles
ok 38 merge two files
not ok 39 fix the permission
  ---
    operator: equal
    expected: '100755'
    actual:   '100666'
  ...
# getVersions
ok 40 should be equal
# matchVersions
ok 41 match all version
ok 42 should be equal
ok 43 should be equivalent

1..43
# tests 43
# pass  34
# fail  9

@steffenmllr
Copy link
Contributor

These mostly look like path issues - building on windows should work now can you give it a try? Tested it on a win7 vm

@steffenmllr
Copy link
Contributor

Talking about creating an app not running the test - if the test work on mac an linux that should be enough :)

@adam-lynch
Copy link
Contributor Author

Since it looks like 0.0.1 is still the latest on npm, I just re-ran the tests;

>TAP version 13
# checkCache
ok 1 (unnamed assert)
ok 2 (unnamed assert)
# downloadAndUnpack: zip
ok 3 file1 unpacked
ok 4 file2 unpacked
ok 5 file3 unpacked
ok 6 444 file permission
ok 7 666 file permission
not ok 8 644 file permission
  ---
    operator: ok
    expected: true
    actual:   false
  ...
# downloadAndUnpack: tar
ok 9 file1 unpacked
ok 10 file2 unpacked
ok 11 file3 unpacked
not ok 12 444 file permission
  ---
    operator: ok
    expected: true
    actual:   false
  ...
ok 13 666 file permission
not ok 14 644 file permission
  ---
    operator: ok
    expected: true
    actual:   false
  ...
# Throw files
ok 15 Check for files
# Throw platforms
ok 16 Check for platforms
# Should check if we have some files
ok 17 should be equivalent
ok 18 should be equal
# Should check if we have some files: rejection
ok 19 should be equal
# Should check the version
ok 20 should log version
ok 21 should be equal
# Should not zip mac apps by default
ok 22 (unnamed assert)
# getPackageInfo invalid
ok 23 (unnamed assert)
# getPackageInfo valid
ok 24 get package name
ok 25 get package version
# editPlist
not ok 26 generate and write a valid plist file
  ---
    operator: equal
    expected:
      '<?xml version="1.0" encoding="UTF-8"?>\r\n<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\r\n<plist version="1.0">\r\n  <dict>\r\n    <key>CFBundleDevelopmentRegion</key>\r\n    <string>en</string>\r\n    <key>CFBundleDisplayName</key>\r\n    <string>TestApp</string>\r\n    <key>CFBundleDocumentTypes</key>\r\n    <array/>\r\n    <key>CFBundleExecutable</key>\r\n    <string>node-webkit</string>\r\n    <key>CFBundleIconFile</key>\r\n    <string>nw.icns</string>\r\n    <key>CFBundleIdentifier</key>\r\n    <string>com.intel.nw</string>\r\n    <key>CFBundleInfoDictionaryVersion</key>\r\n    <string>6.0</string>\r\n    <key>CFBundleName</key>\r\n    <string>TestApp</string>\r\n    <key>CFBundlePackageType</key>\r\n    <string>APPL</string>\r\n    <key>CFBundleShortVersionString</key>\r\n    <string>Version 1.3.3.7</string>\r\n    <key>CFBundleVersion</key>\r\n    <string>1.3.3.7</string>\r\n    <key>LSFileQuarantineEnabled</key>\r\n    <true/>\r\n    <key>LSMinimumSystemVersion</key>\r\n    <string>10.6.0</string>\r\n    <key>NSPrincipalClass</key>\r\n    <string>NSApplication</string>\r\n    <key>NSSupportsAutomaticGraphicsSwitching</key>\r\n    <true/>\r\n    <key>SCMRevision</key>\r\n    <string>222137</string>\r\n    <key>UTExportedTypeDeclarations</key>\r\n    <array/>\r\n    <key>NSHumanReadableCopyright</key>\r\n    <string>(c) by me</string>\r\n  </dict>\r\n</plist>\r\n'
    actual:
      '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n  <dict>\n    <key>CFBundleDevelopmentRegion</key>\n    <string>en</string>\n    <key>CFBundleDisplayName</key>\n    <string>TestApp</string>\n    <key>CFBundleDocumentTypes</key>\n    <array/>\n    <key>CFBundleExecutable</key>\n    <string>node-webkit</string>\n    <key>CFBundleIconFile</key>\n    <string>nw.icns</string>\n    <key>CFBundleIdentifier</key>\n    <string>com.intel.nw</string>\n    <key>CFBundleInfoDictionaryVersion</key>\n    <string>6.0</string>\n    <key>CFBundleName</key>\n    <string>TestApp</string>\n    <key>CFBundlePackageType</key>\n    <string>APPL</string>\n    <key>CFBundleShortVersionString</key>\n    <string>Version 1.3.3.7</string>\n    <key>CFBundleVersion</key>\n    <string>1.3.3.7</string>\n    <key>LSFileQuarantineEnabled</key>\n    <true/>\n    <key>LSMinimumSystemVersion</key>\n    <string>10.6.0</string>\n    <key>NSPrincipalClass</key>\n    <string>NSApplication</string>\n    <key>NSSupportsAutomaticGraphicsSwitching</key>\n    <true/>\n    <key>SCMRevision</key>\n    <string>222137</string>\n    <key>UTExportedTypeDeclarations</key>\n    <array/>\n    <key>NSHumanReadableCopyright</key>\n    <string>(c) by me</string>\n  </dict>\n</plist>\n'
  ...
# getFileList
not ok 27 figure out the right json
  ---
    operator: equal
    expected: 'test/fixtures/nwapp/package.json'
    actual:   'test\\fixtures\\nwapp\\package.json'
  ...
not ok 28 should be equivalent
  ---
    operator: deepEqual
    expected:
      [ { dest: 'images/imagefile.img', src: 'test/fixtures/nwapp/images/imagefile.img' }, { dest: 'index.html', src: 'test/fixtures/nwapp/index.html' }, { dest: 'javascript/bower_packages/simple/package.json', src: 'test/fixtures/nwapp/javascript/bower_packages/simple/package.json' }, { dest: 'javascript/jsfile.js', src: 'test/fixtures/nwapp/javascript/jsfile.js' }, { dest: 'node_modules/package/package.json', src: 'test/fixtures/nwapp/node_modules/package/package.json' }, { dest: 'package.json', src: 'test/fixtures/nwapp/package.json' } ]
    actual:
      [ { dest: 'images\\imagefile.img', src: 'test\\fixtures\\nwapp\\images\\imagefile.img' }, { dest: 'index.html', src: 'test\\fixtures\\nwapp\\index.html' }, { dest: 'javascript\\bower_packages\\simple\\package.json', src: 'test\\fixtures\\nwapp\\javascript\\bower_packages\\simple\\package.json' }, { dest: 'javascript\\jsfile.js', src: 'test\\fixtures\\nwapp\\javascript\\jsfile.js' }, { dest: 'node_modules\\package\\package.json', src: 'test\\fixtures\\nwapp\\node_modules\\package\\package.json' }, { dest: 'package.json', src: 'test\\fixtures\\nwapp\\package.json' } ]
  ...
ok 29 throw an error if there is no package json
ok 30 should be equal
not ok 31 should be equivalent
  ---
    operator: deepEqual
    expected:
      [ { dest: 'images/imagefile.img', src: 'test/fixtures/nwapp/images/imagefile.img' }, { dest: 'index.html', src: 'test/fixtures/nwapp/index.html' }, { dest: 'package.json', src: 'test/fixtures/nwapp/package.json' } ]
    actual:
      [ { dest: 'images\\imagefile.img', src: 'test\\fixtures\\nwapp\\images\\imagefile.img' }, { dest: 'index.html', src: 'test\\fixtures\\nwapp\\index.html' }, { dest: 'package.json', src: 'test\\fixtures\\nwapp\\package.json' } ]
  ...
# should zip the app and create the app.nw file + log it
ok 32 LOG: Zipping images/imagefile.img
ok 33 LOG: Zipping javascript/bower_packages/simple/package.json
ok 34 LOG: Zipping javascript/jsfile.js
ok 35 LOG: Zipping node_modules/package/package.json
ok 36 LOG: Zipping package.json
not ok 37 should be equivalent
  ---
    operator: deepEqual
    expected:
      [ 'images\\imagefile.img', 'javascript\\bower_packages\\simple\\package.json', 'javascript\\jsfile.js', 'node_modules\\package\\package.json', 'package.json' ]
    actual:
      [ 'images/imagefile.img', 'javascript/bower_packages/simple/package.json', 'javascript/jsfile.js', 'node_modules/package/package.json', 'package.json' ]
  ...
# mergeFiles
ok 38 merge two files
not ok 39 fix the permission
  ---
    operator: equal
    expected: '100755'
    actual:   '100666'
  ...
# getVersions
ok 40 should be equal
# matchVersions
ok 41 match all version
ok 42 should be equal
ok 43 should be equivalent

>1..43
# tests 43
# pass  34
# fail  9

@adam-lynch
Copy link
Contributor Author

  • Windows 8.
  • node 0.10.20
  • npm 1.3.11

@steffenmllr
Copy link
Contributor

You can either do:

  • npm install mllrsohn/node-webkit-builder
  • put the github url in you package json
  • `git clone [email protected]:mllrsohn/node-webkit-builder.git && cd node-webkit-builder && npm link``

to test it locally

@adam-lynch
Copy link
Contributor Author

Oh yeah of course.

It seems the same before though :/. It's not a problem with paths for sure since if I open the contents of the mac one, deep down inside of app.nw I see files I recognize.

@adam-lynch
Copy link
Contributor Author

It would be great to get the tests working on Windows btw... I'll try help make that happen

@steffenmllr
Copy link
Contributor

be my guest :) I only tried the cli version on windows with the exmaple folder - worked fine on a win7 vitrualbox

@steffenmllr
Copy link
Contributor

@adam-lynch any success getting the tests pass in windows? The build is working for me on windows and I want to update the grunt version on monday. If the app is running on for you on windows pls close the PR and open another one for the tests :)

@adam-lynch
Copy link
Contributor Author

@steffenmllr no update on the tests. I'll create a separate PR when I get around to it.

The same thing is happening as far as I can see. I am installing the latest from GitHub.

Also, sometimes when re-running it, I get this error:

EPERM, operation not permitted '.....\dist\app_name_here\win'

And if I try to build for linux32, linux64 or linux, nothing is outputted; I just see mac and win directories. Even after I delete the cache and dist directories.

@adam-lynch
Copy link
Contributor Author

I've tried building on Mac OSX 10.9.1 for Windows, Mac and Linux.

  • Mac works.

  • Windows creates the same dummy executable as building on Windows does.

  • When trying to build for linux, I get the following (even after I delete the cache directory):

    ENOENT, no such file or directory '...../cache/0.9.1/linux32/nw'

@adam-lynch
Copy link
Contributor Author

Apologies, those tests on the Mac were with 0.0.1. With 0.0.2 the results are:

  • Mac works.
  • Same as above.
  • No linux directories created in my dist directory.

@steffenmllr
Copy link
Contributor

which windows operating system are you using? master build works for me on win7

@adam-lynch
Copy link
Contributor Author

Today, the tests were done by a colleague on Windows 7. Before now it was Windows 8.

@adam-lynch
Copy link
Contributor Author

Ok I can confirm building for Mac and building for Windows, on Windows, works. (With latest from GitHub).


I had this crazy problem(s) where it seemed like having custom/private modules' (which were stored outside of node_modules) dev-dependencies being in my _public (i.e. source directory for building) caused it to break. By break, I mean I got the dummy .exe. Also found other problems in third party stuff; installing [email protected] throws errors each time now (reverted to 0.8.6) and npm may have a bug in npm link and some other problems :). I mean this was even happening with the Grunt building. If any of this sounds familiar, let me know.


Anyway, it seems to work now fine except building for linux32 and linux64 do nothing, I'll create a separate issue.

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

No branches or pull requests

2 participants