netsh acl设置(需要替代方法-注册表设置吗?) [英] netsh acl setting (need alternative method - registry settings?)

查看:141
本文介绍了netsh acl设置(需要替代方法-注册表设置吗?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用inno-setup安装需要取消阻止Win7上的端口4326(允许acl访问)的程序,以便可以通过HTTP对端口4326进行GET操作。

I am using inno-setup to install a program that needs to unblock port 4326 on Win7 (permit acl access) so that GET operations can be done over HTTP to port 4326.

我有一个powershell脚本,管理员可以运行该脚本来解除阻止该端口的作用。但这不能作为inno-setup [run]命令使用(因为本地计算机通常会禁止脚本运行)。 (即powershell.exe -nowait& script.ps1)

I have a powershell script that an admin can run to unblock the port. But this does not work as an inno-setup [run] command (because the local machine usually disables scripts from running). (i.e powershell.exe -nowait & script.ps1)

我可以设置的目标计算机中是否有一些注册表项可以解除对端口的阻止?由于setup.exe以管理员身份运行,因此我可以在inno-setup中轻松完成此操作。我猜一个独立的EXE可以做同样的事情。

Is there some registry keys in the target machine that I can set that will unblock the port? That I can do pretty easily in inno-setup since the setup.exe runs as an admin. I guess a self-contained EXE could do the same thing.

这里是我想替换的脚本,只需在HKLM中设置注册表设置即可。

Here is the script that I would like to replace with just setting the registry settings in HKLM.

set-alias netsh c:\Windows\System32\netsh.exe
$PORT = 4326
$domain = $Env:userdomain
$name = $Env:username
$ErrorActionPreference = "Continue";

netsh http delete urlacl url=http://*:$PORT/
netsh http add urlacl url=http://*:$PORT/ user=$domain\$name


推荐答案

请参见将netsh.exe作为inno-setup中的安装后运行,以继续进行此操作题。但是我基本上,jachguate将netsh.exe作为后安装程序运行的答案似乎是正确的方法。

See running netsh.exe as a post-install in inno-setup for a continuation of this question. But I basically, jachguate's answer of running netsh.exe as a post install seems the right way to go.

这篇关于netsh acl设置(需要替代方法-注册表设置吗?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆