Open astrO1 opened 3 years ago
Hey @astrO1,
I'm not Mikael but I will try to at least solve one of you're problems.
Because I have no clue about the timing issue I am trying my luck on explaining the icon problem to you.
When you use your electron app in "Production" (or pack it, how you would prefer it) it creates an App.asar which is the actual file that will be called by you're electron app (Production version). Since this file doesn't just include your main electron files but also most of your npm packages and other stuff the calling of this file is handled in a specific way. I will not explain that deep how this file actually works. all you need to know is that when you are using you're app in production mode the variable of "__dirname" changes and so does the folder.
But don't worry.
There are 2 possible solutions to this project.
The first one is that you could export you're icon files or image files separately. Just look at the documentation or google for it. Surely you will find something by searching for "electron packager separate image files" What happens is that you are saying to electron-packager it should export your image files in a folder that is located in the same directory as the asar file.
And here we come to my second solution: Putting the file/folder manually in the right directory. The error actually should say that it can't find the image file in the folder where the .asar file is located so you simply have to search this folder and but in you're image manually (a little trick to find that path: just write a code that prints out the value of "__dirname" and run it in production mode so you should see where the folder is located). This should work somehow.
However, as I said I am sorry that I don't know enough to help you with you're second problem but maybe it will work by fixing the first problem.
Anyway: I wish you the best of luck and have fun coding 😉
Max
Hi Mikael,
First of all, I want to thank you from the bottom of my heart for this amazing tool, it saves my life on my project.
Thank you and thank you again.
I'm facing 2 small problems, is that I can put on my development on electron this icon with no problem but in production, I don't know why it doesn't show, here is my code on main.ts
icon: path.join(__dirname, 'mp_notification_icon.png')
This path is the root of my project, where the main.ts is. This works on development but not in production any help? What I'm doing wrong.
And another small problem is the "wait and time" attribute it seems that it doesn't work, my notification duration is only 5 seconds, and the notification only stops if I put the mouse over it.
What I can do to solve this problem?