evshiron/node-resourcehacker

Making exe corrupt

Opened this issue · 1 comments

require("openurl").open("http://www.google.com");

This is code in app.js - used pkg for creating app.exe and running below code for changing icon
Output - creates new app.exe with icon but make it invalid

const resourceHacker = require('node-resourcehacker');

// Use the beta release of Resource Hacker.
process.env['SOURCE_RESOURCE_HACKER'] = 'http://www.angusj.com/resourcehacker/resource_hacker.zip';

// Use a local Resource Hacker archive.
//process.env['SOURCE_RESOURCE_HACKER'] = '~/Downloads/resource_hacker.zip';

resourceHacker({
operation: 'addoverwrite',
input: 'app.exe',
output: 'app_blue.exe',
resource: 'blue.ico',
resourceType: 'ICONGROUP',
resourceName: 'IDR_MAINFRAME',
}, (err) => {

if (err) {
    return console.error(err);
}

console.log('Done.');

});

Please let me know if I am doing any step wrong.

It is opening and closing the window in millisec so cannot see error. it is related to identifier i guess so

You're probably using an iconset with different dimensions than the original on the executable (thus corrupting the binary). Take a look at this issue (read the last comment by "KingRial") for more details and the exact dimensions to use.