简体   繁体   English

如何在设置项目中嵌入横幅图像和/或添加删除程序图标?

[英]How do I embed a banner image and or add remove programs icon in my setup project?

I'm using a setup project in visual studio 2010 to create an installer for a program I'm working on. 我正在Visual Studio 2010中使用安装项目来为我正在处理的程序创建安装程序。 I want to have a custom banner image in my setup as well as a custom icon in add remove programs. 我想在安装程序中添加自定义横幅图片,并在添加删除程序中添加自定义图标。

I've added both these images to the "Application Folder" of my installer and was able to get them to show up correctly. 我将这两个图像都添加到了安装程序的“应用程序文件夹”中,并能够使它们正确显示。 However, my program is not very big and only installs as an EXE and a few DLLs. 但是,我的程序不是很大,只能作为EXE和一些DLL安装。 So it seems a little silly to me that the 4th and 5th files that get "installed" are graphics only used during installation. 因此,对我来说,“安装”的第4个和第5个文件只是在安装过程中使用的图形,这似乎有点愚蠢。

Is there some way I can embed these images in the installer or one of my other projects? 有什么方法可以将这些映像嵌入安装程序或其他项目之一?

I'm currently using VS 2008 and just been playing around with the setup project. 我目前正在使用VS 2008,并且一直在使用安装项目。 I believe the following works - it did in my tests. 我相信以下作品-在我的测试中做到了。

  1. Select the setup project in the solution explorer window. 在解决方案资源管理器窗口中选择安装项目。
  2. Right click and select Add/File 右键单击并选择添加/文件
  3. Find your banner Image file and add it. 找到您的横幅图像文件并将其添加。

You will see that it's been added to the Application folder. 您将看到它已添加到“应用程序”文件夹中。

  1. Select the banner file in the application folder - or in the project list on the solution explorer. 在应用程序文件夹中或解决方案资源管理器上的项目列表中选择标题文件。
  2. Open the Properties Window 打开属性窗口
  3. On the properties set "EXCLUDE" to TRUE. 在属性上,将“ EXCLUDE”设置为TRUE。

When you set exclude to true you will see the banner file removed from application folder - but it will still be shown in the project tree - the icon will for the file will have a little red circle with a line through it. 当将exclude设置为true时,您将看到标题文件已从应用程序文件夹中删除-但仍将显示在项目树中-该文件的图标将带有一个红色小圆圈,并带有一条直线。

I've done this with both the banner and a custom icon and tested my install - worked fine with both and neither file showed up in the application folder. 我已经使用横幅和自定义图标完成了此操作,并测试了我的安装-两者都可以正常工作,并且文件都没有显示在应用程序文件夹中。

Hope this helps. 希望这可以帮助。

In the setup project properties you can put an image for the add/remove icon in the property AddRemoveProgramsIcon 在安装项目属性中,您可以在属性AddRemoveProgramsIcon放置用于添加/删除图标的图像。

For the banner image, right click on the setup project, View -> User Interface, click on the page you want, and then in the properties you want the BannerBitmap property. 对于标题图像,请右键单击安装项目,依次单击“视图”->“用户界面”,单击所需的页面,然后在所需的属性中单击BannerBitmap属性。

博客讨论了一种无需修改Visual Studio项目即可更改标题图像的方法。

If you want to change of the icon of the application EXE, then you just need to right click on the EXE and "create shortcut". 如果要更改应用程序EXE的图标,则只需右键单击EXE并单击“创建快捷方式”。 In the properties you will find the icon and you can change it. 在属性中,您将找到该图标,然后可以对其进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装我的应用程序后,在“添加/删除程序”中没有条目(我使用了安装项目) - There is no entry in Add/Remove Programs after installing my application (I used Setup project) 如何更改“添加或删除程序”中的图标 - How to change the icon in 'Add or Remove Programs' 如何在 c # setup 项目中嵌入客户端 ID? (从我的网站下载时) - How do I embed client id in the c # setup project? (while downloading it from my website) 如何在默认程序列表中添加我的应用程序 - How do I add my application in the Default Programs list 如何使用 VS2010 安装项目将我的程序添加到用户开始菜单? - How do I add my program to the users start menu with VS2010 Setup Project? 如何在项目设置中添加SQL Server数据库 - How can I add SQL Server Database in my project setup C# 如何将项目中的 jpeg 图像添加到图像数组 - C# How do I add a jpeg image that I have in my project to an image array 如何在Outlook中为自定义按钮添加图像图标 - How do I add an image icon for custom button in outlook 如何将表单的图标更改为自己的图像? - How do I change a form's icon to my own image? 如何在Windows Vista / 7的“默认程序”列表中添加我的应用程序? - How do I add my application in the Default Programs list of Windows Vista/7?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM