Skip to content

Commit 641e097

Browse files
committed
Switch to single project packaging
1 parent 5dc2b47 commit 641e097

File tree

10 files changed

+28
-100
lines changed

10 files changed

+28
-100
lines changed

.github/scripts/Configure-AppxManifest.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if ($Branch -eq "SideloadPreview")
4242
# Save modified Package.appxmanifest
4343
$xmlDoc.Save($PackageManifestPath)
4444

45-
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
45+
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.xaml -recurse | ForEach-Object -Process `
4646
{ `
4747
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | `
4848
Set-Content $_ -NoNewline `
@@ -75,7 +75,7 @@ elseif ($Branch -eq "StorePreview")
7575

7676
$xmlDoc.Save($PackageManifestPath)
7777

78-
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
78+
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.xaml -recurse | ForEach-Object -Process `
7979
{ `
8080
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | `
8181
Set-Content $_ -NoNewline `
@@ -102,7 +102,7 @@ elseif ($Branch -eq "SideloadStable")
102102
# Save modified Package.appxmanifest
103103
$xmlDoc.Save($PackageManifestPath)
104104

105-
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
105+
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.xaml -recurse | ForEach-Object -Process `
106106
{ `
107107
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | `
108108
Set-Content $_ -NoNewline `
@@ -133,7 +133,7 @@ elseif ($Branch -eq "StoreStable")
133133
# Save modified Package.appxmanifest
134134
$xmlDoc.Save($PackageManifestPath)
135135

136-
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process `
136+
Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.xaml -recurse | ForEach-Object -Process `
137137
{ `
138138
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | `
139139
Set-Content $_ -NoNewline `

Files.slnx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<File Path="Directory.Packages.props" />
1010
</Folder>
1111
<Folder Name="/src/" />
12-
<Folder Name="/src/core/" Id="8d626ea8-cb54-bc41-363a-217881beba6e">
12+
<Folder Name="/src/core/">
1313
<Project Path="src/Files.Core.SourceGenerator/Files.Core.SourceGenerator.csproj" />
1414
<Project Path="src/Files.Core.Storage/Files.Core.Storage.csproj">
1515
<Platform Solution="*|arm64" Project="arm64" />
@@ -22,10 +22,7 @@
2222
<Platform Solution="*|x86" Project="x86" />
2323
</Project>
2424
</Folder>
25-
<Folder Name="/src/platforms/" Id="82099983-647e-f067-e69a-cd800643a918">
26-
<Project Path="src/Files.App (Package)/Files.Package.wapproj" Type="c7167f0d-bc9f-4e6e-afe1-012c56b48db5">
27-
<Deploy />
28-
</Project>
25+
<Folder Name="/src/platforms/">
2926
<Project Path="src/Files.App.BackgroundTasks/Files.App.BackgroundTasks.csproj">
3027
<Platform Solution="*|arm64" Project="arm64" />
3128
<Platform Solution="*|x64" Project="x64" />

src/Files.App (Package)/Files.Package.wapproj

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/Files.App.Server/Files.App.Server.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,4 @@
5050
<ProjectReference Include="..\Files.Core.SourceGenerator\Files.Core.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="False" />
5151
<ProjectReference Include="..\Files.Shared\Files.Shared.csproj" />
5252
</ItemGroup>
53-
54-
<Import Project="..\Satori.targets" Condition=" '$(Platform)' != 'x86' " />
5553
</Project>

src/Files.App/Files.App.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33

44
<PropertyGroup>
5+
<EnableMsixTooling>true</EnableMsixTooling>
6+
<PublishProfile>Properties\PublishProfiles\win-$(Platform).pubxml</PublishProfile>
57
<TargetFramework>$(WindowsTargetFramework)</TargetFramework>
68
<OutputType>WinExe</OutputType>
79
<AssemblyName>Files</AssemblyName>
@@ -31,7 +33,7 @@
3133
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
3234
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
3335
<PublishReadyToRunComposite Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRunComposite>
34-
<ApplicationIcon>..\Files.App (Package)\Assets\AppTiles\Dev\Logo.ico</ApplicationIcon>
36+
<ApplicationIcon>Assets\AppTiles\Dev\Logo.ico</ApplicationIcon>
3537
</PropertyGroup>
3638

3739
<PropertyGroup>
@@ -138,5 +140,11 @@
138140
<AdditionalFiles Include="Strings\en-US\Resources.resw" />
139141
</ItemGroup>
140142

141-
<Import Project="..\Satori.targets" Condition=" '$(Platform)' != 'x86' " />
143+
<!-- Build Files.App.Server before this project without a ProjectReference, to avoid its
144+
self-contained output files being pulled into the MSIX payload and causing APPX1101 errors -->
145+
<Target Name="BuildFilesAppServer" BeforeTargets="Build;Rebuild;ResolveAssemblyReferences">
146+
<MSBuild Projects="..\Files.App.Server\Files.App.Server.csproj"
147+
Targets="Build"
148+
Properties="Configuration=$(Configuration);Platform=$(Platform)" />
149+
</Target>
142150
</Project>

src/Files.App/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public async Task InitializeApplicationAsync(object activatedEventArgs)
6666
if (launchArgs.Arguments is not null &&
6767
(CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev.exe", StringComparison.OrdinalIgnoreCase)
6868
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase)
69-
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].Equals(Path.Join(Package.Current.InstalledLocation.Path, "Files.App", "Files.exe"), StringComparison.OrdinalIgnoreCase)))
69+
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].Equals(Path.Join(Package.Current.InstalledLocation.Path, "Files.exe"), StringComparison.OrdinalIgnoreCase)))
7070
{
7171
// WINUI3: When launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370)
7272
var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments);

src/Files.App (Package)/Package.appxmanifest renamed to src/Files.App/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<Extensions>
165165
<Extension Category="windows.activatableClass.inProcessServer">
166166
<InProcessServer>
167-
<Path>Files.App\WinRT.Host.dll</Path>
167+
<Path>WinRT.Host.dll</Path>
168168
<ActivatableClass ActivatableClassId="Files.App.BackgroundTasks.UpdateTask" ThreadingModel="both" />
169169
</InProcessServer>
170170
</Extension>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"profiles": {
3+
"MsixPackage": {
4+
"commandName": "MsixPackage"
5+
}
6+
}
7+
}

src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static async Task<bool> CheckDefaultZipApp(string filePath)
103103
{
104104
return Constants.Distributions.KnownAppNames.Any(x => assoc.StartsWith(x, StringComparison.OrdinalIgnoreCase))
105105
|| assoc == Package.Current.Id.FamilyName
106-
|| assoc.EndsWith("Files.App\\Files.exe", StringComparison.OrdinalIgnoreCase)
106+
|| assoc.EndsWith("Files.exe", StringComparison.OrdinalIgnoreCase)
107107
|| assoc.Equals(IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe"), StringComparison.OrdinalIgnoreCase);
108108
}
109109
return true;

src/Files.App/ViewModels/Settings/AdvancedViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private async Task SetAsDefaultExplorerAsync()
5555
var destFolder = Path.Combine(ApplicationData.Current.LocalFolder.Path, "FilesOpenDialog");
5656
Directory.CreateDirectory(destFolder);
5757

58-
foreach (var file in Directory.GetFiles(Path.Combine(Package.Current.InstalledLocation.Path, "Files.App", "Assets", "FilesOpenDialog")))
58+
foreach (var file in Directory.GetFiles(Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "FilesOpenDialog")))
5959
{
6060
if (!SafetyExtensions.IgnoreExceptions(() => File.Copy(file, Path.Combine(destFolder, Path.GetFileName(file)), true), App.Logger))
6161
{
@@ -115,7 +115,7 @@ private async Task SetAsOpenFileDialogAsync()
115115

116116
var destFolder = Path.Combine(ApplicationData.Current.LocalFolder.Path, "FilesOpenDialog");
117117
Directory.CreateDirectory(destFolder);
118-
foreach (var file in Directory.GetFiles(Path.Combine(Package.Current.InstalledLocation.Path, "Files.App", "Assets", "FilesOpenDialog")))
118+
foreach (var file in Directory.GetFiles(Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "FilesOpenDialog")))
119119
{
120120
if (!SafetyExtensions.IgnoreExceptions(() => File.Copy(file, Path.Combine(destFolder, Path.GetFileName(file)), true), App.Logger))
121121
{

0 commit comments

Comments
 (0)