Unable to build VB6 application in DevOps Server

Viewed 1342

My requirement is to be able to Build VB6 application through Microsoft Azure DevOps Server 2019. For this, I have installed VB6 Enterprise IDE on Microsoft Server 2019, which is working perfectly. For building, I opted to use a Powershell script, which is very simple at the moment.

$vb6 = "C:\Program Files (x86)\Microsoft Visual Studio\VB98\Vb6.exe"
$prj = "C:\proj\Project1.vbp"
$outdir = "C:\proj\out"
$out = "C:\proj\out\log.log"

New-Item -ItemType Directory -Force -Path C:\proj\out
& $vb6 /make $prj /out $out /outdir $outdir

Script itself runs regardless of what project folders I use when I run it through the Powershell window. When it is run through the DevOps, it executes with no issues reported, directory is created, but the VB6 part doesn't seem to execute. Why does this happen and what are my options to make it work?

3 Answers

Have you tried adding additional chr(34) to the beginning and end of $vb6... I'm thinking that since we're building our command line as a string, and usually a path with a space in it needs to be delimited with quotes...

Feel me?...

In the end, I made a pipeline without this step with some others that are needed that will occur at same time every day. After the pipeline is completed, I run Windows scheduled task using this script (with build folders) and I have no issues with it. It is not a real 1/1 resolution to the issue, but it works.

In my powershell scripts I've had more luck running vb6.exe using the "Start-Process" cmdlet, I have found that using the Call Operator (&) was finicky (it's been a while since I've written this bit of the build script, I don't recall exactly what the problems were)

Example-

$projectFile = 'C:\Proj\ProjFile.vbp'
$binaryDir = 'C:\Binaries\Proj'
$logFile = 'C:\Proj\BuildLog.log'
$vb6EXE = 'C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE'
$paramArr = '/MAKE', "`"$projectFile`"", "/outdir `"$binaryDir`"", "/out `"$logFile`""  

Start-Process -FilePath $vb6EXE -ArgumentList $paramArr -NoNewWindow -Wait
Related