diff --git a/.github/scripts/Package-Windows.ps1 b/.github/scripts/Package-Windows.ps1 index 4823136d..3e7dd464 100644 --- a/.github/scripts/Package-Windows.ps1 +++ b/.github/scripts/Package-Windows.ps1 @@ -68,14 +68,44 @@ function Package { Remove-Item @RemoveArgs + # Build a staging directory with two subfolders: + # recommended/ - new layout, extract to %ProgramData%\obs-studio\ + # legacy/ - old layout, extract to the OBS install directory + $ReleasePath = "${ProjectRoot}/release/${Configuration}" + $StagingPath = "${ProjectRoot}/release/zip-staging" + $NewBinPath = "${ReleasePath}/${ProductName}/bin/64bit" + $NewDataPath = "${ReleasePath}/${ProductName}/data" + + Remove-Item -Path $StagingPath -Recurse -Force -ErrorAction SilentlyContinue + New-Item -ItemType Directory -Force -Path $StagingPath | Out-Null + Copy-Item -Path "${ProjectRoot}/build-aux/CI/windows/README.txt" -Destination "${StagingPath}/README.txt" + + if ( Test-Path -Path $NewBinPath ) { + $RecBinPath = "${StagingPath}/recommended/${ProductName}/bin/64bit" + $LegacyBinPath = "${StagingPath}/legacy/obs-plugins/64bit" + New-Item -ItemType Directory -Force -Path $RecBinPath | Out-Null + New-Item -ItemType Directory -Force -Path $LegacyBinPath | Out-Null + Copy-Item -Path "${NewBinPath}/*" -Destination $RecBinPath -Recurse -Force + Copy-Item -Path "${NewBinPath}/*" -Destination $LegacyBinPath -Recurse -Force + } + if ( Test-Path -Path $NewDataPath ) { + $RecDataPath = "${StagingPath}/recommended/${ProductName}/data" + $LegacyDataPath = "${StagingPath}/legacy/data/obs-plugins/${ProductName}" + New-Item -ItemType Directory -Force -Path $RecDataPath | Out-Null + New-Item -ItemType Directory -Force -Path $LegacyDataPath | Out-Null + Copy-Item -Path "${NewDataPath}/*" -Destination $RecDataPath -Recurse -Force + Copy-Item -Path "${NewDataPath}/*" -Destination $LegacyDataPath -Recurse -Force + } + Log-Group "Archiving ${ProductName}..." $CompressArgs = @{ - Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*") + Path = (Get-ChildItem -Path $StagingPath) CompressionLevel = 'Optimal' DestinationPath = "${ProjectRoot}/release/${OutputName}.zip" - Verbose = ($Env:CI -ne $null) + Verbose = ($null -ne $Env:CI) } Compress-Archive -Force @CompressArgs + Remove-Item -Path $StagingPath -Recurse -Force Log-Group if ( ( $BuildInstaller ) ) { diff --git a/build-aux/CI/windows/README.txt b/build-aux/CI/windows/README.txt new file mode 100644 index 00000000..4a6a859f --- /dev/null +++ b/build-aux/CI/windows/README.txt @@ -0,0 +1,37 @@ +Advanced Scene Switcher - Windows Installation +============================================== + +For full installation instructions visit: +https://github.com/WarmUpTill/SceneSwitcher/wiki/Installation + + +Quick guide +----------- + +This archive contains two installation methods. +Choose ONE depending on your OBS version. + + +recommended\ (preferred) +--------------------------------------------- +Extract the CONTENTS of this folder into: + + C:\ProgramData\obs-studio\ + +Tip: press Win+R and type %ProgramData%\obs-studio\plugins to open that folder. + +After extracting, the path should look like: + C:\ProgramData\obs-studio\plugins\advanced-scene-switcher\bin\64bit\advanced-scene-switcher.dll + + +legacy\ (older OBS versions, portable OBS installs, or if the recommended method does not work) +--------------------------------------------------------------------------- +Extract the CONTENTS of this folder into your OBS installation directory, +typically: + + C:\Program Files\obs-studio\ + +Merge the data\ and obs-plugins\ folders with the existing ones when prompted. + +Steam users: right-click OBS in your library -> Manage -> Browse local files, +then extract the contents of legacy\ into that directory. \ No newline at end of file