我有一個WiX腳本,用於安裝服務。我在Component
下有ServiceInstall
元素。將服務配置爲延遲自動啓動(並在XP/2003上自動啓動)
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes"
Name="abc" DisplayName="abc service"
Description="It does this" Start="auto"
Account="LocalSystem" ErrorControl="normal" Interactive="no">
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
</ServiceInstall>
而且從代碼看到,我使用ServiceConfig
與DelayedAutoStart
標誌設置服務延遲自動啓動方式啓動。然而,維克斯編譯器(candle.exe
)觸發警告:
警告CNDL1150:ServiceConfig功能在 Windows安裝程序的SDK文檔「不是[工作]如預期。」考慮用WixUtilExtension ServiceConfig元素替換 ServiceConfig。
因此,我嘗試使用util:ServiceConfig
^,但是這個元素沒有任何屬性來控制服務啓動。
^命名空間導入:
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
因此,問題只是:
- 如何設置服務啓動時自動(延時啓動)?
- 如何有條件地只在Vista和更高版本上做,並在Windows XP/2003上正常(自動)?
那麼理想情況下,不應該給的警告。 – Ajay