How to embed an image to the bootstrapper? #1400
Replies: 2 comments 1 reply
-
I could never manage to get WiX runtime to play nice with the runtime location of dependencies. So I took the matter into my own hands and simply embedded the resources via .NET resourcing mechanism: public BitmapImage Banner => Resource1.wixsharp_logo.ToImageSource(); <Image
Width="50"
Height="50"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Source="{Binding Banner}" /> See https://github.com/oleg-shilo/wixsharp/tree/wix-v3-master/Source/src/WixSharp.Samples/Wix%23%20Samples/Bootstrapper/WixBootstrapper_UI for details |
Beta Was this translation helpful? Give feedback.
-
Yep, with resources dictionaries it's harder to control the URI, that's why I dynamically load it from resources. You can also add the resource in the MSI and then extract it. But you still will need to have that bound image source property dynamically resolved in the code behind. I am sure there is a special value of For a simple single image I would go with embedded resources (resex or msi) but if your WPF is extensive then you will need to sort out your embedded resources URI. |
Beta Was this translation helpful? Give feedback.
-
When designing my custom UI for the bootstrapper, it looks alright. But when built and opened, the image doesn't show up.
As you can see in the XML, the image is placed in the solution, in a
Media
directory, and the PNG file is flagged asContent
.I tried to set
CopyToOutputDirectory
toAlways
, but didn't fix my problem.Do you have an idea why this is happening and how I can embed this image to the boostrapper?
Beta Was this translation helpful? Give feedback.
All reactions