4

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?

  • Maybe the path to the vb6.exe isn't part of the environment at that time? Try changing the compile line to explicitly include the full path for vb6.exe. – MarkL Jul 01 '20 at 12:28
  • I have already tried that, same result as initial one. Permissions are fine, as I am able to run scripts that create new files, folders, or run Python scripts or .net core exe files, so that's also out of the question. I tried running it also through .net core exe inside build pipeline, which also yielded same result. – Boris Martinovic Jul 01 '20 at 13:04
  • Your command-line for the VB6 build looks correct to me. I have never used Azure DevOps Server though, can't comment on that part. Sorry not to be more help. – MarkJ Jul 01 '20 at 15:49
  • 2
    How about use the powershell scripts directly to build the VB6 application in the server machine directly without Azure DevOps Server? If possible, please check if this document: http://www.donovanbrown.com/post/Build-Visual-Basic-60-applications-with-Visual-Studio-Team-Services give any helps. – Leo Liu Jul 02 '20 at 05:36
  • @LeoLiu-MSFT I actually just did that for now, but will leave this question open for a while if I or someone else find out the answer to it. – Boris Martinovic Jul 02 '20 at 13:51
  • Take a look at [How to setup CI with Azure Pipelines for VB6 projects on github.com](http://www.vbforums.com/showthread.php?880049-RESOLVED-WIP-How-to-setup-CI-with-Azure-Pipelines-for-VB6-projects-on-github-com) post and the linked `build.bat` batch file from a repo that is already using Azure Pipelines w/ VB6. – wqw Jul 02 '20 at 15:39
  • Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Jul 06 '20 at 06:00
  • 1
    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. – Boris Martinovic Jul 06 '20 at 08:39
  • @BorisMartinovic, Glad to know that you have resolved your question, would you please converted your comment to the answer, This can be beneficial to other community members reading this thread and we could close this thread, thanks – Leo Liu Jul 07 '20 at 01:08
  • How do you install VB6 Enterprise IDE on Windows Server 2019? – Borislav Ivanov Dec 23 '22 at 20:51

3 Answers3

0

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?...

  • I considered that beforehand and I have also tried just using CD to folder and executing VB6.exe from there, it all works when i run it locally, but DevOps just won't go through with this line. – Boris Martinovic Jul 03 '20 at 11:41
0

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.

0

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
Alex
  • 343
  • 1
  • 5
  • 13