From cfbf0e3a5e7013e63d73e52d0245e3827d7d50fd Mon Sep 17 00:00:00 2001 From: Adam Naylor Date: Sun, 28 Jan 2018 09:22:14 +0000 Subject: [PATCH 1/2] Migrates to net core --- .gitignore | 1 + NAppUpdate.sln | 133 ++++++-------- .../NAppUpdate.Framework.csproj | 164 ++---------------- .../Properties/AssemblyInfo.cs | 41 ----- src/NAppUpdate.Framework/Utils/FileSystem.cs | 22 +-- src/NAppUpdate.Framework/Utils/NauIpc.cs | 6 +- .../Utils/PermissionsCheck.cs | 7 +- .../Conditions/BooleanCondition.cs | 34 ++-- .../Conditions/FileVersionConditionTests.cs | 8 +- .../Core/UpdateStarterTests.cs | 22 +-- .../FeedReaders/AppcastReaderTests.cs | 10 +- .../FeedReaders/NauXmlFeedReaderTests.cs | 58 +++---- .../Integration/FileDownloaderTests.cs | 8 +- .../Integration/SimpleWebSourceTests.cs | 10 +- src/NAppUpdate.Tests/NAppUpdate.Tests.csproj | 137 ++------------- .../Properties/AssemblyInfo.cs | 36 ---- src/NAppUpdate.Tests/Tasks/BasicTaskTests.cs | 10 +- .../UtilTests/PermissionsCheckTest.cs | 60 +------ 18 files changed, 185 insertions(+), 582 deletions(-) delete mode 100644 src/NAppUpdate.Framework/Properties/AssemblyInfo.cs delete mode 100644 src/NAppUpdate.Tests/Properties/AssemblyInfo.cs diff --git a/.gitignore b/.gitignore index b99ed157..7dbedfd2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ Thumbs.db *.orig packages/ FeedBuilder/FeedBuilder.xml +.vs/ diff --git a/NAppUpdate.sln b/NAppUpdate.sln index 113a373e..2d2d7b11 100644 --- a/NAppUpdate.sln +++ b/NAppUpdate.sln @@ -1,29 +1,26 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{BDD7694F-9B8D-45B1-B75E-3901BC6F04DD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{78F44777-F4E4-4154-A396-80DAD1E47065}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAppUpdate.Tests", "src\NAppUpdate.Tests\NAppUpdate.Tests.csproj", "{2742ABE7-977D-4989-B12A-992A50B28E2F}" - ProjectSection(ProjectDependencies) = postProject - {7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40} = {7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40} - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAppUpdate.Updater", "src\NAppUpdate.Updater\NAppUpdate.Updater.csproj", "{7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFSampleApp", "Samples\WPFSampleApp\WPFSampleApp.csproj", "{D4321517-F941-4B1C-A9F7-9F63F5B86EE8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAppUpdate.Framework", "src\NAppUpdate.Framework\NAppUpdate.Framework.csproj", "{5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsSampleApp", "Samples\WinFormsSampleApp\WinFormsSampleApp.csproj", "{935426A8-2F13-449E-A808-A3BD07AA3570}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeedBuilder", "FeedBuilder\FeedBuilder.csproj", "{734FA44E-39AC-478E-A5AA-0F3D1F1974AA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsProgressSample", "Samples\WinFormsProgressSample\WinFormsProgressSample.csproj", "{991B322D-C0EC-47A6-B67A-665C873C7B19}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NAppUpdate.Framework", "src\NAppUpdate.Framework\NAppUpdate.Framework.csproj", "{AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NAppUpdate.Tests", "src\NAppUpdate.Tests\NAppUpdate.Tests.csproj", "{B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,27 +37,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Debug|x86.ActiveCfg = Debug|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 3.5|Any CPU.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 3.5|Any CPU.Build.0 = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 3.5|Mixed Platforms.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 3.5|Mixed Platforms.Build.0 = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 3.5|x86.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 4.0|Any CPU.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 4.0|Any CPU.Build.0 = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 4.0|Mixed Platforms.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 4.0|Mixed Platforms.Build.0 = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release 4.0|x86.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release|Any CPU.Build.0 = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release|x86.ActiveCfg = Release|Any CPU - {2742ABE7-977D-4989-B12A-992A50B28E2F}.Release|x86.Build.0 = Release|Any CPU {7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40}.Debug|Any CPU.Build.0 = Debug|Any CPU {7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -103,27 +79,6 @@ Global {D4321517-F941-4B1C-A9F7-9F63F5B86EE8}.Release|Mixed Platforms.Build.0 = Release|Any CPU {D4321517-F941-4B1C-A9F7-9F63F5B86EE8}.Release|x86.ActiveCfg = Release|Any CPU {D4321517-F941-4B1C-A9F7-9F63F5B86EE8}.Release|x86.Build.0 = Release|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Debug|x86.ActiveCfg = Debug|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 3.5|Any CPU.ActiveCfg = Release 3.5|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 3.5|Any CPU.Build.0 = Release 3.5|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 3.5|Mixed Platforms.ActiveCfg = Release 3.5|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 3.5|Mixed Platforms.Build.0 = Release 3.5|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 3.5|x86.ActiveCfg = Release 3.5|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 4.0|Any CPU.ActiveCfg = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 4.0|Any CPU.Build.0 = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 4.0|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 4.0|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release 4.0|x86.ActiveCfg = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release|Any CPU.ActiveCfg = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release|Any CPU.Build.0 = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release|Mixed Platforms.ActiveCfg = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release|Mixed Platforms.Build.0 = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release|x86.ActiveCfg = Release 4.0|Any CPU - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE}.Release|x86.Build.0 = Release 4.0|Any CPU {935426A8-2F13-449E-A808-A3BD07AA3570}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {935426A8-2F13-449E-A808-A3BD07AA3570}.Debug|Any CPU.Build.0 = Debug|Any CPU {935426A8-2F13-449E-A808-A3BD07AA3570}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -191,30 +146,54 @@ Global {991B322D-C0EC-47A6-B67A-665C873C7B19}.Release|Mixed Platforms.Build.0 = Release|x86 {991B322D-C0EC-47A6-B67A-665C873C7B19}.Release|x86.ActiveCfg = Release|x86 {991B322D-C0EC-47A6-B67A-665C873C7B19}.Release|x86.Build.0 = Release|x86 - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Debug|x86.ActiveCfg = Debug|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Debug|x86.Build.0 = Debug|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 3.5|Any CPU.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 3.5|Any CPU.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 3.5|Mixed Platforms.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 3.5|Mixed Platforms.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 3.5|x86.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 3.5|x86.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 4.0|Any CPU.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 4.0|Any CPU.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 4.0|Mixed Platforms.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 4.0|Mixed Platforms.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 4.0|x86.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release 4.0|x86.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release|Any CPU.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release|x86.ActiveCfg = Release|Any CPU - {3637B716-7EEE-4A84-B6B9-982C4D8A39A6}.Release|x86.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Debug|x86.ActiveCfg = Debug|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Debug|x86.Build.0 = Debug|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 3.5|Any CPU.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 3.5|Any CPU.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 3.5|Mixed Platforms.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 3.5|Mixed Platforms.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 3.5|x86.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 3.5|x86.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 4.0|Any CPU.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 4.0|Any CPU.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 4.0|Mixed Platforms.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 4.0|Mixed Platforms.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 4.0|x86.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release 4.0|x86.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release|Any CPU.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release|x86.ActiveCfg = Release|Any CPU + {AC0F4E4A-CE3B-467C-8096-F1107CCA8CAC}.Release|x86.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Debug|x86.ActiveCfg = Debug|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Debug|x86.Build.0 = Debug|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 3.5|Any CPU.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 3.5|Any CPU.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 3.5|Mixed Platforms.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 3.5|Mixed Platforms.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 3.5|x86.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 3.5|x86.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 4.0|Any CPU.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 4.0|Any CPU.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 4.0|Mixed Platforms.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 4.0|Mixed Platforms.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 4.0|x86.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release 4.0|x86.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release|Any CPU.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release|x86.ActiveCfg = Release|Any CPU + {B69D6ECF-8E3B-49F0-B2F0-B807E5ACDC34}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -222,8 +201,10 @@ Global GlobalSection(NestedProjects) = preSolution {7D4D18D4-DBD2-4ADC-9D82-397D6C5E9F40} = {BDD7694F-9B8D-45B1-B75E-3901BC6F04DD} {D4321517-F941-4B1C-A9F7-9F63F5B86EE8} = {78F44777-F4E4-4154-A396-80DAD1E47065} - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE} = {BDD7694F-9B8D-45B1-B75E-3901BC6F04DD} {935426A8-2F13-449E-A808-A3BD07AA3570} = {78F44777-F4E4-4154-A396-80DAD1E47065} {991B322D-C0EC-47A6-B67A-665C873C7B19} = {78F44777-F4E4-4154-A396-80DAD1E47065} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E8CC529D-0CE7-489F-8732-6E76B3131F95} + EndGlobalSection EndGlobal diff --git a/src/NAppUpdate.Framework/NAppUpdate.Framework.csproj b/src/NAppUpdate.Framework/NAppUpdate.Framework.csproj index 2fb2acd1..94354726 100644 --- a/src/NAppUpdate.Framework/NAppUpdate.Framework.csproj +++ b/src/NAppUpdate.Framework/NAppUpdate.Framework.csproj @@ -1,160 +1,16 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE} - Library - Properties - NAppUpdate.Framework - NAppUpdate.Framework - v3.5 - 512 - true - NAppUpdate.snk - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\net35\ - - - prompt - 4 - Off - AllRules.ruleset - v3.5 - - - pdbonly - true - bin\Release\net40\ - prompt - 4 - Off - AllRules.ruleset - v4.0 + netcoreapp2.0 + - - + + - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - - - - - - - - - - - - - - + + - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - if not exist "$(SolutionDir)src\NAppUpdate.Framework\Updater" (mkdir "$(SolutionDir)src\NAppUpdate.Framework\Updater") -if not exist "$(SolutionDir)src\NAppUpdate.Framework\Updater\updater.exe" (echo This is a dummy file > "$(SolutionDir)src\NAppUpdate.Framework\Updater\updater.exe") - - - \ No newline at end of file + + diff --git a/src/NAppUpdate.Framework/Properties/AssemblyInfo.cs b/src/NAppUpdate.Framework/Properties/AssemblyInfo.cs deleted file mode 100644 index 7a53dc3e..00000000 --- a/src/NAppUpdate.Framework/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NAppUpdate - .NET Application Updater")] -[assembly: AssemblyDescription("Library for easy and flexible integration of application update mechanism")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Itamar Syn-Hershko")] -[assembly: AssemblyProduct("NAppUpdate")] -[assembly: AssemblyCopyright("Copyright © 2010-2012 Itamar Syn-Hershko")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("NAppUpdate.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100839241908cc575797ba10e219d9117d22a8defc25437eaecc7c23e0a761ebfd5d1cad66e1ad1aa60529bce5037d7d943471428bc683b39399e1ac8f7e7aa1068e8b15eb2a7ddbf2652bf2258b76ae244734480d5e941dc9642beed1b5c3ab73954a990f3a4112998cde0e8867feaa47632af230730ec685e9601db36d32dfdb0")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("NAppUpdate.Updater, PublicKey=0024000004800000940000000602000000240000525341310004000001000100839241908cc575797ba10e219d9117d22a8defc25437eaecc7c23e0a761ebfd5d1cad66e1ad1aa60529bce5037d7d943471428bc683b39399e1ac8f7e7aa1068e8b15eb2a7ddbf2652bf2258b76ae244734480d5e941dc9642beed1b5c3ab73954a990f3a4112998cde0e8867feaa47632af230730ec685e9601db36d32dfdb0")] - -[assembly: CLSCompliant(true)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("563ca010-168f-46c0-a12d-219e3f48dc41")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.5.1.0")] -[assembly: AssemblyFileVersion("0.5.1.0")] diff --git a/src/NAppUpdate.Framework/Utils/FileSystem.cs b/src/NAppUpdate.Framework/Utils/FileSystem.cs index e1d1a777..fc5dc2b1 100644 --- a/src/NAppUpdate.Framework/Utils/FileSystem.cs +++ b/src/NAppUpdate.Framework/Utils/FileSystem.cs @@ -101,19 +101,19 @@ public static bool IsFileLocked(FileInfo file) public static void CopyAccessControl(FileInfo src, FileInfo dst) { - FileSecurity fs = src.GetAccessControl(); + //FileSecurity fs = src.GetAccessControl(); - bool hasInheritanceRules = fs.GetAccessRules(false, true, typeof(SecurityIdentifier)).Count > 0; - if (hasInheritanceRules) - { - fs.SetAccessRuleProtection(false, false); - } - else - { - fs.SetAccessRuleProtection(true, true); - } + //bool hasInheritanceRules = fs.GetAccessRules(false, true, typeof(SecurityIdentifier)).Count > 0; + //if (hasInheritanceRules) + //{ + // fs.SetAccessRuleProtection(false, false); + //} + //else + //{ + // fs.SetAccessRuleProtection(true, true); + //} - dst.SetAccessControl(fs); + //dst.SetAccessControl(fs); } } } diff --git a/src/NAppUpdate.Framework/Utils/NauIpc.cs b/src/NAppUpdate.Framework/Utils/NauIpc.cs index 52b08c54..0b71b3bb 100644 --- a/src/NAppUpdate.Framework/Utils/NauIpc.cs +++ b/src/NAppUpdate.Framework/Utils/NauIpc.cs @@ -17,10 +17,10 @@ namespace NAppUpdate.Framework.Utils /// Starts the cold update process by extracting the updater app from the library's resources, /// passing it all the data it needs and terminating the current application /// - internal static class NauIpc + public static class NauIpc { [Serializable] - internal class NauDto + public class NauDto { public NauConfigurations Configs { get; set; } public IList Tasks { get; set; } @@ -102,7 +102,7 @@ public static NauDto ReadDto(string syncProcessName) return dto; } - internal static void ExtractUpdaterFromResource(string updaterPath, string hostExeName) + public static void ExtractUpdaterFromResource(string updaterPath, string hostExeName) { if (!Directory.Exists(updaterPath)) Directory.CreateDirectory(updaterPath); diff --git a/src/NAppUpdate.Framework/Utils/PermissionsCheck.cs b/src/NAppUpdate.Framework/Utils/PermissionsCheck.cs index 93d8689b..e812dbea 100644 --- a/src/NAppUpdate.Framework/Utils/PermissionsCheck.cs +++ b/src/NAppUpdate.Framework/Utils/PermissionsCheck.cs @@ -4,6 +4,8 @@ namespace NAppUpdate.Framework.Utils { + using System.Security.AccessControl; + public static class PermissionsCheck { private static readonly IdentityReferenceCollection groups = WindowsIdentity.GetCurrent().Groups; @@ -22,9 +24,8 @@ public static bool HaveWritePermissionsForFolder(string path) return HaveWritePermissionsForFileOrFolder(folder); } - public static bool HaveWritePermissionsForFileOrFolder(string path) - { - var rules = Directory.GetAccessControl(path).GetAccessRules(true, true, typeof(SecurityIdentifier)); + public static bool HaveWritePermissionsForFileOrFolder(string path) { + var rules = new FileSecurity(path, AccessControlSections.All).GetAccessRules(true, true, typeof(SecurityIdentifier)); bool allowwrite = false, denywrite = false; foreach (FileSystemAccessRule rule in rules) diff --git a/src/NAppUpdate.Tests/Conditions/BooleanCondition.cs b/src/NAppUpdate.Tests/Conditions/BooleanCondition.cs index a72e6a47..85c5f7e5 100644 --- a/src/NAppUpdate.Tests/Conditions/BooleanCondition.cs +++ b/src/NAppUpdate.Tests/Conditions/BooleanCondition.cs @@ -1,5 +1,4 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NAppUpdate.Framework.Conditions; +using NAppUpdate.Framework.Conditions; using System; using System.Collections.Generic; using System.Linq; @@ -7,6 +6,8 @@ namespace NAppUpdate.Tests.Conditions { + using Xunit; + internal class MockCondition : NAppUpdate.Framework.Conditions.IUpdateCondition { private bool _isMet; @@ -22,10 +23,9 @@ public bool IsMet(Framework.Tasks.IUpdateTask task) } } - [TestClass] public class BooleanConditionTests { - [TestMethod] + [Fact] public void ShortCircuitOR() { BooleanCondition bc = new BooleanCondition(); @@ -35,10 +35,10 @@ public void ShortCircuitOR() bool isMet = bc.IsMet(null); - Assert.IsTrue(isMet, "Expected the second or to short circuit the condition list"); + Assert.True(isMet, "Expected the second or to short circuit the condition list"); } - [TestMethod] + [Fact] public void MultipleAND() { BooleanCondition bc = new BooleanCondition(); @@ -47,10 +47,10 @@ public void MultipleAND() bool isMet = bc.IsMet(null); - Assert.IsTrue(isMet); + Assert.True(isMet); } - [TestMethod] + [Fact] public void MultipleANDFail() { BooleanCondition bc = new BooleanCondition(); @@ -59,10 +59,10 @@ public void MultipleANDFail() bool isMet = bc.IsMet(null); - Assert.IsFalse(isMet); + Assert.False(isMet); } - [TestMethod] + [Fact] public void MultipleANDFail2() { BooleanCondition bc = new BooleanCondition(); @@ -71,10 +71,10 @@ public void MultipleANDFail2() bool isMet = bc.IsMet(null); - Assert.IsFalse(isMet); + Assert.False(isMet); } - [TestMethod] + [Fact] public void LastORPass() { BooleanCondition bc = new BooleanCondition(); @@ -84,10 +84,10 @@ public void LastORPass() bool isMet = bc.IsMet(null); - Assert.IsTrue(isMet); + Assert.True(isMet); } - [TestMethod] + [Fact] public void MiddleORFail() { BooleanCondition bc = new BooleanCondition(); @@ -97,10 +97,10 @@ public void MiddleORFail() bool isMet = bc.IsMet(null); - Assert.IsFalse(isMet); + Assert.False(isMet); } - [TestMethod] + [Fact] public void Not() { BooleanCondition bc = new BooleanCondition(); @@ -108,7 +108,7 @@ public void Not() bool isMet = bc.IsMet(null); - Assert.IsTrue(isMet); + Assert.True(isMet); } } } diff --git a/src/NAppUpdate.Tests/Conditions/FileVersionConditionTests.cs b/src/NAppUpdate.Tests/Conditions/FileVersionConditionTests.cs index be6fce32..9261d8f5 100644 --- a/src/NAppUpdate.Tests/Conditions/FileVersionConditionTests.cs +++ b/src/NAppUpdate.Tests/Conditions/FileVersionConditionTests.cs @@ -1,20 +1,20 @@ using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using NAppUpdate.Framework.Conditions; namespace NAppUpdate.Tests.Conditions { - [TestClass] + using Xunit; + public class FileVersionConditionTests { - [TestMethod] + [Fact] public void ShouldAbortGracefullyOnUnversionedFiles() { var tempFile = Path.GetTempFileName(); File.WriteAllText(tempFile, "foo"); var cnd = new FileVersionCondition { ComparisonType = "is", LocalPath = tempFile, Version = "1.0.0.0" }; - Assert.IsTrue(cnd.IsMet(null)); + Assert.True(cnd.IsMet(null)); } } } diff --git a/src/NAppUpdate.Tests/Core/UpdateStarterTests.cs b/src/NAppUpdate.Tests/Core/UpdateStarterTests.cs index d5ddced8..aa39a0ea 100644 --- a/src/NAppUpdate.Tests/Core/UpdateStarterTests.cs +++ b/src/NAppUpdate.Tests/Core/UpdateStarterTests.cs @@ -2,32 +2,32 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using NAppUpdate.Framework; using NAppUpdate.Framework.Tasks; using NAppUpdate.Framework.Utils; namespace NAppUpdate.Tests.Core { - [TestClass] + using Xunit; + public class UpdateStarterTests { - [TestMethod] + [Fact] public void UpdaterDeploymentWorks() { var path = Path.Combine(Path.GetTempPath(), "NAppUpdate-Tests"); NauIpc.ExtractUpdaterFromResource(path, "Foo.exe"); - Assert.IsTrue(Directory.Exists(path)); - Assert.IsTrue(File.Exists(Path.Combine(path, "Foo.exe"))); - Assert.IsTrue(File.Exists(Path.Combine(path, "NAppUpdate.Framework.dll"))); + Assert.True(Directory.Exists(path)); + Assert.True(File.Exists(Path.Combine(path, "Foo.exe"))); + Assert.True(File.Exists(Path.Combine(path, "NAppUpdate.Framework.dll"))); // Cleanup test NAppUpdate.Framework.Utils.FileSystem.DeleteDirectory(path); } - [TestMethod] + [Fact] public void UpdaterDeploymentAndIPCWorks() { var dto = new NauIpc.NauDto @@ -57,12 +57,12 @@ public void UpdaterDeploymentAndIPCWorks() }; var p = NauIpc.LaunchProcessAndSendDto(dto, info, dto.Configs.UpdateProcessName); - Assert.IsNotNull(p); + Assert.Null(p); p.WaitForExit(); - Assert.IsTrue(Directory.Exists(path)); - Assert.IsTrue(File.Exists(Path.Combine(path, "Foo.exe"))); - Assert.IsTrue(File.Exists(Path.Combine(path, "NAppUpdate.Framework.dll"))); + Assert.True(Directory.Exists(path)); + Assert.True(File.Exists(Path.Combine(path, "Foo.exe"))); + Assert.True(File.Exists(Path.Combine(path, "NAppUpdate.Framework.dll"))); // Cleanup test FileSystem.DeleteDirectory(path); diff --git a/src/NAppUpdate.Tests/FeedReaders/AppcastReaderTests.cs b/src/NAppUpdate.Tests/FeedReaders/AppcastReaderTests.cs index d1144f79..1448fef0 100644 --- a/src/NAppUpdate.Tests/FeedReaders/AppcastReaderTests.cs +++ b/src/NAppUpdate.Tests/FeedReaders/AppcastReaderTests.cs @@ -1,11 +1,11 @@ using System; using System.Linq; using NAppUpdate.Framework; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace NAppUpdate.Tests.Unit { - [TestClass] + using Xunit; + public class AppcastReaderTests { const string ZuneUpdateFeed = @@ -26,14 +26,14 @@ public class AppcastReaderTests "; - [TestMethod] + [Fact] public void Should_be_able_to_get_the_description_from_the_update() { var reader = new NAppUpdate.Framework.FeedReaders.AppcastReader(); var updates = reader.Read(ZuneUpdateFeed); - Assert.AreEqual(1, updates.Count()); - Assert.AreEqual(".WMA Support and other minor bug fixes", updates.First().Description); + Assert.Equal(1, updates.Count()); + Assert.Equal(".WMA Support and other minor bug fixes", updates.First().Description); } } } diff --git a/src/NAppUpdate.Tests/FeedReaders/NauXmlFeedReaderTests.cs b/src/NAppUpdate.Tests/FeedReaders/NauXmlFeedReaderTests.cs index 8c766795..4a6b5437 100644 --- a/src/NAppUpdate.Tests/FeedReaders/NauXmlFeedReaderTests.cs +++ b/src/NAppUpdate.Tests/FeedReaders/NauXmlFeedReaderTests.cs @@ -1,20 +1,20 @@ using System; using System.Text; using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; using NAppUpdate.Framework; using NAppUpdate.Framework.Conditions; using NAppUpdate.Framework.Tasks; namespace NAppUpdate.Tests.FeedReaders { + using Xunit; + /// /// Summary description for NauXmlFeedReaderTest /// - [TestClass] public class NauXmlFeedReaderTests { - [TestMethod] + [Fact] public void NauReaderCanReadFeed1() { const string NauUpdateFeed = @@ -35,24 +35,24 @@ public void NauReaderCanReadFeed1() var reader = new NAppUpdate.Framework.FeedReaders.NauXmlFeedReader(); IList updates = reader.Read(NauUpdateFeed); - Assert.IsTrue(updates.Count == 1); + Assert.True(updates.Count == 1); var task = updates[0] as FileUpdateTask; - Assert.IsNotNull(task); - Assert.IsFalse(task.CanHotSwap); - Assert.AreEqual("test.dll", task.LocalPath); - Assert.AreEqual("remoteFile.dll", task.UpdateTo); - Assert.IsNull(task.Sha256Checksum); - Assert.IsNotNull(task.Description); + Assert.NotNull(task); + Assert.False(task.CanHotSwap); + Assert.Equal("test.dll", task.LocalPath); + Assert.Equal("remoteFile.dll", task.UpdateTo); + Assert.Null(task.Sha256Checksum); + Assert.NotNull(task.Description); - Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount); + Assert.Equal(1, task.UpdateConditions.ChildConditionsCount); var cnd = task.UpdateConditions.Degrade() as FileExistsCondition; - Assert.IsNotNull(cnd); - Assert.AreEqual("otherFile.dll", cnd.LocalPath); + Assert.NotNull(cnd); + Assert.Equal("otherFile.dll", cnd.LocalPath); } - [TestMethod] + [Fact] public void NauReaderCanReadFeed2() { const string NauUpdateFeed = @@ -73,23 +73,23 @@ public void NauReaderCanReadFeed2() var reader = new NAppUpdate.Framework.FeedReaders.NauXmlFeedReader(); IList updates = reader.Read(NauUpdateFeed); - Assert.IsTrue(updates.Count == 1); + Assert.True(updates.Count == 1); var task = updates[0] as FileUpdateTask; - Assert.IsNotNull(task); - Assert.IsTrue(task.CanHotSwap); + Assert.NotNull(task); + Assert.True(task.CanHotSwap); - Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount); + Assert.Equal(1, task.UpdateConditions.ChildConditionsCount); var cnd = task.UpdateConditions.Degrade() as FileVersionCondition; - Assert.IsNotNull(cnd); - Assert.IsNull(cnd.LocalPath); + Assert.NotNull(cnd); + Assert.Null(cnd.LocalPath); - Assert.AreEqual("below", cnd.ComparisonType); - Assert.AreEqual("1.0.176.0", cnd.Version); + Assert.Equal("below", cnd.ComparisonType); + Assert.Equal("1.0.176.0", cnd.Version); } - [TestMethod] + [Fact] public void NauReaderCanReadFeed3() { const string NauUpdateFeed = @@ -110,18 +110,18 @@ public void NauReaderCanReadFeed3() var reader = new NAppUpdate.Framework.FeedReaders.NauXmlFeedReader(); IList updates = reader.Read(NauUpdateFeed); - Assert.IsTrue(updates.Count == 1); + Assert.True(updates.Count == 1); var task = updates[0] as FileUpdateTask; - Assert.IsNotNull(task); - Assert.IsTrue(task.CanHotSwap); + Assert.NotNull(task); + Assert.True(task.CanHotSwap); - Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount); + Assert.Equal(1, task.UpdateConditions.ChildConditionsCount); var cnd = task.UpdateConditions.Degrade() as OSCondition; - Assert.IsNotNull(cnd); + Assert.NotNull(cnd); - Assert.AreEqual(64, cnd.OsBits); + Assert.Equal(64, cnd.OsBits); } } } diff --git a/src/NAppUpdate.Tests/Integration/FileDownloaderTests.cs b/src/NAppUpdate.Tests/Integration/FileDownloaderTests.cs index ff265f28..42607d50 100644 --- a/src/NAppUpdate.Tests/Integration/FileDownloaderTests.cs +++ b/src/NAppUpdate.Tests/Integration/FileDownloaderTests.cs @@ -1,19 +1,19 @@ using NAppUpdate.Framework.Utils; -using Microsoft.VisualStudio.TestTools.UnitTesting; namespace NAppUpdate.Tests.Integration { - [TestClass] + using Xunit; + public class FileDownloaderTests { - [TestMethod] + [Fact] public void Should_be_able_to_download_a_small_file_from_the_internet() { var fileDownloader = new FileDownloader("http://www.google.co.uk/intl/en_uk/images/logo.gif"); byte[] fileData = fileDownloader.Download(); - Assert.IsTrue(fileData.Length > 0); + Assert.True(fileData.Length > 0); } } } diff --git a/src/NAppUpdate.Tests/Integration/SimpleWebSourceTests.cs b/src/NAppUpdate.Tests/Integration/SimpleWebSourceTests.cs index 8f66a929..1005643e 100644 --- a/src/NAppUpdate.Tests/Integration/SimpleWebSourceTests.cs +++ b/src/NAppUpdate.Tests/Integration/SimpleWebSourceTests.cs @@ -1,12 +1,12 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NAppUpdate.Framework.Sources; +using NAppUpdate.Framework.Sources; namespace NAppUpdate.Tests.Integration { - [TestClass] + using Xunit; + public class SimpleWebSourceTests { - [TestMethod] + [Fact] public void can_download_ansi_feed() { const string expected = "NHibernate.Profiler-Build-"; @@ -14,7 +14,7 @@ public void can_download_ansi_feed() var ws = new SimpleWebSource("http://builds.hibernatingrhinos.com/latest/nhprof"); var str = ws.GetUpdatesFeed(); - Assert.AreEqual(expected, str.Substring(0, expected.Length)); + Assert.Equal(expected, str.Substring(0, expected.Length)); } } } diff --git a/src/NAppUpdate.Tests/NAppUpdate.Tests.csproj b/src/NAppUpdate.Tests/NAppUpdate.Tests.csproj index 56dcf45c..c109d215 100644 --- a/src/NAppUpdate.Tests/NAppUpdate.Tests.csproj +++ b/src/NAppUpdate.Tests/NAppUpdate.Tests.csproj @@ -1,132 +1,21 @@ - - + + - Debug - AnyCPU - 9.0.30729 - 2.0 - {2742ABE7-977D-4989-B12A-992A50B28E2F} - Library - Properties - NAppUpdate.Tests - NAppUpdate.Tests - v4.0 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\ - true + netcoreapp2.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - true - - - ..\NAppUpdate.Framework\NAppUpdate.snk - - - - - - 3.5 - - - 3.5 - - - - - ..\..\packages\xunit.1.9.1\lib\net20\xunit.dll - - - - - - - - - - - - - - + - - {5C07EBDF-D43F-4BE9-B560-D7A443C0EDCE} - NAppUpdate.Framework - + + + + - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - + + - - NAppUpdate.snk - - + - - - \ No newline at end of file + + diff --git a/src/NAppUpdate.Tests/Properties/AssemblyInfo.cs b/src/NAppUpdate.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 48f1b1e2..00000000 --- a/src/NAppUpdate.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NAppUpdate.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NAppUpdate.Tests")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ad30af46-0cc0-450a-8bcc-1d9792c05c39")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NAppUpdate.Tests/Tasks/BasicTaskTests.cs b/src/NAppUpdate.Tests/Tasks/BasicTaskTests.cs index b7665d66..9fe60d86 100644 --- a/src/NAppUpdate.Tests/Tasks/BasicTaskTests.cs +++ b/src/NAppUpdate.Tests/Tasks/BasicTaskTests.cs @@ -1,16 +1,16 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NAppUpdate.Framework.Tasks; +using NAppUpdate.Framework.Tasks; namespace NAppUpdate.Tests.Tasks { - [TestClass] + using Xunit; + public class BasicTaskTests { - [TestMethod] + [Fact] public void TestTaskDefaultCharacteristics() { var task = new FileUpdateTask(); // just a random task object - Assert.IsTrue(task.ExecutionStatus == TaskExecutionStatus.Pending); + Assert.True(task.ExecutionStatus == TaskExecutionStatus.Pending); } } } diff --git a/src/NAppUpdate.Tests/UtilTests/PermissionsCheckTest.cs b/src/NAppUpdate.Tests/UtilTests/PermissionsCheckTest.cs index 7e7dc4b2..ac855921 100644 --- a/src/NAppUpdate.Tests/UtilTests/PermissionsCheckTest.cs +++ b/src/NAppUpdate.Tests/UtilTests/PermissionsCheckTest.cs @@ -1,89 +1,41 @@ using NAppUpdate.Framework.Utils; using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; using System; namespace NAppUpdate.Tests { + using Xunit; + /// ///This is a test class for PermissionsCheckTest and is intended ///to contain all PermissionsCheckTest Unit Tests /// - [TestClass()] public class PermissionsCheckTest { - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - #region Additional test attributes - // - //You can use the following additional attributes as you write your tests: - // - //Use ClassInitialize to run code before running the first test in the class - //[ClassInitialize()] - //public static void MyClassInitialize(TestContext testContext) - //{ - //} - // - //Use ClassCleanup to run code after all tests in a class have run - //[ClassCleanup()] - //public static void MyClassCleanup() - //{ - //} - // - //Use TestInitialize to run code before running each test - //[TestInitialize()] - //public void MyTestInitialize() - //{ - //} - // - //Use TestCleanup to run code after each test has run - //[TestCleanup()] - //public void MyTestCleanup() - //{ - //} - // - #endregion - /// /// Test whether HaveWritePermissionsForFolder correctly returns on folder for which write permissions are permitted /// - [TestMethod()] + [Fact] public void HaveWritePermissionsForFolderTest() { string path = Path.GetTempPath(); //Guaranteed writable (I believe) bool expected = true; // TODO: Initialize to an appropriate value bool actual; actual = PermissionsCheck.HaveWritePermissionsForFolder(path); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); } /// /// Test whether HaveWritePermissionsForFolder correctly returns on folder for which write permissions are not granted /// - [TestMethod()] + [Fact] public void HaveWritePermissionsForFolderDeniedTest() { string path = Environment.GetFolderPath(Environment.SpecialFolder.System); bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = PermissionsCheck.HaveWritePermissionsForFolder(path); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); } } } From ad5c8fd6569f3d2a2ec6aa0c6bb693b48d8613ee Mon Sep 17 00:00:00 2001 From: Adam Naylor Date: Sun, 28 Jan 2018 09:30:41 +0000 Subject: [PATCH 2/2] Uncomments CopyAccessControl --- src/NAppUpdate.Framework/Utils/FileSystem.cs | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/NAppUpdate.Framework/Utils/FileSystem.cs b/src/NAppUpdate.Framework/Utils/FileSystem.cs index fc5dc2b1..e1d1a777 100644 --- a/src/NAppUpdate.Framework/Utils/FileSystem.cs +++ b/src/NAppUpdate.Framework/Utils/FileSystem.cs @@ -101,19 +101,19 @@ public static bool IsFileLocked(FileInfo file) public static void CopyAccessControl(FileInfo src, FileInfo dst) { - //FileSecurity fs = src.GetAccessControl(); + FileSecurity fs = src.GetAccessControl(); - //bool hasInheritanceRules = fs.GetAccessRules(false, true, typeof(SecurityIdentifier)).Count > 0; - //if (hasInheritanceRules) - //{ - // fs.SetAccessRuleProtection(false, false); - //} - //else - //{ - // fs.SetAccessRuleProtection(true, true); - //} + bool hasInheritanceRules = fs.GetAccessRules(false, true, typeof(SecurityIdentifier)).Count > 0; + if (hasInheritanceRules) + { + fs.SetAccessRuleProtection(false, false); + } + else + { + fs.SetAccessRuleProtection(true, true); + } - //dst.SetAccessControl(fs); + dst.SetAccessControl(fs); } } }