Visual Studio安装项目 - 使用exe文件图标安装快捷方式 [英] Visual Studio Setup Project - Use exe Icon for installed Shortcuts
问题描述
我有一个将被部署到客户端计算机与Visual Studio 2010的安装项目一个应用程序。 我的应用程序创建一个桌面快捷方式到主exe文件。
如果我打开快捷方式的属性,然后选择更改图标我看到,用于快捷方式的图标是一样的东西:
<$p$p><$c$c>%SystemRoot%\Installer\{5B821236-4F7A-4AC9-8BA6-441F456F12F0}\_83771230001D45618121E3.exe
Hoever,我想这是
%程序Files%\ MyCompany的\ MyApp的\ MyApp.exe的
或
%程序Files%\ MyCompany的\ MyApp的\ MyIcon.ico
有没有办法才达到的?
我已经使用JavaScript的PICE会修改我的设置在PostBuild步骤添加
DISABLEADVTSHORTCUTS = 1
在安装文件中的属性表。也许解决方案是相似的,但我不知道什么改变。
真正的问题似乎只创建低质量(48×48像素最大)图标,在安装项目中的错误,并已被证实由微软,但没有得到解决,直到现在。
请参阅<一href="http://connect.microsoft.com/VisualStudio/feedback/details/540424/setup-deployment-project-creates-poor-defaulticon-for-file-type" rel="nofollow">http://connect.microsoft.com/VisualStudio/feedback/details/540424/setup-deployment-project-creates-poor-defaulticon-for-file-type
您可以通过编辑* .msi文件与Orca的解决这个问题:
-
看那
快捷方式
表,找到桌面快捷方式,记得图标_
值。 -
转至图标表,至极包含entrys的名称和数据列。找到合适的图标,双击
[二进制数据]
输入和浏览您的高分辨率图标。
不幸的是,你必须要做到这一点,每次你重新安装项目,但至少你有一个很好的结果。如果我有一些空闲时间我会尝试的过程自动化和更新这个帖子。
I have a Application that is deployed to client machines with a Visual Studio 2010 Setup Project. My App creates a Desktop Shortcut to the main exe file.
If I open the shortcut's properties and choose "change icon" I see that the icon used for the shortcut is something like:
%SystemRoot%\Installer\{5B821236-4F7A-4AC9-8BA6-441F456F12F0}\_83771230001D45618121E3.exe
Hoever, I want it to be
%Program Files%\MyCompany\MyApp\MyApp.exe
or
%Program Files%\MyCompany\MyApp\MyIcon.ico
Is there a way to achive that?
I already use a pice of Javascript that modifies my setup in a PostBuild Step to add
DISABLEADVTSHORTCUTS = 1
to the properties table in the Setup file. Maybe the solution is similar, but I don't know what to change.
The real issue seems to be a bug in the Setup Project creating only low quality (48x48 px max) icons and has been confirmed by Microsoft but not been fixed until now.
You can fix this by editing the *.msi file with Orca:
Look at the
Shortcut
Table, find the Desktop Shortcut, remember theIcon_
value.Go to the Icon Table, wich contains entrys with a Name and a Data column. Locate the right Icon, Double Click the
[Binary Data]
entry and browse for your high resolution icon.
Unfortunatly you have to do this everytime you recreate the setup project, but at least you have a good result. If I have some spare time I will try to automate the process and update this post.
这篇关于Visual Studio安装项目 - 使用exe文件图标安装快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!