2014-02-24 125 views
0

我有一个Windows服务,并且我已经在同一个项目中为服务创建了一个安装程序。 现在我想部署我的服务。所以我在我的解决方案中添加了一个新项目(Wix安装项目)。安装后运行程序参数

我现在想要的是在安装后运行我的程序,即我的Windows服务,并发送参数以便安装服务。例如命令行shuld是这样的: MyService.exe/I

,也是一个想送一个参数/U卸载我的服务。

谢谢

+0

你应该使用ServiceInstall元素:http://wixtoolset.org/documentation/manual/v3/xsd/wix/serviceinstall.html。它包含将参数传递给已安装服务的属性。 –

回答

0

我已经解决了这个问题。

<InstallExecuteSequence> 
    <Custom Action="InstallWinService" Before="InstallFinalize">NOT Installed</Custom> 
    <Custom Action="UninstallWinService" Before="RemoveFiles">Installed AND NOT REINSTALL</Custom> 
</InstallExecuteSequence> 
+0

并非代码的所有部分都在上面呈现。这是缺少的: Spricko