File: Build_GUI_Windows.ps1

package info (click to toggle)
mediainfo 26.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,912 kB
  • sloc: cpp: 19,090; objc: 3,102; xml: 1,428; sh: 1,328; python: 263; makefile: 212
file content (78 lines) | stat: -rwxr-xr-x 4,181 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
##  Copyright (c) MediaArea.net SARL. All Rights Reserved.
##
##  Use of this source code is governed by a BSD-style license that can
##  be found in the License.html file in the root of the source tree.
##

Param([parameter(Mandatory=$true)][String]$arch)

$ErrorActionPreference = "Stop"

#-----------------------------------------------------------------------
# Setup
$release_directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$version = (Get-Content "${release_directory}\..\Project\version.txt" -Raw).Trim()
$arch_bcb="${arch}"
if ("${arch}" -eq "x64" ) {
    $arch_bcb="Win64"
}

#-----------------------------------------------------------------------
# Prepare
Push-Location -Path "${release_directory}\..\..\zlib\contrib\vstudio\vc17"
    ((Get-Content -Path zlibstat.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path zlibstat.vcxproj
Pop-Location

Push-Location -Path "${release_directory}\..\..\ZenLib\Project\MSVC2022\Library"
    ((Get-Content -Path ZenLib.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path ZenLib.vcxproj
Pop-Location

Push-Location -Path "${release_directory}\..\..\MediaInfoLib\Project\MSVC2022"
    ((Get-Content -Path Library\MediaInfoLib.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Library\MediaInfoLib.vcxproj
    ((Get-Content -Path Dll\MediaInfoDll.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Dll\MediaInfoDll.vcxproj
    ((Get-Content -Path Example\HowToUse_Dll.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path Example\HowToUse_Dll.vcxproj
    ((Get-Content -Path ShellExtension\MediaInfoShellExt.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path ShellExtension\MediaInfoShellExt.vcxproj
    ((Get-Content -Path FieldsDescription\FieldsDescription.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path FieldsDescription\FieldsDescription.vcxproj
    ((Get-Content -Path RegressionTest\RegressionTest.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path RegressionTest\RegressionTest.vcxproj
    ((Get-Content -Path PreRelease\PreRelease.vcxproj) -Replace 'MultiThreadedDLL','MultiThreaded') | Set-Content -Path PreRelease\PreRelease.vcxproj
Pop-Location


#-----------------------------------------------------------------------
# Build
### Build: MediaInfo DLL ###
Push-Location -Path "${release_directory}\..\..\MediaInfoLib\Project\MSVC2022"
    MSBuild "/p:Configuration=Release;Platform=${arch}" MediaInfoLib.sln
    if ("${arch}" -eq "x64") { # Also build native ARM MediaInfo.dll
        MSBuild "/p:Configuration=Release;Platform=ARM64" MediaInfoLib.sln
        MSBuild "/p:Configuration=Release;Platform=ARM64EC" MediaInfoLib.sln
    }
Pop-Location

### Build: Windows 11 menu helper ###
Push-Location -Path "${release_directory}\..\Project\MSVC2022"
    makeappx pack /d "..\..\Source\WindowsSparsePackage\MSIX" /p "${arch}\Release\MediaInfo_SparsePackage.msix" /nv
Pop-Location

Push-Location -Path "${release_directory}\..\Project\MSVC2022"
    MSBuild /restore "/p:RestorePackagesConfig=true;Configuration=Release;Platform=${arch}" "/t:MediaInfo_WindowsShellExtension" MediaInfo.sln
    if ("${arch}" -eq "x64") { # Also build native ARM MediaInfo_WindowsShellExtension.dll
        MSBuild "/p:RestorePackagesConfig=true;Configuration=Release;Platform=ARM64" "/t:MediaInfo_WindowsShellExtension" MediaInfo.sln
    }
    MSBuild /restore "/p:RestorePackagesConfig=true;Configuration=Release;Platform=Win32" "/t:MediaInfo_PackageHelper" MediaInfo.sln
Pop-Location

### Build: zlib BCB library ###
Push-Location -Path "${release_directory}\..\..\zlib\contrib\BCB"
    MSBuild "/p:Configuration=Release;Platform=${arch_bcb}" zlib.cbproj
Pop-Location

### Build: Zenlib BCB library ###
Push-Location -Path "${release_directory}\..\..\ZenLib\Project\BCB\Library"
    MSBuild "/p:Configuration=Release;Platform=${arch_bcb}" ZenLib.cbproj
Pop-Location

### Build: GUI ###
Push-Location -Path "${release_directory}\..\Project\BCB\GUI"
    MSBuild "/p:Configuration=Release;Platform=${arch_bcb}" MediaInfo_GUI.cbproj
Pop-Location