-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/windows: create installer for windows x64
Signed-off-by: Adrian Stanea <Adrian.Stanea@analog.com>
- Loading branch information
1 parent
34a963b
commit 2f176a5
Showing
4 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
$ErrorActionPreference = "Stop" | ||
$ErrorView = "NormalView" | ||
|
||
$SRC_DIR = Get-Location | ||
|
||
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 | ||
} | ||
|
||
|
||
Set-Location $SRC_DIR | ||
|
||
$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." | ||
} | ||
|
||
$INSALLER_PATH = Join-Path($SRC_DIR "build-win64\installer") | ||
$DIST_PATH = Join-Path($SRC_DIR "build-win64\dist") | ||
|
||
Copy-Item -Path $ddlPaths.msvcp140Path -Destination $DIST_PATH | ||
Copy-Item -Path $ddlPaths.vcruntime140Path -Destination $DIST_PATH | ||
|
||
# creates installer in: C:\libm2k-system-setup.exe | ||
ISCC (Join-Path $DIST_PATH "libm2k.iss") | ||
|
||
if (-not (Test-Path -Path $INSALLER_PATH)) { | ||
New-Item -Path $INSALLER_PATH -ItemType Directory | ||
} | ||
Move-Item -Path "C:\libm2k-system-setup.exe" -Destination $INSALLER_PATH | ||
|
||
# clear artifacts staging directory and copy the installer -> new step is to push an artifact | ||
Get-ChildItem $env:BUILD_ARTIFACTSTAGINGDIRECTORY -Force -Recurse | Remove-Item -Force -Recurse | ||
Copy-Item -Path (Join-Path $INSALLER_PATH "C:\libm2k-system-setup.exe") -Destination $env:BUILD_ARTIFACTSTAGINGDIRECTORY | ||
|
||
Set-Location $SRC_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters