Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/p4vfs-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
Write-Output "ImageVersion=$env:ImageVersion" >> $env:GITHUB_ENV

- name: Checkout the repo
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64

- name: Cache OpenSSL ${{env.ImageOS}} ${{env.ImageVersion}}
uses: actions/cache@v4.0.2
uses: actions/cache@v4.2.0
with:
path: |
external/OpenSSL
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For example, you can use the P4VFS to perform a "virtual sync" to a Perforce fil

# Installation
You can install the latest signed release of P4VFS from here:
> [P4VFS.Setup](https://github.com/microsoft/p4vfs/releases/download/v1.28.0.0/P4VFS.Setup-1.28.0.0.exe)
> [P4VFS.Setup](https://github.com/microsoft/p4vfs/releases/download/v1.28.3.0/P4VFS.Setup-1.28.3.0.exe)

The entire history of release notes is included with the installer.
> [Release Notes](https://github.com/microsoft/p4vfs/blob/main/source/P4VFS.Console/P4VFS.Notes.txt)
Expand Down Expand Up @@ -49,8 +49,8 @@ The tool respects P4CONFIG file usage, as well as supports typical configuration
### Build Requirments:

1. Visual Studio 2022 version 17.5.0 or later
1. Windows SDK version 10.0.22621.0 (22H2)
1. Windows WDK version 10.0.22621.382 (22H2)
1. Windows SDK version 10.0.26100.1742
1. Windows WDK version 10.0.26100.2454

Details for installing Visual Studio 2022, the Windows Software Development Kit (SDK), and the Windows Driver Kit (WDK) can be found here:
> [Download the Windows Driver Kit](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk)
Expand Down
6 changes: 6 additions & 0 deletions source/P4VFS.Console/P4VFS.Notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Microsoft P4VFS Release Notes

Version [1.28.3.0]
* Fixing service initialization error if registry ImagePath value contains quotes
under key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\P4VFS.Service".
Including a new unit test to verify handling of user settings paths.
* Updating driver WDK to 10.0.26100

Version [1.28.2.0]
* Fixing support for specifying a value for P4TICKETS from within a P4CONFIG file,
and correctly used from working directory of p4vfs.exe, or placeholder file folder
Expand Down
2 changes: 1 addition & 1 deletion source/P4VFS.Driver/Include/DriverVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#define P4VFS_VER_MAJOR 1 // Increment this number almost never
#define P4VFS_VER_MINOR 28 // Increment this number whenever the driver changes
#define P4VFS_VER_BUILD 2 // Increment this number when a major user mode change has been made
#define P4VFS_VER_BUILD 3 // Increment this number when a major user mode change has been made
#define P4VFS_VER_REVISION 0 // Increment this number when we rebuild with any change

#define P4VFS_VER_STRINGIZE_EX(v) L#v
Expand Down
2 changes: 1 addition & 1 deletion source/P4VFS.Driver/P4VFS.Driver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<RootNamespace>Microsoft::P4VFS::Driver</RootNamespace>
<InfVerif_AdditionalOptions>/msft</InfVerif_AdditionalOptions>
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10.0.Debug|x64'" Label="Configuration">
Expand Down
3 changes: 2 additions & 1 deletion source/P4VFS.Extensions/Source/Common/VirtualFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public static string PublicSettingsFilePath
{
get
{
string publicProfile = Environment.GetEnvironmentVariable("PUBLIC");
string publicProfile = Environment.GetEnvironmentVariable("PUBLIC")?.Trim('"');
return String.IsNullOrEmpty(publicProfile) ? String.Empty : Path.GetFullPath(String.Format("{0}\\{1}", publicProfile, SettingsFile));
}
}
Expand All @@ -247,6 +247,7 @@ public static string InstalledSettingsFilePath
{
string serviceFilePath = null;
RegistryInfo.GetTypedValue(Microsoft.Win32.Registry.LocalMachine, ServiceRegistryKey, "ImagePath", ref serviceFilePath);
serviceFilePath = serviceFilePath?.Trim('"');
return String.IsNullOrEmpty(serviceFilePath) ? String.Empty : Path.GetFullPath(String.Format("{0}\\{1}", Path.GetDirectoryName(serviceFilePath), SettingsFile));
}
}
Expand Down
191 changes: 30 additions & 161 deletions source/P4VFS.Extensions/Source/Utilities/RegistryInfo.cs

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions source/P4VFS.UnitTest/Source/UnitTestInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,43 @@ public void DriverOperationsTest()
Assert(VirtualFileSystem.IsVirtualFileSystemAvailable());
}

[TestMethod, Priority(9)]
public void InstalledSettingsFilePathTest()
{
// Verifications of the simple settings file path
Assert(String.IsNullOrEmpty(VirtualFileSystem.UserSettingsFilePath) == false);
Assert(String.IsNullOrEmpty(VirtualFileSystem.AssemblySettingsFilePath) == false);

// Verifications of the public settings file path given differences in the PUBLIC environment variable
string originalPublicSettingsFilePath = VirtualFileSystem.PublicSettingsFilePath;
Assert(String.IsNullOrEmpty(VirtualFileSystem.PublicSettingsFilePath) == false);
using (new SetEnvironmentVariableScope("PUBLIC", ""))
Assert(String.IsNullOrEmpty(VirtualFileSystem.PublicSettingsFilePath));
using (new SetEnvironmentVariableScope("PUBLIC", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)))
Assert(String.Equals(VirtualFileSystem.PublicSettingsFilePath, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), VirtualFileSystem.SettingsFile), StringComparison.InvariantCultureIgnoreCase));
using (new SetEnvironmentVariableScope("PUBLIC", $"\"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\""))
Assert(String.Equals(VirtualFileSystem.PublicSettingsFilePath, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), VirtualFileSystem.SettingsFile), StringComparison.InvariantCultureIgnoreCase));
Assert(originalPublicSettingsFilePath == VirtualFileSystem.PublicSettingsFilePath);

// Verifications of the installed settings file path given the service registry key
string originalInstalledSettingsFilePath = VirtualFileSystem.InstalledSettingsFilePath;
Assert(String.IsNullOrEmpty(VirtualFileSystem.InstalledSettingsFilePath) == false);
Assert(String.Equals(VirtualFileSystem.InstalledSettingsFilePath, Path.Combine(Path.GetDirectoryName(InstalledP4vfsExe), VirtualFileSystem.SettingsFile), StringComparison.InvariantCultureIgnoreCase));
Assert(RegistryInfo.GetValueKind(Microsoft.Win32.Registry.LocalMachine, VirtualFileSystem.ServiceRegistryKey, "ImagePath") == Microsoft.Win32.RegistryValueKind.ExpandString);
string installedImagePath = null;
Assert(RegistryInfo.GetTypedValue(Microsoft.Win32.Registry.LocalMachine, VirtualFileSystem.ServiceRegistryKey, "ImagePath", ref installedImagePath));
Assert(Directory.Exists(Path.GetDirectoryName(installedImagePath)));
Assert(String.Equals(Path.GetDirectoryName(installedImagePath), Path.GetDirectoryName(InstalledP4vfsExe), StringComparison.InvariantCultureIgnoreCase));
AssertLambda(() => RegistryInfo.SetValue(Microsoft.Win32.Registry.LocalMachine, VirtualFileSystem.ServiceRegistryKey, "ImagePath", $"\"{installedImagePath}\"", Win32.RegistryValueKind.ExpandString));
string quotedInstalledImagePath = null;
Assert(RegistryInfo.GetTypedValue(Microsoft.Win32.Registry.LocalMachine, VirtualFileSystem.ServiceRegistryKey, "ImagePath", ref quotedInstalledImagePath));
Assert(quotedInstalledImagePath == $"\"{installedImagePath}\"");
Assert(originalInstalledSettingsFilePath == VirtualFileSystem.InstalledSettingsFilePath);
AssertLambda(() => RegistryInfo.SetValue(Microsoft.Win32.Registry.LocalMachine, VirtualFileSystem.ServiceRegistryKey, "ImagePath", installedImagePath, Win32.RegistryValueKind.ExpandString));
Assert(RegistryInfo.GetValueKind(Microsoft.Win32.Registry.LocalMachine, VirtualFileSystem.ServiceRegistryKey, "ImagePath") == Microsoft.Win32.RegistryValueKind.ExpandString);
Assert(originalInstalledSettingsFilePath == VirtualFileSystem.InstalledSettingsFilePath);
}

public bool IsInstallationSigned()
{
string p4vfsExe = InstalledP4vfsExe;
Expand Down
2 changes: 1 addition & 1 deletion source/P4VFS.UnitTest/Source/UnitTestUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void FileAttributeTest()

Assert(ReconcilePreview(clientFolder).Any() == false);
Assert(IsPlaceholderFile(clientFile) == false);
Assert(getAttr(clientFile) == FileAttributes.ReadOnly);
Assert(getAttr(clientFile).HasFlag(FileAttributes.ReadOnly));
File.SetAttributes(clientFile, FileAttributes.Normal);
Assert(getAttr(clientFile) == FileAttributes.Normal);

Expand Down