Include Image in Managed Burn BootstrapperApplicat

2019-07-11 19:58发布

I'm working on an installer with wix using Burn and a custom bootstrapper application. Everything works fine, but i fail to include a simple image into my application UI.

I include the Image into my UI like this:

<Image Source="logo.jpg" Height="100" HorizontalAlignment="Center"  Margin="0,0,0,20" VerticalAlignment="Center" Width="250"/>

It shows normal in the designer. I reduced the interface to nothing but the image to exclude other possible errors.

I also added the Image as a payload in the bundle

<Payload SourceFile="..\BootstrapperApplication\logo.jpg"/>

If i start the installer the file appears in the temp folder of the installation.

I tried different approaches like adding is as a static ressource, changing the build actions for the image but cant figure out how to do it right.

1条回答
再贱就再见
2楼-- · 2019-07-11 20:19

You can look at the WixBA source code to see how the WiX installer does it. It seems to embed the images as resources:

XAML:

<Image Grid.Row="0" Grid.Column="2" Source="resources\legal.png"/>

CSProj:

<ItemGroup>
  <Resource Include="Resources\exit.png" />
  <Resource Include="Resources\gear.png" />
  <Resource Include="Resources\legal.png" />
  <Resource Include="Resources\news.png" />
  <Resource Include="Resources\wrench.png" />
</ItemGroup>
查看更多
登录 后发表回答