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

时间:2011-03-31 14:16:52

标签: 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: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运行者是否以另一个用户身份运行?

1 个答案:

答案 0 :(得分:0)

最有可能的是,您将TeamCity构建代理作为Windows服务运行。请确保此Windows服务在具有足够权限的Windows帐户下运行。