Search code examples
wixngen

How to change the text shown while NGen is running in a WiX MSI package


We are using NGen during installation to optimize startup time of our application.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  ...
  <File Id="File.$(var.ProjectName.TargetName).exe" Source="$(var.ProjectName.TargetPath)" KeyPath="yes">
    <netfx:NativeImage Id="ngen.File.$(var.ProjectName.TargetName)" Platform="$(var.NgenPlatform)" Priority="0" AppBaseDirectory="INSTALLLOCATION"/>
  </File>
  ...
</Wix>

While installing the resulting MSI the step "removing backup files" took extremely long time compared to other steps. Digging into it we found out that the NGen is running at that time.

How could we write something else there, like "we are now saving lots of time for you later on every startup of your application"?


Solution

  • This is discussed already as a feature request here. You may move the ngen activities to the background as discussed here.

    Another option is to change the text of the "removing backup files" label by replacing the action text for the InstallFinalize action:

    <UI>
      <ProgressText Action="InstallFinalize">Speeding up your application beforehand :)</ProgressText>
    </UI>