Skip to content

Commit 6018097

Browse files
committed
- Use svg icons instead of png.
- Install the application to %AppData% instead of %ProgramFiles%. Admin rights are not needed for the installation. - Show locking information in alphabetical order - Bugfix: in some situation extra locking information related to another folder was shown. - Bugfix: processing of locking information was done several times, decreasing the performance.
1 parent 1fe9aea commit 6018097

53 files changed

Lines changed: 524 additions & 225 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ insert_final_newline = true
77
charset = utf-8
88
indent_style = space
99
indent_size = 4
10+
11+
[*.{xml,wxs}]
12+
indent_size = 2

.github/workflows/build.ps1

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,25 @@ Function FindMsBuild() {
5252
return $msbuild
5353
}
5454

55+
Function RemoveFileIfExists($fileName) {
56+
Info "Remove '$fileName'"
57+
Remove-Item $fileName -Force -Recurse -ErrorAction SilentlyContinue
58+
}
59+
5560
Set-StrictMode -Version Latest
5661
$ErrorActionPreference = "Stop"
5762
$ProgressPreference = "SilentlyContinue"
5863

5964
$root = Resolve-Path "$PSScriptRoot/../.."
60-
$publishDir = "$root/build/Release"
65+
$buildDir = "$root/build"
66+
$publishDir = "$buildDir/Release"
6167
$projectName = "ShowWhatProcessLocksFile"
6268
$version = GetVersion
6369
$installerVersion = GetInstallerVersion $version
6470
$msbuild = FindMsBuild
6571

6672
Info "Version: '$version'. InstallerVersion: '$installerVersion'"
6773

68-
Info "Remove Publish directory `n $publishDir"
69-
Remove-Item $publishDir -Force -Recurse -ErrorAction SilentlyContinue
70-
7174
Info "Build project"
7275
& $msbuild `
7376
/property:RestorePackagesConfig=true `
@@ -80,10 +83,18 @@ Info "Build project"
8083
$root/$projectName.sln
8184
CheckReturnCodeOfPreviousCommand "build failed"
8285

83-
# TODO: there are no processes which lock files on Github Actions executors. It makes a lot of test fail.
84-
# Info "Run tests"
85-
# & "$root/build/nuget/nunit.consolerunner/*/tools/nunit3-console.exe" `
86-
# $publishDir/net461/Test.dll `
87-
# --stoponerror `
88-
# --noresult
89-
# CheckReturnCodeOfPreviousCommand "tests failed"
86+
RemoveFileIfExists "$publishDir/${projectName}.msi.zip"
87+
Info "Create zip archive from msi installer"
88+
Compress-Archive -Path "$publishDir/$projectName.msi" -DestinationPath "$publishDir/${projectName}.msi.zip"
89+
90+
# Skip running tests if the build script is run on Github Actions.
91+
# There are no processes which lock files on Github Actions executors. It makes a lot of test fail.
92+
if ($null -eq $env:GITHUB_ACTIONS) {
93+
& "$buildDir/nuget/nunit.consolerunner/*/tools/nunit3-console.exe" `
94+
"$publishDir/net461/Test.dll" `
95+
--stoponerror `
96+
--labels=Before `
97+
--noheader `
98+
--noresult
99+
CheckReturnCodeOfPreviousCommand "tests failed"
100+
}

.github/workflows/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1313
with:
1414
draft: true
15-
files: Build/Release/*.msi
15+
files: Build/Release/*.msi.zip
1616
- uses: actions/upload-artifact@v2
1717
with:
1818
name: Build artifacts
19-
path: Build/Release/*.msi
19+
path: Build/Release/*.msi.zip

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# ShowWhatProcessLocksFile
22
An utility to discover what processes lock a specific file or folder.<br>
3+
4+
# Screenshots
5+
## Context menu
36
![Screenshot](doc/ContextMenu.png)
4-
<br>
7+
## The application
58
![Screenshot](doc/Screenshot.png)
69

710
# System requirements
@@ -12,8 +15,8 @@ An utility to discover what processes lock a specific file or folder.<br>
1215
The application uses [Handle by Mark Russinovich](https://docs.microsoft.com/en-us/sysinternals/downloads/handle) to get information about locking processes. The output of `handle.exe` is parsed and displayed in the GUI.<br>
1316

1417
# How to use
15-
* Download `ShowWhatProcessLocksFile.msi` from the latest [release](https://github.com/PolarGoose/ShowWhatProcessLocksFile/releases).
16-
* Run the installer. The installer will install this programm to the `C:\Program Files\ShowWhatProcessLocksFile` folder and add a "Show what locks this file" Windows File Explorer context menu element.
18+
* Download `ShowWhatProcessLocksFile.msi.zip` from the latest [release](https://github.com/PolarGoose/ShowWhatProcessLocksFile/releases).
19+
* Run the installer. The installer will install this programm to the `%AppData%\ShowWhatProcessLocksFile` folder and add a "Show what locks this file" Windows File Explorer context menu element.
1720
* Use "Show what locks this file" File Explorer's context menu to select a file or folder
1821
* To terminate selected processes, open a context menu by clicking mouse right button
1922
* If you want to uninstall the program, use `Control Panel\Programs\Programs and Features`, uninstaller will remove an integration with the context menu and all files which were installed.

doc/ContextMenu.png

7.75 KB
Loading

doc/Screenshot.png

-8.67 KB
Loading

src/App/Gui/Controls/ExpandToggleButton.xaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,25 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
67
mc:Ignorable="d"
78
d:DesignHeight="450" d:DesignWidth="800">
8-
<ToggleButton.Style> <Style TargetType="ToggleButton" BasedOn="{StaticResource {x:Type ToggleButton}}"> <Setter Property="Content"> <Setter.Value> <Image Source="/Gui/Icons/ExpandRight_md_16x.png"/> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="Content"> <Setter.Value> <Image Source="/Gui/Icons/ExpandDown_md_16x.png"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> </ToggleButton.Style>
9+
<ToggleButton.Style>
10+
<Style TargetType="ToggleButton" BasedOn="{StaticResource {x:Type ToggleButton}}">
11+
<Setter Property="Content">
12+
<Setter.Value>
13+
<svgc:SvgViewbox Source="/Gui/Icons/ExpandRight_md_16x.svg"/>
14+
</Setter.Value>
15+
</Setter>
16+
<Style.Triggers>
17+
<Trigger Property="IsChecked" Value="True">
18+
<Setter Property="Content">
19+
<Setter.Value>
20+
<svgc:SvgViewbox Source="/Gui/Icons/ExpandDown_md_16x.svg"/>
21+
</Setter.Value>
22+
</Setter>
23+
</Trigger>
24+
</Style.Triggers>
25+
</Style>
26+
</ToggleButton.Style>
927
</ToggleButton>

src/App/Gui/Controls/IconButton.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
67
x:Name="self"
78
mc:Ignorable="d"
89
d:DesignHeight="450" d:DesignWidth="800">
9-
<Image Source="{Binding Icon, ElementName=self}"/>
10+
<svgc:SvgViewbox Source="{Binding Icon, ElementName=self}"/>
1011
</Button>

src/App/Gui/Controls/IconButton.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
using System;
12
using System.Windows;
23
using System.Windows.Controls;
3-
using System.Windows.Media;
44

55
namespace ShowWhatProcessLocksFile.Gui.Controls
66
{
77
public partial class IconButton : Button
88
{
9-
public ImageSource Icon
9+
public Uri Icon
1010
{
11-
get => (ImageSource)GetValue(IconProperty);
11+
get => (Uri)GetValue(IconProperty);
1212
set => SetValue(IconProperty, value);
1313
}
1414

1515
public static readonly DependencyProperty IconProperty =
16-
DependencyProperty.Register("Icon", typeof(ImageSource), typeof(IconButton));
16+
DependencyProperty.Register("Icon", typeof(Uri), typeof(IconButton));
1717

1818
public IconButton()
1919
{

src/App/Gui/Controls/ProcessInfoListView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</Grid.RowDefinitions>
1515

1616
<StackPanel Grid.Row="0" Orientation="Horizontal">
17-
<local:IconButton Height="21" Width="21" Margin="2" Command="{Binding ExpandAllCommand}" Icon="/Gui/Icons/ExpandAll_16x.png" ToolTip="Expand All"/>
18-
<local:IconButton Height="21" Width="21" Margin="2" Command="{Binding CollapseAllCommand}" Icon="/Gui/Icons/CollapseAll_16x.png" ToolTip="Collapse All"/>
17+
<local:IconButton Height="21" Width="21" Margin="2" Command="{Binding ExpandAllCommand}" Icon="/Gui/Icons/ExpandAll_16x.svg" ToolTip="Expand All"/>
18+
<local:IconButton Height="21" Width="21" Margin="2" Command="{Binding CollapseAllCommand}" Icon="/Gui/Icons/CollapseAll_16x.svg" ToolTip="Collapse All"/>
1919
</StackPanel>
2020

2121
<ListBox x:Name="processInfoList" Grid.Row="1" SelectionMode="Extended" ItemsSource="{Binding ProcessInfoViewModels}" ScrollViewer.CanContentScroll="False">

0 commit comments

Comments
 (0)