0
我已經安裝了使用Installutil.exe的windows服務,現在最重要的是現在我正在使用wix進行安裝。 我正在嘗試使用WIX安裝Windows服務。 我的意圖是先停止服務,安裝服務然後啓動服務。Wix安裝程序:驗證您是否有足夠的權限來安裝系統服務
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="GPAT-PricingInactivateService" Language="1033" Version="1.0.0.0" Manufacturer="American Express" UpgradeCode="6b4cf27d-6504-4e24-803e-d26491b21b3d">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<Upgrade Id="6b4cf27d-6504-4e24-803e-d26491b21b3d">
<UpgradeVersion Minimum="0.0.0.0"
IncludeMinimum="yes"
OnlyDetect="no"
Maximum="1.0.0.0"
IncludeMaximum="yes"
Property="PREVIOUSFOUND" />
</Upgrade>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
<Feature Id="ProductFeature" Title="GPAT-PricingInactivateService" Level="1">
<ComponentGroupRef Id="ServiceComponents" />
</Feature>
<Media Id="1" Cabinet="Components.cab" EmbedCab="yes" />
<Property Id="TARGETDIR">C:\Test\</Property>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLFOLDER" Name="GPATPriceInactiveService"/>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ServiceComponents">
<Component Id="Axp.Gcpt.Gpat.Worker.Library" Directory="INSTALLFOLDER" Guid="{E1810FA9-5620-4739-9FE2-2726CC2CA6F4}">
<File Id="FileService" Name="Axp.Gcpt.Gpat.Worker.exe" Source="$(var.Axp.Gcpt.Gpat.Worker.TargetDir)\Axp.Gcpt.Gpat.Worker.exe" KeyPath='yes' />
<ServiceInstall Id="GPATService" Type="ownProcess" Name="Axp.Gcpt.Gpat.Worker" DisplayName="Axp.Gcpt.Gpat.Worker"
Description="Axp.Gcpt.Gpat.Worker description" Start="auto" Account="LocalSystem" ErrorControl="normal" Interactive="yes" Vital="yes" >
<ServiceControl Id="GPATServiceStart" Name="Axp.Gcpt.Gpat.Worker" Stop="both" Start="both" Wait="yes" />
</Component>