Skip to content

Code Quality: Format XML files & Add prefixes to BackgroundTasks project name #12659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Files.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Backend", "src\Files.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Sdk.Storage", "src\Files.Sdk.Storage\Files.Sdk.Storage.csproj", "{53371D77-7AC1-4975-9A2A-5E0EB0B37CE3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BackgroundTasks", "src\BackgroundTasks\BackgroundTasks.csproj", "{BB1DA0B0-4E5B-4336-961E-DF389482C094}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App.BackgroundTasks", "src\Files.App.BackgroundTasks\Files.App.BackgroundTasks.csproj", "{BB1DA0B0-4E5B-4336-961E-DF389482C094}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.InteractionTests", "tests\Files.InteractionTests\Files.InteractionTests.csproj", "{4ED01D20-8529-4DEF-8C1B-4E31031AE7E0}"
EndProject
Expand Down
15 changes: 11 additions & 4 deletions src/Files.App (Package)/Files.Package.wapproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '17.0'">
<VisualStudioVersion>17.0</VisualStudioVersion>
</PropertyGroup>

<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -65,11 +67,14 @@
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>

<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
<PathToXAMLWinRTImplementations>Files.App\</PathToXAMLWinRTImplementations>
</PropertyGroup>

<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />

<PropertyGroup>
<ProjectGuid>8f60fd8e-1921-47d6-97b0-d26d7b3a4999</ProjectGuid>
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
Expand All @@ -91,24 +96,26 @@
<EntryPointProjectUniqueName>..\Files.App\Files.App.csproj</EntryPointProjectUniqueName>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>

<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\AppTiles\Dev\**" />
<Content Include="Package.appinstaller" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Files.App\Files.App.csproj">
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
</ProjectReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" IncludeAssets="build" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" IncludeAssets="build" />
</ItemGroup>

<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
</Project>

</Project>
16 changes: 0 additions & 16 deletions src/Files.App (Package)/Package.appinstaller

This file was deleted.

140 changes: 89 additions & 51 deletions src/Files.App (Package)/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2023 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
IgnorableNamespaces="uap uap5 mp rescap desktop6 desktop4 desktop">
<Identity Name="FilesDev" Publisher="CN=Files" Version="2.5.2.0" />
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
IgnorableNamespaces="uap uap5 mp rescap desktop6 desktop4 desktop">

<Identity
Name="FilesDev"
Publisher="CN=Files"
Version="2.5.2.0" />

<Properties>
<DisplayName>Files - Dev</DisplayName>
<PublisherDisplayName>Yair A</PublisherDisplayName>
<Logo>Assets\AppTiles\Dev\StoreLogo.png</Logo>
<desktop6:FileSystemWriteVirtualization>disabled</desktop6:FileSystemWriteVirtualization>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.22621.0" />
</Dependencies>

<Resources>
<Resource Language="en-US"/>
<Resource Language="af"/>
Expand Down Expand Up @@ -68,75 +76,105 @@
<Resource Language="zh-Hans"/>
<Resource Language="zh-Hant"/>
</Resources>

<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$" desktop4:SupportsMultipleInstances="true">
<uap:VisualElements DisplayName="Files - Dev" Description="Organize your files and folders easily. Robust multitasking experiences, helpful tags, and deep integrations add to an intuitive design, made by the community." Square150x150Logo="Assets\AppTiles\Dev\Square150x150Logo.png" Square44x44Logo="Assets\AppTiles\Dev\Square44x44Logo.png" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\AppTiles\Dev\Wide310x150Logo.png" Square71x71Logo="Assets\AppTiles\Dev\Small71x71Logo.png" Square310x310Logo="Assets\AppTiles\Dev\Large310x310Logo.png" ShortName="Files">
<Application
Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$"
desktop4:SupportsMultipleInstances="true">

<uap:VisualElements
DisplayName="Files - Dev"
Description="Organize your files and folders easily. Robust multitasking experiences, helpful tags, and deep integrations add to an intuitive design, made by the community."
Square150x150Logo="Assets\AppTiles\Dev\Square150x150Logo.png"
Square44x44Logo="Assets\AppTiles\Dev\Square44x44Logo.png"
BackgroundColor="transparent">

<uap:DefaultTile
Wide310x150Logo="Assets\AppTiles\Dev\Wide310x150Logo.png"
Square71x71Logo="Assets\AppTiles\Dev\Small71x71Logo.png"
Square310x310Logo="Assets\AppTiles\Dev\Large310x310Logo.png"
ShortName="Files">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
<uap:ShowOn Tile="square310x310Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile>

<uap:SplashScreen Image="Assets\AppTiles\Dev\SplashScreen.png" uap5:Optional="true" />

</uap:VisualElements>

<Extensions>
<uap3:Extension Category="windows.appExtensionHost">
<uap3:AppExtensionHost>
<uap3:Name>com.files.filepreview</uap3:Name>
</uap3:AppExtensionHost>
</uap3:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
</uap:Extension>
<uap5:Extension Category="windows.appExecutionAlias">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="files.exe"/>
</uap5:AppExecutionAlias>
</uap5:Extension>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="3AA55462-A5FA-4933-88C4-712D0B6CDEBB"
Enabled="false"
DisplayName="Files" />
</uap5:Extension>
<Extension Category="windows.updateTask" EntryPoint="BackgroundTasks.UpdateTask" />
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="archives">
<uap:SupportedFileTypes>
<uap:FileType>.zip</uap:FileType>
<uap:FileType>.7z</uap:FileType>
<uap:FileType>.rar</uap:FileType>
<uap:FileType>.tar</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>

<uap3:Extension Category="windows.appExtensionHost">
<uap3:AppExtensionHost>
<uap3:Name>com.files.filepreview</uap3:Name>
</uap3:AppExtensionHost>
</uap3:Extension>

<uap:Extension Category="windows.protocol">
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
</uap:Extension>

<uap5:Extension Category="windows.appExecutionAlias">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="files.exe"/>
</uap5:AppExecutionAlias>
</uap5:Extension>

<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask
TaskId="3AA55462-A5FA-4933-88C4-712D0B6CDEBB"
Enabled="false"
DisplayName="Files" />
</uap5:Extension>

<Extension Category="windows.updateTask" EntryPoint="Files.App.BackgroundTasks.UpdateTask" />

<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="archives">
<uap:SupportedFileTypes>
<uap:FileType>.zip</uap:FileType>
<uap:FileType>.7z</uap:FileType>
<uap:FileType>.rar</uap:FileType>
<uap:FileType>.tar</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>

</Extensions>

</Application>
</Applications>

<!-- To host the BgTaskComponent, you must add this activatable class entry -->
<!-- To Host The BackGroundTaskComponent, You Must Add This Activatable Class Entry -->
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>Files.App\WinRT.Host.dll</Path>
<ActivatableClass ActivatableClassId="BackgroundTasks.UpdateTask" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="Files.App.BackgroundTasks.UpdateTask" ThreadingModel="both" />
</InProcessServer>
</Extension>
</Extensions>

<Capabilities>
<!--<rescap:Capability Name="packageQuery"/>-->
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="broadFileSystemAccess" />
<rescap:Capability Name="allowElevation"/>
<!--The unvirtualizedResources capability is used to support file operations in the AppData directory-->
<rescap:Capability Name="unvirtualizedResources" />
<!--The packageManagement capability is used to download updates in the sideload version of Files. We only use
this capability in the sideload version and remove it when compiling the store vesion in Azure DevOps-->
<!--
The packageManagement capability is used to download updates in the sideload version of Files. We only use
this capability in the sideload version and remove it when compiling the store vesion in Azure DevOps.
-->
<rescap:Capability Name="packageManagement"/>
<uap:Capability Name="removableStorage" />
<Capability Name="internetClient"/>
<Capability Name="privateNetworkClientServer"/>
</Capabilities>

</Package>
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<AssemblyName>BackgroundTasks</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup>
<CsWinRTComponent>true</CsWinRTComponent>
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
<CsWinRTGeneratedFilesDir>$(MSBuildProjectDirectory)\bin\$(Platform)\$(Configuration)</CsWinRTGeneratedFilesDir>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Windows.Storage;
using Windows.UI.StartScreen;

namespace BackgroundTasks
namespace Files.App.BackgroundTasks
{
public sealed class UpdateTask : IBackgroundTask
{
Expand Down
13 changes: 11 additions & 2 deletions src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<OutputType>WinExe</OutputType>
Expand Down Expand Up @@ -26,6 +27,7 @@
<TieredCompilation>true</TieredCompilation>
<TieredPgo>true</TieredPgo>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
</PropertyGroup>
Expand All @@ -45,6 +47,7 @@
<DefineConstants>TRACE;RELEASE;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
<Content Include="7z.dll">
Expand Down Expand Up @@ -75,9 +78,11 @@
</Content>
<Content Remove="Assets\FilesHome.png" />
</ItemGroup>

<ItemGroup>
<None Remove="UserControls\OpacityIcon.xaml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ByteSize" Version="2.1.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
Expand Down Expand Up @@ -107,17 +112,19 @@
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="Microsoft.Management.Infrastructure.Runtime.Win" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BackgroundTasks\BackgroundTasks.csproj" />
<ProjectReference Include="..\Files.App.BackgroundTasks\Files.App.BackgroundTasks.csproj" />
<ProjectReference Include="..\Files.App.Storage\Files.App.Storage.csproj" />
<ProjectReference Include="..\Files.Backend\Files.Backend.csproj" />
<ProjectReference Include="..\Files.Sdk.Storage\Files.Sdk.Storage.csproj" />
<ProjectReference Include="..\Files.Shared\Files.Shared.csproj" />
<ProjectReference Include="..\Files.SourceGenerator\Files.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<TrimmerRootAssembly Include="BackgroundTasks" />
<TrimmerRootAssembly Include="Files" />
<TrimmerRootAssembly Include="Files.App.BackgroundTasks" />
<TrimmerRootAssembly Include="Files.App.Storage" />
<TrimmerRootAssembly Include="Files.Backend" />
<TrimmerRootAssembly Include="Files.Sdk.Storage" />
Expand All @@ -136,9 +143,11 @@
<TrimmerRootAssembly Include="CommunityToolkit.WinUI.UI.Controls.Media" />
<TrimmerRootAssembly Include="CommunityToolkit.WinUI.UI.Controls.Primitives" />
</ItemGroup>

<ItemGroup>
<Page Update="UserControls\OpacityIcon.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Files.App/ServicesImplementation/SideloadUpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public sealed class SideloadUpdateService : ObservableObject, IUpdateService, ID
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
private static extern uint RegisterApplicationRestart(string pwzCommandLine, int dwFlags);

private const string SIDELOAD_STABLE = "https://cdn.files.community/files/stable/Files.Package.appinstaller";
private const string SIDELOAD_PREVIEW = "https://cdn.files.community/files/preview/Files.Package.appinstaller";
private const string SIDELOAD_STABLE = "https://cdn.files.community/files/stable/Files.App.Package.appinstaller";
private const string SIDELOAD_PREVIEW = "https://cdn.files.community/files/preview/Files.App.Package.appinstaller";
Comment on lines +30 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't going to help for existing users

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any idea to fix the auto updating issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make it work if we split it into two steps

  1. Update this url and release an update with the change
  2. Rename the projects in another update


private readonly HttpClient _client = new(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(1) });

Expand Down