使用Inno Setup忽略启动屏幕切片的.VisualElementsManifest.xml

时间:2014-01-15 18:08:33

标签: windows-8 inno-setup desktop-shortcut

我正在使用Inno Setup为我的应用创建安装程序。 使用[图标]在Windows 8启动屏幕上创建快捷方式正常。 但现在我想使用VisualElementsManifest自定义磁贴。

我相信我遵循了以下所有步骤:“如何自定义桌面应用的启动屏幕图块” http://msdn.microsoft.com/en-us/library/windows/apps/dn393983.aspx#create_the_customization_xml_file

但是,当我编译安装程序并运行它时,将忽略VisualElementsManifest。 磁贴显示在开始屏幕上,其中包含Inno Setup iss文件(IconFilename)中定义的常规图标。

以下步骤为MyApp.exe创建自定义磁贴:

<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <VisualElements
        BackgroundColor="#E82C2A"
        ShowNameOnSquare150x150Logo="off"
        ForegroundText="light"
        Square150x150Logo="logo.MyApp.150x150.png"
        Square70x70Logo="logo.MyApp.70x70.png"/>
</Application>

文件保存为MyApp.visualelementsmanifest.xml,与MyApp.exe保存在同一目录中。

配置Inno设置:

[Setup]
AppName=MyApp
AppVersion=0.1
DefaultDirName={pf}\MyApp
SetupIconFile=MyApp.ico

[Files]
Source: "MyApp.exe"; DestDir: "{app}"
Source: "MyApp.exe.manifest"; DestDir: "{app}"
Source: "MyApp.ico"; DestDir: "{app}"
Source: "logo.MyApp.150x150.png"; DestDir: "{app}"
Source: "logo.MyApp.70x70.png"; DestDir: "{app}"
Source: "MyApp.visualelementsmanifest.xml"; DestDir: "{app}"

[Icons]
Name: "{group}\appfolder\MyApp"; Filename: "{app}\MyApp.exe";
Name: "{commonprograms}\MyApp"; Filename: "{app}\MyApp.exe";
Name: "{commondesktop}\MyApp"; Filename: "{app}\MyApp.exe";

编译安装程序并运行它..没有运气。

1 个答案:

答案 0 :(得分:2)

我使用了customization XML file以下内容(这是链接文章中显示的必要最低要求):

<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <VisualElements
        BackgroundColor="#FF0000"
        ShowNameOnSquare150x150Logo="on"
        ForegroundText="light"/>
</Application>

并将其保存为MyProg.visualelementsmanifest.xml,因为我要安装的程序是MyProg.exe(我使用了Inno Setup的Examples子文件夹中的那个但是没关系;这里很重要根据该可执行文件命名XML文件。我的脚本看起来像这样(再次,只是必要的最小值):

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Files]
Source: "MyProg.exe"; DestDir: "{app}"
Source: "MyProg.visualelementsmanifest.xml"; DestDir: "{app}"

[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"

我已经在Windows 8.1 Enterprise 64位(在虚拟机上运行)上进行了测试,它按预期工作。我已经检查了 Apps 屏幕以及 Start 屏幕(如果您在 Apps Pin to Start 选项) >屏幕)。甚至更新按预期工作,因此尝试从这个最小值构建您的设置(检查XML文件是否具有我在此处使用的最小属性,并检查XML文件的名称是否等于预期模式)。