﻿Um die gesamte Heat Datei neu zu erzeugen, nachfolgendes Kommando als ein PostBuild Event beim Projekt "Centron.WPF.UI" hinterlegen und Installer neu erzeugen. Nachfolgende Schritte nicht vergessen!

ACHTUNG: Vorgang darf nur durchgeführt werden, wenn Ausgabeverzeichnis dem "Release"-Verzeichnis entspricht. Ansonsten kommt zu viel in den Installer!!

Schritt 1: Über heat.exe die Referenzen der Applikation erneuern
"$(WiX)bin\heat.exe" dir "$(SolutionDir)Centron.Host.WindowsService\bin\$(Configuration)" -dr APPLICATIONFOLDER -cg WebServiceProductComponentsHeat -gg -g1 -sf -srd -sreg -scom -var "var.Centron.Host.WindowsService.TargetDir" -out "$(SolutionDir)WebServiceSetupProject\WebServiceProductHeat.wxs"

Schritt 2: Heat Datei öffnen

Schritt 3: Namespace für ngen hinzufügen:
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"

Beispiel: 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">

Schritt 4: ngen auf die Centron.Host.WindowsService.exe einstellen
- Die Datei öffnen und folgende Zeile einfügen:
<netfx:NativeImage Id="ngen_fil04C6E9A1324A0A1878612A211EC8F58D" Dependencies="yes" Platform="64bit" Priority="0" />

Beispiel:
            <Component Id="cmp54AD61A14FF27242E8B736BEDD206569" Directory="APPLICATIONFOLDER" Guid="59E9BDB6-A752-49B9-A2A6-DB10C1F4BD4B">
              <File Id="fil04C6E9A1324A0A1878612A211EC8F58D" KeyPath="yes" Source="$(var.Centron.Host.WindowsService.TargetDir)\Centron.Host.WindowsService.exe">
				<!-- Do not specify AppBaseDirectory here because ngen.exe will figure it out by itself. See: http://wixtoolset.org/documentation/manual/v3/xsd/netfx/nativeimage.html -->
                <netfx:NativeImage Id="ngen_fil04C6E9A1324A0A1878612A211EC8F58D" Dependencies="yes" Platform="64bit" Priority="0" />
              </File>
            </Component>

Schritt 5: Folgende Components aktualisieren:

> Bei Centron.Host.WindowsService.exe.config Attribute "NeverOverwrite" und "Permanent" setzen. Ganze Komponente am besten übernehmen. Muss gleiche Guid weiterhin haben!
            <Component Id="cmpE1CBAE5DF69973E9C8C0285CCD15049D" Directory="APPLICATIONFOLDER" Guid="D93F56E0-D63C-4077-8173-1FD5B18CF5ED" NeverOverwrite="yes" Permanent="yes">
                <File Id="filA742DBEE5652A2AD5C07F3DA2B850FA9" KeyPath="yes" Source="$(var.Centron.Host.WindowsService.TargetDir)\Centron.Host.WindowsService.exe.config" />
            </Component>

Schritt 6: Komponente für "FluentNHibernate.pdb" entfernen

Schritt 7: Registrierung des Services hinzufügen
- Bei der Komponente Centron.Host.WindowsService.exe folgende Zeilen hinzufügen:
    <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="CentronWebService" DisplayName="c-entron Web-Service" Description="c-entron Web-Service for access c-entron informations from outside" Start="auto" ErrorControl="normal" />
    <ServiceControl Id="StartService" Stop="both" Remove="uninstall" Name="CentronWebService" Wait="yes" />

Beispiel:
            <Component Id="cmp54AD61A14FF27242E8B736BEDD206569" Directory="APPLICATIONFOLDER" Guid="59E9BDB6-A752-49B9-A2A6-DB10C1F4BD4B">
              <File Id="fil04C6E9A1324A0A1878612A211EC8F58D" KeyPath="yes" Source="$(var.Centron.Host.WindowsService.TargetDir)\Centron.Host.WindowsService.exe">
				<!-- Do not specify AppBaseDirectory here because ngen.exe will figure it out by itself. See: http://wixtoolset.org/documentation/manual/v3/xsd/netfx/nativeimage.html -->
                <netfx:NativeImage Id="ngen_fil04C6E9A1324A0A1878612A211EC8F58D" Dependencies="yes" Platform="64bit" Priority="0" />
              </File>
              <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="CentronWebService" DisplayName="c-entron Web-Service" Description="c-entron Web-Service for access c-entron informations from outside" Start="auto" ErrorControl="normal" />
              <ServiceControl Id="StartService" Stop="both" Remove="uninstall" Name="CentronWebService" Wait="yes" />
            </Component>
