Skip to content

Commit

Permalink
Fix Refresh button.
Browse files Browse the repository at this point in the history
Add all script files to the solution file.
Simplify getting 3rd party dependencies.
  • Loading branch information
PolarGoose committed Jul 22, 2021
1 parent bf0a73c commit 1fe9aea
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 44 deletions.
13 changes: 12 additions & 1 deletion ShowWhatProcessLocksFile.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31129.286
Expand All @@ -9,6 +8,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "src\Test\Test.cspro
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "src\Installer\Installer.wixproj", "{8D8AB22B-5677-4A21-B25F-75F2409248EC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{A8406D94-94FD-4135-875A-1A0FF1E54DC5}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.github\workflows\build.ps1 = .github\workflows\build.ps1
src\Directory.Build.props = src\Directory.Build.props
.github\workflows\main.yaml = .github\workflows\main.yaml
nuget.config = nuget.config
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down
35 changes: 0 additions & 35 deletions src/App/DownloadHandleExe.ps1

This file was deleted.

1 change: 1 addition & 0 deletions src/App/Gui/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public ViewModelBase MainControl
{
mainControl = value;
OnPropertyChanged();
RelayCommand.Refresh();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/App/Gui/Utils/RelayCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Execute(object parameter)
methodToExecute();
}

public void Refresh()
public static void Refresh()
{
CommandManager.InvalidateRequerySuggested();
}
Expand Down Expand Up @@ -77,7 +77,7 @@ public void Execute(object parameter)
methodToExecute((T)parameter);
}

public void Refresh()
public static void Refresh()
{
CommandManager.InvalidateRequerySuggested();
}
Expand Down
20 changes: 14 additions & 6 deletions src/App/ShowWhatProcessLocksFile.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net461</TargetFramework>
Expand All @@ -14,11 +14,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

<Target Name="DownloadHandleExe" BeforeTargets="BeforeBuild" Condition="!Exists('$(OutDir)handle.exe')">
<Exec Command="PowerShell -NonInteractive -ExecutionPolicy Unrestricted -Command &quot;&amp; { &amp;&apos;$(MSBuildThisFileDirectory)DownloadHandleExe.ps1&apos; &apos;$(OutDir)&apos; } &quot;" />
</Target>


<ItemGroup>
<PackageReference Include="CliWrap" Version="3.3.2" />
<PackageReference Include="morelinq" Version="3.3.2" />
Expand All @@ -33,4 +29,16 @@
<Resource Include="Gui\Icons\Refresh_16x.png" />
<Resource Include="Gui\Icons\StatusCriticalError_16x.png" />
</ItemGroup>

<!-- Download handle.exe and unpack it -->
<Target Name="DownloadHandleExe" BeforeTargets="BeforeBuild" Condition="!Exists('$(BuildFolder)handle.zip')">
<Message Text="Download handle from the web"/>
<Exec Command="PowerShell -NonInteractive -ExecutionPolicy Unrestricted -Command ^
&quot; Invoke-WebRequest -Uri https://download.sysinternals.com/files/Handle.zip -OutFile '$(BuildFolder)handle.zip' &quot;" />
</Target>
<Target Name="UnpackHandleExe" AfterTargets="DownloadHandleExe" BeforeTargets="BeforeBuild" Condition="!Exists('$(OutDir)handle.exe')">
<Message Text="Unpack handle.zip"/>
<Exec Command="PowerShell -NonInteractive -ExecutionPolicy Unrestricted -Command ^
&quot; Expand-Archive '$(BuildFolder)handle.zip' '$(OutDir)' &quot;" />
</Target>
</Project>

0 comments on commit 1fe9aea

Please sign in to comment.