1
votes

I have created myapp.exe (the version of app that runs directly on double clicking) by binary copying myapp's code into nw.exe. This myapp.exe runs with proper app icon in task bar.

However, when created installer through Inno Setup and then run the installed copy, it runs with default node webkits icon in taskbar.

Here is my script of Inno Setup:

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce

[Files]
Source: "src\myapp.exe"; DestDir: "{app}"
Source: "src\myapp_nw_app2.exe"; DestDir: "{app}"
Source: "supportive_app.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "supportive_app.bin"; DestDir: "{app}"; Flags: ignoreversion
Source: "supportive_app\Redist\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "src\Autorun.inf"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\credits.html"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\d3dcompiler_47.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\ffmpegsumo.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\icudtl.dat"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\nw.pak"; DestDir: "{app}"; Flags: ignoreversion
Source: "src\pdf.dll"; DestDir: "{app}"; Flags: ignoreversion

[Setup]
AlwaysShowComponentsList=False
AppName=MyApp
AppVersion=0.0.1
AppCopyright=MyApp Inc.
PrivilegesRequired=none
AppId={{123456-29F0-43E1-9785-D71234554DDF9}
TimeStampsInUTC=True
DefaultDirName=C:\MyFolder\MyApp
UsePreviousAppDir=False
DisableDirPage=yes
AllowUNCPath=False
ShowLanguageDialog=no
AppPublisher=MyApp Inc.
AppPublisherURL=http://www.myapp.com
MinVersion=0,5.01sp3
CreateUninstallRegKey=yes
SetupIconFile=C:\MyAppInstaller\src\app_icon.ico

[Run]
Filename: "{app}\supportive_app.exe"; Flags: nowait
Filename: "{app}\myapp.exe"; Flags: nowait postinstall

[Icons]
Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"; WorkingDir: "{app}";

Can anybody tell what am I missing here?

3
@MartinPrikryl I have already brought up my image to the root level of my app code. It still doesn't work. Thanks anyways!Sujit Singh

3 Answers

0
votes

I observed that the MyApp.exe which I created by binary merging my code with nw.exe, was having nw icon for file in explorer.

Through Resource Hacker (recommended by nw community itself), I changed that Icon to desired customized icon. Then I created the installer through Inno Setup and it started showing the same customized icon in taskbar when I run the installed copy of MyApp.exe.

Not sure if this is standard way for this problem. I would appreciate if someone can guide me on this.

Thanks!

0
votes

Yes, you’re meant to change NW.EXE’s icon with a program like Resource Hacker and the compile your program for the change to take effect. Inno setup then just zips all your stuff so it shouldn’t have any effect on your executables’ icon.

0
votes

For future visitors;

The app icon and the icon on the taskbar are different. As stated previously in nwjs community and answers, you can use tool like resource hacker to change the .ico of the executable. But the icon that shows on the taskbar is actually picked up by package.json which should just be a standard png.

"window": {
  "icon": "images/my-icon.png"
}