0

I have created a stand-alone wcf JSON service (port 4326). On Windows 7, I find that either I have to run as admin, or use the netsh as a command line (just once) to unblock the port:

e.g. C:> netsh http add urlacl url=http://+:4326/ user=CSDL-SERVICES\ysg4206 

See: http://msdn.microsoft.com/en-us/library/ms733768.aspx

Is there a way that I could do this from within the .NET application (so that the user does not have to do it after installing the program? Can I discover the user account, and do this permanently like the netsh program?

Alternatively, is there some way in InstallShield to find out the domain/username of the user and then run this as a script during install?

4

1 回答 1

1

您使用的是什么 InstallShield 版本和项目类型?

如果是 MSI,您可以使用 EXE 自定义操作来运行该命令。另一种选择是调用 LaunchAppAndWait 来调用 EXE 的 InstallScript 自定义操作。(没有闪烁的 DOS 提示符。)

此外,如果是 MSI,您可以创建一个使用安静执行自定义操作模式或可能使用防火墙扩展的 WiX 合并模块。

FirewallException 元素(防火墙扩展)

安静执行自定义操作

使用 Windows Installer XML 增强 InstallShield - 证书

启动应用程序并等待

Q102426:如何:启动自定义可执行文件

于 2012-11-23T02:23:27.120 回答