Skip to content

Commit

Permalink
ci/windows: create installer for windows x64
Browse files Browse the repository at this point in the history
- create a subfolder in the artifacts folder for the installer
- another subfolder will be created for the zip artifacts

Signed-off-by: Adrian Stanea <[email protected]>
  • Loading branch information
Adrian-Stanea committed Nov 13, 2023
1 parent 34a963b commit 7ae8da0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
49 changes: 49 additions & 0 deletions CI/windows/create_installer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
$ErrorActionPreference = "Stop"
$ErrorView = "NormalView"

function Get-Dll-Paths() {
$vsPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if ($vsPath -eq $null) {
Write-Host "Visual Studio (vswhere.exe) not found - can't find dll paths."
return $null
}

$vsInstallerPath = & $vsPath -latest -requires Microsoft.Component.MSBuild -property installationPath
if ($vsInstallerPath -eq $null) {
Write-Host "Visual Studio Installer path is not available"
return $null
}

$msvcp140Path = Join-Path $vsInstallerPath 'VC\Tools\MSVC\14.*\bin\Hostx64\x64\msvcp140.dll'
$vcruntime140Path = Join-Path $vsInstallerPath 'VC\Tools\MSVC\14.*\bin\Hostx64\x64\vcruntime140.dll'
if (($msvcp140Path -eq $null) -or ($vcruntime140Path -eq $null)) {
Write-Host "Dll paths not found in Visual Studion installation path."
return $null
}

$result = New-Object PSObject -Property @{
msvcp140Path = $msvcp140Path
vcruntime140Path = $vcruntime140Path
}
return $result
}

$ddlPaths = Get-Dll-Paths

if ($ddlPaths -ne $null) {
Write-Host "msvcp140Path: $($ddlPaths.msvcp140Path)"
Write-Host "vcruntime140Path: $($ddlPaths.vcruntime140Path)"
} else {
Write-Host "Dll Paths not found."
}

$DIST_PATH = Join-Path($Agent.BuildDirectory "s\build-win64\dist")
Copy-Item -Path $ddlPaths.msvcp140Path -Destination $DIST_PATH
Copy-Item -Path $ddlPaths.vcruntime140Path -Destination $DIST_PATH

ISCC (Join-Path $DIST_PATH "libm2k.iss")


$INSTALLER_STAGING_DIR = Join-Path($env:BUILD_ARTIFACTSTAGINGDIRECTORY "installer")

Move-Item C:\libm2k-system-setup.exe $INSTALLER_STAGING_DIR
17 changes: 16 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,25 @@ jobs:
targetType: filePath
filePath: ./CI/windows/install_deps.ps1
- task: PowerShell@2
displayName: 'Build libm2k'
inputs:
targetType: 'filePath'
filePath: ./CI/windows/make_windows.ps1
displayName: 'Build libm2k'
- task: PowerShell@2
displayName: 'Create libm2k-system-setup installer'
inputs:
targetType: 'filePath'
filePath: ./CI/windows/create_installer.ps1
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)\installer'
artifactName: 'Libm2k-Setup-Exe'


# Should do the create installer step

# Zips




0 comments on commit 7ae8da0

Please sign in to comment.