如何用WIX ServiceInstall安裝Windows服務

來源:互聯網
上載者:User

下面XML代碼展示如何利用Wix中的ServiceInstall來自動安裝Windows服務

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="832B8322-6349-4ddd-8AC6-CF18E7A05509" Name="DotNetService"
           Language="1033" Version="1.0.0.0" Manufacturer="Persistent"
           UpgradeCode="6493A097-BA2D-482b-9EDD-2BDBC3E5463E">
    <Package InstallerVersion="200" Compressed="yes" />
    <Media Id="1" Cabinet="WixServiceInstaller.cab" EmbedCab="yes" />
    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='DOTNETSERVICE' Name='DotNet'>
          <Component Id="InstallService" Guid='AAA67783-EEF0-453f-BBAF-E02B1341E3BC'>
            <File Id="WindowsService" Name="WixServiceInstaller.exe"
                  Source="WixServiceInstaller.exe" KeyPath="yes"/>
            <ServiceInstall Id="ABC"
                            Name="WixServiceInstaller"
                            DisplayName="WixServiceInstaller"
                            Type="ownProcess"
                            Start="auto"
                            ErrorControl="normal"
                            Description="WixServiceInstaller"
                            Account="[SERVICEACCOUNT]"
                            Password="[SERVICEPASSWORD]" />
            <ServiceControl Id="StartWixServiceInstaller"
                            Name="WixServiceInstaller" Start="install" Wait="no" />
            <ServiceControl Id="StopWixServiceInstaller" Name="WixServiceInstaller"
                            Stop="both" Wait="yes" Remove="uninstall" />
          </Component>
        </Directory>
      </Directory>
    </Directory>
    <Feature Id='TheOnlyFeature' Description='Feature contains the single component'
             Level='1'>
      <ComponentRef Id='InstallService'/>
    </Feature>
  </Product>
</Wix>

 

--------------------------------

from:http://avinashkt.blogspot.com/2007/05/how-to-install-windows-service-using.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.