2017-03-07 1 views
0

Ich habe ein Wix-Installationsprogramm, das erfolgreich aktiviert den IIS mit asp durch Ausführen des Befehls Aspnet_regiis.exe auf 64-Bit-System. Jedoch hat dieser Befehl anderen Pfad in FRAMEWORK Ordnern auf 32 Bit oder 64-Bit-System, je nach dieser Verbindung IIS registration with ASPplattformunabhängige Registrierung von IIS mit ASP in Wix-Installer

auf 32-Bit-System

% windir% \ Microsoft.NET \ Framework \ v2.0.50727 \ aspnet_regiis.exe -i

und auf 64-Bit-System

% windir% \ Microsoft.NET \ Framework64 \ v2.0.50727 \ aspnet_regiis.exe -i

ich brauche mein Installateur zu erweitern abzudecken sowohl 32 Bit als auch 64 Bit pl Atformen. Ich habe versucht, diese Antwort answer on platform independent durch einen Vorprozess Variable definiert, basierend auf der Plattform wie folgt:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <?if $(var.Platform) = x64 ?> 
     <?define IISRegCommand = "C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i" ?>  
    <?else ?> 
     <?define IISRegCommand = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i" ?> 
    <?endif ?> 
    <Product Id="*" Name="IISRegistration" Language="1033" Version="1.0.0.0" Manufacturer="Eurotherm By Schneider-Electric" UpgradeCode="4bfb41e4-5701-4a47-9c4c-cdb657ab7a62"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated"/> 

     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" /> 

     <Feature Id="ProductFeature" Title="IISRegistration" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
     </Feature> 

     <CustomAction Id="IISRegistration" Directory="INSTALLFOLDER" 
      ExeCommand="$(var.IISRegCommand)" 
      Return="check"/> 

     <InstallExecuteSequence> 
      <Custom Action="IISRegistration" After="InstallFiles"></Custom> 
     </InstallExecuteSequence> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="CommonAppDataFolder"> 
     <Directory Id="Company" Name="Company"> 
      <Directory Id="INSTALLFOLDER" Name="Application" /> 
     </Directory> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <Component Id="ProductComponent" Guid=""> 
     <File Id="File1" Name="IISRegistration.txt" Source="IISRegistration.txt"></File> 
     </Component> 
    </ComponentGroup> 
    </Fragment> 
</Wix> 

Allerdings, wenn ich es mit candle.exe kompilieren ich die folgende Fehlermeldung erhalten:

„Fehler CNDL0150: Nicht definiert Präprozessorvariable '$ (var.Platform)' "

BTW, ich benutze wix 3.11. Gibt es eine Möglichkeit, das zu lösen?

Antwort

0

Versuchen Sie diesen Code zum .wixproj hinzuzufügen:

<PropertyGroup> 
    <DefineConstants> 
     $(DefineConstants); 
     Platform=$(Platform) 
    </DefineConstants> 
</PropertyGroup> 
Verwandte Themen