2013-01-29 37 views
6

Tôi đang cố tạo dự án trình cài đặt cho ứng dụng windows bằng WiX v3.7 (vì VS2012 không bao gồm các dự án thiết lập và triển khai nữa) cho mục đích học tập. Bộ công cụ Wix được gán cho VS và tôi đang tạo một dự án cài đặt trình cài đặt đơn WiX mới. Trình cài đặt luôn được biên dịch thành công (ngoại trừ cảnh báo trong phần mở rộng biểu tượng), nó chạy hoàn hảo và đặt phím tắt trên màn hình, nhưng không đặt đúng các phím tắt menu khởi động trên Windows 7 Professional x64 Gói Dịch vụ 1. Tôi đã tìm kiếm trên web và cố gắng hầu như bất cứ điều gì tôi thấy, nhưng cho đến nay không thành công. Tệp tin product.wxs như sau và các chuỗi "my_guid" được thay thế bằng GUIDS phù hợp trong dự án. Rõ ràng tôi đang thiếu một điểm nhưng không thể nhìn thấy ở đâu. Khoá đăng ký cũng không được tạo, vì vậy đoạn cuối cùng có thể không được thực thi vì một lý do. Làm thế nào điều này có thể được giải quyết?Phím tắt trình đơn khởi động trình cài đặt Wix không xuất hiện

<?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> 
+5

Đăng nhập bằng cách cài đặt với lệnh sau 'msiexec/i WixSingleSetupExample.msi/lvoicewarmupx log.txt' và xem các tập tin đăng nhập _log.txt_ cho bất kỳ dấu hiệu tại sao isn thành phần' t cài đặt. – BryanJ

+0

Tôi đã làm như bạn đã hỏi, nhưng tệp nhật ký đầu ra dài 1545 dòng. Đường dẫn khởi động là chính xác trong tệp nhật ký nhưng tôi không thể thấy bất kỳ dấu hiệu lỗi nào. Bất kỳ đề xuất nơi để tìm? Hoặc tôi có thể gửi liên kết tập tin ở đây nếu bạn muốn. – mcy

+0

Câu trả lời được chấp nhận dưới đây giải quyết được vấn đề. Nhưng với bình luận của bạn, tôi đã học được cách đăng nhập, vì vậy cảm ơn bạn. – mcy

Trả lời

16

tôi thêm mã mà làm việc như dự định để tham khảo trong tương lai và một câu trả lời chính xác cho câu hỏi:

<?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> 
+1

+1 Tôi đã dành nhiều thời gian hơn mà tôi muốn thừa nhận đang cố gắng thực hiện điều này! Cảm ơn bạn nó hoạt động hoàn hảo. –

+0

@mcy Vì vậy, vấn đề mà bạn đã giải quyết là gì? – nam

0

Tôi đã bắt đầu sử dụng Wix thời gian gần đây và tôi đã bị mắc kẹt với vấn đề bạn mô tả trong nhiều tuần.

Tôi tìm thấy một cách khác để thêm phím tắt menu bắt đầu mà không cần thêm thành phần bổ sung (để xóa thư mục trình đơn) mà không cần tạo khóa nóng trên sổ đăng ký máy đích.

Điều này có thể được thực hiện bằng cách di chuyển định nghĩa <RemoveFolder ... /> thành phần tử <Component Id="ProductTextFile" ...>. Sau đây gọi là kịch bản làm việc chỉnh sửa:

<?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> 
Các vấn đề liên quan