Domanda

I have Wix Burn Custom installer using ManagedBootstrapperApplicationHost. What I want to do is, have a splash screen, with Version No. Now I don't want to change splash screen image everytime i update the installation. I would like it to have a version No what i have set in bundle.

How can I achieve same, do i have to create my own window with image and manage the splashscreen ? or is there any other way ?

È stato utile?

Soluzione

Now I don't want to change splash screen image everytime i update the installation.

I agree that it should be done programmatically. To me, it is important that end-users have a single version label to refer to when managing their software configuration or reporting issues. And, following the DRY principle, that means during the build there is only one place that it should be drawn from.

But, since different development and deployment tools and resources, including splash screens, need different formats, I find it worthwhile to invest in build steps to create or update the places where the version is needed. For splash screens, Imagemagick can draw text on images. Using MsBuild (e.g., via your bootstrapper .wixproj file), you can extract the version from your Bundle and draw it on your splash screen before the bundle is built.

<Target Name="StampProjectFilesWithVersion" BeforeTargets="Compile">
  <XmlPeek Namespaces="&lt;Namespace Prefix='wi' Uri='http://schemas.microsoft.com/wix/2006/wi'/&gt;" XmlInputPath="Bundle.wxs" Query="/wi:Wix/wi:Bundle/@Version">
    <Output TaskParameter="Result" ItemName="BundleVersion" />
  </XmlPeek>
  <XmlPeek Namespaces="&lt;Namespace Prefix='wi' Uri='http://schemas.microsoft.com/wix/2006/wi'/&gt;" XmlInputPath="Bundle.wxs" Query="/wi:Wix/wi:Bundle/@Name">
    <Output TaskParameter="Result" ItemName="BundleName" />
  </XmlPeek>
  <Message Text="@(BundleName) @(BundleVersion)" />
  <Exec Command="tools\imagemagick\convert ^
       splash-template.bmp ^
       -pointsize 18 ^
       -draw &quot;text 100,300 'Version @(BundleVersion)'&quot; ^
       -pointsize 24 ^
       -draw &quot;text 100,260 '@(BundleName)'&quot; ^
       bmp3:splash.bmp" />
</Target>

Obviously, you should extract the version from whatever source makes sense in your project.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top