Skip to content

Commit 1a01e67

Browse files
committed
v6.1.18304.0-Beta
1 parent 68cecc9 commit 1a01e67

File tree

14 files changed

+37
-70
lines changed

14 files changed

+37
-70
lines changed

Common/Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<Platforms>AnyCPU;x64</Platforms>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="ITHit.FileSystem" Version="6.1.18092.0-Beta" />
13+
<PackageReference Include="ITHit.FileSystem" Version="6.1.18304.0-Beta" />
1414
</ItemGroup>
1515
</Project>

Common/StreamCopy.cs

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

Windows/Common/Core/Common.Windows.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
2121
</ItemGroup>
2222
<ItemGroup>
23-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.18092.0-Beta" />
24-
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.1.18092.0-Beta" />
23+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.18304.0-Beta" />
24+
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.1.18304.0-Beta" />
2525
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2626
</ItemGroup>
2727
</Project>

Windows/Common/VirtualDrive/Common.Windows.VirtualDrive.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Platforms>AnyCPU;x64</Platforms>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.1.18092.0-Beta" />
12+
<PackageReference Include="ITHit.FileSystem.Windows" Version="6.1.18304.0-Beta" />
1313
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1414
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
1515
</ItemGroup>

Windows/Common/VirtualDrive/SparsePackageRegistrar.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
53
using System.Threading.Tasks;
64

75
using log4net;
86

97
using ITHit.FileSystem.Windows;
10-
using ITHit.FileSystem.Windows.ShellExtension;
118
using ITHit.FileSystem.Windows.Package;
129

1310

@@ -22,6 +19,8 @@ namespace ITHit.FileSystem.Samples.Common.Windows
2219
/// </remarks>
2320
public class SparsePackageRegistrar : Registrar
2421
{
22+
private static Version minimalSupportedVersion = new Version(10, 0, 19043);
23+
2524
/// <summary>
2625
/// Creates instance of this class.
2726
/// </summary>
@@ -46,7 +45,7 @@ public SparsePackageRegistrar(
4645
/// Registers sparse package if needed. In development mode also registers development certificate.
4746
/// </summary>
4847
/// <returns>
49-
/// True if app has identity and the app can start execution.
48+
/// True if app has identity and the app can start execution.
5049
/// False if the app needs to restart after sparse package registrtatio or if installation failed.
5150
/// </returns>
5251
public async Task<bool> RegisterSparsePackageAsync()
@@ -60,6 +59,7 @@ public async Task<bool> RegisterSparsePackageAsync()
6059

6160
if (!PackageRegistrar.SparsePackageRegistered())
6261
{
62+
EnsureOSVersionIsSupported();
6363
#if DEBUG
6464
/// Registering sparse package requires a valid certificate.
6565
/// In the development mode we use the below call to install the development certificate.
@@ -81,7 +81,7 @@ public async Task<bool> RegisterSparsePackageAsync()
8181
}
8282

8383
/// <summary>
84-
/// Unregisters sparse package. In development mode also registers development certificate.
84+
/// Unregisters sparse package. In development mode also unregisters development certificate.
8585
/// </summary>
8686
public async Task UnregisterSparsePackageAsync()
8787
{
@@ -179,5 +179,13 @@ private async Task EnsureConflictingPackagesUninstalled()
179179
}
180180
}
181181
#endif
182+
183+
private void EnsureOSVersionIsSupported()
184+
{
185+
if (minimalSupportedVersion.CompareTo(Environment.OSVersion.Version) == 1)
186+
{
187+
throw new NotSupportedException($"Minimal Windows version with sparse package support is: {minimalSupportedVersion}. Please, update your Windows version.");
188+
}
189+
}
182190
}
183191
}

Windows/VirtualDrive/VirtualDrive.ShellExtension/VirtualDrive.ShellExtension.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="6.1.18092.0-Beta" />
22+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="6.1.18304.0-Beta" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<None Update="log4net.config">

Windows/VirtualDrive/VirtualDrive/VirtualDrive.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This is an advanced project with ETags support, Microsoft Office documents editi
4040
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
4141
</ItemGroup>
4242
<ItemGroup>
43-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.18092.0-Beta" />
43+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="6.1.18304.0-Beta" />
4444
<ProjectReference Include="..\..\..\Common\Common.csproj" />
4545
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
4646
</ItemGroup>

Windows/VirtualDrive/VirtualDrive/VirtualFile.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using ITHit.FileSystem;
99
using ITHit.FileSystem.Windows;
1010
using ITHit.FileSystem.Samples.Common;
11-
11+
using ITHit.FileSystem.Samples.Common.Windows;
1212

1313
namespace VirtualDrive
1414
{
@@ -54,8 +54,12 @@ public async Task ReadAsync(Stream output, long offset, long length, ITransferDa
5454

5555
using (FileStream stream = new FileInfo(remoteStoragePath).Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete))
5656
{
57+
if (output.Length != stream.Length)
58+
throw new StatusException(CloudFileStatus.STATUS_CLOUD_FILE_UNSUCCESSFUL);
59+
5760
stream.Seek(offset, SeekOrigin.Begin);
5861
const int bufferSize = 0x500000; // 5Mb. Buffer size must be multiple of 4096 bytes for optimal performance.
62+
5963
try
6064
{
6165
await stream.CopyToAsync(output, bufferSize, length, cancellationToken);
@@ -136,7 +140,6 @@ public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null,
136140
remoteStorageItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
137141
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
138142
remoteStorageItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
139-
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
140143
remoteStorageItem.Attributes = fileMetadata.Attributes;
141144

142145
// Save ETag received from your remote storage in persistent placeholder properties.

Windows/VirtualDrive/VirtualDrive/VirtualFolder.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public async Task<byte[]> CreateFileAsync(IFileMetadata fileMetadata, Stream con
6767
remoteStorageNewItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
6868
remoteStorageNewItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
6969
remoteStorageNewItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
70-
remoteStorageNewItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
7170
remoteStorageNewItem.Attributes = fileMetadata.Attributes;
7271

7372
// Save Etag received from your remote storage in
@@ -103,7 +102,6 @@ public async Task<byte[]> CreateFolderAsync(IFolderMetadata folderMetadata, IInS
103102
remoteStorageNewItem.CreationTimeUtc = folderMetadata.CreationTime.UtcDateTime;
104103
remoteStorageNewItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
105104
remoteStorageNewItem.LastAccessTimeUtc = folderMetadata.LastAccessTime.UtcDateTime;
106-
remoteStorageNewItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
107105
remoteStorageNewItem.Attributes = folderMetadata.Attributes;
108106

109107
// Save ETag received from your remote storage in persistent placeholder properties.
@@ -181,7 +179,6 @@ public async Task WriteAsync(IFolderMetadata folderMetadata, IOperationContext o
181179
remoteStorageItem.CreationTimeUtc = folderMetadata.CreationTime.UtcDateTime;
182180
remoteStorageItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
183181
remoteStorageItem.LastAccessTimeUtc = folderMetadata.LastAccessTime.UtcDateTime;
184-
remoteStorageItem.LastWriteTimeUtc = folderMetadata.LastWriteTime.UtcDateTime;
185182
remoteStorageItem.Attributes = folderMetadata.Attributes;
186183
}
187184
}

Windows/VirtualFileSystem/VirtualFile.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public async Task WriteAsync(IFileMetadata fileMetadata, Stream content = null,
106106
remoteStorageItem.CreationTimeUtc = fileMetadata.CreationTime.UtcDateTime;
107107
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
108108
remoteStorageItem.LastAccessTimeUtc = fileMetadata.LastAccessTime.UtcDateTime;
109-
remoteStorageItem.LastWriteTimeUtc = fileMetadata.LastWriteTime.UtcDateTime;
110109
remoteStorageItem.Attributes = fileMetadata.Attributes;
111110
}
112111
}

0 commit comments

Comments
 (0)