Skip to content

Commit

Permalink
v5.6.16262.0-Beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
ITHitBuild committed Jul 4, 2022
1 parent 73bcf46 commit 39675e1
Show file tree
Hide file tree
Showing 29 changed files with 525 additions and 429 deletions.
2 changes: 1 addition & 1 deletion Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem" Version="5.6.15918.0-Beta2" />
<PackageReference Include="ITHit.FileSystem" Version="5.6.16262.0-Beta2" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Windows/Common/Core/Common.Windows.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="5.6.15918.0-Beta2" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.15918.0-Beta2" />
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="5.6.16262.0-Beta2" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16262.0-Beta2" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
</ItemGroup>
</Project>
66 changes: 40 additions & 26 deletions Windows/Common/Core/LogFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private string ConfigureLogger()
}

/// <summary>
/// Prints environment description.
/// Prints environment description and console commands.
/// </summary>
public void PrintEnvironmentDescription()
{
Expand All @@ -94,30 +94,46 @@ public void PrintEnvironmentDescription()
log.Info($"\n{".NET version:",-25} {RuntimeInformation.FrameworkDescription} {IntPtr.Size * 8}bit.");
log.Info($"\n{"Package or app identity:",-25} {PackageRegistrar.IsRunningWithIdentity()}");
log.Info($"\n{"Sparse package identity:",-25} {PackageRegistrar.IsRunningWithSparsePackageIdentity()}");
log.Info($"\n{"Elevated mode:",-25} {new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()).IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator)}");
log.Info($"\n{"Elevated mode:",-25} {new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()).IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator)}");

string sparsePackagePath = PackageRegistrar.GetSparsePackagePath();
if (File.Exists(sparsePackagePath))
{
log.Info($"\n{"Sparse package location:",-25} {sparsePackagePath}");
var cert = System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile(sparsePackagePath);
log.Info($"\n{"Sparse package cert:",-25} Subject: {cert.Subject}, Issued by: {cert.Issuer}");
}
else
{
log.Info($"\n{"Sparse package:",-25} Not found");
}

// Log console commands.
PrintHelp();
}

/// <summary>
/// Print Engine config, settings, console commands, logging headers.
/// Print Engine config, settings, logging headers.
/// </summary>
/// <param name="engine">Engine instance.</param>
/// <param name="remoteStorageRootPath">Remote storage root path.</param>
public async Task PrintEngineStartInfoAsync(EngineWindows engine)
{
await PrintEngineEnvironmentDescriptionAsync(engine);

// Log console commands.
PrintHelp();
log.Info("\n");

// Log logging columns headers.
PrintHeader();
}

public async Task PrintEngineEnvironmentDescriptionAsync(EngineWindows engine)
{
log.Info($"\n");
log.Info($"\n{"File system root:",-25} {engine.Path}");
log.Info($"\n{"Remote storage root:",-25} {remoteStorageRootPath}");
log.Info($"\n{"AutoLock:",-25} {engine.AutoLock}");
log.Info($"\n{"Outgoing sync, ms:",-25} {engine.SyncService.SyncIntervalMs}");


// Log indexing state. Sync root must be indexed.
await PrintIndexingStateAsync(engine.Path);
Expand All @@ -138,16 +154,23 @@ private async Task PrintIndexingStateAsync(string path)
/// </summary>
public void PrintHelp()
{
log.Info("\n\nPress Esc to unregister file system, delete all files/folders, unregister sparse package, unregister handlers and exit (simulate uninstall).");
log.Info("\nPress Spacebar to exit without unregistering (simulate reboot).");
log.Info("\nPress 'p' to unregister file system, delete all files/folders, developer certificate, unregister sparse package, unregister handlers and exit (simulate full uninstall).");
log.Info("\nPress 'e' to start/stop the Engine and all sync services.");
log.Info("\nPress 's' to start/stop synchronization service.");
log.Info("\nPress 'm' to start/stop remote storage monitor.");
log.Info("\nPress 'd' to enable/disable debug and performance logging.");
log.Info($"\nPress 'l' to open log file. ({LogFilePath})");
log.Info($"\nPress 'b' to submit support tickets, report bugs, suggest features. (https://userfilesystem.com/support/)");
log.Info("\n----------------------\n");
log.Info("\n\n ----------------------------------------------------------------------------------------");
log.Info("\n Commands:");
PrintCommandDescription("Spacebar", "Exit without unregistering (simulate reboot)");
PrintCommandDescription("Esc", "Unregister file system, delete all files/folders, unregister handlers and exit.");
PrintCommandDescription("Shift-Esc", "Unregister file system, delete all files/folders, unregister handlers, uninstall developer certificate, unregister sparse package and exit (simulate full uninstall).");
PrintCommandDescription("e", "Start/stop the Engine and all sync services.");
PrintCommandDescription("s", "Start/stop synchronization service.");
PrintCommandDescription("m", "Start/stop remote storage monitor.");
PrintCommandDescription("d", "Enable/disable debug and performance logging.");
PrintCommandDescription("l", $"Open log file. ({LogFilePath})");
PrintCommandDescription("b", "Submit support tickets, report bugs, suggest features. (https://userfilesystem.com/support/)");
log.Info("\n ----------------------------------------------------------------------------------------");
}

private void PrintCommandDescription(string key, string description)
{
log.Info($"{Environment.NewLine} {key, 12} - {description,-25}");
}

public void LogError(IEngine sender, EngineErrorEventArgs e)
Expand Down Expand Up @@ -190,16 +213,6 @@ private void WriteLog(IEngine sender, EngineMessageEventArgs e, log4net.Core.Lev
string sourcePath = e.SourcePath?.FitString(sourcePathWidth, 6);
string targetPath = e.TargetPath?.FitString(sourcePathWidth, 6);

// Trim sync root and remote storage root to reduce ammount of logging and improve logs readability
//if (sender != null)
//{
//sourcePath = sourcePath?.Replace((sender as EngineWindows).Path, "<FS root>");
//sourcePath = sourcePath?.Replace(remoteStorageRootPath, "<RS root>");

//targetPath = targetPath?.Replace((sender as EngineWindows).Path, "<FS root>");
//targetPath = targetPath?.Replace(remoteStorageRootPath, "<RS root>");
//}

string message = Format(DateTimeOffset.Now.ToString("hh:mm:ss.fff"), process, priorityHint?.ToString(), fileId, "", e.ComponentName, e.CallerLineNumber.ToString(), e.CallerMemberName, e.CallerFilePath, e.Message, sourcePath, att, targetPath);

if (level == log4net.Core.Level.Error)
Expand Down Expand Up @@ -233,6 +246,7 @@ private static string Format(string date, string process, string priorityHint, s
/// </summary>
private void PrintHeader()
{
log.Info("\n");
log.Info(Format("Time", "Process Name", "Prty", "FS ID", "RS ID", "Component", "Line", "Caller Member Name", "Caller File Path", "Message", "Source Path", "Attributes", "Target Path"));
log.Info(Format("----", "------------", "----", "_____", "_____", "---------", "____", "------------------", "----------------", "-------", "-----------", "----------", "-----------"));
}
Expand Down
2 changes: 1 addition & 1 deletion Windows/Common/Core/Registrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static void ValidateStorageProviderSyncRootInfo(StorageProviderSyncRootI
}

/// <summary>
/// Determins if the syn root is registered for specified folder.
/// Determines if the syn root is registered for specified folder.
/// </summary>
/// <param name="path">Sync root path.</param>
/// <returns>True if the sync root is registered, false otherwise.</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.15918.0-Beta2" />
<PackageReference Include="ITHit.FileSystem.Windows" Version="5.6.16262.0-Beta2" />
<ProjectReference Include="..\..\..\Common\Common.csproj" />
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
</ItemGroup>
Expand Down
34 changes: 0 additions & 34 deletions Windows/Common/VirtualDrive/Interop/SHCNE.cs

This file was deleted.

16 changes: 0 additions & 16 deletions Windows/Common/VirtualDrive/Interop/SHCNF.cs

This file was deleted.

22 changes: 0 additions & 22 deletions Windows/Common/VirtualDrive/Interop/Shell32.cs

This file was deleted.

4 changes: 0 additions & 4 deletions Windows/Common/VirtualDrive/MenuCommandLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using ITHit.FileSystem.Samples.Common.Windows.VirtualDrive.Interop;
using ITHit.FileSystem.Windows;


namespace ITHit.FileSystem.Samples.Common.Windows
{

Expand Down Expand Up @@ -78,8 +76,6 @@ public async Task InvokeAsync(IEnumerable<string> filesPath)
await clientNotifications.UnlockAsync();
else
await clientNotifications.LockAsync();

Shell32.SHChangeNotify(SHCNE.SHCNE_UPDATEITEM, SHCNF.SHCNF_PATHW, userFileSystemPath, null);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.15918.0-Beta2" />
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="5.6.16262.0-Beta2" />
</ItemGroup>
<ItemGroup>
<None Update="log4net.config">
Expand Down
2 changes: 1 addition & 1 deletion Windows/VirtualDrive/VirtualDrive/Mapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static string GetRemoteStoragePathById(byte[] remoteStorageId)
/// </remarks>
/// <param name="remoteStorageId">Remote storage ID.</param>
/// <param name="remoteStoragePath">Remote storage path.</param>
/// <returns>True if the method completed succesefully, false - otherwise.</returns>
/// <returns>True if the method completed successfully, false - otherwise.</returns>
public static bool TryGetRemoteStoragePathById(byte[] remoteStorageId, out string remoteStoragePath)
{
return WindowsFileSystemItem.TryGetPathByItemId(remoteStorageId, out remoteStoragePath);
Expand Down
Loading

0 comments on commit 39675e1

Please sign in to comment.