问题
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