[Demo] remove bg music from bundled demo

This commit is contained in:
ParantezTech 2026-10-10 16:40:10 +03:00
parent 4d5697892e
commit a298369293
3 changed files with 40 additions and 2 deletions

View File

@ -181,7 +181,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
</Target>
<PropertyGroup>
<SharpEmuDemoTag>e3a6dd3</SharpEmuDemoTag>
<SharpEmuDemoTag>49e6b3b</SharpEmuDemoTag>
<SharpEmuDemoFolderName>demo</SharpEmuDemoFolderName>
<SharpEmuDemoCacheDir>$(BaseIntermediateOutputPath)sharpemu-demo/$(SharpEmuDemoTag)</SharpEmuDemoCacheDir>
<SharpEmuDemoArchive>$(SharpEmuDemoCacheDir)/sharpemu-demo.zip</SharpEmuDemoArchive>
@ -207,6 +207,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
DestinationFolder="$(SharpEmuDemoDir)"
Condition="'$(SharpEmuDemoTag)' != '' And '$(_SharpEmuDemoCurrent)' != 'true' And Exists('$(SharpEmuDemoArchive)')"
ContinueOnError="WarnAndContinue" />
<!-- Older demo releases include preview music; keep the bundled demo silent. -->
<Delete Files="$(SharpEmuDemoDir)sce_sys/snd0.at9" />
<PropertyGroup>
<SharpEmuDemoComplete Condition="Exists('$(SharpEmuDemoDir)eboot.bin') And Exists('$(SharpEmuDemoDir)sce_sys/param.json') And Exists('$(SharpEmuDemoDir)sce_sys/icon0.png') And Exists('$(SharpEmuDemoDir)sce_sys/pic0.png')">true</SharpEmuDemoComplete>
</PropertyGroup>
@ -231,6 +233,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
SourceFiles="@(_SharpEmuDemoFiles)"
DestinationFiles="@(_SharpEmuDemoFiles->'$(OutDir)$(SharpEmuDemoFolderName)/%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />
<Delete Files="$(OutDir)$(SharpEmuDemoFolderName)/sce_sys/snd0.at9" />
</Target>
<Target Name="PublishSharpEmuDemo" AfterTargets="Publish" DependsOnTargets="FetchSharpEmuDemo">
@ -245,6 +248,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
SourceFiles="@(_SharpEmuDemoFiles)"
DestinationFiles="@(_SharpEmuDemoFiles->'$(PublishDir)$(SharpEmuDemoFolderName)/%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />
<Delete Files="$(PublishDir)$(SharpEmuDemoFolderName)/sce_sys/snd0.at9" />
</Target>
</Project>

View File

@ -15,7 +15,6 @@ internal static class BundledDemo
Path.Combine("sce_sys", "param.json"),
Path.Combine("sce_sys", "icon0.png"),
Path.Combine("sce_sys", "pic0.png"),
Path.Combine("sce_sys", "snd0.at9"),
];
internal static string? FindEboot(string baseDirectory)

View File

@ -0,0 +1,35 @@
// Copyright (C) 2026 SharpEmu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
using SharpEmu.GUI;
using Xunit;
namespace SharpEmu.Libs.Tests.GUI;
public sealed class BundledDemoTests
{
[Fact]
public void FindEbootRequiresDemoAssetsButNotPreviewMusic()
{
var directory = Directory.CreateTempSubdirectory("bundled-demo-test-");
try
{
var root = Path.Combine(directory.FullName, BundledDemo.FolderName);
var assets = Directory.CreateDirectory(Path.Combine(root, "sce_sys")).FullName;
var eboot = Path.Combine(root, "eboot.bin");
File.WriteAllBytes(eboot, []);
foreach (var name in new[] { "param.json", "icon0.png", "pic0.png" })
{
File.WriteAllBytes(Path.Combine(assets, name), []);
}
Assert.Equal(eboot, BundledDemo.FindEboot(directory.FullName));
File.Delete(Path.Combine(assets, "param.json"));
Assert.Null(BundledDemo.FindEboot(directory.FullName));
}
finally
{
directory.Delete(recursive: true);
}
}
}