在InstallShield安装程序中运行sc命令

时间:2012-12-05 22:39:52

标签: windows installer installshield

我有一个sc命令,我想在“After Register Product”自定义操作中使用Visual Studio 2012 InstallShield版本运行。我为执行行动选择了“New Exe”。我已选择“目标计算机上的文件存在”作为源位置。对于“文件位置”,我输入了“[SystemFolder]”。对于“文件名和命令行”,我大概有

  

sc.exe create ABC binPath =“[INSTALLDIR] abc.exe”   DisplayName =“ABC服务”start = auto

。当我运行安装程序时,它失败了。我对事业感到茫然。

1 个答案:

答案 0 :(得分:2)

过去有过类似的问题。以另一种方式解决了CA类型:Deferred execution in system context,工作目录SystemFolder

cmd.exe /c "[WindowsFolder]system32\sc.exe delete [SERVICENAME]"
相关问题