2016-06-05 13 views
1

Ich bin neu mit Wix, und ich versuche, ein Windows-Service-Installationspaket mit Wix 3.10 in Visual Studio 2012 zu erstellen, aber ich kann keine externen DLL-Referenzen hinzufügen.Wix externe DLL im Installationsordner hinzufügen

Ich habe mein Projekt, das ist der Windwos Service, den ich mit Referenzen installieren möchte. Und ParodosService.Setup, das ist mein Installer-Projekt. hier ist

meine .wxs Datei aus ParodosService.Setup Projekt:

<?xml version="1.0" encoding="UTF-8"?> 
<!-- The name of the product --> 
<?define Name = "Vision Service" ?> 
<!-- The manufacturer, for setup package publisher and folder info --> 
<?define Manufacturer = "MyCompany" ?> 
<!-- The version number of this setup package--> 
<?define Version = "1.0.1" ?> 
<!-- UpgradeCode must be unique and not changed once the first version of the program is installed. --> 
<?define UpgradeCode = "{1240E0CD-B3D2-44A7-B064-11B3C0709D69}" ?> 

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="*" Name="$(var.Name)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)" Language="1033"> 
    <!-- Create a folder inside Talk Sharp called Test Service --> 
    <Package InstallerVersion="300" Compressed="yes"/> 
    <!-- Create a folder inside Talk Sharp called Test Service --> 
    <Media Id="1" Cabinet="ParodosService.cab" EmbedCab="yes" /> 
    <!-- Allow upgrades and prevent downgrades --> 
    <MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." /> 
    <!-- Define the directory structure --> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
     <!-- Create a folder inside program files called Talk Sharp --> 
     <Directory Id="ROOTDIRECTORY" Name="$(var.Manufacturer)"> 
      <!-- Create a folder inside Talk Sharp called Test Service --> 
      <Directory Id="INSTALLFOLDER" Name="$(var.Name)" /> 
     </Directory> 
     </Directory> 
    </Directory> 

    <ComponentGroup Id="DllsComponent" Directory="INSTALLFOLDER" Source="C:\Users\Pasquale\Documents\Visual Studio 2012\Projects\ParodosService\ParodosService\bin\Release">  
     <Component Id="EntityFramework.dll"> 
     <File Name="EntityFramework.dll" /> 
     </Component> 
     <Component Id="EntityFramework.SqlServer.dll"> 
     <File Name="EntityFramework.SqlServer.dll" /> 
     </Component>   
     <Component Id="ParodosService.exe.config"> 
     <File Name="ParodosService.exe.config" /> 
     </Component> 
    </ComponentGroup> 
    <!-- The files inside this DirectoryRef are linked to the Test Service directory via INSTALLFOLDER --> 
    <DirectoryRef Id="INSTALLFOLDER"> 
     <!-- Create a single component which is the ParodosService.exe file --> 
     <Component Id="$(var.ParodosService.TargetFileName)"> 
     <!-- Copies the ParodosService.exe file using the project reference preprocessor variables --> 
     <File Id="$(var.ParodosService.TargetFileName)" Source="$(var.ParodosService.TargetPath)" KeyPath="yes" /> 
     <!-- Remove all files from the INSTALLFOLDER on uninstall --> 
     <RemoveFile Id="ALLFILES" Name="*.*" On="both" /> 
     <!-- Tell WiX to install the Service --> 
     <ServiceInstall Id="ServiceInstaller" 
         Type="ownProcess" 
         Name="ParodosService" 
         DisplayName="$(var.Name)" 
         Description="A Test Service that logs dummy text on an interval to a text file." 
         Start="auto" 
         ErrorControl="normal" /> 
     <!-- Tell WiX to start the Service --> 
     <ServiceControl Id="StartService" Start="install" Stop="both" remove="uninstall" Name="ParodosService" Wait="yes" /> 
     </Component> 
    </DirectoryRef> 
    <!-- Tell WiX to install the files --> 
    <Feature Id="MainApplication" Title="Main Application" Level="1"> 
     <ComponentRef Id="$(var.ParodosService.TargetFileName)" /> 
    </Feature> 
    </Product> 
</Wix> 

ich manuell hinzugefügt drei Komponenten in der ComponentGroup die drei Dateien spezifiziert i in der Instalation Ordner meiner Windows-Dienst benötigen. Diese Art der manuellen Änderung, gibt mir einen Fehler für jede hinzugefügte Datei:

ICE21: Component: 'EntityFramework.dll' does not belong to any Feature. 

Als ich mit WIX bin neu, ich hatte Mühe dies auch mit heat.exe zu tun, und ich tought, dass dies das war einfacherer Weg, aber beide Wege geben mir Fehler ...

+0

es ein einfacherer Weg, um den Ausgabeordner anzugeben, als den ganzen absoluten Pfad setzen. Sie können '' verwenden. –

Antwort

3

Die Fehlermeldung sagt Ihnen, dass Ihre Komponente verwaist ist, muss es zu einer Funktion gehören.

Ich denke, wenn Sie Ihre Funktion Definition wie folgt ändern, sollte es funktionieren:

<Feature Id="MainApplication" Title="Main Application" Level="1"> 
     <ComponentRef Id="$(var.ParodosService.TargetFileName)" /> 
     <ComponentGroupRef Id="DllsComponent"/> 
</Feature> 
+0

Ja, jetzt funktioniert es perfekt !!! – pasluc74669

Verwandte Themen