Command line 如何使用TeamCity导入注册表设置?

Command line 如何使用TeamCity导入注册表设置?,command-line,continuous-integration,registry,teamcity,Command Line,Continuous Integration,Registry,Teamcity,使用TeamCity从.reg文件导入设置时遇到问题。有问题的应用程序有很多注册表设置,这些设置会定期更改,因此将其作为构建步骤至关重要 我正在使用以下命令: regedit /s "C:\app\params\epm\epm_tlp\trunk\csr_vsm_tlp_exl.reg" 路径很好(我检查了好几次)。当我手动运行此命令时,它可以工作。然而,当从TeamCity运行时,它似乎没有任何作用。这是日志: [16:01:13]: Checking for changes [16:01:

使用TeamCity从
.reg
文件导入设置时遇到问题。有问题的应用程序有很多注册表设置,这些设置会定期更改,因此将其作为构建步骤至关重要

我正在使用以下命令:

regedit /s "C:\app\params\epm\epm_tlp\trunk\csr_vsm_tlp_exl.reg"
路径很好(我检查了好几次)。当我手动运行此命令时,它可以工作。然而,当从TeamCity运行时,它似乎没有任何作用。这是日志:

[16:01:13]: Checking for changes
[16:01:16]: Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[16:01:16]: Checkout directory: C:\app
[16:01:16]: Updating sources: server side checkout... (1s)
[16:01:16]: [Updating sources: server side checkout...] Building incremental patch for VCS root: NEP-content
[16:01:18]: [Updating sources: server side checkout...] Repository sources transferred
[16:01:18]: Step 1/2
[16:01:18]: [Step 1/2] Using runner: simpleRunner
[16:01:18]: [Step 1/2] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script1107617910631593889.cmd
[16:01:18]: [Step 1/2] in directory: C:\app\params\epm\epm_tlp\trunk
[16:01:18]: [Step 1/2] C:\app\params\epm\epm_tlp\trunk>regedit /s "C:\app\params\epm\epm_tlp\trunk\csr_vsm_tlp_exl.reg"
[16:01:18]: [Step 1/2] Process exited with code 0
[16:01:18]: Step 2/2
[16:01:18]: [Step 2/2] Using runner: simpleRunner
[16:01:18]: [Step 2/2] Starting: c:\app\exe\startup.exe
[16:01:18]: [Step 2/2] in directory: C:\app\exe
[16:01:18]: [Step 2/2] Process exited with code -1073741515
[16:01:18]: [Step 2/2] Step failed
[16:01:18]: Publishing artifacts
[16:01:18]: [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[16:01:18]: [Publishing artifacts] Sending files
[16:01:18]: Build finished

这是我第一次尝试TeamCity,所以我不知道从哪里开始寻找麻烦,为什么这个命令会失败?是否有任何安全原因?TeamCity Runner是否以其他用户的身份运行?

最有可能的情况是,TeamCity build agent以Windows服务的形式运行。请确保此windows服务在具有足够权限的windows帐户下运行。

最可能的情况是,您的TeamCity build agent作为windows服务运行。请确保此windows服务在windows帐户下运行,该帐户具有足够的权限。

今天早上我确实想到了这一点,所以我已经签出了它。我已将其从作为系统帐户运行切换到管理员帐户,但没有任何帮助:-/我不明白的一件事是,regedit正在退出,代码为0…是否失败?请仔细检查-您是否更改了TeamCity build agent service(而不是TeamCity server service)的用户。我今天早上确实想到了这一点,所以我查过了。我已将其从作为系统帐户运行切换为管理员帐户,但没有任何帮助:-/我不明白的一件事是,regedit正在退出,代码为0…是否失败?请仔细检查-您是否更改了TeamCity build agent service(而不是TeamCity server service)的用户?您是否尝试过“REG.EXE导入”?因为它是一个控制台应用程序,所以可能会输出一条有用的错误消息。@RogerLipscombe:我没有尝试过,没有。目前我没有时间再次“玩”TC,但当我玩的时候,我会尝试让你知道。谢谢您尝试过“REG.EXE导入”吗?因为它是一个控制台应用程序,所以可能会输出一条有用的错误消息。@RogerLipscombe:我没有尝试过,没有。目前我没有时间再次“玩”TC,但当我玩的时候,我会尝试让你知道。谢谢