-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
142 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
# Compare Menu | ||
|
||
A Windows context menu shell extension that proxies general comparison commands to any diff application. | ||
|
||
While many popular comparison applications such as Beyond Compare come with their own such shell extensions help improve user experience, there are good ones that still do not have. Rather than requesting each developer team to come up with their own solution, why not build a general one that can work everywhere as long as their take standard input arguments? | ||
|
||
The concept of such context menu is simple: | ||
|
||
* When exactly two files or two directories are selected, a "Compare Two" command becomes available, sending the two paths to the configured diff application. | ||
* If only one object is selected for the first time, the menu remembers its path. | ||
* If another object is selected afterwards, the menu either sends both paths to the diff application and reset, or replaces the previously remembered path, depending on user choice. | ||
|
||
Note that a file can't be compared to a directory. So if the types mismatch, "Compare Two" won't be available, and the only option for single select mode is replacement. | ||
|
||
## Install | ||
|
||
* Unpack the archive. | ||
* Run install.bat to register the shell extension. | ||
* Open config.reg and edit the application path. `\` in the path needs to be escaped as `\\`. | ||
* The default arguments to the application is just the two paths. If a different one is needed, change the `ComparerArgs` value in config.reg. | ||
|
||
## Build | ||
|
||
A build script `build.ps1` is included to automate the process. It obtains dependencies and starts compilation. Before running `build.ps1`, make sure you have the latest Visual Studio installed. The script will automatically assume the Visual Studio developer environment and check out dependencies. To run the script, pass the target configuration and platform as arguments, e.g. `build.ps1 Debug x64` or `build.ps1 Release x86`. | ||
|
||
## Screenshots | ||
|
||
Compare Two | ||
![Compare Two](screenshots/compare_two.webp) | ||
|
||
Select First | ||
![Select First](screenshots/select_first.webp) | ||
|
||
Select Second | ||
![Select Second](screenshots/select_second.webp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -utf8 -latest -property installationPath | ||
Import-Module "${vsPath}\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" | ||
Enter-VsDevShell -VsInstallPath $vsPath -DevCmdArguments "-arch=amd64 -host_arch=amd64 -no_logo" -SkipAutomaticLocation | ||
|
||
Set-Location $PSScriptRoot | ||
|
||
$configuration = $args[0] | ||
$platform = $args[1] | ||
|
||
MSBuild.exe -property:"Configuration=${configuration};Platform=${platform}" -maxCpuCount -nologo compare_menu.sln | ||
exit $LASTEXITCODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
regsvr32 "%~dp0acompare_menu_64.dll" | ||
regsvr32 "%~dp0acompare_menu_32.dll" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
regsvr32 /u "%~dp0compare_menu_64.dll" | ||
regsvr32 /u "%~dp0compare_menu_32.dll" |