2013-07-26 43 views
8

Tôi đang sử dụng WiX để cài đặt dịch vụ trên máy kiểm tra. Nhưng khi tôi làm điều đó chỉ người dùng đã cài đặt nó trên máy mới có thể thấy trong tùy chọn 'Thêm/Loại bỏ Chương trình' trong bảng điều khiển. Nhưng tôi muốn làm cho nó hiển thị cho mọi người dùng trên máy.Đặt tùy chọn 'Tất cả người dùng' trên trình cài đặt Wix không hoạt động

Tôi đã thực hiện một số nghiên cứu và nhận ra rằng tôi không đặt thuộc tính AllUSERS trong khi tạo trình cài đặt trong tệp .wxs.

Vì vậy, tôi đã cập nhật tập lệnh của mình với dòng này <Property Id="AllUSERS" Value="1"/> và tạo trình cài đặt. Nhưng vẫn chỉ người dùng đã cài đặt mới có thể thấy trong Bảng điều khiển.

Đây là tập lệnh của tôi để tạo trình cài đặt.

<?xml version='1.0' encoding='windows-1252'?> 

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> 

<Product Name='Importer Service' Id='PUT-GUID-HERE' UpgradeCode='PUT-GUID-HERE' 
Language='1033' Codepage='1252' Version='$(var.version)' Manufacturer='Test'> 

<Package Id='*' Keywords='Installer' Description="Imports data" 
    Manufacturer='Test' InstallerVersion='100' Languages='1033' Compressed='yes' 
    SummaryCodepage='1252' /> 

<Media Id='1' Cabinet='ImporterWebService.cab' EmbedCab='yes' 
     DiskPrompt="CD-ROM #1" /> 
<Property Id='DiskPrompt' Value="Importer Web Service 1.0 Installation [1]" /> 

<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> 
<Property Id="AllUSERS" Value="1"/> 

<Directory Id='TARGETDIR' Name='SourceDir'> 

    <Directory Id='ProgramFilesFolder' Name='PFiles'> 
    <Directory Id='Test' Name='Test1'> 
     <Directory Id='INSTALLDIR' Name='Importer Service'> 

     <Component Id='MainExecutable' Guid='*'> 
      <File Id='ImporterWindowsServiceEXE' 
       Name='Importer.WindowsService.exe' DiskId='1' 
       Source='Importer.WindowsService.exe' KeyPath='yes'> 
      </File> 

     <ServiceInstall 
      Id="ImporterServiceInstaller" 
      Type="ownProcess" 
      Vital="yes" 
      Name="Importer Service" 
      DisplayName="Importer Service" 
      Description="Imports data." 
      Start="demand" 
      Account="LocalSystem" 
      ErrorControl="ignore" 
      Interactive="no"> 
    </ServiceInstall> 

     <ServiceControl Id="StartService" Stop="both" Remove="uninstall" 
         Name="Importer Service" Wait="yes" /> 
     </Component> 

     <Component Id='FileHelpersLibrary' Guid='*'> 
      <File Id='FileHelpersDLL' Name='FileHelpers.dll' DiskId='1' 
       Source='FileHelpers.dll' KeyPath='yes' /> 
     </Component>   

     <Component Id='CodeSmithDataLibrary' Guid='*'> 
      <File Id='CodeSmithDataDLL' Name='CodeSmith.Data.dll' DiskId='1' 
       Source='CodeSmith.Data.dll' KeyPath='yes' /> 
     </Component>   

     </Directory> 
    </Directory> 
    </Directory> 

    <Directory Id="ProgramMenuFolder" Name="Programs"> 
    <Directory Id="ProgramMenuDir" Name="Importer Service"> 
     <Component Id="ProgramMenuDir" Guid="*"> 
     <RemoveFolder Id='ProgramMenuDir' On='uninstall' /> 
     <RegistryValue Root='HKCU' 
         Key='Software\[Manufacturer]\[ProductName]' 
         Type='string' Value='' KeyPath='yes' /> 
     </Component> 
    </Directory> 
    </Directory> 

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

<Feature Id='Complete' Title='Importer Service' 
     Description='The complete package' 
     Display='hidden' Level='1' ConfigurableDirectory='INSTALLDIR'> 
    <ComponentRef Id='MainExecutable' /> 
    <ComponentRef Id='FileHelpersLibrary' /> 
    <ComponentRef Id='CodeSmithDataLibrary' />  
    <ComponentRef Id='ProgramMenuDir' />  
</Feature> 

<UIRef Id="WixUI_InstallDir" /> 
<UIRef Id="WixUI_ErrorProgressText" /> 


</Product> 
</Wix> 

Ai đó có thể xem kịch bản và cho tôi biết tôi đang làm gì sai.

Cảm ơn.

+0

WiX có một lịch sử lâu dài giúp việc xây dựng các gói Windows Installer ngày càng dễ dàng hơn. Có rất nhiều hướng dẫn và ví dụ tốt trên Internet nhưng chúng thường không theo kịp tiến trình của WiX. Bạn vẫn có thể học hỏi từ họ nhưng hãy nhớ kiểm tra tài liệu hiện tại (bao gồm lược đồ XML, ví dụ: qua IntelliSense) và chạy công cụ WiXCop để công việc của bạn trên trình cài đặt mới được cập nhật. –

+0

Hãy thử ALLUSERS thay vì AllUSERS –

Trả lời

13

Thay vì đặt ALLUSERS một cách rõ ràng, hãy thử đặt InstallScope của phần tử Package thành perMachine. Theo tài liệu, thực tế này:

Đặt giá trị này để tuyên bố gói là cài đặt cho mỗi máy và yêu cầu đặc quyền nâng cao để cài đặt. Đặt các tài sản ALLUSERS thành 1.

Vì vậy, cần thực hiện công việc theo yêu cầu dưới mui xe.

Các vấn đề liên quan