2023-04-12 10:02:36 +00:00
|
|
|
# Check wix installation
|
|
|
|
$wixInstalledFolder = "C:\Program Files (x86)\WiX Toolset v3.11\bin"
|
|
|
|
if(Test-Path $wixInstalledFolder)
|
|
|
|
{
|
|
|
|
$wixFolder = $wixInstalledFolder
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$prepareWix = Join-Path $PSScriptRoot -ChildPath prepare_wix.ps1
|
|
|
|
& "$prepareWix"
|
|
|
|
$wixFolder = Join-Path $PSScriptRoot -ChildPath 'wix/'
|
|
|
|
}
|
2022-11-14 18:55:00 +00:00
|
|
|
$candleToolPath = Join-Path $wixFolder -ChildPath candle.exe
|
|
|
|
$lightToolPath = Join-Path $wixFolder -ChildPath light.exe
|
|
|
|
$heatToolPath = Join-Path $wixFolder -ChildPath heat.exe
|
2023-04-12 10:02:36 +00:00
|
|
|
|
2023-03-05 19:57:26 +00:00
|
|
|
$GPSUpgradeCode = "9B87C8FF-599C-4F20-914E-AF5E68CB3DC0"
|
2023-09-17 18:02:44 +00:00
|
|
|
|
|
|
|
$GPSVersion = Get-Content $PSScriptRoot\..\..\VERSION -Raw
|
2023-03-05 19:57:26 +00:00
|
|
|
Write-Output $GPSVersion
|
2022-11-14 18:55:00 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
Push-Location $PSScriptRoot
|
|
|
|
|
|
|
|
if(-not (Test-Path $wixFolder))
|
|
|
|
{
|
|
|
|
throw "Folder $wixFolder does not exist. Start DownloadAndExtractWix.ps1 script to create it."
|
|
|
|
}
|
|
|
|
if((-not (Test-Path $candleToolPath)) -or (-not (Test-Path $lightToolPath)))
|
|
|
|
{
|
|
|
|
throw "Tools required to build installer (candle.exe and light.exe) do not exist in wix folder."
|
|
|
|
}
|
|
|
|
# GST and GTK are installed in this folder by prepare_gstreamer.ps1.
|
|
|
|
# GST and GTK are built by the docker image.
|
|
|
|
$gstreamerInstallDir="c:\gst-install-clean"
|
|
|
|
$gstreamerBinInstallDir= Join-Path $gstreamerInstallDir -ChildPath "bin/"
|
|
|
|
$gstreamerPluginInstallDir= Join-Path $gstreamerInstallDir -ChildPath "lib\gstreamer-1.0"
|
|
|
|
|
|
|
|
& "$heatToolPath" dir "$gstreamerBinInstallDir" -gg -sfrag -template:fragment -out gstreamer-1.0.wxs -cg "_gstreamer" -var var.gstreamerBinInstallDir -dr INSTALLFOLDER
|
|
|
|
& "$heatToolPath" dir "$gstreamerPluginInstallDir" -gg -sfrag -template:fragment -out gstreamer-plugins-1.0.wxs -cg "_gstreamer_plugins" -var var.gstreamerPluginInstallDir -dr INSTALLFOLDER
|
|
|
|
|
|
|
|
$files = "gps gstreamer-1.0 gstreamer-plugins-1.0"
|
|
|
|
$wxs_files = @()
|
|
|
|
$obj_files = @()
|
|
|
|
foreach ($f in $files.split(" ")){
|
|
|
|
$wxs_files += "$f.wxs"
|
|
|
|
$obj_files += "$f.wixobj"
|
|
|
|
}
|
|
|
|
Write-Output $wxs_files
|
|
|
|
Write-Output $obj_files
|
|
|
|
# compiling wxs file into wixobj
|
2023-03-05 19:57:26 +00:00
|
|
|
$msiFileName = "GstPipelineStudio-$GPSVersion.msi"
|
2022-11-14 18:55:00 +00:00
|
|
|
foreach ($f in $wxs_files){
|
2023-03-05 19:57:26 +00:00
|
|
|
& "$candleToolPath" "$f" -dPlatform=x64 -dGPSUpgradeCode="$GPSUpgradeCode" -dGPSVersion="$GPSVersion" -dgstreamerBinInstallDir="$gstreamerBinInstallDir" -dgstreamerPluginInstallDir="$gstreamerPluginInstallDir"
|
2022-11-14 18:55:00 +00:00
|
|
|
if($LASTEXITCODE -ne 0)
|
|
|
|
{
|
|
|
|
throw "Compilation of $wxsFileName failed with exit code $LASTEXITCODE"
|
|
|
|
}
|
|
|
|
}
|
2023-09-16 10:58:15 +00:00
|
|
|
|
2022-11-14 18:55:00 +00:00
|
|
|
$AllArgs = $obj_files + @('-out', $msiFileName)
|
|
|
|
|
2022-11-30 17:08:47 +00:00
|
|
|
& $lightToolPath $AllArgs -ext WixUIExtension
|
2022-11-14 18:55:00 +00:00
|
|
|
if($LASTEXITCODE -ne 0)
|
|
|
|
{
|
|
|
|
throw "Linking of $wixobjFileName failed with exit code $LASTEXITCODE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
Write-Error $_
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
Pop-Location
|
|
|
|
}
|