diff --git a/templates/windows/resource/ApplicationMain.rc b/templates/windows/resource/ApplicationMain.rc index 2d12ca8ef6..23139f7fc4 100644 --- a/templates/windows/resource/ApplicationMain.rc +++ b/templates/windows/resource/ApplicationMain.rc @@ -1,5 +1,7 @@ #include "winres.h" +IDI_ICON1 ICON "ApplicationMain.ico" + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK VS_VERSION_INFO VERSIONINFO diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index e474b3c003..5de2d69585 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -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); @@ -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); - } } } }