Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to .NET Core 3.1 #33

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
32 changes: 15 additions & 17 deletions HostsFileEditor.proj
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,18 @@ with HostsFileEditor. If not, see http://www.gnu.org/licenses/.

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">Any CPU</Platform>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>

<Target Name="CollectBuiltFiles">
<CreateItem
Condition=" '$(Configuration)' == 'Release'"
Include=".\src\\**\bin\$(Configuration)\\**\*.*;.\setup\\**\bin\$(Configuration)\*.*"
Exclude=".\src\\**\bin\$(Configuration)\\**\*.pdb;.\\**\bin\$(Configuration)\\**\*.vshost.exe">
Include=".\src\**\bin\**\$(Configuration)\**\publish\**\*.*"
Exclude="*.pdb">
<Output
TaskParameter="Include"
ItemName="BuildFiles"/>
</CreateItem>
<CreateItem
Condition=" '$(Configuration)' == 'Debug'"
Include=".\src\\**\bin\$(Configuration)\\**\*.*;.\setup\\**\bin\$(Configuration)\*.*"
Exclude=".\\**\bin\$(Configuration)\\**\*.vshost.exe">
<Output
TaskParameter="Include"
ItemName="BuildFiles"/>
</CreateItem>
</Target>

<!-- ==================== Clean Targets ====================== -->
Expand All @@ -59,7 +51,7 @@ with HostsFileEditor. If not, see http://www.gnu.org/licenses/.

<Target Name = "Clean">
<CreateItem
Include=".\src\\**\bin\\**\*.*;.\setup\\**\bin\\**\*.*">
Include=".\src\**\bin\**\*.*;.\setup\**\bin\**\*.*">
<Output
TaskParameter="Include"
ItemName="CleanFiles"/>
Expand All @@ -77,13 +69,19 @@ with HostsFileEditor. If not, see http://www.gnu.org/licenses/.

<Target Name="InternalBuild" DependsOnTargets = "CleanBin;CreateDirectories">
<CreateItem
Include=".\*.sln">
Include=".\src\*.csproj">
<Output
TaskParameter="Include"
ItemName="HostsFileEditor"/>
</CreateItem>
<CreateItem
Include=".\setup\*.wixproj">
<Output
TaskParameter="Include"
ItemName="SolutionFiles"/>
ItemName="HostsFileEditorSetup"/>
</CreateItem>
<MSBuild Projects="@(SolutionFiles)" Targets="Build"
Properties="Configuration=$(Configuration);Platform=$(Platform)" />
<MSBuild Projects="@(HostsFileEditor)" Targets="Restore;Build;Publish" Properties="Configuration=$(Configuration);TargetFramework=$(TargetFramework);RuntimeIdentifier=$(RuntimeIdentifier)" />
<MSBuild Projects="@(HostsFileEditorSetup)" Targets="Build" Properties="Configuration=$(Configuration);TargetFramework=$(TargetFramework);RuntimeIdentifier=$(RuntimeIdentifier)" />
</Target>

<Target Name = "CreateDirectories">
Expand Down
19 changes: 2 additions & 17 deletions HostsFileEditor.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
# Visual Studio Version 16
VisualStudioVersion = 16.0.30128.74
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostsFileEditor", "src\HostsFileEditor.csproj", "{17A37069-B2AC-4D58-8F6E-C955F284F94C}"
EndProject
Expand All @@ -24,8 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{BF6F
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deployment", "Deployment", "{51E2000C-3F31-4E18-8A74-02CDEEBEC6A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NGenCustomAction", "setup\NGenInstallCustomAction\NGenCustomAction.csproj", "{BD2FA119-BB09-4F09-A646-338CD73F9491}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "HostsFileEditorSetup", "setup\HostsFileEditorSetup.wixproj", "{A78A7EC4-2707-408C-A19F-AB237F0D85BA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "choco", "choco", "{28C2637D-F3C9-4040-B7B4-A7C7AAA898CC}"
Expand Down Expand Up @@ -60,18 +58,6 @@ Global
{17A37069-B2AC-4D58-8F6E-C955F284F94C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{17A37069-B2AC-4D58-8F6E-C955F284F94C}.Release|x86.ActiveCfg = Release|Any CPU
{17A37069-B2AC-4D58-8F6E-C955F284F94C}.Release|x86.Build.0 = Release|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Debug|x86.Build.0 = Debug|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Release|Any CPU.Build.0 = Release|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Release|x86.ActiveCfg = Release|Any CPU
{BD2FA119-BB09-4F09-A646-338CD73F9491}.Release|x86.Build.0 = Release|Any CPU
{A78A7EC4-2707-408C-A19F-AB237F0D85BA}.Debug|Any CPU.ActiveCfg = Debug|x86
{A78A7EC4-2707-408C-A19F-AB237F0D85BA}.Debug|Any CPU.Build.0 = Debug|x86
{A78A7EC4-2707-408C-A19F-AB237F0D85BA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
Expand All @@ -90,7 +76,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{17A37069-B2AC-4D58-8F6E-C955F284F94C} = {F4971D95-21F4-4E91-B8EE-3971F0B50FE3}
{BD2FA119-BB09-4F09-A646-338CD73F9491} = {51E2000C-3F31-4E18-8A74-02CDEEBEC6A4}
{A78A7EC4-2707-408C-A19F-AB237F0D85BA} = {51E2000C-3F31-4E18-8A74-02CDEEBEC6A4}
{28C2637D-F3C9-4040-B7B4-A7C7AAA898CC} = {51E2000C-3F31-4E18-8A74-02CDEEBEC6A4}
{90653B84-9F43-4140-AACC-6F9970696669} = {28C2637D-F3C9-4040-B7B4-A7C7AAA898CC}
Expand Down
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Download

Release binaries can be downloaded from [GitHub](https://github.com/scottlerch/HostsFileEditor/releases) or [CodePlex](https://hostsfileeditor.codeplex.com/).
* [Download Latest Installer](https://github.com/scottlerch/HostsFileEditor/releases/download/v1.2.0/HostsFileEditorSetup-1.2.0.msi)
* [Download Latest Portable](https://github.com/scottlerch/HostsFileEditor/releases/download/v1.2.0/HostsFileEditor-1.2.0.zip)
* [Download Latest Installer](https://github.com/scottlerch/HostsFileEditor/releases/download/v1.3.0/HostsFileEditorSetup-1.3.0.msi)
* [Download Latest Portable](https://github.com/scottlerch/HostsFileEditor/releases/download/v1.3.0/HostsFileEditor-1.3.0.zip)

## Features
* Cut, copy, paste, duplicate, enable, disable and move one or more entries at a time
Expand All @@ -27,7 +27,7 @@ Using the filter and sort while editing is quirky. The filter and sort are appli

## Build

Requires Visual Studio 2017 or newer. To build the installer you must have WiX Toolset 3.7+.
Requires Visual Studio 2019 or newer. To build the installer you must have WiX Toolset 3.7+.

Run `build-release.bat` or `build-debug.bat`.

Expand Down
6 changes: 5 additions & 1 deletion build-clean.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ if exist logs goto msbuild
mkdir logs

:msbuild
"%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Clean
"%PROGRAMFILES(X86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath > vspath.txt
set /p VSPath= < vspath.txt
del vspath.txt

"%VSPath%\MSBuild\Current\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Clean
6 changes: 5 additions & 1 deletion build-debug.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ if exist logs goto msbuild
mkdir logs

:msbuild
"%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Build /p:Configuration=Debug /l:FileLogger,Microsoft.Build.Engine;logfile=logs\build-debug.log
"%PROGRAMFILES(X86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath > vspath.txt
set /p VSPath= < vspath.txt
del vspath.txt

"%VSPath%\MSBuild\Current\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Build /p:Configuration=Debug /l:FileLogger,Microsoft.Build.Engine;logfile=logs\build-debug.log
6 changes: 5 additions & 1 deletion build-release-signed.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ if exist logs goto msbuild
mkdir logs

:msbuild
"%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Build /p:Configuration=Release /p:StrongName=true /p:Sign=true /p:CertPassword=%1 /l:FileLogger,Microsoft.Build.Engine;logfile=logs\build-release.log
"%PROGRAMFILES(X86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath > vspath.txt
set /p VSPath= < vspath.txt
del vspath.txt

"%VSPath%\MSBuild\Current\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Build /p:Configuration=Release /p:StrongName=true /p:Sign=true /p:CertPassword=%1 /l:FileLogger,Microsoft.Build.Engine;logfile=logs\build-release.log
goto end

:passwordblank
Expand Down
6 changes: 5 additions & 1 deletion build-release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ if exist logs goto msbuild
mkdir logs

:msbuild
"%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Build /p:Configuration=Release /p:StrongName=true /l:FileLogger,Microsoft.Build.Engine;logfile=logs\build-release.log
"%PROGRAMFILES(X86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath > vspath.txt
set /p VSPath= < vspath.txt
del vspath.txt

"%VSPath%\MSBuild\Current\Bin\MSBUILD.exe" HostsFileEditor.proj /t:Build /p:Configuration=Release /p:StrongName=true /l:FileLogger,Microsoft.Build.Engine;logfile=logs\build-release.log
goto end

:end
2 changes: 1 addition & 1 deletion choco/hosts.editor.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>hosts.editor</id>
<version>1.2.0</version>
<version>1.3.0</version>
<title>Hosts File Editor</title>
<authors>scottlerch</authors>
<owners>scottlerch,stimpy77</owners>
Expand Down
2 changes: 1 addition & 1 deletion choco/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$packageName = 'hosts.editor'
$installerType = 'msi'
$url = 'https://github.com/scottlerch/HostsFileEditor/releases/download/v1.2.0/HostsFileEditorSetup-1.2.0.msi'
$url = 'https://github.com/scottlerch/HostsFileEditor/releases/download/v1.3.0/HostsFileEditorSetup-1.3.0.msi'
$silentArgs = '/quiet'
$validExitCodes = @(0)

Expand Down
Binary file removed lib/Microsoft.WindowsAPICodePack.Shell.dll
Binary file not shown.
Binary file not shown.
Binary file removed lib/Microsoft.WindowsAPICodePack.dll
Binary file not shown.
20 changes: 1 addition & 19 deletions setup/HostsFileEditorSetup.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<DefineSolutionProperties>false</DefineSolutionProperties>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
Expand All @@ -27,30 +28,11 @@
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\HostsFileEditor.csproj">
<Name>HostsFileEditor</Name>
<Project>{17a37069-b2ac-4d58-8f6e-c955f284f94c}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="NGenInstallCustomAction\NGenCustomAction.csproj">
<Name>NGenCustomAction</Name>
<Project>{bd2fa119-bb09-4f09-a646-338cd73f9491}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources" />
<Folder Include="Resources\Binary" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\Binary\InstallUtil" />
<Content Include="Resources\Binary\MSVBDPCADLL" />
<Content Include="Resources\Binary\VSDNETCFG" />
<Content Include="Resources\WiXDefBannerBitmap.bmp" />
Expand Down
Loading