Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions templates/windows/resource/ApplicationMain.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "winres.h"

IDI_ICON1 ICON "ApplicationMain.ico"

LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK

VS_VERSION_INFO VERSIONINFO
Expand Down
13 changes: 5 additions & 8 deletions tools/platforms/WindowsPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ class WindowsPlatform extends PlatformTarget

if (noOutput) return;

IconHelper.createWindowsIcon(icons, Path.combine(targetDirectory + "/obj", "ApplicationMain.ico"));

CPPHelper.compile(project, targetDirectory + "/obj", flags);

System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath);
Expand Down Expand Up @@ -617,19 +619,14 @@ class WindowsPlatform extends PlatformTarget

if (noOutput) return;

IconHelper.createWindowsIcon(icons, Path.combine(targetDirectory + "/obj", "ApplicationMain.ico"));

CPPHelper.compile(project, targetDirectory + "/obj", flags.concat(["-Dstatic_link"]));

CPPHelper.compile(project, targetDirectory + "/obj", flags, "BuildMain.xml");

System.copyFile(targetDirectory + "/obj/Main" + (project.debug ? "-debug" : "") + ".exe", executablePath);
}

var iconPath = Path.combine(applicationDirectory, "icon.ico");

if (IconHelper.createWindowsIcon(icons, iconPath) && System.hostPlatform == WINDOWS)
{
var templates = [Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)) + "/templates"].concat(project.templatePaths);
System.runCommand("", System.findTemplate(templates, "bin/ReplaceVistaIcon.exe"), [executablePath, iconPath, "1"], true, true);
}
}
}
}
Expand Down