@@ -68,14 +68,44 @@ function Package {
6868
6969 Remove-Item @RemoveArgs
7070
71+ # Build a staging directory with two subfolders:
72+ # recommended/ - new layout, extract to %ProgramData%\obs-studio\
73+ # legacy/ - old layout, extract to the OBS install directory
74+ $ReleasePath = " ${ProjectRoot} /release/${Configuration} "
75+ $StagingPath = " ${ProjectRoot} /release/zip-staging"
76+ $NewBinPath = " ${ReleasePath} /${ProductName} /bin/64bit"
77+ $NewDataPath = " ${ReleasePath} /${ProductName} /data"
78+
79+ Remove-Item - Path $StagingPath - Recurse - Force - ErrorAction SilentlyContinue
80+ New-Item - ItemType Directory - Force - Path $StagingPath | Out-Null
81+ Copy-Item - Path " ${ProjectRoot} /build-aux/CI/windows/README.txt" - Destination " ${StagingPath} /README.txt"
82+
83+ if ( Test-Path - Path $NewBinPath ) {
84+ $RecBinPath = " ${StagingPath} /recommended/${ProductName} /bin/64bit"
85+ $LegacyBinPath = " ${StagingPath} /legacy/obs-plugins/64bit"
86+ New-Item - ItemType Directory - Force - Path $RecBinPath | Out-Null
87+ New-Item - ItemType Directory - Force - Path $LegacyBinPath | Out-Null
88+ Copy-Item - Path " ${NewBinPath} /*" - Destination $RecBinPath - Recurse - Force
89+ Copy-Item - Path " ${NewBinPath} /*" - Destination $LegacyBinPath - Recurse - Force
90+ }
91+ if ( Test-Path - Path $NewDataPath ) {
92+ $RecDataPath = " ${StagingPath} /recommended/${ProductName} /data"
93+ $LegacyDataPath = " ${StagingPath} /legacy/data/obs-plugins/${ProductName} "
94+ New-Item - ItemType Directory - Force - Path $RecDataPath | Out-Null
95+ New-Item - ItemType Directory - Force - Path $LegacyDataPath | Out-Null
96+ Copy-Item - Path " ${NewDataPath} /*" - Destination $RecDataPath - Recurse - Force
97+ Copy-Item - Path " ${NewDataPath} /*" - Destination $LegacyDataPath - Recurse - Force
98+ }
99+
71100 Log- Group " Archiving ${ProductName} ..."
72101 $CompressArgs = @ {
73- Path = (Get-ChildItem - Path " ${ProjectRoot} /release/ ${Configuration} " - Exclude " ${OutputName} *.* " )
102+ Path = (Get-ChildItem - Path $StagingPath )
74103 CompressionLevel = ' Optimal'
75104 DestinationPath = " ${ProjectRoot} /release/${OutputName} .zip"
76- Verbose = ($Env: CI -ne $null )
105+ Verbose = ($null -ne $Env: CI )
77106 }
78107 Compress-Archive - Force @CompressArgs
108+ Remove-Item - Path $StagingPath - Recurse - Force
79109 Log- Group
80110
81111 if ( ( $BuildInstaller ) ) {
0 commit comments