I've got a Wix Managed Bootstrapper Application written in WPF.
After a certain change was made, the bootstrapper no longer works: When I run the WPF project without the Bootstrapper it runs fine (UI shows at least). But when I run the Bootstrapper itself it opens an empty (black background) window that just sits there and does nothing.
The breaking change seems to be moving the main view MainView.xaml
into a View
subfolder. Of course even with this change the WPF project itself still runs fine, but just the Bootstrapper is broken as mentioned.
I did some searching and the closest info I could find was this http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Visual-Styles-in-Wix-BA-td7584971.html where the suggestions included:
1) use pack://application:,,,
i.e absolute paths for all resources: I tried this but it did not fix my issue
2) add the extra files as Payload elements: This seems to only apply for non-embedded resources so it doesn't apply to me
3) Add Application.ResourceAssembly = typeof(MainWindow).Assembly;
to the Bootstrapper: I don't know what this does and I don't know where to add it so I haven't tried it.
How can I fix this issue?
Additional info: The breaking change: I moved the my MainView
XAML file from the root directory of the WPF application to a subfolder named View
. I moved several ResourceDictionary
XAML files from /View/
to /View/Dictionaries/
. I used absolute paths to access these moved XAML files, something like:
<ResourceDictionary Source="WindowStyle.xaml" />
was changed to
<ResourceDictionary Source="/View/Dictionaries/WindowStyle.xaml" />
Note that the absolute paths I used started with a slash, but did not start with pack://application:,,,
.
Image resources: In case it is relevant, any images I had were placed in the Resources
folder, with their properties Build action = Resource
and Copy to output directory = Do not copy
. I used the images like this:
<Image Source="/Resources/logo.png" VerticalAlignment="Center" Width="75" Height="25" />