Include Image in Managed Burn BootstrapperApplication

强颜欢笑 提交于 2019-12-11 02:36:02

问题


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:


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>


来源:https://stackoverflow.com/questions/25122005/include-image-in-managed-burn-bootstrapperapplication

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!