当我的安装程序完成安装或卸载时,我想重新启动正在运行的服务。
我找到了这段代码:
<ServiceControl Id="SomeUniqueId" Name="NameOfTheirService"
Start="both" Stop="both"/>
但是我在哪里附加这个代码呢?到放置 my 的组件?
代码:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="325c4bfd-6614-43e9-aedb-93661295352d" Name="Plugin" Language="1033" Version="1.0.0.0"
Manufacturer="XXX Inc." UpgradeCode="4307526e-3902-40d0-991b-bacff9b3d71b">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Property Id="XXXXXX">
<RegistrySearch Id="XXXXXX" Type="raw"
Root="HKLM" Key="SOFTWARE\XXX\XXX" Name="InstallationPath" />
</Property>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="XXXXXX">
<Component Id="ProductComponent" Guid="93118c45-f0c0-4c9e-9168-8ea905e9427c">
<File Id="pluggin" Source="C://setup.log" KeyPath="yes" Checksum="yes"/>
<ServiceControl Id="StartService" Name="servicename"
Start="both" Stop="both"/>
</Component>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="install" Level="1">
<ComponentRef Id="ProductComponent" />
<ComponentGroupRef Id="Product.Generated" />
</Feature>
</Product>