自动嵌入在.NET可执行多个图标 [英] Automatically embed multiple icons in a .NET Executable

查看:296
本文介绍了自动嵌入在.NET可执行多个图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上有相同的问题,因为这个问题:嵌入WPF EXE多个图标

I basically have the same issue as this question: Embed multiple icons in WPF EXE

我的.NET 2.0 WinForms应用程序目前有这样当您单击更改图标,在资源管理器:

My .NET 2.0 WinForms application currently has this when you click "Change Icon" in explorer:

我想看看,并与一些黑客有关的建议在上述文章中,我得到这个方式:

What I would like to see, and with some hacking about as suggested by the above article I get this:

但到达那里所有的版本信息组装的过程中丢失。我需要保持的版本信息中的装配为我自动更新过程依赖于这个标识安装的应用程序版本。

However the process of getting there all of the version information for the assembly is lost. I need to maintain the Version Information in the assembly as my auto-update process relies on this to identify the installed version of the application.

我还通过构建一个持续集成过程中的应用,所以我会preFER不要有需要人工干预的任何步骤,所以这是可能以自动化的方式?

I also build the application through a continuous integration process so I would prefer not to have any steps that require manual intervention, so is this possible in an automated way?

推荐答案

我刚刚创建了一个简单的工具做正是这一点,而不必惹的.res文件。这是一个很小的工具,它可以为您生成后事件的一部分使用,并且可以在一个特定的文件夹中添加的所有图标文件到您的程序集。如果我们假设你有一个图标在您的主项目文件夹,文件夹,你可以添加以下生成后事件:

I've just created a simple tool to do exactly this without having to mess with .res files. It is a tiny utility which you can use as part of your Post-Build event and lets you add all icon files in a particular folder to your assembly. If we assume that you have a icons folder under your main project folder you can add the following post-build event:

C:\path\to\InsertIcons.exe $(TargetPath) $(ProjectDir)icons

一个进一步的说明和下载可以在<一个发现href="http://einaregilsson.com/add-multiple-icons-to-a-dotnet-application/">http://einaregilsson.com/add-multiple-icons-to-a-dotnet-application/

A further description and a download can be found at http://einaregilsson.com/add-multiple-icons-to-a-dotnet-application/

这篇关于自动嵌入在.NET可执行多个图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆