Skip to content

Code Quality: Remove old launch alias and resolved launcher issues #16621

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

Merged
merged 7 commits into from
Dec 20, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/scripts/Configure-AppxManifest.ps1
Original file line number Diff line number Diff line change
@@ -127,8 +127,8 @@ elseif ($Branch -eq "StoreStable")
$xmlDoc.Package.Capabilities.RemoveChild($pm)

# Update app protocol and execution alias
$ap.SetAttribute("Name", "files");
$aea.RemoveChild($aea.FirstChild); # Avoid duplication
$ap.SetAttribute("Name", "files-stable");
$ea.SetAttribute("Alias", "files-stable.exe");

# Save modified Package.appxmanifest
$xmlDoc.Save($PackageManifestPath)
@@ -141,7 +141,7 @@ elseif ($Branch -eq "StoreStable")

Get-ChildItem $WorkingDir -Include *.cs, *.cpp -recurse | ForEach-Object -Process `
{ `
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files" }) | `
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "files-dev", "files-stable" }) | `
Set-Content $_ -NoNewline `
}
}
4 changes: 1 addition & 3 deletions Files.sln
Original file line number Diff line number Diff line change
@@ -27,16 +27,14 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.App", "src\Files.App\Files.App.csproj", "{6F431D82-A5FF-4833-B5E4-702E1E523126}"
ProjectSection(ProjectDependencies) = postProject
{1EE996D6-885E-4403-A461-26C7A4E14D26} = {1EE996D6-885E-4403-A461-26C7A4E14D26}
{25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}
{7756A1A4-17B5-4E6B-9B12-F19AA868A225} = {7756A1A4-17B5-4E6B-9B12-F19AA868A225}
{A2FF3F3B-8EBC-4108-B99D-1476B7876656} = {A2FF3F3B-8EBC-4108-B99D-1476B7876656}
{B3FE3F3B-CECC-4918-B72B-5488C3774125} = {B3FE3F3B-CECC-4918-B72B-5488C3774125}
{EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6} = {EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6}
EndProjectSection
EndProject
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Files.Package", "src\Files.App (Package)\Files.Package.wapproj", "{8F60FD8E-1921-47D6-97B0-D26D7B3A4999}"
ProjectSection(ProjectDependencies) = postProject
{25FD5045-6D4C-4DD0-B3AC-613AB59CBB07} = {25FD5045-6D4C-4DD0-B3AC-613AB59CBB07}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Core.SourceGenerator", "src\Files.Core.SourceGenerator\Files.Core.SourceGenerator.csproj", "{6FA07816-DE0A-4D49-84E8-38E953A33C87}"
EndProject
12 changes: 0 additions & 12 deletions src/Files.App (Package)/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -118,25 +118,13 @@
</uap3:AppExtensionHost>
</uap3:Extension>

<uap:Extension Category="windows.protocol">
<!-- This is kept for backward compatibility. -->
<uap:Protocol ReturnResults="none" Name="files-uwp" />
</uap:Extension>

<uap:Extension Category="windows.protocol">
<!-- This is kept for backward compatibility. -->
<uap:Protocol ReturnResults="none" Name="files" />
</uap:Extension>

<uap:Extension Category="windows.protocol">
<!-- This value changes based on the build branch by CI (files-stable, files-preview, files-dev). -->
<uap:Protocol ReturnResults="none" Name="files-dev" />
</uap:Extension>

<uap5:Extension Category="windows.appExecutionAlias">
<uap5:AppExecutionAlias>
<!-- This is kept for backward compatibility. -->
<uap5:ExecutionAlias Alias="files.exe" />
<!-- This value changes based on the build branch by CI (files-stable, files-preview, files-dev). -->
<uap5:ExecutionAlias Alias="files-dev.exe" />
</uap5:AppExecutionAlias>
9 changes: 4 additions & 5 deletions src/Files.App.Launcher/Files.App.Launcher.vcxproj
Original file line number Diff line number Diff line change
@@ -113,11 +113,6 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)Files.App.Launcher$(TargetExt)</OutputFile>
</Link>
<PostBuildEvent>
<Command>
xcopy /s /y "$(ProjectDir)$(OutDir)*.exe" "$(ProjectDir)..\..\src\Files.App\Assets\FilesOpenDialog"
certutil -hashfile "$(ProjectDir)..\..\src\Files.App\Assets\FilesOpenDialog\$(TargetFileName)" SHA256|findstr /R /V "^SHA256 ^CertUtil"&gt;"$(ProjectDir)..\..\src\Files.App\Assets\FilesOpenDialog\$(TargetFileName).sha256"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -340,4 +335,8 @@
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy /s /y &quot;$(ProjectDir)$(OutDir)*.exe&quot; &quot;$(ProjectDir)..\..\src\Files.App\Assets\FilesOpenDialog&quot;" />
<Exec Command="certutil -hashfile &quot;$(ProjectDir)..\..\src\Files.App\Assets\FilesOpenDialog\$(TargetFileName)&quot; SHA256 | findstr /R /V &quot;^SHA256 ^CertUtil&quot; &gt; &quot;$(ProjectDir)..\..\src\Files.App\Assets\FilesOpenDialog\$(TargetFileName).sha256&quot;" />
</Target>
</Project>

Unchanged files with check annotations Beta

GetKeyState
CreateDirectoryFromApp
WNetCancelConnection2
NET_USE_CONNECT_FLAGS

Check warning on line 50 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found
NETRESOURCEW
WNetAddConnection3
CREDENTIALW
SetEntriesInAcl
ACL_SIZE_INFORMATION
DeleteAce
EXPLICIT_ACCESS

Check warning on line 83 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?
ACCESS_ALLOWED_ACE
LookupAccountSid
GetComputerName
CoTaskMemFree
QueryDosDevice
DeviceIoControl
GetLastError

Check warning on line 139 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error
CreateFile
GetVolumeInformation
COMPRESSION_FORMAT
var newDocument = context.Document.WithSyntaxRoot(newRoot);
context.RegisterCodeFix(
CodeAction.Create(

Check warning on line 57 in src/Files.Core.SourceGenerator/CodeFixProviders/StringsPropertyCodeFixProvider.cs

GitHub Actions / build (Release, x64)

Provide an explicit argument for optional parameter 'equivalenceKey', which is non-null and unique for each kind of code action created by this fixer
CodeFixProviderTitle,
c => Task.FromResult(newDocument),
null),
_ = PInvoke.RoInitialize(RO_INIT_TYPE.RO_INIT_MULTITHREADED);
var classIds = typeof(Program).Assembly.GetTypes()

Check warning on line 28 in src/Files.App.Server/Program.cs

GitHub Actions / build (Release, x64)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
.Where(t => t.IsSealed && t.IsPublic && t.IsClass)
.Select(t => t.FullName!)
.Where(name => name.StartsWith("Files.App.Server.", StringComparison.Ordinal))
SetHasContent( false );
}
UpdateContent( newContent );

Check warning on line 175 in src/Files.App.Controls/Toolbar/ToolbarToggleButton/ToolbarToggleButton.cs

GitHub Actions / build (Release, x64)

Possible null reference argument for parameter 'newContent' in 'void ToolbarToggleButton.UpdateContent(object newContent)'.
}
#endregion
if (_valueBarBorder != null || _trackBarBorder != null || _containerGrid != null)
{
_valueBarBorder.Height = valueBarHeight;

Check warning on line 188 in src/Files.App.Controls/Storage/StorageBar/StorageBar.cs

GitHub Actions / build (Release, x64)

Dereference of a possibly null reference.
_trackBarBorder.Height = trackBarHeight;

Check warning on line 189 in src/Files.App.Controls/Storage/StorageBar/StorageBar.cs

GitHub Actions / build (Release, x64)

Dereference of a possibly null reference.
if (_barShape == BarShapes.Round)
{
_trackBarBorder.CornerRadius = new(0);
}
_containerGrid.Height = calculatedLargerHeight;

Check warning on line 207 in src/Files.App.Controls/Storage/StorageBar/StorageBar.cs

GitHub Actions / build (Release, x64)

Dereference of a possibly null reference.
}
_gapWidth = calculatedLargerHeight;
if (valuePercent <= minPercent) // Value is <= Minimum
{
_gapColumn.Width = new(1, GridUnitType.Star);

Check warning on line 237 in src/Files.App.Controls/Storage/StorageBar/StorageBar.cs

GitHub Actions / build (Release, x64)

Dereference of a possibly null reference.
_valueColumn.Width = new(1, GridUnitType.Star);
_trackColumn.Width = new(1, GridUnitType.Star);