Reputation: 9665
We package our software to MSI files (using Wix). We use VSTS for Builds and Releases.
Is there a standard way to deploy MSI file as part of the Release?
Yes, I can run msiexec /i ...
as PowerShell or batch script. But we would need a few other things, for example checking exit code, uploading install log file back to VSTS Release or analysing error message, etc.
This all sounds like quite common thing people would like to do, but there is no such standard VSTS step \ extension for this.
Upvotes: 2
Views: 2980
Reputation: 9665
I ended up packaging VSTS extension for this:
https://marketplace.visualstudio.com/items?itemName=ivanboyko.vsts-deploy-MSI
Source code is open-sourced:
https://github.com/IvanBoyko/vsts-install-MSI.git
Upvotes: 2
Reputation: 33698
You can specify log file in msiexec command to install MSI file, then check the detail log content (whether contains errors) by using PowerShell, if there are errors in the log, you can log error or warning by using ##vso[task.logissue].
Regarding upload log file, you can use ##vso[build.uploadlog]local file path to upload installer log file. More information about logging commands, you can refer to this article: Logging Commands.
Simple code to install MSI and wait for the installer to finish:
$filePath='[msi file path]'
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = 'c:\{0}-{1}.log' -f 'nodejsInstall',$DataStamp
$MSIArguments = @(
"/i"
('"{0}"' -f $filePath)
"/qn"
"/norestart"
"/L*v"
$logFile
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow
Upvotes: 0