Installing Visual Studio Test Controller on Azure instance is not working

1

I already mentioned the problem in another thread, but I thought the root of the error was another. Now I know the real error, but cannot solve it, and don't understand it.

I want to install Visual Studio Test Controller on an Azure instance. I am trying to do that via a startup task, that runs a batch-file which in turn downloads the test controller installation file and installs it on the instance.

The problem is: that does not work when running the installation via startup task. When I log in to the machine via RDP and double click the exact same batch file everything works fine.

Here are some additional information:

This is my batch file I execute:

powershell $command = "set-executionpolicy Unrestricted"
powershell $command = ".\setupController.ps1" -NonInteractive >; out.txt
echo Setup TestController >> %~dp0out.txt
cd E:\approot
timeout /T 60
"E:\approot\testcontroller.exe" /full /q /Log %~dp0install.log
echo Setup has been executed! >> %~dp0out.txt
net user vstestagent MyPassword! /add
net localgroup Administrators vstestagent /add
REM Create a task that will run with full network privileges.
net start Schedule
schtasks /CREATE /TN "Configure Test Controller Service" /SC ONCE /SD 01/01/2020 /ST 00:00:00 /RL HIGHEST /RU vstestagent /RP MyPassword! /TR e:\approot\configcontroller.cmd /F
schtasks /RUN /TN "Configure Test Controller Service"

This is the startup task of the role:

<Task executionContext="elevated" taskType="background" commandLine="setupController.cmd"></Task>

The batch file, as well as the installation file of Test Controller are located in E:\approot folder

The installation logfile of testcontroller says something like that:

0A88:0ABC][2013-04-12T10:36:04]: Creating a system restore point.    
[0A88:0ABC][2013-04-12T10:36:04]: System restore disabled, system    restore point not created. 
[0A88:0ABC][2013-04-12T10:36:04]: Caching    bundle from:    'C:\Resources\temp\48c0ec5daf5846cab7f53f6b5c80dc6f.TestController\RoleTemp\{44f19fb6-98e0-4462-886c-c5e56d82dfd3}\.be\vstf_testcontroller.exe'    to: 'D:\ProgramData\Package    Cache\{44f19fb6-98e0-4462-886c-c5e56d82dfd3}\vstf_testcontroller.exe'    
[0A88:0ABC][2013-04-12T10:36:04]: Registering bundle dependency    provider: {44f19fb6-98e0-4462-886c-c5e56d82dfd3}, version:
       11.0.51106.1 
[0A40:09EC][2013-04-12T10:36:04]: MUX:  Cache Begin 
[0A40:064C][2013-04-12T10:36:05]: Error 0x80070070: Failed to set end    of file. 
[0A40:064C][2013-04-12T10:36:05]: Error 0x80070070: Failed    to extract all files from container.    
[0A40:09EC][2013-04-12T10:36:05]: Error 0x80070070: Faild to begin    and wait for operation. 
[0A40:09EC][2013-04-12T10:36:05]: Error    0x80070070: Failed to extract payload: a25 from container:    WixAttachedContainer 
[0A40:09EC][2013-04-12T10:36:05]: Failed to    extract payloads from container: WixAttachedContainer to working    path: E:\approot\testcontroller.exe, error: 0x80070070.    
[0A40:0B98][2013-04-12T10:36:05]: Error 0x80070070: Failed while    caching, aborting execution. 
[0A88:0ABC][2013-04-12T10:36:05]:    Removed bundle dependency provider:    {44f19fb6-98e0-4462-886c-c5e56d82dfd3}
... Some Rollback and cleanup
[0A40:0B98][2013-04-12T10:36:06]: Variable: WixBundleTag = vstf_testcontroller,1031
[0A40:0B98][2013-04-12T10:36:06]: Variable: WixBundleVersion = 11.0.51106.1
[0A40:0B98][2013-04-12T10:36:06]: Exit code: 0x643, restarting: No

I really don't know where the problem is - especially because when I run the batch file via RDP everything works just fine. The only difference seems to be the user esecuting the batch: Startup Tasks run with administrative priviledges and I think my RDP account is another, but also has administrative priviledges....

Best regards Sebastian

testing
azure
installation
asked on Stack Overflow Apr 12, 2013 by sebastian87

1 Answer

1

I still don't know WHY it is that way, but the installation works, if you do it via a scheduled task.

Because I thought the only difference is maybe the account installing the software, I first tried to install the test controller via runas command, but I could not pass a password along with the command. So I created a scheduled task for installing the test controller and was able to pass user credentials along with the command. Now my setupController.cmd looks like this:

powershell $command = "set-executionpolicy Unrestricted"
powershell $command = ".\setupController.ps1" -NonInteractive >; out.txt
echo Setup TestController >> %~dp0out.txt
cd E:\approot
echo Setup has been executed! >> %~dp0out.txt
net user vstestagent MyPassword! /add
net localgroup Administrators vstestagent /add
REM Create a task that will run with full network privileges.
net start Schedule
schtasks /CREATE /TN "Install Test Controller Service" /SC ONCE /SD 01/01/2020 /ST 00:00:00 /RL HIGHEST /RU vstestagent /RP MyPassword! /TR "E:\approot\testcontroller.exe /full /q /Log %~dp0install.log" /F
schtasks /RUN /TN "Install Test Controller Service"
timeout /T 120
schtasks /CREATE /TN "Configure Test Controller Service" /SC ONCE /SD 01/01/2020 /ST 00:00:00 /RL HIGHEST /RU vstestagent /RP MyPassword! /TR e:\approot\configcontroller.cmd /F
schtasks /RUN /TN "Configure Test Controller Service"

Hope it helps somebody else also.

answered on Stack Overflow Apr 13, 2013 by sebastian87 • edited Apr 14, 2013 by sebastian87

User contributions licensed under CC BY-SA 3.0