Skip to content

Commit 7fd2979

Browse files
committed
Support legacy and new Windows install paths in zip archive
See https://obsproject.com/kb/plugins-guide for more details
1 parent 2077e19 commit 7fd2979

2 files changed

Lines changed: 69 additions & 2 deletions

File tree

.github/scripts/Package-Windows.ps1

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 ) ) {

build-aux/CI/windows/README.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Advanced Scene Switcher - Windows Installation
2+
==============================================
3+
4+
For full installation instructions visit:
5+
https://github.com/WarmUpTill/SceneSwitcher/wiki/Installation
6+
7+
8+
Quick guide
9+
-----------
10+
11+
This archive contains two installation methods.
12+
Choose ONE depending on your OBS version.
13+
14+
15+
recommended\ (preferred)
16+
---------------------------------------------
17+
Extract the CONTENTS of this folder into:
18+
19+
C:\ProgramData\obs-studio\
20+
21+
Tip: press Win+R and type %ProgramData%\obs-studio\plugins to open that folder.
22+
23+
After extracting, the path should look like:
24+
C:\ProgramData\obs-studio\plugins\advanced-scene-switcher\bin\64bit\advanced-scene-switcher.dll
25+
26+
27+
legacy\ (older OBS versions, portable OBS installs, or if the recommended method does not work)
28+
---------------------------------------------------------------------------
29+
Extract the CONTENTS of this folder into your OBS installation directory,
30+
typically:
31+
32+
C:\Program Files\obs-studio\
33+
34+
Merge the data\ and obs-plugins\ folders with the existing ones when prompted.
35+
36+
Steam users: right-click OBS in your library -> Manage -> Browse local files,
37+
then extract the contents of legacy\ into that directory.

0 commit comments

Comments
 (0)