electron-userland / electron-wix-msi

:dvd: Create traditional MSI installers for your Electron app
MIT License
315 stars 91 forks source link

Can't set an icon #99

Open layaLils opened 3 years ago

layaLils commented 3 years ago

I am trying to set the path to the icon, like this: const msiCreator = new MSICreator({ . . . , iconPath: 'C:/path/to/electron_app/icon/image.ico', }); But when I execute the ''node build_installer.js'' command to build, I get an error in the console: Unable to extract icon from exe. Please provide an explicit icon via parameter. Error: Cannot find module 'exe-icon-extractor'. I don't know what it is, please, I need help

pichotweb commented 3 years ago

I also had this issue. I tries to set Iconpath, but look like it was ignored...

In windows, I was able to fix it by:

Installing Visual Studio Community from this link: https://visualstudio.microsoft.com/pt-br/downloads/

Then you install it, and you should also install the c++ libraries

image

after rebooting just install the 'exe-icon-extracter' package in your project path

npm i exe-icon-extractor --save-dev

You should be able to create your installer now.

mistermicheels commented 3 years ago

@bitdisaster I think the problem with exe-icon-extractor is that package.json for this module now refers to @bitdisaster/exe-icon-extractor but the code still refers to just exe-icon-extractor. See GitHub search result. I believe the problem was introduced in this commit.

That commit was made after the version bump to 3.0.3, which is the current version according to this repository's master branch. However, it seems it was somehow released to npm as version 3.0.4, which is now marked as @latest on npm.

mistermicheels commented 3 years ago

@layaLils @pichotweb Manually installing exe-icon-extractor indeed gets rid of the error, but exe-icon-extractor is still a fallback for the case where there is no custom app icon specified in options. It seems that, when specifying a custom icon in MSICreator options, you should use appIconPath instead of the iconPath that is mentioned in the README.

Seems like that part is actually a documentation bug.

royanon commented 3 years ago

@layaLils @pichotweb Manually installing exe-icon-extractor indeed gets rid of the error, but exe-icon-extractor is still a fallback for the case where there is no custom app icon specified in options. It seems that, when specifying a custom icon in MSICreator options, you should use appIconPath instead of the iconPath that is mentioned in the README.

Seems like that part is actually a documentation bug.

It work! Thank you very much!

AuracleTech commented 2 years ago

Thank you Seems like the module is missing by default

npm i exe-icon-extractor --save-dev
AlexHsu1987 commented 1 year ago

from the CREATOR.JS defination, find that ico path: " this.exe = options.exe.replace(/.exe$/, ''); this.icon = options.icon; this.extensions = options.extensions || []; this.lightSwitches = options.lightSwitches || []; "

XAbirHasan commented 10 months ago

I recently ran into this problem. Setting the explicit icon path as instructed in the electron-wix-msi configuration doc (https://github.com/electron-userland/electron-wix-msi#configuration) resolved my issue.

<img src="https://github.com/electron/forge/assets/67853959/e2373a26-a476-44cb-97dd-44df792a57c1" width="500">