2013-01-29 22 views
6

Öğrenme amacıyla WiX v3.7 (VS2012 kurulum ve dağıtım projelerini artık içermediğinden) bir windows uygulaması için bir yükleyici projesi oluşturmaya çalışıyorum. Wix araç seti VS'ye entegre edilmiştir ve yeni bir WiX tek yükleyici kurulum projesi oluşturuyorum. Yükleyici her zaman başarılı bir şekilde derlenir (simge uzantısında uyarılar hariç), mükemmel çalışır ve masaüstü kısayollarını olması gerektiği gibi yerleştirir, ancak Windows 7 Professional x64 Service Pack 1'de düzgün başlangıç ​​menü kısayollarını yerleştiremez. Web'de arama yaptım ve Gördüğüm neredeyse herşeyi denedi, ama şimdiye kadar başarı yok. Ürün.wxs dosyası aşağıdaki gibidir ve "my_guid" dizeleri, projede uygun GUIDS ile değiştirilir. Açıkçası bir noktayı kaçırıyorum ama nerede göremiyorum. Kayıt defteri anahtarı da oluşturulmamıştır, bu nedenle son bölüm muhtemelen bir nedenle çalıştırılmaz. Bu nasıl çözülebilir? Geçenlerde Wix kullanmaya başladı ve ettikWix Installer başlat menüsü kısayolu görünmüyor

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="guid_here" Name="WixSingleSetupExample" Language="1055" 
      Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="guid_here"> 
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <MediaTemplate /> 

    <Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1"> 
     <ComponentGroupRef Id="ProductComponents" /> 
     <ComponentRef Id="ProgramMenuDir"/> 
    </Feature> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 

     <Directory Id="DesktopFolder" Name="Desktop" /> 

     <Directory Id="ProgramMenuFolder" Name="Programs"> 
     <Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup"> 
      <Component Id="ProgramMenuDir" Guid="guid_here"> 
      <RemoveFolder Id="ProgramMenuDir" On="uninstall"/> 
      <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\WixSetup" 
          Type="integer" Value="1" Name="installed" KeyPath="yes" /> 
      </Component> 
     </Directory> 
     </Directory> 


     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" /> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <!-- TODO: Remove the comments around this Component element and the 
      ComponentRef below in order to add resources to this installer. --> 
     <Component Id="ProductTextFile"> 
     <File Source="blankText.txt" KeyPath="yes"> 
      <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" 
        Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="icon1.txt" IconIndex="0"> 
      <Icon Id="icon1.txt" SourceFile="blankText.txt" /> 
      </Shortcut> 
      <Shortcut Id="startMenuShotcut" Directory="ApplicationProgramsFolder" 
        Name="WiXSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="icon2.txt" IconIndex="0" Advertise="yes"> 
      <Icon Id="icon2.txt" SourceFile="blankText.txt"/> 
      </Shortcut> 
     </File>  
     </Component> 
    </ComponentGroup> 
    </Fragment> 
</Wix> 
+5

Log 'msiexec/i WixSingleSetupExample.msi/lvoicewarmupx log.txt' ve gör takılıyorum. – BryanJ

+0

İstediğiniz gibi yaptım, ancak çıktı günlük dosyası 1545 satırdır. Başlangıç ​​yolu, günlük dosyasında doğrudur, ancak herhangi bir hata göstergesi göremedim. Bakacağınız herhangi bir öneriniz var mı? Ya da isterseniz dosya bağlantısını buraya gönderebilirim. – mcy

+0

Aşağıdaki kabul edilen cevap sorunu çözmektedir. Ama yorumunuzla, nasıl kayıt olacağımı öğrendim, teşekkürler. – mcy

cevap

16

Ben ileride ve soruya kesin bir cevap için gerektiği gibi çalışıyorsa kod ekliyorum haftalarca tarif edersiniz.

Ek bileşen eklemeden (menü klasörlerini kaldırmak için) ve hedef makine kayıt defterinde kısayol tuşları oluşturmadan başlangıç ​​menü kısayollarını eklemenin başka bir yolunu buldum.

Bu, <RemoveFolder ... /> tanımının <Component Id="ProductTextFile" ...> öğeye taşınmasıyla yapılabilir. Modifiye çalışma senaryoyu bundan sonra: Günlük dosyası _log.txt_ neden bileşen değilmi için herhangi bir işaret verirse aşağıdaki komutu yükleyerek

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="{GUID HERE}" Name="WixSingleSetupExample" Language="1055" 
      Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="{GUID HERE}"> 
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <MediaTemplate /> 

    <Icon Id="ICON1.ICO" SourceFile="icon1.ico" /> 
    <Icon Id="ICON2.ICO" SourceFile="icon2.ico" /> 

    <Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1"> 
     <ComponentRef Id="ProductTextFile" /> 
    </Feature> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="DesktopFolder" Name="Desktop" /> 

     <Directory Id="ProgramMenuFolder" Name="Programs"> 
     <Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup" /> 
     </Directory> 

     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" /> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
     <Component Id="ProductTextFile" Directory="INSTALLFOLDER" Guid="{GUID HERE}"> 
     <File Source="blankText.txt" KeyPath="yes"> 
      <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" 
        Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="ICON1.ICO" IconIndex="0" /> 

      <Shortcut Id="startMenuShotcut" Directory="ApplicationProgramsFolder" 
        Name="WiXSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="ICON2.ICO" IconIndex="0" Advertise="yes" /> 
     </File> 

     <RemoveFolder Id="ProgramMenuDir" Directory="ApplicationProgramsFolder" On="uninstall"/> 
     </Component> 
    </Fragment> 
</Wix> 
+1

+1 Bunu yapmaya çalıştığımı kabul etmek için daha fazla zaman harcadım! Teşekkür ederim, mükemmel çalışıyor. –

+0

@mcy Peki, çözdüğünüz sorun neydi? – nam

0

Ben sorunla saplanıp ettik:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="my_guid" Name="WixSingleSetupExample" Language="1055" Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="my_guid"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
     <MediaTemplate /> 

     <Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
      <ComponentRef Id="ApplicationShortcut" /> 
     </Feature> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
      <Directory Id="DesktopFolder" Name="Desktop" /> 
      <Directory Id="ProgramMenuFolder"> 
       <Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup"/> 
      </Directory> 
      <Directory Id="ProgramFilesFolder"> 
       <Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" /> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
      <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
      <Component Id="ProductTextFile"> 
       <File Source="blankText.txt" KeyPath="yes"> 
        <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" Icon="icon1.txt" IconIndex="0"> 
         <Icon Id="icon1.txt" SourceFile="blankText.txt"/> 
        </Shortcut> 
       </File>  
      </Component> 
     </ComponentGroup> 
    </Fragment> 

    <Fragment> 
    <DirectoryRef Id="ApplicationProgramsFolder"> 
     <Component Id="ApplicationShortcut" Guid="my_guid"> 
     <Shortcut Id="ApplicationStartMenuShortcut" 
        Name="WixSingleSetup Help" 
        Description="Setup Example" 
        Target="blankText.txt" 
        WorkingDirectory="INSTALLFOLDER" 
        Icon="icon2.txt" 
        IconIndex="0"> 
      <Icon Id="icon2.txt" SourceFile="blankText.txt"/> 
     </Shortcut> 
     <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/> 
     <RegistryValue Root="HKCU" Key="Software/Microsoft/WixSingleSetup" Name="installed" Type="integer" Value="1" KeyPath="yes" /> 
     </Component> 
    </DirectoryRef> 
    </Fragment> 
</Wix>