2013-03-05 14 views
7
<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
    xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" 
    xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
    xmlns:netfx='http://schemas.microsoft.com/wix/NetFxExtension'> 

    <Bundle Name="IPDev" Version="0.6" Manufacturer="MYAPP Corporation" UpgradeCode="f380ae43-5df1-4cfe-9297-526e3e638e57"> 
     <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" /> 
     <Chain> 
      <!-- TODO: Define the list of chained packages. --> 
      <PackageGroupRef Id="Netfx45FullPackage"/>  
     </Chain> 
    </Bundle> 
    <Fragment> 
    <!--checking for matlab 2012a installation--> 
    <util:RegistrySearch Id="MatlabPath" 
      Variable="UniqueId" 
      Root="HKLM" 
      Key="SOFTWARE\MathWorks\MATLAB\4.17\" 
      Result="exists" 
      Win64="yes" 
      /> 
    <!--checking for matlab MCR 2012a 64 bit installation--> 
    <util:RegistrySearch Id="MatlabMCRPath" 
      Variable="UniqueId" 
      Root="HKLM" 
      Key="SOFTWARE\MathWorks\MATLAB Compiler Runtime\7.17\" 
      Result="exists" 
      Win64="yes" 
      /> 
    <PackageGroup Id="Netfx45FullPackage"> 

    <ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" 
     SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe" 
     DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))" 
     InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))"/> 
    <ExePackage Id="MatlabMCR2012a64" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" 
     SourceFile="..\SetupProject\MCR_R2012a_win64_installer.exe" 
     InstallCondition="(NOT MatlabPath) OR (NOT MatlabMCRPath)"/> 
    <MsiPackage Id="IPDev" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="..\SetupProject\bin\Release\IPDevSetup.msi"/> 

    </PackageGroup> 
    </Fragment> 
</Wix> 

ecco il mio codice: mio problema è che .NET4.5 è installato solo se esiste.
tuttavia l'MCR di MATLAB viene installato indipendentemente dal fatto che esista o meno.
può dirmi cosa c'è di sbagliato con la mia condizione:installer wix 3.7 programma di avvio automatico di ricerca del Registro

InstallCondition="(NOT MatlabPath) AND (NOT MatlabMCRPath)" 

correzione dopo la risposta di Rob:

DetectCondition="MatlabMCRPathExists OR MatlabPathExists" 

questa condizione dovrebbe essere falsa per poter installare

risposta

4

L'attributo InstallCondition viene utilizzato per determinare se un pacchetto deve essere installato sulla macchina. Se true, il pacchetto può essere installato. Se falso, il pacchetto viene disinstallato. Quello che vuoi è un attributo DetectCondition per determinare se il pacchetto è già presente sulla macchina.

La correzione è probabilmente solo per modificare il Matlab ExePackage/@InstallCondition su un ExePackage/@DetectCondition.

+0

grazie .i sono stati modificati in DetectCondition ma salta l'installazione di MatLab MCR. avevo disinstallato MCR e riavviato il mio computer. questo è il file di log: "Condition" (NOT MatlabPath) AND (NOT MatlabMCRPath) "è true." e anche "Pacchetto rilevato: MatlabMCR2012a64, stato: Presente, memorizzato nella cache: Nessuno" significa che il registro è ancora lì? o ho un bug nel mio codice? – Gilad

+0

ho cambiato la mia condizione in un OR e questo è quello che ottengo Condizione 'MatlabMCRPathExists OR MatlabPathExists' viene valutato come falso. comunque MCR è installato – Gilad

+0

ok nvm è stato come sempre un tipo. grazie è stato risolto! – Gilad

3

Puoi correggi la tua chiamata RegistrySearch come di seguito:

<!--checking for matlab 2012a installation--> 
<util:RegistrySearch Id="MatlabPath" 
     Variable="MatlabPathExists" 
     Root="HKLM" 
     Key="SOFTWARE\MathWorks\MATLAB\4.17\" 
     Result="exists"/> 
<!--checking for matlab MCR 2012a 64 bit installation--> 
<util:RegistrySearch Id="MatlabMCRPath" 
     Variable="MatlabMCRPathExists" 
     Root="HKLM" 
     Key="SOFTWARE\MathWworks\MATLAB Compiler Runtime\7.17\" 
     Result="exists"/> 
<PackageGroup Id="Netfx45FullPackage"> 

Questa ricerca imposta il risultato della ricerca sulla variabile MatlabPathExists e MatlabMCRPathExists.
Allora il vostro assegno condizione dovrebbe essere come segue usando quelle variabili:

DetectCondition="(NOT MatlabPathExists) OR (NOT MatlabMCRPathExists)" 
+0

grazie, il mio obiettivo è installare Matlab MCR solo se non è installato MATLAB o MCR. la tua InstallCondition non significa installare MCR se uno di questi non viene trovato? – Gilad

+0

@Androidy, quindi la logica di controllo delle condizioni richiede alcune correzioni. Ho appena usato la variabile corretta in util: RegistrySearch e usato lo stesso correttamente. Quindi il controllo delle condizioni può essere come InstallCondition = "(NON MatlabPathExists) E (NON MatlabMCRPathExists)" Spero. – RinoTom

+0

questa è la mia condizione e non funziona – Gilad

4

Ecco il mio codice finale e funzionante:
questo controllo del codice per l'installazione di .NET 4.5. e per Matlab R2012a o Matlab MCR R2012a.

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
    xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" 
    xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
    xmlns:netfx='http://schemas.microsoft.com/wix/NetFxExtension'> 

    <Bundle Name="IPDev" Version="0.6" Manufacturer="Intel Corporation" UpgradeCode="f380ae43-5df1-4cfe-9297-526e3e638e57"> 

     <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" /> 
     <Chain> 

      <!-- TODO: Define the list of chained packages. --> 
      <PackageGroupRef Id="Netfx45FullPackage"/>  
     </Chain> 
    </Bundle> 
    <Fragment> 

     <!--checking for matlab 2012a installation--> 
    <util:RegistrySearch Id="MatlabPath" 
      Variable="MatlabPathExists" 
      Root="HKLM" 
      Key="SOFTWARE\MathWorks\MATLAB\4.17" 
      Result="exists" 
      Win64="yes" /> 
    <!--checking for matlab MCR 2012a 64 bit installation--> 
    <util:RegistrySearch Id="MatlabMCRPath" 
      Variable="MatlabMCRPathExists" 
      Root="HKLM" 
      Key="SOFTWARE\MathWorks\MATLAB Compiler Runtime\7.17" 
      Result="exists" 
      Win64="yes" /> 
    <PackageGroup Id="Netfx45FullPackage"> 


    <ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" 
     SourceFile="..\SetupProject\dotnetfx45_full_x86_x64.exe" 
     DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))" 
     InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))"/> 
    <ExePackage Id="MatlabMCR2012a64" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" 
     SourceFile="..\SetupProject\MCR_R2012a_win64_installer.exe" 
     DetectCondition="MatlabMCRPathExists OR MatlabPathExists"/> 
    <MsiPackage Id="IPDev" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="..\SetupProject\bin\Release\IPDevSetup.msi"/> 

    </PackageGroup> 
    </Fragment> 
</Wix> 
Problemi correlati