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

rcedit.exe is not working on Windows #53

Closed
iamdriz opened this issue Jun 1, 2015 · 23 comments · Fixed by #467
Closed

rcedit.exe is not working on Windows #53

iamdriz opened this issue Jun 1, 2015 · 23 comments · Fixed by #467
Labels
bug 🐛 build-target:windows Bundling an Electron app specifically for Windows
Milestone

Comments

@iamdriz
Copy link

iamdriz commented Jun 1, 2015

I have the following options for my grunt task:

windowsBuild: {
    options: {
        name: 'Cameron',
        dir: 'app',
        out: 'dist',
        version: '0.25.3',
        platform: 'win32',
        arch: 'ia32',
        icon: 'icon.ico'
    }
}

but the icon isn't applied to the final dist app... I just get the default Electron icon.

The ico file is valid and at the specified location!

Tried on Windows 7.

@max-mapper
Copy link
Contributor

cc @sindresorhus

On Monday, June 1, 2015, iamdriz notifications@github.com wrote:

I have the following options for my grunt task:

windowsBuild: {
options: {
name: 'Cameron',
dir: 'app',
out: 'dist',
version: '0.25.3',
platform: 'win32',
arch: 'ia32',
icon: 'icon.ico'
}
}

but the icon isn't applied to the final dist app... I just get the default
Electron icon. The ico file is valid at at the specified location!

Tried on Windows 7.


Reply to this email directly or view it on GitHub
#53.

Sent from my phone

@Flet
Copy link

Flet commented Jun 1, 2015

Just for verification, rcedit.exe is available and in the path?
https://github.com/maxogden/electron-packager#building-windows-apps-from-non-windows-platforms

@iamdriz
Copy link
Author

iamdriz commented Jun 1, 2015

But I'm on a windows platform... That article says for building windows apps on non windows platforms.

Sent from my iPhone

On 1 Jun 2015, at 22:04, Dan Flettre notifications@github.com wrote:

Just for verification, rcedit.exe is available and in the path?
https://github.com/maxogden/electron-packager#building-windows-apps-from-non-windows-platforms


Reply to this email directly or view it on GitHub.

@max-mapper
Copy link
Contributor

@iamdriz you need it on any platform. I assumed it came with windows but I am probably mistaken (I don't test on windows, I rely on windows to fix issues like that). Can you see if you have rcedit.exe on your machine? If not, we'll have to add instructions on how to install it on windows to the readme

@junosuarez
Copy link
Contributor

@maxogden rcedit.exe is a tool made by the electron team for editing Windows executables... it does not come with Windows. We should update the readme!

@sindresorhus
Copy link
Contributor

But it does come with the node module rcedit that electron-packager depend on https://github.com/atom/node-rcedit/blob/master/bin/rcedit.exe

We should make sure everything is correct here: https://github.com/maxogden/electron-packager/blob/ac8aea014e04fa65a234f7398aca864f0524fecc/win32.js#L109 But I have a strong feeling it's something with rcedit.

@max-mapper
Copy link
Contributor

ah ok I figured it was some sort of minimal polyfill for non windows sytems

On Mon, Jun 1, 2015 at 3:14 PM, jden notifications@github.com wrote:

@maxogden https://github.com/maxogden rcedit.exe is a tool made by the
electron team for editing Windows executables... it does not come with
Windows. We should update the readme!


Reply to this email directly or view it on GitHub
#53 (comment)
.

@iamdriz
Copy link
Author

iamdriz commented Jun 2, 2015

Where should rcedit.exe live in relation to the Gruntfile.js? I've tried it at the same level but doesn't seem to have fixed the issue with the icon.

@junosuarez
Copy link
Contributor

@iamdriz when you npm install electron-packager, you should have (relative to the package path) node_modules/rcedit/bin/rcedit.exe

@iamdriz
Copy link
Author

iamdriz commented Jun 2, 2015

And where does this come from? And by relative you mean it's a node module inside the electron-packager folder.

Sent from my iPhone

On 2 Jun 2015, at 17:31, jden notifications@github.com wrote:

@iamdriz when you npm install electron-packager, you should have (relative to the package path) node_modules/rcedit/bin/rcedit.exe


Reply to this email directly or view it on GitHub.

@junosuarez
Copy link
Contributor

Yes, it is distributed in the rcedit npm package

@iamdriz
Copy link
Author

iamdriz commented Jun 4, 2015

Okay I installed rcedit next to electron-packager but the icon is only viewable in the Windows Explorer preview bar and not on the window itself, the taskbar, or the actual file. Manually running rcedit and grunt-rcedit solves this and correctly applies the icon. So it seems that the packager isn't running rcedit properly nor does it use the other built-in features as changing copyright info etc.

@mhkeller
Copy link

mhkeller commented Jul 6, 2015

I'm also running into an issue of the icon not being set but I'm on os x. Here's the command I'm running:

electron-packager ./ NewsLynx --platform=darwin --arch=x64 --version=0.28.1 --icon=merlynne.ico --prune

When it builds, it seems to flash to the default Electron icon from another state. This could be the custom icon or the default "Paper and pencils" os x icon.

Are there any file size / type / dimension restrictions to be aware of? I've tried it with png, ico and icns.

@malept
Copy link
Member

malept commented Jul 6, 2015

@mhkeller I think your problem is different, this is Windows-specific. The OSX app requires an icns file.

@malept malept changed the title Icon not applied Icon not applied on Windows builds Jul 6, 2015
@IronGeek
Copy link

IronGeek commented Jul 7, 2015

Hi,
Just trying to share my experience here as I just had the same issue today with a fresh Windows 8.1 64-bit installation.

The electron-packager does not throw any error, everything seems fine, yet the icon is not applied to final output. But when I try to run the rcedit directly... well, That's when I was greeted with this error message:

2015-07-07_19-09-46

It seems rcedit require VC++ 2010 redistributable components to run, Visual C++ 2010 Redistributable Package (x86) to be exact. I installed the x64 version first and learn it the hard way... 😫

@malept malept added bug 🐛 build-target:windows Bundling an Electron app specifically for Windows help wanted Needs a contributor from the community labels Oct 23, 2015
@kethinov
Copy link

👍 thanks @IronGeek I was seeing the same error when manually running rcedit.exe as well, however even after installing the VC++ dependency, rcedit still does not correctly apply the icon to my app.

When I run the same command to build my app for Windows from an OS X dev environment, rcedit runs correctly, so there is obviously still something screwy going on on my Windows dev env... 😕

@coclav
Copy link

coclav commented Nov 23, 2015

I have been struggling all day long with this issue without success. Once I had fixed the MSVCP100.dll issue, the next one was The application was unable to start correctly (0xc000007b)

image

and I gave up at this stage :(

I went for Resource Hacker which seemed to work so fare

here is my script. Do that before signing and putting it in installer

[FILENAMES]
     Exe=    "c:\path\to\exe\before\yourElectronApp.exe"
     SaveAs= "c:\bla\bla\YourElectronAPpWithCoolIcons.exe"
[COMMANDS]
     -addoverwrite "path\to\icon.ico", ICONGROUP,1,

@max-mapper max-mapper changed the title Icon not applied on Windows builds rcedit.exe is not working on Windows Nov 23, 2015
@wearhere
Copy link

Some details about my failing environment and I how I fixed it, largely confirming @IronGeek's and @kethinov's posts:

  • I'm running electron-packager in Windows 8. Here, I was seeing electron-packager silently fail to edit the icon
    • though I was seeing rcedit errors when trying to run grunt-electron-installer.
  • When running electron-packager in OS X 10.10.5 (with Wine), it succeeded in editing the icon.
  • When I installed the VC++ 2010 components linked by @IronGeek, then electron-packager succeeded in editing the icon in Windows 8.
  • My coworker was able to successfully edit the icon without installing anything in Windows 10.

So, perhaps this is just fixed by updating to the latest VC++ toolchain? Though I know that didn't quite work for @kethinov.

@dhildebrandt
Copy link

I am very grateful for this thread, which walked me all the way through up to getting the application having our customized icon. For reference:

  • Running Windows 10
  • Added RCEDIT into the path
  • installed VC+2010 components

Now I'm working on why the desktop shortcut that points to the correctly iconified application is still itself Electron's icon. If I figure it out I'll report back to this thread.

@dhildebrandt
Copy link

In the Properties of the shortcut, one can select the icon from among those in the exe. n.b. this is the Windows dialog. I changed it to the one my app presented (the customized one). I changed no code. In future runs of rebuilds of the installer, the shortcut was installed with the correct customized icon. Registry madness?

@malept
Copy link
Member

malept commented Apr 12, 2016

It's been a while since I've dealt with Windows, but I thought desktop shortcuts defaulted to the icon of the .exe. It shouldn't affect other desktop shortcuts or especially the original executable's icon. Perhaps some weird icon caching was happening?

@dhildebrandt
Copy link

I have an earlier snapshot of the VM I am using; perhaps I can fork the VM from there and see if I can replicate the issue.

@junosuarez
Copy link
Contributor

Windows shortcut icons default to the default app icon, but they can also be set to any icon resource, e.g., another icon resource embedded in the target executable or an icon resource in a dll. I know there are ways to change this programmatically, a super quick search brings up https://blogs.technet.microsoft.com/heyscriptingguy/2005/08/12/how-can-i-change-the-icon-for-an-existing-shortcut/ - hope this helps point in the right direction!

@malept malept added this to the 8.0.0 milestone Aug 24, 2016
@malept malept removed the help wanted Needs a contributor from the community label Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 build-target:windows Bundling an Electron app specifically for Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.