2008-10-14 21 views

Trả lời

43

Tất cả những gì bạn cần làm là thêm mã này vào tập lệnh WIX, nó sẽ cung cấp cho bạn WelcomeDlg trước khi cài đặt và hiển thị tiến trình Cài đặt, sau đó là Hộp thoại thoát. Đừng quên thêm WixUIExtension.dll vào tài liệu tham khảo của bạn.

<UI Id="UserInterface"> 
    <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" /> 
    <Property Id="WixUI_Mode" Value="Custom" /> 

    <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> 
    <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" /> 
    <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> 

    <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> 

    <DialogRef Id="ProgressDlg" /> 
    <DialogRef Id="ErrorDlg" /> 
    <DialogRef Id="FilesInUse" /> 
    <DialogRef Id="FatalError" /> 
    <DialogRef Id="UserExit" /> 

    <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> 
    <Publish Dialog="WelcomeDlg" Control="Next" Event="EndDialog" Value="Return" Order="2"></Publish> 

</UI> 
<UIRef Id="WixUI_Common" /> 
+0

công việc của mình cho tôi, cảm ơn rất nhiều –

+2

trông giống như nó đã làm việc cho một số phiên bản cũ của wix. xem ví dụ hoàn chỉnh của tôi trong câu trả lời dưới đây cho Wix 3.8, dựa trên câu trả lời gốc của đồng chí CheGueVerra – lowtech

+0

@CheGueVerra Great work! Làm việc cho tôi. Bạn có biết cách thêm hộp thoại sẽ cho biết: "Phiên bản trước đã tồn tại bạn có muốn tiếp tục" không? Tôi đã thử [http://stackoverflow.com/questions/16014082/custom-dialog-when-previous-version-exists] – misshomme

4

Nếu bạn đang sử dụng Visual Studio và Wix 3.8 thì bạn có thể tạo dự án Thiết lập Wix và sử dụng văn bản bên dưới làm nội dung của Product.wxs. Trong trường hợp của tôi, tôi cần sao chép tệp python và văn bản vào thư mục đích. Cảm ơn một lần nữa cho kiệt tác ban đầu, đồng chí CheGueVerra:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 

    <Product Id="*" Name="testwixsetup" Language="1033" Version="2.1.3.0" Manufacturer="ttt" UpgradeCode="PUT-GUID-HERE"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

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

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

    <UI Id="UserInterface"> 
     <Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" /> 
     <Property Id="WixUI_Mode" Value="Custom" /> 

     <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> 
     <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" /> 
     <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> 

     <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> 

     <DialogRef Id="ProgressDlg" /> 
     <DialogRef Id="ErrorDlg" /> 
     <DialogRef Id="FilesInUse" /> 
     <DialogRef Id="FatalError" /> 
     <DialogRef Id="UserExit" /> 

     <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> 
     <Publish Dialog="WelcomeDlg" Control="Next" Event="EndDialog" Value="Return" Order="2"></Publish> 

    </UI> 
    <UIRef Id="WixUI_Common" /> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
      <Directory Id="ProgramFilesFolder"> 
     <Directory Id="COMPANYFOLDER" Name="test-wixinstall"> 
      <Directory Id="INSTALLFOLDER" Name="testwixsetup" /> 
     </Directory> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
       <Component Id="ProductComponent" Guid="*"> 
      <File Name="test.py"/> 
      <File Name="test.txt"/> 
      </Component> 
     </ComponentGroup> 
    </Fragment> 

</Wix> 
Các vấn đề liên quan