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

Windows app icon #19

Closed
adam-lynch opened this issue May 28, 2014 · 14 comments
Closed

Windows app icon #19

adam-lynch opened this issue May 28, 2014 · 14 comments

Comments

@adam-lynch
Copy link
Contributor

Passing a winIco breaks things. I get the dummy "node webkit" (in ascii art) app. macIcns works fine.

@steffenmllr
Copy link
Contributor

#1

@adam-lynch
Copy link
Contributor Author

FYI, I created the icon using icon fx. I assume that's fine

@SamyPesse
Copy link
Contributor

Which version of node-webkit are you using?

Because we got this bug two days ago on windows, and then we changed the version of node-webkit and it's working fine (we didn't linked this issue to the ico but maybe it's this).

@adam-lynch
Copy link
Contributor Author

@SamyPesse 0.9.2. Well, 0.9.2-4 from npm but 0.9.2 is passed as the version for node-webkit-builder.

@SamyPesse
Copy link
Contributor

Please, test using 0.8.5

@adam-lynch
Copy link
Contributor Author

Ok, that took forever. It's the same with 0.8.5 (locally, globally and passed to node-webkit-builder). Dummy app but if I take out the winIco, then it's fine.

@SamyPesse, anything else you want me to try before I update back to 0.9.2-4?

@adam-lynch
Copy link
Contributor Author

Waaait. It's correct in the taskbar (although very blurry, maybe that's icon fx's fault). The .exe has the default icon still though.

@dufferzafar
Copy link

@adam-lynch I am having the exact same issue. The .exe shows the default node webkit icon and if I remove the winIco part, it works fine.

I am using the node-webkit-builder from a gulp task. Here is the gulpy output.

[gulp] Using gulpfile D:\Github\social-notifs\gulpfile.js
[gulp] Starting 'copy-js'...
[gulp] Starting 'copy-css'...
[gulp] Starting 'copy-app'...
[gulp] Starting 'clean-release'...
[gulp] Finished 'copy-app' after 102 ms
[gulp] Finished 'copy-css' after 105 ms
[gulp] Finished 'copy-js' after 114 ms
[gulp] Starting 'copy'...
[gulp] Finished 'copy' after 5.75 μs
[gulp] Finished 'clean-release' after 103 ms
[gulp] Starting 'build-nw'...
[gulp] Finished 'build-nw' after 11 ms
[gulp] Starting 'build'...
[gulp] Finished 'build' after 5.34 μs
[gulp] Starting 'default'...
[gulp] Finished 'default' after 6.16 μs
Using v0.9.1
Create cache folder in D:\Github\social-notifs\build\cache\0.9.1
Using cache for: win
Create release folder in D:\Github\social-notifs\build\release\Social-Notifs\win
Update executable icon
{ name: 'RejectionError',
  message: 'Fatal error: Unable to load file\r\n',
  cause: 
   [Error: Fatal error: Unable to load file
   ],
  stack: 'Error: Fatal error: Unable to load file\r\n\n    at maybeWrapAsError (D:\\Github\\social-notifs\\node_modules\\node-webkit-builder\\node_modules\\bluebird\\js\\main\\util.js:127:12)\n    at PromiseResolver$_callback (D:\\Github\\social-notifs\\node_modules\\node-webkit-builder\\node_modules\\bluebird\\js\\main\\promise_resolver.js:55:48)\n    at ChildProcess.<anonymous> (D:\\Github\\social-notifs\\node_modules\\node-webkit-builder\\node_modules\\rcedit\\lib\\rcedit.js:51:16)\n    at ChildProcess.EventEmitter.emit (events.js:98:17)\n    at maybeClose (child_process.js:735:16)\n    at Process.ChildProcess._handle.onexit (child_process.js:802:5)' }

and here is my gulp file:

var gulp = require('gulp'),
    gutil = require('gulp-util'),
    flatten = require('gulp-flatten'),
    rimraf = require('rimraf'),
    exec = require('child_process').spawn,
    NwBuilder = require('node-webkit-builder');

gulp.task('copy-js', function () {
    return gulp.src('vendor/**/*.min.js')
        .pipe(flatten())
        .pipe(gulp.dest('./build/src/js'));
});

gulp.task('copy-css', function () {
    return gulp.src('vendor/**/*.min.css')
        .pipe(flatten())
        .pipe(gulp.dest('./build/src/css'));
});

gulp.task('copy-app', function () {
    return gulp.src(['app/**', 'package.json'])
        .pipe(gulp.dest('./build/src'));
});

gulp.task('copy', ['copy-js', 'copy-css', 'copy-app']);

gulp.task('clean-release', function (cb) {
    rimraf('./build/release', cb);
});

gulp.task('build-nw', ['copy', 'clean-release'], function () {
    var nw = new NwBuilder({
        platforms: ['win'],
        files: 'build/src/**',
        winIco: 'build/src/ico/main.ico',
        buildDir: 'build/release',
        cacheDir: 'build/cache'
    });

    // Log stuff you want
    nw.on('log', function (msg) {
        // Ignore 'Zipping... messages
        if (msg.indexOf('Zipping') !== 0)
            console.log(msg)
    });

    // nw.build();

    // Build retruns a promise
    nw.build().then(function () {
       console.log('All Done!');
    }).catch(function (error) {
        console.error(error);
    });
});

gulp.task('run', function () {
    exec('D:\\Github\\social-notifs\\build\\release\\Social-Notifs\\win\\nw.exe')
});

gulp.task('build', ['build-nw']);

gulp.task('default', ['build']);

@dufferzafar
Copy link

This is unrelated to the issue, but currently when I build a release it goes into the release\social-notifs\win. Shouldn't the buildDir option put the files in the release\win folder itself? I mean, what's the point in having so deep folder structure?

@aecc
Copy link

aecc commented Jul 16, 2014

I still have problems with winIco, is it fixed?

@gabepaez
Copy link
Contributor

gabepaez commented Aug 1, 2014

winIco is working. One note is that if you are on Mac or Linux you need to have Wine installed for it to work properly. This is a requirement created by the rcedit module being used to modify the exe resources. I added some error handling and documentation surrounding this here ef7d006

@gabepaez gabepaez closed this as completed Aug 1, 2014
@adam-lynch
Copy link
Contributor Author

@gabepaez that should probably be noted somewhere

@gabepaez
Copy link
Contributor

gabepaez commented Aug 1, 2014

@adam-lynch I added it to the Readme for this project here ef7d006

@adam-lynch
Copy link
Contributor Author

I've been crazy busy but I just built on Windows using this param and it worked great. Thanks 👍

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

6 participants