-1

I have a powershell script which will install an exe. It works fine when i try it from a powershell ISE console, but it fails when i try it from TFS build step. Note : My TFS user, agent user and triggering user are same. Could anybody can shed some light on this issue ?

Start-Process -FilePath $installerFileName -Verb "runas" -ArgumentList $parameter -Wait

The above code is using to install the exe. $parameter is a list of custom parameters.

I am getting below error

[WixSession.GetSession][GetSessionValues]exception: Value cannot be null. Parameter name: s

Arun
  • 182
  • 1
  • 2
  • 14
  • 1
    Do you get any error messages? They may be helpful – Theo Sep 04 '18 at 14:43
  • Is the script running on a TFS agent or the target machine? How (specifically) are you trying to install the application? Please provide more details. – Dan Wilson Sep 04 '18 at 14:48
  • @Theo , error message has been added. It is coming from installer. But the error throwing only when it is running under build step. It will work fine, if i run it from console. – Arun Sep 05 '18 at 05:30
  • @DanWilson, more information has been added. Here my TFS agent and target machine are same. – Arun Sep 05 '18 at 05:32
  • Can you share the powershell script? – Eddie Chen - MSFT Sep 07 '18 at 01:42

1 Answers1

0

What kind of exe are you trying to install? Dose that support silent installation? If UI pop up during the installation, then the agent needs to run in interactive mode.

Test on my side with below command to install/unistall the notepad++ with service mode, everyting works as expected:

start-process -FilePath "D:\Software\npp.7.5.8.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait

And:

start-process -FilePath "C:\Program Files\Notepad++\uninstall.exe" -ArgumentList '/S' -Verb runas -Wait
Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • My installer supports Silent installation. It works silently on my console window. But the mentioned error throws while it runs by TFS build step. – Arun Sep 05 '18 at 08:53
  • @Arun Can you run the command directly on your build server (agent machine)? – Andy Li-MSFT Sep 05 '18 at 09:30
  • I ran the command directly in my agent machine, it went good. But when i try it under TFS build step, it throws error. – Arun Sep 05 '18 at 10:12
  • @Arun Could you please provide the `*.exe` file and the detail parameters for further troubleshooting? You can share the files in Github or Onedrive or anywhere we can access them... – Andy Li-MSFT Sep 05 '18 at 10:27