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

Possible to use a local file for iconUrl instead of an actual Url? #151

Closed
Sunyang730 opened this issue Dec 2, 2016 · 10 comments
Closed

Comments

@Sunyang730
Copy link

Hi,

I can get it working on my build system, but when installed by other users the add & remove program does not show the icon. I believe this is due to the icon does not pack with the installer?

I see that I can add with the nuspectemplate. Possible to add the icon as a content file and use that instead?

@Thomas101
Copy link

I was wondering the same thing -- just came up against the same issue

@develar
Copy link
Contributor

develar commented Jul 13, 2017

@Thomas101 electron-builder supports NSIS to produce windows installer and no such strange nupkg requirements.

@ghost
Copy link

ghost commented Oct 26, 2017

This is still an issue. You can work around this by using an file:// URL and point to the .ico file.
But there is no chance to use this relative to the project, so the file:// URL must be absolute and this is a no go when using the project on different development environements.

@MarshallOfSound
Copy link
Member

This is a requirement upstream (nupkg) and electron/windows-installer cannot change this requirement. Simply statically hosting your icon in a GH release or on S3 would work and be quite easy 👍

@mix3d
Copy link
Contributor

mix3d commented Jun 24, 2020

Static hosting of Icon does not work when installing offline or in private networks.

Looks like with the latest versions of NuGet this has been fixed (v5.3, August 2019), and they support locally bundled icons:
NuGet/Home#352 (comment)

Please reopen this and add support for local files!

@ThomasStubbe
Copy link

Won't this work?

iconUrl: "file://" + __dirname + "/resources/icon.ico",

@mix3d
Copy link
Contributor

mix3d commented Jun 25, 2020

No it does not. You get build errors:

The 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd:iconUrl' element is invalid - The value 'file://./assets/app.ico' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:anyURI' - The string 'file://./assets/app.ico' is not a valid Uri value.

Even if it could work, the file URL would have to be relative to the installation exe, since the icon file itself is not bundled, and the icon is requested during installation time.

@mor-o
Copy link

mor-o commented Nov 24, 2022

can we reopen this? this is still an issue on private networks with no access to the internet

@Volburt7
Copy link

Volburt7 commented Jan 25, 2024

Won't this work?

iconUrl: "file://" + __dirname + "/resources/icon.ico",

Well this worked for me to a certain extend. This made that the icon inside "Programs and Features" is the correct one.

Desktop Shortcut and App Icon seem to continue not to be shown correctly, but apparently it is a caching issue with Windows since I somehow managed to fix it once by deleting this file and restarting the pc C:\Users\%username%\AppData\Local\IconCache.db.
However I was not able to reproduce it again..

@duonghn
Copy link

duonghn commented Jun 12, 2024

@Volburt7 which Windows are using to build the setup? The file:// worked by me with Win11 but not with Windows 10. 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

9 participants