Wix:Progressbar的ImageFile属性不起作用

时间:2013-04-19 09:22:43

标签: wix

在我的安装项目中,我想自定义Progressbar并给它一个不同的颜色。我使用默认主题xml。这是我修改的进度页面:

<Page Name="Progress">
    <Image X="11" Y="20" Width="485" Height="300" ImageFile="logo.png" Visible="yes"/>
    <Text X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Text>
    <Text X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Text>
    <Text Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Text>
    <Progressbar ImageFile=".\test.bmp" Name="OverallCalculatedProgressbar" X="21" Y="168" Width="-21" Height="33" />
    <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="85" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
</Page>

在Progressbar标记中,我添加了ImageFile属性。 test.bmp文件与theme.xml位于同一目录中。 ImageFile帮助说明如下:

  

控件图像文件的相对路径。图像必须是4像素宽:左边的像素是进度条的左边,左边的中间像素是进度使用的,右边的中间像素是未使用的,右边的像素是进度条的右边。与ImageResource和SourceX以及SourceY属性互斥。

bmp 4像素宽(所有像素都是黑色),但进度条仍然是默认的窗口颜色(带有Aero的Win7:绿色)。我既不使用ImageResource也不使用SourceX和SourceY属性(如文档所要求的那样)。

任何人都可以帮我吗?我错过了什么,还是我误解了什么?

1 个答案:

答案 0 :(得分:2)

thmutil很可能无法加载.\test.bmp。很可能文件丢失了。如果无法加载该文件,它将以静默方式跳过该故障,并将恢复为系统进度条。

为确保找到.\test.bmp,我建议先从.\路径中删除,然后确保该文件包含在Payload BootstrapperApplication中元件。例如:

<Bundle ...>
   <BootstrapperApplication SourceFile='path\to\ba.dll'>
      <Payload SourceFile='path\to\custom.thm' />
      <Payload SourceFile='path\to\test.bmp' />
   </BoostrapperApplication>
</Bundle>

这会将文件test.bmp添加到BootstrapperApplication有效负载列表中。如果您使用的是wixstdba,它看起来更像是:

<Bundle ...>
   <BootstrapperApplicationRef Id='WixStandardBootstrapperApplication.RtfLicense'>
      <bal:WixStandardBootstrapperApplication ThemeFile='path\to\custom.thm' />
      <Payload SourceFile='path\to\test.bmp' />
   </BoostrapperApplication>
</Bundle>
相关问题