Compare commits

..

1 Commits

Author SHA1 Message Date
Dimitrij
9e70dce626 update PuTTY to v.0.75 2021-07-04 14:44:56 +01:00
869 changed files with 27349 additions and 48087 deletions

View File

@@ -1,24 +1,58 @@
**Hello, and welcome to the mRemoteNG project!**
# Welcome!
Open source software is best when shared with others. This also applies to the work that goes into the software. Your ideas and passion are what make this software great!
There are many ways that you can help improve mRemoteNG, even if you don't know how to program:
We are really glad you are interested in contributing to mRemoteNG!
- add documentation or "how-to" articles on the Wiki
- answer support questions on the forum
- add or improve a translation
- submit a pull request for a bug or feature ticket
Open source software is best when shared with others. This also applies to the work that goes into the software. Your ideas and passion are what make this software great.
### Ways you can contribute
There are many ways that you can help improve mRemoteNG, even if you don't know how to program.
For example, you might:
- add documentation or "how-to" articles on the [Wiki](https://github.com/mRemoteNG/mRemoteNG/wiki)
- answer support questions on the [forum](http://forum.mremoteng.org)
- [add or improve a translation](https://github.com/mRemoteNG/mRemoteNG/wiki/How-to-Help-Translating-mRemoteNG)
- submit a [pull request](https://github.com/mRemoteNG/mRemoteNG/pulls) for a [bug or feature ticket](https://github.com/mRemoteNG/mRemoteNG/issues)
# Submitting GitHub Issues
The GitHub Issue tracker is our preferred channel for bug reports and feature requests.
For questions or general discussion, please use [our public Gitter chat](https://gitter.im/mRemoteNG/PublicChat) or the [forum](http://forum.mremoteng.org).
- For questions or general discussion, please use [our public Gitter chat](https://gitter.im/mRemoteNG/PublicChat) or the [forum](http://forum.mremoteng.org).
- If you find a security vulnerability, do **NOT** open an issue. Email support@mremoteng.org instead.
If you find a security vulnerability, do **NOT** open an issue. Email security@mremoteng.org instead.
### Bug reports
A bug is any behavior that does not consistently produce the expected result.
You'll find all information on our GitHub workflow in our [Wiki](https://github.com/mRemoteNG/mRemoteNG/wiki), or you can use these links:
Guidelines for bug reports:
1. Do not open bug reports for questions.
1. Use the GitHub Issue search to make sure your bug hasn't already been reported.
1. Include as much detailed information as possible. We've included a default template when opening an issue to make this easier.
- [Branches](https://github.com/mRemoteNG/mRemoteNG/wiki/Branches)
- [Bug Repots](https://github.com/mRemoteNG/mRemoteNG/wiki/Bug-Reports)
- [Feature Requests](https://github.com/mRemoteNG/mRemoteNG/wiki/Feature-Requests)
- [Pull Requests](https://github.com/mRemoteNG/mRemoteNG/wiki/Pull-Requests)
### Feature requests
Feature requests are great! Take some time to compose a well thought out proposal. It's up to you to convince the project maintainers that your feature is a good idea. To ensure your request receives the consideration that it deserves, include as much detail as possible. For example:
- What is the purpose of the new feature?
- What situation led you to want this feature?
- How does the application perform now and how would the new feature change this?
- If applicable, consider including visual mock-ups to show us what you mean.
# Pull requests
Good pull requests are a huge help! If you haven't already, please consider reading [GitHub's guide to contributing to open source](https://guides.github.com/activities/contributing-to-open-source/)
Our requests when it comes to pull requests:
- Be clear about what your PR seeks to do.
- Keep your PR focused. It should be clear what code changed to achieve your stated goal.
- Add or update tests when possible. Some of the code base is still very hard to effectively test. If you can, please try to create or update tests that relate to your PR.
- Please talk with one of the project maintainers before starting work on large pull requests. Otherwise, you run the risk of putting a lot of time into a feature or refactor that gets denied.
- If you have access to Static Code Analysis tools (like ReSharper), please don't analyze/fix everything in one giant PR. As great as these tools are, they can sometimes cause unintended problems.
# Code Style
- Please make use of simple types and var where possible
- Prefer "using" over .Dispose()
- Avoid nesting "using"
# Your first contributions
Want to help but don't know where to start? Check out the issues that we've labeled with [`Help Wanted`](https://github.com/mRemoteNG/mRemoteNG/issues?q=is%3Aissue+is%3Aopen+label%3A%22Help+Wanted%22) or [`ready`](https://github.com/mRemoteNG/mRemoteNG/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3A%22ready%22). These will vary in difficulty, but should be possible for new contributors.
Even if you don't know C# you can heck out the issues that we've labeled with [`Documentation`](https://github.com/mRemoteNG/mRemoteNG/labels/Documentation).
Want to help but don't know C#? Check out the issues that we've labeled with [`Documentation`](https://github.com/mRemoteNG/mRemoteNG/labels/Documentation).
Sorry, we currently do not have any tags for truly beginner-friendly issues :(

View File

@@ -15,19 +15,15 @@
## Screenshots (if appropriate):
## Types of changes
<!--- What types of changes does your code introduce? -->
<!--- Uncomment the line(s) that apply(s) to you pull request -->
<!--- - Bug fix (non-breaking change which fixes an issue) -->
<!--- - New feature (non-breaking change which adds functionality) -->
<!--- - Breaking change (fix or feature that would cause existing functionality to change) -->
<!--- - Updated translation -->
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Checklist:
<!--- Go over all the following points. All of them must apply to your pull request to be merged. -->
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have read the **CONTRIBUTING** document.
- [ ] My code follows the code style of this project.
- [ ] All Tests within VisualStudio are passing
- [ ] This pull request does not target the master branch.
- [ ] I have updated the changelog file accordingly, if necessary.
- [ ] I have updated the documentation accordingly, if necessary.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.

5
.gitignore vendored
View File

@@ -283,6 +283,9 @@ Installer Projects/Installer/Fragments/HelpFilesFragment.wxs
InstallerProjects/Installer/Fragments/FilesFragment.wxs
InstallerProjects/Installer/Resources/License.rtf
# user preference: .editorconfig - http://editorconfig.org/
.editorconfig
# gh-pages info
runlocal.bat
/_site
/_site

1496
CHANGELOG.TXT Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

144
CREDITS.TXT Normal file
View File

@@ -0,0 +1,144 @@
Contributors
============
Current mRemoteNG dev team:
David Sparer (github.com/sparerd)
Sean Kaim (github.com/kmscode)
Thanks for the awesome new website!
Bennett Blodinger (github.com/benwa)
Joe Cefoli (github.com/jcefoli)
countchappy (github.com/countchappy)
Tony Lambert
Julien Roncaglia (github.com/vbfox)
github.com/peterchenadded
Brandon Wulf (github.com/mrwulf)
Pedro Rodrigues (github.com/pedro2555)
github.com/dekelMP
github.com/farosch
Bruce (github.com/brucetp)
Camilo Alvarez (github.com/jotatsu)
github.com/DamianBis
github.com/pfjason
github.com/sirLoaf
github.com/Fyers
Vladimir Semenov (github.com/sli-pro)
Stephan (github.com/st-schuler)
Past Contributors
=================
Felix Deimel - mRemote original developer
Riley McArdle - mRemoteNG original developer
Hayato Iriumi (github.com/hiriumi)
Jason Barbier
Wiktor Beryt
Lionel Caignec
Ruben d'Arco
Holger Henke
Tom Hiller
Apisitt Rattana
Andreas Rehm
David Vidmar
github.com/Brandhor
github.com/Kvarkas
Translators
===========
Eugenio "Ryo567" Mart<72>nez
Mathieu Pape
Emanuel Silva
Robert Siwiec
Hayato Iriumi
Sebastien Thieury (github.com/SebThieu)
Riza Emet
Lukas Plachy (github.com/rheingold)
Gyuha Shin
Stefan (github.com/polluks)
github.com/emazv72
Vladimir Semenov (github.com/sli-pro)
Marco Sousa (github.com/marcomsousa)
Included Source Code
====================
Command Line Arguments Parser
Copyright <20> 2002 Richard Lopes
MIT License
http://www.codeproject.com/KB/recipes/command_line.aspx
FilteredPropertyGrid
Copyright <20> 2006 Azuria
http://www.codeproject.com/KB/cs/FilteredPropertyGrid.aspx
InputBox
Copyright <20> 2016 Jan Slama
http://www.csharp-examples.net/inputbox/
IP TextBox
Copyright <20> 2005 mawnkay
http://www.codeproject.com/Articles/11576/IP-TextBox
PortableSettingsProvider
Copyright <20> 2014 crdx
https://github.com/crdx/PortableSettingsProvider
Included Components
===================
ADTree
Copyright <20> 2004 Marc Merritt
Copyright <20> 2008 Felix Deimel
http://www.codeproject.com/KB/selection/ADPickerCtrl.aspx
DockPanel Suite
Copyright <20> 2016 @roken and @lextm (formerly Weifen Luo)
MIT License
https://github.com/dockpanelsuite/dockpanelsuite
GeckoFX
Copyright <20> 2016 Tom Hindle
Mozilla Public License
https://bitbucket.org/geckofx/
log4net
Copyright <20> 2001-2015 The Apache Software Foundation
Apache License Version 2.0
http://logging.apache.org/log4net/
Magic Library
Copyright <20> 2002-2003 Crownwood Consulting, Ltd.
Freely redistributable with attribution
http://www.dotnetmagic.com/magic_download.html
PuTTY
Copyright <20> 1997-2017 Simon Tatham
MIT License
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Silk Icon Set
Copyright <20> 2005-2008 FAMFAMFAM
Creative Commons Attribution 2.5 License
http://www.famfamfam.com/
SSH.NET
Copyright <20> 2016
MIT License
https://github.com/sshnet/SSH.NET
VncSharp
Copyright <20> 2004-2009 David Humphrey
GNU General Public License (GPL) Version 2
https://github.com/humphd/VncSharp
ObjectListView
Copyright <20> 2006-2016 Phillip Piper
GNU General Public License (GPL) Version 3
https://sourceforge.net/projects/objectlistview/

View File

@@ -1,150 +0,0 @@
# Contributors
## Current mRemoteNG dev team
David Sparer (http://github.com/sparerd)
Sean Kaim (http://github.com/kmscode)
Faryan Rezagholi (http://github.com/farosch)
Thanks for the awesome new website!
Bennett Blodinger (http://github.com/benwa)
Joe Cefoli (http://github.com/jcefoli)
countchappy (http://github.com/countchappy)
Tony Lambert
Julien Roncaglia (http://github.com/vbfox)
http://github.com/peterchenadded
Brandon Wulf (http://github.com/mrwulf)
Pedro Rodrigues (http://github.com/pedro2555)
http://github.com/dekelMP
Bruce (http://github.com/brucetp)
Camilo Alvarez (http://github.com/jotatsu)
http://github.com/DamianBis
http://github.com/pfjason
http://github.com/sirLoaf
http://github.com/Fyers
Vladimir Semenov (http://github.com/sli-pro)
Stephan (http://github.com/st-schuler)
Aleksey Reytsman (http://github.com/areytsman)
Cristian Abelleira (http://github.com/CrAbelleira)
http://github.com/MitchellBot
Filippo Ferrazini (http://github.com/Filippo125)
## Past Contributors
Felix Deimel - mRemote original developer
Riley McArdle - mRemoteNG original developer
Hayato Iriumi (http://github.com/hiriumi)
Jason Barbier
Wiktor Beryt
Lionel Caignec
Ruben d'Arco
Holger Henke
Tom Hiller
Apisitt Rattana
Andreas Rehm
David Vidmar
http://github.com/Brandhor
Dimitrij (http://github.com/Kvarkas)
## Translators
Eugenio "Ryo567" Martínez
Mathieu Pape
Emanuel Silva
Robert Siwiec
Hayato Iriumi
Sebastien Thieury (http://github.com/SebThieu)
Riza Emet
Lukas Plachy (http://github.com/rheingold)
Gyuha Shin
Stefan (http://github.com/polluks)
http://github.com/emazv72
Vladimir Semenov (http://github.com/sli-pro)
Marco Sousa (http://github.com/marcomsousa)
http://github.com/wwj402
http://github.com/Fyers
http://github.com/pablomh
Damian Szczepanik (http://github.com/damianszczepanik)
Mant1kor (http://github.com/Mant1kor)
## Included Source Code
Command Line Arguments Parser
Copyright © 2002 Richard Lopes
MIT License
http://www.codeproject.com/KB/recipes/command_line.aspx
FilteredPropertyGrid
Copyright © 2006 Azuria
http://www.codeproject.com/KB/cs/FilteredPropertyGrid.aspx
InputBox
Copyright © 2016 Jan Slama
http://www.csharp-examples.net/inputbox/
IP TextBox
Copyright © 2005 mawnkay
http://www.codeproject.com/Articles/11576/IP-TextBox
PortableSettingsProvider
Copyright © 2014 crdx
https://github.com/crdx/PortableSettingsProvider
## Included Components
ADTree
Copyright © 2004 Marc Merritt
Copyright © 2008 Felix Deimel
http://www.codeproject.com/KB/selection/ADPickerCtrl.aspx
DockPanel Suite
Copyright © 2018 @roken and @lextm (formerly Weifen Luo)
MIT License
https://github.com/dockpanelsuite/dockpanelsuite
GeckoFX
Copyright © 2016 Tom Hindle
Mozilla Public License
https://bitbucket.org/geckofx/
log4net
Copyright © 2001-2015 The Apache Software Foundation
Apache License Version 2.0
http://logging.apache.org/log4net/
Magic Library
Copyright © 2002-2003 Crownwood Consulting, Ltd.
Freely redistributable with attribution
http://www.dotnetmagic.com/magic_download.html
PuTTY
Copyright © 1997-2017 Simon Tatham
MIT License
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Silk Icon Set
Copyright © 2005-2008 FAMFAMFAM
Creative Commons Attribution 2.5 License
http://www.famfamfam.com/
SSH.NET
Copyright © 2016
MIT License
https://github.com/sshnet/SSH.NET
VncSharp
Copyright © 2004-2009 David Humphrey
GNU General Public License (GPL) Version 2
https://github.com/humphd/VncSharp [Archived]
ObjectListView
Copyright © 2006-2016 Phillip Piper
GNU General Public License (GPL) Version 3
https://sourceforge.net/projects/objectlistview/
Markdig
Copyright © 2016-2019 Alexandre Mutel
BSD 2-Clause "Simplified"
https://github.com/lunet-io/markdig
ConsoleControl
Copyright © 2015 Dave Kerr
MIT License
https://github.com/dwmkerr/consolecontrol

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@@ -3,19 +3,16 @@
<Fragment>
<ComponentGroup Id="CG.ProjectInfoFiles" Directory="INSTALLDIR">
<Component Id="C.Changelog" Guid="*">
<File Id="ChangelogFile" Name="Changelog.txt" Source="$(var.SolutionDir)CHANGELOG.md" KeyPath="yes" />
<File Id="ChangelogFile" Name="Changelog.txt" Source="$(var.SolutionDir)CHANGELOG.TXT" KeyPath="yes" />
</Component>
<Component Id="C.Credits" Guid="*">
<File Id="CreditsFile" Name="Credits.txt" Source="$(var.SolutionDir)CREDITS.md" KeyPath="yes" />
<File Id="CreditsFile" Name="Credits.txt" Source="$(var.SolutionDir)CREDITS.TXT" KeyPath="yes" />
</Component>
<Component Id="C.License" Guid="*">
<File Id="LicenseFile" Name="License.txt" Source="$(var.SolutionDir)COPYING.TXT" KeyPath="yes" />
</Component>
<Component Id="C.Readme" Guid="*">
<File Id="ReadmeFile" Name="Readme.txt" Source="$(var.SolutionDir)README.md" KeyPath="yes" />
</Component>
<Component Id="C.TileManifest" Guid="*">
<File Id="TileManifest" Name="mRemoteNG.VisualElementsManifest.xml" Source="$(var.SolutionDir)mRemoteV1\bin\Release\mRemoteNG.VisualElementsManifest.xml" KeyPath="yes" />
<File Id="ReadmeFile" Name="Readme.txt" Source="$(var.SolutionDir)README.TXT" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>

View File

@@ -5,14 +5,14 @@
<DirectoryRef Id="DesktopFolder">
<Component Id="C.DesktopShortcut" Guid="F78E5A16-A2F7-4BD9-9250-CBF3016CCCDA">
<Shortcut Id="DesktopShortcut" Name="$(var.ProductName)" Target="[INSTALLDIR][MAINEXE]" WorkingDirectory="INSTALLDIR" Icon="AppIcon.ico" />
<Shortcut Id="DesktopShortcut" Name="$(var.ProductName)" Target="[INSTALLDIR][MAINEXE]" WorkingDirectory="INSTALLDIR" Icon="mRemoteNG.ico" />
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="DesktopShortcut" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="C.ApplicationStartMenuShortcut" Guid="193B9E14-F40E-44F1-8514-BED253BCBF75">
<Shortcut Id="ApplicationStartMenuShortcut" Name="$(var.ProductName)" Target="[INSTALLDIR][MAINEXE]" WorkingDirectory="INSTALLDIR" Icon="AppIcon.ico" />
<Shortcut Id="ApplicationStartMenuShortcut" Name="$(var.ProductName)" Target="[INSTALLDIR][MAINEXE]" WorkingDirectory="INSTALLDIR" Icon="mRemoteNG.ico" />
<Shortcut Id="CreditsShortcut" Name="Credits" Target="[INSTALLDIR]Credits.txt" WorkingDirectory="INSTALLDIR" />
<Shortcut Id="LicenseShortcut" Name="License" Target="[INSTALLDIR]License.txt" WorkingDirectory="INSTALLDIR" />
<Shortcut Id="ReadmeShortcut" Name="Readme" Target="[INSTALLDIR]Readme.txt" WorkingDirectory="INSTALLDIR" />

View File

@@ -41,9 +41,10 @@
<ItemGroup>
<Content Include="Filters\Harvest_Filter.xslt" />
<Content Include="Includes\Config.wxi" />
<Content Include="Resources\AppIcon.ico" />
<Content Include="Resources\Installer_Header.png" />
<Content Include="Resources\Installer_Side.png" />
<Content Include="Resources\header.bmp" />
<Content Include="Resources\License.rtf" />
<Content Include="Resources\mRemoteNG.ico" />
<Content Include="Resources\welcome.bmp" />
</ItemGroup>
<ItemGroup>
<Folder Include="CustomActions" />
@@ -56,6 +57,10 @@
<Folder Include="Resources" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localizations\ru-RU.wxl" />
<EmbeddedResource Include="Localizations\ja-JP.wxl" />
<EmbeddedResource Include="Localizations\cs-CZ.wxl" />
<EmbeddedResource Include="Localizations\de-DE.wxl" />
<EmbeddedResource Include="Localizations\en-US.wxl" />
</ItemGroup>
<ItemGroup>
@@ -114,14 +119,15 @@
:: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one.
powershell -noprofile -command "sleep 2"
set /p buildenv=&lt;buildenv.tmp
:: Manual builds, set the cert password and uncomment below.
:: IF "%25APPVEYOR_BUILD_FOLDER"=="" ( set cert_pwd= )
set solutionDir=$(SolutionDir)\
set targetDir=%25cd%25
set psScriptsDir=$(SolutionDir)Tools
set certPath=$(CertPath)
set certPassword=$(CertPassword)
:: Call the post build powershell script
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_installer.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "%25cd%25" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"</PostBuildEvent>
powershell.exe -ExecutionPolicy Bypass -File "%25psScriptsDir%25\postbuild_installer.ps1" -SolutionDir "%25solutionDir%25" -TargetDir "%25targetDir%25" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "%25certPath%25" -CertificatePassword "%25certPassword%25"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>REM Clean the TargetDir
@@ -130,7 +136,7 @@ rmdir /S /Q "$(TargetDir)"
echo $(ConfigurationName) &gt; buildenv.tmp
REM Harvest bin directory of the mRemoteV1 project
"$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag -nologo -dr INSTALLDIR -var var.HarvestPath -srd -scom -sreg -cg MandatoryComponents -template fragment -out "$(ProjectDir)Fragments\FilesFragment.wxs" -t "$(ProjectDir)Filters\Harvest_Filter.xslt"
"$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag -nologo -dr INSTALLDIR -var var.HarvestPath -srd -cg MandatoryComponents -template fragment -out "$(ProjectDir)Fragments\FilesFragment.wxs" -t "$(ProjectDir)Filters\Harvest_Filter.xslt"
REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the installer GUI
"$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="cs-CZ" Language="1029" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<!-- Install Conditions -->
<String Id="Upgrade_NewerVersionInstalled" Overridable="yes">A newer version of [ProductName] is already installed.</String>
<String Id="Install_NeedToBeAdminToInstall">You need to be an administrator to install this product.</String>
<String Id="Install_NeedDotNetFrameworkVersion">mRemoteNG requires Microsoft .NET Framework $(var.RequiredDotNetFrameworkVersion).</String>
<String Id="Install_OSVersionRequirement">mRemoteNG requires Windows 7 SP1 or higher to run. Please update your operating system and try again.</String>
<String Id="Install_RDP80Requirement">mRemoteNG requires RDP 8.0 or higher to run. Windows 7 users will need to install KB2592687</String>
<String Id="Install_Win7RequiresSP1">For mRemoteNG to run on Windows 7, it requires Service Pack 1 to be installed. Please install Service Pack 1 and try again.</String>
<!-- Directories and File names -->
<String Id="Folders_Desktop">Desktop</String>
<String Id="File_Credits">Credits</String>
<String Id="File_License">License</String>
<String Id="File_VersionHistory">Version History</String>
<!-- Features and install options -->
<String Id="Feature_Complete">Complete</String>
<String Id="Feature_DesktopShortcut">Desktop Shortcut</String>
<String Id="Feature_StartMenuShortcut">Start menu shortcut</String>
<!-- GUI Page Text -->
<String Id="FinishPage_LaunchMremoteNow" Overridable="yes">Launch [ProductName] Now</String>
</WixLocalization>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="de-DE" Language="1031" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<!-- Install Conditions -->
<String Id="Upgrade_NewerVersionInstalled" Overridable="yes">A newer version of [ProductName] is already installed.</String>
<String Id="Install_NeedToBeAdminToInstall">You need to be an administrator to install this product.</String>
<String Id="Install_NeedDotNetFrameworkVersion">mRemoteNG requires Microsoft .NET Framework $(var.RequiredDotNetFrameworkVersion).</String>
<String Id="Install_OSVersionRequirement">mRemoteNG requires Windows 7 SP1 or higher to run. Please update your operating system and try again.</String>
<String Id="Install_RDP80Requirement">mRemoteNG requires RDP 8.0 or higher to run. Windows 7 users will need to install KB2592687</String>
<String Id="Install_Win7RequiresSP1">For mRemoteNG to run on Windows 7, it requires Service Pack 1 to be installed. Please install Service Pack 1 and try again.</String>
<!-- Directories and File names -->
<String Id="Folders_Desktop">Desktop</String>
<String Id="File_Credits">Credits</String>
<String Id="File_License">License</String>
<String Id="File_VersionHistory">Version History</String>
<!-- Features and install options -->
<String Id="Feature_Complete">Complete</String>
<String Id="Feature_DesktopShortcut">Desktop Shortcut</String>
<String Id="Feature_StartMenuShortcut">Start menu shortcut</String>
<!-- GUI Page Text -->
<String Id="FinishPage_LaunchMremoteNow" Overridable="yes">mRemoteNG jetzt Starten</String>
</WixLocalization>

View File

@@ -22,6 +22,6 @@
<String Id="Feature_StartMenuShortcut">Start menu shortcut</String>
<!-- GUI Page Text -->
<String Id="FinishPage_LaunchMremoteNow" Overridable="yes">Launch mRemoteNG now</String>
<String Id="FinishPage_LaunchMremoteNow" Overridable="yes">Launch mRemoteNG Now</String>
</WixLocalization>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="ja-JP" Language="1041" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<!-- Install Conditions -->
<String Id="Upgrade_NewerVersionInstalled" Overridable="yes">A newer version of [ProductName] is already installed.</String>
<String Id="Install_NeedToBeAdminToInstall">You need to be an administrator to install this product.</String>
<String Id="Install_NeedDotNetFrameworkVersion">mRemoteNG requires Microsoft .NET Framework $(var.RequiredDotNetFrameworkVersion).</String>
<String Id="Install_OSVersionRequirement">mRemoteNG requires Windows 7 SP1 or higher to run. Please update your operating system and try again.</String>
<String Id="Install_RDP80Requirement">mRemoteNG requires RDP 8.0 or higher to run. Windows 7 users will need to install KB2592687</String>
<String Id="Install_Win7RequiresSP1">For mRemoteNG to run on Windows 7, it requires Service Pack 1 to be installed. Please install Service Pack 1 and try again.</String>
<!-- Directories and File names -->
<String Id="Folders_Desktop">Desktop</String>
<String Id="File_Credits">Credits</String>
<String Id="File_License">License</String>
<String Id="File_VersionHistory">Version History</String>
<!-- Features and install options -->
<String Id="Feature_Complete">Complete</String>
<String Id="Feature_DesktopShortcut">Desktop Shortcut</String>
<String Id="Feature_StartMenuShortcut">Start menu shortcut</String>
<!-- GUI Page Text -->
<String Id="FinishPage_LaunchMremoteNow" Overridable="yes">Launch [ProductName] Now</String>
</WixLocalization>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="ru-RU" Language="1049" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<!-- Install Conditions -->
<String Id="Upgrade_NewerVersionInstalled" Overridable="yes">A newer version of [ProductName] is already installed.</String>
<String Id="Install_NeedToBeAdminToInstall">You need to be an administrator to install this product.</String>
<String Id="Install_NeedDotNetFrameworkVersion">mRemoteNG requires Microsoft .NET Framework $(var.RequiredDotNetFrameworkVersion).</String>
<String Id="Install_OSVersionRequirement">mRemoteNG requires Windows 7 SP1 or higher to run. Please update your operating system and try again.</String>
<String Id="Install_RDP80Requirement">mRemoteNG requires RDP 8.0 or higher to run. Windows 7 users will need to install KB2592687</String>
<String Id="Install_Win7RequiresSP1">For mRemoteNG to run on Windows 7, it requires Service Pack 1 to be installed. Please install Service Pack 1 and try again.</String>
<!-- Directories and File names -->
<String Id="Folders_Desktop">Desktop</String>
<String Id="File_Credits">Credits</String>
<String Id="File_License">License</String>
<String Id="File_VersionHistory">Version History</String>
<!-- Features and install options -->
<String Id="Feature_Complete">Complete</String>
<String Id="Feature_DesktopShortcut">Desktop Shortcut</String>
<String Id="Feature_StartMenuShortcut">Start menu shortcut</String>
<!-- GUI Page Text -->
<String Id="FinishPage_LaunchMremoteNow" Overridable="yes">Launch [ProductName] Now</String>
</WixLocalization>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,82 +0,0 @@
{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}}
{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
\widowctrl\hyphauto
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 GNU GENERAL PUBLIC LICENSE\line
Version 2, June 1991\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 Preamble\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The precise terms and conditions for copying, distribution and modification follow.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 GNU GENERAL PUBLIC LICENSE\par}
{\pard \ql \f0 \sa180 \li0 \fi0 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 0.\tx360\tab This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 1.\tx360\tab You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 2.\tx360\tab You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\par}
{\pard \ql \f0 \sa180 \li720 \fi-360 a)\tx360\tab You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.\par}
{\pard \ql \f0 \sa180 \li720 \fi-360 b)\tx360\tab You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.\par}
{\pard \ql \f0 \sa180 \li720 \fi-360 c)\tx360\tab If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)\sa180\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 3.\tx360\tab You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:\par}
{\pard \ql \f0 \sa180 \li720 \fi-360 a)\tx360\tab Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\par}
{\pard \ql \f0 \sa180 \li720 \fi-360 b)\tx360\tab Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\par}
{\pard \ql \f0 \sa180 \li720 \fi-360 c)\tx360\tab Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)\sa180\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 4.\tx360\tab You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 5.\tx360\tab You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 6.\tx360\tab Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 7.\tx360\tab If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 8.\tx360\tab If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 9.\tx360\tab The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 10.\tx360\tab If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\par}
{\pard \ql \f0 \sa180 \li360 \fi0 \f1 NO WARRANTY\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 11.\tx360\tab BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par}
{\pard \ql \f0 \sa180 \li360 \fi-360 12.\tx360\tab IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par}
{\pard \ql \f0 \sa180 \li360 \fi0 \f1 END OF TERMS AND CONDITIONS\line
\line
How to Apply These Terms to Your New Programs\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 <one line to give the program's name and a brief idea of what it does.>\line
Copyright (C) <year> <name of author>\line
\line
This program is free software; you can redistribute it and/or modify\line
it under the terms of the GNU General Public License as published by\line
the Free Software Foundation; either version 2 of the License, or\line
(at your option) any later version.\line
\line
This program is distributed in the hope that it will be useful,\line
but WITHOUT ANY WARRANTY; without even the implied warranty of\line
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\line
GNU General Public License for more details.\line
\line
You should have received a copy of the GNU General Public License along\line
with this program; if not, write to the Free Software Foundation, Inc.,\line
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Also add information on how to contact you by electronic and paper mail.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If the program is interactive, make it output a short notice like this when it starts in an interactive mode:\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 Gnomovision version 69, Copyright (C) year name of author\line
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\line
This is free software, and you are welcome to redistribute it\line
under certain conditions; type `show c' for details.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The hypothetical commands {\f1 show w' and}show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than {\f1 show w' and}show c'; they could even be mouse-clicks or menu items--whatever suits your program.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 , 1 April 1989 Ty Coon, President of Vice\par}
{\pard \ql \f0 \sa180 \li0 \fi0 This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.\par}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

View File

@@ -11,7 +11,7 @@
<MediaTemplate EmbedCab="yes" />
<Binary Id="CustomActions.CA.dll" SourceFile="$(var.SolutionDir)InstallerProjects\CustomActions\bin\$(var.Configuration)\CustomActions.CA.dll" />
<Property Id="MsiLogging" Value="v" />
<Property Id="ARPPRODUCTICON" Value="AppIcon.ico" />
<Property Id="ARPPRODUCTICON" Value="mRemoteNG.ico" />
<Property Id="ARPHELPLINK" Value="http://www.mremoteng.org" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize" />
<Property Id="MAINEXE" Value="$(var.ExeProcessName)" />
@@ -27,11 +27,13 @@
<Property Id='LEGACYVERSIONINSTALLED' Value='0' />
<PropertyRef Id="NETFRAMEWORK40FULL" />
<PropertyRef Id="WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED" />
<Icon Id="AppIcon.ico" SourceFile="Resources\AppIcon.ico" />
<Icon Id="mRemoteNG.ico" SourceFile="Resources\mRemoteNG.ico" />
<CustomActionRef Id='SaveCmdlineINSTALLDIR' />
<InstallUISequence>
<Custom Action="CheckIfRdpDtlsUpdateInstalled" After="AppSearch">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
<Custom Action="CheckIfMinimumRdpInstalled" After="CheckIfRdpDtlsUpdateInstalled">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
<LaunchConditions After="SetWIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED" />
<Custom Action="CheckIfLegacyVersionInstalled" After="LaunchConditions" />
<Custom Action="UninstallLegacyVersion" After="CheckIfLegacyVersionInstalled">(NOT Installed) AND (LEGACYVERSIONINSTALLED = 1)</Custom>
@@ -104,8 +106,8 @@
</UI>
<WixVariable Id="WixUILicenseRtf" Value="Resources\License.rtf" />
<WixVariable Id="WixUIDialogBmp" Value="Resources\Installer_Side.png" />
<WixVariable Id="WixUIBannerBmp" Value="Resources\Installer_Header.png" />
<WixVariable Id="WixUIDialogBmp" Value="Resources\welcome.bmp" />
<WixVariable Id="WixUIBannerBmp" Value="Resources\header.bmp" />
<!-- Provide option to run app after install -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.FinishPage_LaunchMremoteNow)" />

View File

@@ -2,7 +2,7 @@ node('windows') {
def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
def msBuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe"
def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.10.0\\tools\\nunit3-console.exe"
def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.7.0\\tools\\nunit3-console.exe"
def openCoverPath = "${jobDir}\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe"
def testResultFilePrefix = "TestResult"
def testResultFileNormal = "${testResultFilePrefix}_UnitTests_normal.xml"

View File

@@ -4,16 +4,15 @@
[![Join the chat at https://gitter.im/mRemoteNG/PublicChat/](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mRemoteNG/PublicChat)
[![PayPal](https://img.shields.io/badge/%24-PayPal-blue.svg)](https://www.paypal.me/DavidSparer)
[![Github Releases](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/total.svg?style=flat-square)](https://github.com/mRemoteNG/mRemoteNG/releases/)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/529/badge)](https://bestpractices.coreinfrastructure.org/projects/529)
[![Documentation Status](https://readthedocs.org/projects/mremoteng/badge/?version=latest)](https://mremoteng.readthedocs.io/en/latest/?badge=latest)
[![Issues In Progress](https://badge.waffle.io/mRemoteNG/mRemoteNG.png?label=In%20Progress&title=In%20Progress)](https://waffle.io/mRemoteNG/mRemoteNG)
| Update Channel | Build Status | Downloads |
| ---------------|--------------|-----------|
| Stable | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/master?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/master) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) |
| Beta | | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) |
| Development | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/develop?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/develop) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.77.1/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.77.1) |
| Stable | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/master?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/master) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.75.7012/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.75.7012) |
| Beta | | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.75.7012/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.75.7012) |
| Development | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/develop?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/develop) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76Alpha5/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76Alpha5) |
mRemoteNG is the next generation of mRemote, a full-featured, multi-tab remote connections manager.
@@ -38,20 +37,23 @@ For a detailed feature list and general usage support, refer to the [User Manual
## Installation
mRemoteNG is supported on Windows 7 or later. Before installing make sure you fullfill all the [minimum requirements](https://mremoteng.readthedocs.io/en/latest/installation/minimum_requirements.html).
Before installing make sure you have all the required [prerequisites](https://github.com/mRemoteNG/mRemoteNG/wiki/Prerequisites).
mRemoteNG is available as a redistributable msi package, and can be downloaded from the following locations:
* [GitHub](https://github.com/mRemoteNG/mRemoteNG/releases)
* [Project Website](https://mremoteng.org/download)
mRemoteNG is supported on Windows 7 or later.
Windows 7 and Windows Server 2008 installations must ensure the [listed required updates](https://github.com/mRemoteNG/mRemoteNG/wiki/Prerequisites#full-list-of-required-windows-updates-for-windows-7--server-2008-clients) are installed and active.
## Contribute
If you find mRemoteNG useful and would like to contribute, it would be greatly appreciated. When you contribute, you make it possible for the team to cover the costs of producing mRemoteNG.
### Submit Code
Check out the [Wiki page](https://github.com/mRemoteNG/mRemoteNG/wiki) on how to configure your development environment and submit a pull request.
Check out the [Wiki page](https://github.com/mRemoteNG/mRemoteNG/wiki/Development) on how to configure your development environment and submit a pull request.
### Translate
Check out the [Wiki page](https://github.com/mRemoteNG/mRemoteNG/wiki) on how to help make mRemoteNG a polyglot
Check out the [Wiki page](https://github.com/mRemoteNG/mRemoteNG/wiki/How%20to%20Help%20Translating%20mRemoteNG) on how to help make mRemoteNG a polygot
[![Developed with ReSharper](https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/develop/.github/icon_ReSharper.png)](https://www.jetbrains.com/resharper/)

25
Readme.txt Normal file
View File

@@ -0,0 +1,25 @@
mRemoteNG is the next generation of mRemote, a full-featured, multi-tab remote connections manager.
It allows you to store all your remote connections in a simple yet powerful interface.
Currently these protocols are supported:
* RDP (Remote Desktop)
* VNC (Virtual Network Computing)
* ICA (Independent Computing Architecture)
* SSH (Secure Shell)
* Telnet (TELecommunication NETwork)
* HTTP/S (Hypertext Transfer Protocol)
* Rlogin (Rlogin)
* RAW
mRemoteNG can be installed on Windows 7 or later.
Windows 7 systems require RDP version 8:
https://support.microsoft.com/en-us/kb/2592687
OR
https://support.microsoft.com/en-us/kb/2923545
Windows 8+ support RDP version 8+ out of the box.
RDP versions are backwards compatible, so an mRemoteNG client running on Windows 10 can connection successfully to a Windows 2003 host (for example).

View File

@@ -1,208 +1,60 @@
#####################################
# Authors: David Sparer & Jack Denton
# Summary:
# Author: David Sparer
# Summary:
# This is intended to be a template for creating connections in bulk. This uses the serializers directly from the mRemoteNG binaries.
# You will still need to create the connection info objects, but the library will handle serialization. It is expected that you
# are familiar with PowerShell. If this is not the case, reach out to the mRemoteNG community for help.
# Usage:
# Replace or modify the examples that are shown toward the end of the script to create your own connection info objects.
# Replace or modify the examples that are shown toward the end of the script to create your own connection info objects.
#####################################
foreach ($Path in 'HKLM:\SOFTWARE\WOW6432Node\mRemoteNG', 'HKLM:\SOFTWARE\mRemoteNG') {
Try {
$mRNGPath = (Get-ItemProperty -Path $Path -Name InstallDir -ErrorAction Stop).InstallDir
break
}
Catch {
continue
}
}
if (!$mRNGPath) {
Add-Type -AssemblyName System.Windows.Forms
$FolderBrowser = [System.Windows.Forms.FolderBrowserDialog]@{
Description = 'Please select the folder which contains mRemoteNG.exe'
ShowNewFolderButton = $false
}
$Response = $FolderBrowser.ShowDialog()
if ($Response.value__ -eq 1) {
$mRNGPath = $FolderBrowser.SelectedPath
}
elseif ($Response.value__ -eq 2) {
Write-Warning 'A folder containing mRemoteNG.exe has not been selected'
return
}
}
$null = [System.Reflection.Assembly]::LoadFile((Join-Path -Path $mRNGPath -ChildPath "mRemoteNG.exe"))
Add-Type -Path (Join-Path -Path $mRNGPath -ChildPath "BouncyCastle.Crypto.dll")
$EncryptionKey = (Get-Credential -Message "Enter the encryption key you would like to use. This must match the encryption key used by the rest of the confCons file." -UserName "DontNeedUsername").Password
$PathToMrngFolder = ""
function ConvertTo-mRNGSerializedXml {
[CmdletBinding()]
Param (
[Parameter(Mandatory)]
[mRemoteNG.Connection.ConnectionInfo[]]
$Xml
)
function Get-ChildNodes {
Param ($Xml)
$Xml
if ($Xml -is [mRemoteNG.Container.ContainerInfo] -and $Xml.HasChildren()) {
foreach ($Node in $Xml.Children) {
Get-ChildNodes -Xml $Node
}
}
}
$AllNodes = Get-ChildNodes -Xml $Xml
if (
$AllNodes.Password -or
$AllNodes.RDGatewayPassword -or
$AllNodes.VNCProxyPassword
) {
$Password = Read-Host -Message 'If you have password protected your ConfCons.xml please enter the password here otherwise just press enter' -AsSecureString
}
else {
$Password = [securestring]::new()
}
$CryptoProvider = [mRemoteNG.Security.SymmetricEncryption.AeadCryptographyProvider]::new()
$SaveFilter = [mRemoteNG.Security.SaveFilter]::new()
$ConnectionNodeSerializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionNodeSerializer26]::new($CryptoProvider, $Password, $SaveFilter)
$XmlSerializer = [mRemoteNG.Config.Serializers.Xml.XmlConnectionsSerializer]::new($CryptoProvider, $ConnectionNodeSerializer)
$RootNode = [mRemoteNG.Tree.Root.RootNodeInfo]::new('Connection')
foreach ($Node in $Xml) {
$RootNode.AddChild($Node)
}
$XmlSerializer.Serialize($RootNode)
if ($PathToMrngFolder -eq "") {
Write-Error -Message 'You must set the $PathToMrngFolder variable in this script to the folder which contains mRemoteNG.exe'
}
function New-mRNGConnection {
[CmdletBinding(DefaultParameterSetName = 'Credential')]
Param (
[Parameter(Mandatory)]
[string]
$Name,
$assembly = [System.Reflection.Assembly]::LoadFile((Join-Path -Path $PathToMrngFolder -ChildPath "mRemoteNG.exe"))
$assembly = [System.Reflection.Assembly]::LoadFile((Join-Path -Path $PathToMrngFolder -ChildPath "BouncyCastle.Crypto.dll"))
[Parameter(Mandatory)]
[string]
$Hostname,
[Parameter(Mandatory)]
[mRemoteNG.Connection.Protocol.ProtocolType]
$Protocol,
[Parameter(ParameterSetName = 'Credential')]
[pscredential]
$Credential,
[Parameter(ParameterSetName = 'InheritCredential')]
[switch]
$InheritCredential,
[Parameter()]
[mRemoteNG.Container.ContainerInfo]
$ParentContainer,
[Parameter()]
[switch]
$PassThru
)
$Connection = [mRemoteNG.Connection.ConnectionInfo]@{
Name = $Name
Hostname = $Hostname
Protocol = $Protocol
}
if ($Credential) {
$Connection.Username = $Credential.GetNetworkCredential().UserName
$Connection.Domain = $Credential.GetNetworkCredential().Domain
$Connection.Password = $Credential.GetNetworkCredential().Password
}
if ($InheritCredential) {
$Connection.Inheritance.Username = $true
$Connection.Inheritance.Domain = $true
$Connection.Inheritance.Password = $true
}
if ($ParentContainer) {
$ParentContainer.AddChild($Connection)
if ($PSBoundParameters.ContainsKey('PassThru')) {
$Connection
}
}
else {
$Connection
}
}
function New-mRNGContainer {
[CmdletBinding(DefaultParameterSetName = 'Credential')]
Param (
[Parameter(Mandatory)]
[string]
$Name,
[Parameter(ParameterSetName = 'Credential')]
[pscredential]
$Credential,
[Parameter(ParameterSetName = 'InheritCredential')]
[switch]
$InheritCredential,
[Parameter()]
[mRemoteNG.Container.ContainerInfo]
$ParentContainer
)
$Container = [mRemoteNG.Container.ContainerInfo]@{
Name = $Name
}
if ($Credential) {
$Container.Username = $Credential.GetNetworkCredential().UserName
$Container.Domain = $Credential.GetNetworkCredential().Domain
$Container.Password = $Credential.GetNetworkCredential().Password
}
if ($InheritCredential) {
$Container.Inheritance.Username = $true
$Container.Inheritance.Domain = $true
$Container.Inheritance.Password = $true
}
if ($ParentContainer) {
$ParentContainer.AddChild($Container)
}
$Container
}
function Export-mRNGXml {
function New-mRemoteNGXmlSerializer {
[CmdletBinding()]
param (
[Parameter()]
[string]
$Path,
[Parameter()]
[string]
$SerializedXml
[SecureString]
$EncryptionKey
)
$FilePathProvider = [mRemoteNG.Config.DataProviders.FileDataProvider]::new($Path)
$filePathProvider.Save($SerializedXml)
PROCESS {
$cryptoProvider = New-Object -TypeName mRemoteNG.Security.SymmetricEncryption.AeadCryptographyProvider
$saveFilter = New-Object -TypeName mRemoteNG.Security.SaveFilter -ArgumentList @($false)
$xmlSerializer = New-Object -TypeName mRemoteNG.Config.Serializers.XmlConnectionNodeSerializer -ArgumentList @($cryptoProvider, $encryptionKey, $saveFilter)
Write-Output $xmlSerializer
}
}
function New-mRemoteNGConnectionInfo {
[CmdletBinding()]
param ()
PROCESS {
$connectionInfo = New-Object -TypeName mRemoteNG.Connection.ConnectionInfo
Write-Output $connectionInfo
}
}
function New-mRemoteNGContainerInfo {
[CmdletBinding()]
param ()
PROCESS {
$connectionInfo = New-Object -TypeName mRemoteNG.Container.ContainerInfo
Write-Output $connectionInfo
}
}
# Setup the services needed to do serialization
$xmlSerializer = New-mRemoteNGXmlSerializer -EncryptionKey $EncryptionKey
@@ -210,85 +62,53 @@ function Export-mRNGXml {
# Example 1: serialize many connections, no containers
# Here you can define the number of connection info objects to create
# You can also provide a list of desired hostnames and iterate over those
$xml = ""
foreach($i in 1..5)
{
$connectionInfo = New-mRemoteNGConnectionInfo
$Connections = foreach ($i in 1..5) {
# Create new connection
$Splat = @{
Name = 'Server-{0:D2}' -f $i
Hostname = 'Server-{0:D2}' -f $i
Protocol = 'RDP'
InheritCredential = $true
}
New-mRNGConnection @Splat
# Set connection info properties
$connectionInfo.Name = "server-$i"
$connectionInfo.Hostname = "some-win-server-$i"
$connectionInfo.Protocol = [mRemoteNG.Connection.Protocol.ProtocolType]::RDP
$connectionInfo.Inheritance.Username = $true
$connectionInfo.Inheritance.Domain = $true
$connectionInfo.Inheritance.Password = $true
$serializedConnection = $xmlSerializer.SerializeConnectionInfo($connectionInfo).ToString()
$xml += $serializedConnection + [System.Environment]::NewLine
}
# Serialize the connections
$SerializedXml = ConvertTo-mRNGSerializedXml -Xml $Connections
# Write the XML to a file ready to import into mRemoteNG
Export-mRNGXml -Path "$ENV:APPDATA\mRemoteNG\PowerShellGenerated.xml" -SerializedXml $SerializedXml
# Now open up mRemoteNG and press Ctrl+O and open up the exported XML file
Write-Output $xml
#----------------------------------------------------------------
# Example 2: serialize a container which has connections
# You can also create containers and add connections and containers to them, which will be nested correctly when serialized
# If you specify the ParentContainer parameter for new connections then there will be no output unless the PassThru parameter is also used
# You can also create containers and add connections to them, which will be nested correctly when serialized
$xml = ""
$container = New-mRemoteNGContainerInfo
$container.Name = "ProductionServers"
$serializedContainer = $xmlSerializer.SerializeConnectionInfo($container)
$ProdServerCreds = Get-Credential
$ProdServers = New-mRNGContainer -Name 'ProdServers' -Credential $ProdServerCreds
foreach($i in 1..3)
{
$connectionInfo = New-mRemoteNGConnectionInfo
foreach ($i in 1..3) {
# Create new connection
$Splat = @{
Name = 'Server-{0:D2}' -f $i
Hostname = 'Server-{0:D2}' -f $i
Protocol = 'RDP'
InheritCredential = $true
ParentContainer = $ProdServers
}
New-mRNGConnection @Splat
# Set connection info properties
$connectionInfo.Name = "server-$i"
$connectionInfo.Hostname = "some-linux-server-$i"
$connectionInfo.Protocol = [mRemoteNG.Connection.Protocol.ProtocolType]::SSH2
$connectionInfo.Inheritance.Username = $true
$connectionInfo.Inheritance.Domain = $true
$connectionInfo.Inheritance.Password = $true
# serialize the connection
$serializedConnection = $xmlSerializer.SerializeConnectionInfo($connectionInfo)
# add the connection to the container
$serializedContainer.Add($serializedConnection)
}
$ProdWebServers = New-mRNGContainer -Name 'WebServers' -ParentContainer $ProdServers -InheritCredential
foreach ($i in 1..3) {
# Create new connection
$Splat = @{
Name = 'WebServer-{0:D2}' -f $i
Hostname = 'WebServer-{0:D2}' -f $i
Protocol = 'SSH1'
InheritCredential = $true
ParentContainer = $ProdWebServers
}
New-mRNGConnection @Splat
}
$DevServers = New-mRNGContainer -Name 'DevServers'
foreach ($i in 1..3) {
# Create new connection
$Splat = @{
Name = 'DevServer-{0:D2}' -f $i
Hostname = 'DevServer-{0:D2}' -f $i
Protocol = 'RDP'
InheritCredential = $true
ParentContainer = $DevServers
PassThru = $true
}
# Specified the PassThru parameter in order to catch the connection and change a property
$Connection = New-mRNGConnection @Splat
$Connection.Resolution = 'FullScreen'
}
# Serialize the container
$SerializedXml = ConvertTo-mRNGSerializedXml -Xml $ProdServers, $DevServers
# Write the XML to a file ready to import into mRemoteNG
Export-mRNGXml -Path "$ENV:APPDATA\mRemoteNG\PowerShellGenerated.xml" -SerializedXml $SerializedXml
# Now open up mRemoteNG and press Ctrl+O and open up the exported XML file
# Call ToString() on the top-level container to get the XML of it and all its children
Write-Output $serializedContainer.ToString()

View File

@@ -1,73 +0,0 @@
if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {
Write-Output "NOT running via Appveyor - Exiting"
Exit
}
$appvDir = $Env:APPVEYOR_BUILD_FOLDER
Write-Output "Appveyor Build Dir: '$($appvDir)'"
$ConfigurationName = $Env:CONFIGURATION.Trim()
Write-Output "Config Name (tirmmed): '$($ConfigurationName)'"
$SIGCHECK="Tools\exes\sigcheck.exe"
$SEVENZIP="Tools\7zip\7za.exe"
if ($ConfigurationName -eq "Release Portable") {
Write-Output "Packaging Release Portable ZIP"
$version = & $SIGCHECK /accepteula -q -n "mRemoteV1\bin\$($ConfigurationName)\mRemoteNG.exe"
Write-Output "Version is $($version)"
$PortableZip="Release\mRemoteNG-Portable-$($version).zip"
Remove-Item -Recurse "mRemoteV1\bin\package" -ErrorAction SilentlyContinue | Out-Null
New-Item "mRemoteV1\bin\package" -ItemType "directory" | Out-Null
Copy-Item "mRemoteV1\Resources\PuTTYNG.exe" -Destination "mRemoteV1\bin\package"
Copy-Item "mRemoteV1\bin\$ConfigurationName\*" -Destination "mRemoteV1\bin\package" -Recurse -Force -Exclude *.pdb
Copy-Item "*.txt" -Destination "mRemoteV1\bin\package"
Write-Output "Creating portable ZIP file $($PortableZip)"
Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip ".\mRemoteV1\bin\package\*.*"
}
else {
Write-Output "We will not zip anything - this isnt a portable release build."
}
Write-Output ""
Write-Output ""
if ($ConfigurationName -match "Release" -And $ConfigurationName -ne "Release Installer") {
Write-Output "Packaging debug symbols"
$version = & $SIGCHECK /accepteula -q -n "mRemoteV1\bin\$($ConfigurationName)\mRemoteNG.exe"
Write-Output "Version is $($version)"
if ($ConfigurationName -match "Portable") {
$zipFilePrefix = "mRemoteNG-Portable-symbols"
} else {
$zipFilePrefix = "mRemoteNG-symbols"
}
$outputZipPath="Release\$zipFilePrefix-$($version).zip"
Write-Output "Creating debug symbols ZIP file $($outputZipPath)"
Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue
$SymPath = (Join-Path -Path mRemoteV1\bin\$($ConfigurationName) -ChildPath "*.pdb")
if(Test-Path "$SymPath") {
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath "$SymPath"
} else {
Write-Output "No Debugging Symbols Found..."
}
}
else {
Write-Output "We will not package debug symbols for this configuration $($ConfigurationName)"
}
Write-Output ""

View File

@@ -1,83 +0,0 @@
if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {
Write-Output "NOT running via Appveyor - Exiting"
Throw "NOT running via Appveyor - Exiting"
}
$appvDir = $Env:APPVEYOR_BUILD_FOLDER
$SIGCHECK="Tools\exes\sigcheck.exe"
$SEVENZIP="Tools\7zip\7za.exe"
Write-Output "Appveyor Build Dir: '$($appvDir)'"
Write-Output "Decrypt Cert"
& appveyor-tools\secure-file -decrypt "$($Env:cert_path).enc" -secret "$Env:cert_decrypt_pwd"
if(-Not (Test-Path $Env:cert_path)) {
Write-Output "decrypt cert does not exist..."
Throw "Could not decrypt cert"
}
Write-Output "Restoring NuGets"
& nuget restore
Write-Output "Build Release Installer"
& msbuild "$($appvDir)\mRemoteV1.sln" /nologo /t:Clean,Build /p:Configuration="Release Installer" /p:Platform=x86 /p:CertPath="$($Env:cert_path)" /p:CertPassword="$Env:cert_pwd" /m /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Write-Output "Packaging debug symbols"
$version = & $SIGCHECK /accepteula -q -n "mRemoteV1\bin\Release\mRemoteNG.exe"
Write-Output "Version is $($version)"
$zipFilePrefix = "mRemoteNG-symbols"
$outputZipPath="Release\$zipFilePrefix-$($version).zip"
Write-Output "Creating debug symbols ZIP file $($outputZipPath)"
Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue
$SymPath = (Join-Path -Path "mRemoteV1\bin\Release" -ChildPath "*.pdb")
if(Test-Path "$SymPath") {
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath "$SymPath"
} else {
Write-Output "No Debugging Symbols Found..."
}
Write-Output "Build Release Portable"
& msbuild "$($appvDir)\mRemoteV1.sln" /nologo /t:Clean,Build /p:Configuration="Release Portable" /p:Platform=x86 /p:CertPath="$($Env:cert_path)" /p:CertPassword="$Env:cert_pwd" /m /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Write-Output "Packaging Release Portable ZIP"
$version = & $SIGCHECK /accepteula -q -n "mRemoteV1\bin\Release Portable\mRemoteNG.exe"
Write-Output "Version is $($version)"
$zipFilePrefix = "mRemoteNG-Portable-symbols"
$outputZipPath="Release\$zipFilePrefix-$($version).zip"
Write-Output "Creating debug symbols ZIP file $($outputZipPath)"
Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue
$SymPath = (Join-Path -Path "mRemoteV1\bin\Release Portable" -ChildPath "*.pdb")
if(Test-Path "$SymPath") {
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath "$SymPath"
} else {
Write-Output "No Debugging Symbols Found..."
}
$PortableZip="Release\mRemoteNG-Portable-$($version).zip"
Remove-Item -Recurse "mRemoteV1\bin\package" -ErrorAction SilentlyContinue | Out-Null
New-Item "mRemoteV1\bin\package" -ItemType "directory" | Out-Null
Copy-Item "mRemoteV1\Resources\PuTTYNG.exe" -Destination "mRemoteV1\bin\package"
Copy-Item "mRemoteV1\bin\Release Portable\*" -Destination "mRemoteV1\bin\package" -Recurse -Force
Copy-Item "*.txt" -Destination "mRemoteV1\bin\package"
Write-Output "Creating portable ZIP file $($PortableZip)"
Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip ".\mRemoteV1\bin\package\*.*"

View File

@@ -1,17 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
Write-Output "Copying TILES folder to output"
$sourceFiles = [io.path]::combine($SolutionDir , 'mRemoteV1\Resources\Tiles' )
robocopy $sourceFiles $TargetDir *.*
Write-Output ""

View File

@@ -30,7 +30,7 @@ function New-MsiUpdateFileContent {
$fileContents = `
"Version: $version
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$TagName/$($MsiFile.Name)
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$TagName/CHANGELOG.md
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$TagName/CHANGELOG.TXT
CertificateThumbprint: $certThumbprint
Checksum: $hash"
Write-Output $fileContents

View File

@@ -1,23 +1,23 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
param (
[string]
[Parameter(Mandatory=$true)]
$TargetDir
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
Write-Output "Building HTML-Documentation with Sphinx"
$path_HelpFilesDir = Join-Path -Path $TargetDir -ChildPath "Help"
$path_SphinxSourceDir = Join-Path -Path $SolutionDir -ChildPath "mremoteV1\Documentation"
Write-Output "Moving Help files to correct directory"
# Remove stale Help files, if they exist
if (Test-Path -Path $path_HelpFilesDir) {
Remove-Item -Path $path_HelpFilesDir -Recurse -Force
}
sphinx-build $path_SphinxSourceDir $path_HelpFilesDir
# Move Help files
Move-Item -Path (Join-Path -Path $TargetDir -ChildPath "Resources\Help") -Destination $path_HelpFilesDir -Force
Start-Sleep -Seconds 2
Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "Resources") -Recurse -Force
Write-Output ""

View File

@@ -33,12 +33,11 @@ Format-Table -AutoSize -Wrap -InputObject @{
"TargetDir" = $TargetDir
"TargetFileName" = $TargetFileName
"ConfigurationName" = $ConfigurationName
"CertificatePath" = $CertificatePath
"ExcludeFromSigning" = $ExcludeFromSigning
}
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning -SolutionDir $SolutionDir
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath -SolutionDir $SolutionDir
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath
& "$PSScriptRoot\rename_installer_with_version.ps1" -SolutionDir $SolutionDir
& "$PSScriptRoot\copy_release_installer.ps1" -SourcePath $TargetDir -DestinationDir (Join-Path -Path $SolutionDir -ChildPath "Release")

View File

@@ -33,7 +33,6 @@ Format-Table -AutoSize -Wrap -InputObject @{
"TargetDir" = $TargetDir
"TargetFileName" = $TargetFileName
"ConfigurationName" = $ConfigurationName
"CertificatePath" = $CertificatePath
"ExcludeFromSigning" = $ExcludeFromSigning
}
@@ -41,12 +40,11 @@ Format-Table -AutoSize -Wrap -InputObject @{
& "$PSScriptRoot\copy_puttyng.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\copy_themes.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\copy_tiles.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\sphinx_docs.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\move_help_files.ps1" -TargetDir $TargetDir
& "$PSScriptRoot\set_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
& "$PSScriptRoot\verify_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
& "$PSScriptRoot\tidy_files_for_release.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning -SolutionDir $SolutionDir
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath -SolutionDir $SolutionDir
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath
& "$PSScriptRoot\zip_symbols.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName
& "$PSScriptRoot\zip_portable_files.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName

View File

@@ -12,16 +12,12 @@ param (
$Exclude,
[string]
[AllowEmptyString()]
# The code signing certificate to use when signing the files.
$CertificatePath,
[string]
# Password to unlock the code signing certificate.
$CertificatePassword,
[string]
$SolutionDir
$CertificatePassword
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
@@ -30,59 +26,51 @@ Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
# validate release versions and if the certificate value was passed
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
if ($ConfigurationName -notmatch "Release") {
Write-Output "This is not a release build - we won't sign files."
return
}
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
}
if ($CertificatePath -eq "" -or !(Test-Path -Path $CertificatePath -PathType Leaf)) {
Write-Output "Certificate is not present - we won't sign files."
return
}
# make sure the cert is actually available
if ($CertificatePath -eq "" -or !(Test-Path -Path $CertificatePath -PathType Leaf))
{
Write-Output "Certificate is not present - we won't sign files."
return
}
if ($CertificatePassword -eq "") {
Write-Output "No certificate password was provided - we won't sign files."
return
}
if ($CertificatePassword -eq "") {
Write-Output "No certificate password was provided - we won't sign files."
return
}
try {
$certKeyStore = [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::MachineKeySet
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificatePath, $CertificatePassword, $certKeyStore) -ErrorAction Stop
} catch {
Write-Output "Error loading certificate file - we won't sign files."
Write-Output $Error[0]
return
}
try {
$certKeyStore = [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::MachineKeySet
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificatePath, $CertificatePassword, $certKeyStore) -ErrorAction Stop
} catch {
Write-Output "Error loading certificate file - we won't sign files."
Write-Output $Error[0]
return
}
# Sign MSI if we are building a release version and the certificate is available
Write-Output "Signing Binaries"
Write-Output "Getting files from path: $TargetDir"
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -notcontains $_.Name}
# Sign MSI if we are building a release version and the certificate is available
Write-Output "Signing Binaries"
Write-Output "Getting files from path: $TargetDir"
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -notcontains $_.Name}
$excluded_files = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -contains $_.Name}
$excluded_files | ForEach-Object `
-Begin { Write-Output "The following files were excluded from signing due to being on the exclusion list:" } `
-Process { Write-Output "-- $($_.FullName)" }
$excluded_files = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -contains $_.Name}
$excluded_files | ForEach-Object `
-Begin { Write-Output "The following files were excluded from signing due to being on the exclusion list:" } `
-Process { Write-Output "-- $($_.FullName)" }
Write-Output "Signable files count: $($signableFiles.Count)"
Write-Output "Signable files count: $($signableFiles.Count)"
foreach ($file in $signableFiles) {
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
}
foreach ($file in $signableFiles) {
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
}
# Release certificate
if ($cert -ne $null) {
$cert.Dispose()
}
} else {
Write-Output "This is not a release build or CertificatePath wasn't provided - we won't sign files."
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
# Release certificate
if ($cert -ne $null) {
$cert.Dispose()
}
Write-Output ""

View File

@@ -13,12 +13,7 @@ Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
# Remove unnecessary files from Release versions
if ($ConfigurationName -match "Release") {
Write-Output "Removing unnecessary files from Release versions"
$test = Join-Path -Path $TargetDir -ChildPath "app.publish"
if (Test-Path $test -PathType Container) {
Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "app.publish") -Recurse -Force
}
Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "app.publish") -Recurse -Force
$filesToDelete = Get-ChildItem -Path $TargetDir -Recurse -Include @(
"*.publish",
"*.xml",
@@ -26,9 +21,7 @@ if ($ConfigurationName -match "Release") {
"*.log",
"*vshost*",
"*.tmp"
) -Exclude @(
"mRemoteNG.VisualElementsManifest.xml"
)
)
Remove-Item -Path $filesToDelete.FullName
Write-Output $filesToDelete.FullName
}

View File

@@ -9,25 +9,15 @@ param (
[string]
[Parameter(Mandatory=$true)]
[AllowEmptyString()]
# The code signing certificate to use when signing the files.
$CertificatePath,
[string]
[Parameter(Mandatory=$true)]
$SolutionDir
$CertificatePath
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
# validate release versions and if the certificate value was passed
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
# validate release versions and if the certificate is available
if ($ConfigurationName -match "Release") {
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
}
# make sure the cert is actually available
if ($CertificatePath -eq "" -or !(Test-Path -Path $CertificatePath -PathType Leaf))
{
Write-Output "Certificate is not present - files likely not signed - we won't verify file signatures."
@@ -52,8 +42,7 @@ if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
Write-Output "All files have valid signatures."
}
} else {
Write-Output "This is not a release build or CertificatePath wasn't provided - we won't verify file signatures."
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
Write-Output "This is not a release build - we won't verify file signatures."
}
Write-Output ""

View File

@@ -0,0 +1,39 @@
if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {
Write-Output "NOT running via Appveyor - Exiting"
Exit
}
$appvDir = $Env:APPVEYOR_BUILD_FOLDER
Write-Output "Appveyor Build Dir: '$($appvDir)'"
$ConfigurationName = $Env:CONFIGURATION.Trim()
Write-Output "Config Name (tirmmed): '$($ConfigurationName)'"
$SIGCHECK="$($SolutionDir)Tools\exes\sigcheck.exe"
$SEVENZIP="$($SolutionDir)Tools\7zip\7za.exe"
if ($ConfigurationName -eq "Release Portable") {
Write-Output "Packaging Release Portable ZIP"
$version = & $SIGCHECK /accepteula -q -n "$($SolutionDir)mRemoteV1\bin\$($ConfigurationName)\mRemoteNG.exe"
Write-Output "Version is $($version)"
$PortableZip="$($SolutionDir)Release\mRemoteNG-Portable-$($version).zip"
Remove-Item -Recurse "$($SolutionDir)mRemoteV1\bin\package" -ErrorAction SilentlyContinue | Out-Null
New-Item "$($SolutionDir)mRemoteV1\bin\package" -ItemType "directory" | Out-Null
Copy-Item "$($SolutionDir)mRemoteV1\Resources\PuTTYNG.exe" -Destination "$($SolutionDir)mRemoteV1\bin\package"
Copy-Item "$($SolutionDir)mRemoteV1\bin\$ConfigurationName\*" -Destination "$($SolutionDir)mRemoteV1\bin\package" -Recurse -Force
Copy-Item "$($SolutionDir)*.txt" -Destination "$($SolutionDir)mRemoteV1\bin\package"
Write-Output "Creating portable ZIP file $($PortableZip)"
Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip "$($SolutionDir)mRemoteV1\bin\package\*.*"
}
else {
Write-Output "We will not zip anything - this isnt a portable release build."
}

28
appveyor.yml Normal file
View File

@@ -0,0 +1,28 @@
version: 1.76.{build}
pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2017
configuration:
- Release
- Release Portable
- Release Installer
platform: x86
clone_depth: 1
install:
- ps: C:\projects\mremoteng\mRemoteV1\Resources\CitrixReceiver.exe DONOTSTARTCC=1 ENABLE_SSON="No" /silent | out-null
before_build:
- cmd: nuget restore
build:
project: mRemoteV1.sln
verbosity: normal
after_build:
- ps: "if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {\n Write-Output \"NOT running via Appveyor - Exiting\"\n Exit\n}\n\n$appvDir = $Env:APPVEYOR_BUILD_FOLDER\n\nWrite-Output \"Appveyor Build Dir: '$($appvDir)'\"\n$ConfigurationName = $Env:CONFIGURATION.Trim()\nWrite-Output \"Config Name (tirmmed): '$($ConfigurationName)'\"\n\n\n$SIGCHECK=\"$($SolutionDir)Tools\\exes\\sigcheck.exe\"\n$SEVENZIP=\"$($SolutionDir)Tools\\7zip\\7za.exe\"\n\nif ($ConfigurationName -eq \"Release Portable\") {\n Write-Output \"Packaging Release Portable ZIP\"\n \n $version = & $SIGCHECK /accepteula -q -n \"$($SolutionDir)mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n $PortableZip=\"$($SolutionDir)Release\\mRemoteNG-Portable-$($version).zip\"\n\n Remove-Item -Recurse \"$($SolutionDir)mRemoteV1\\bin\\package\" -ErrorAction SilentlyContinue | Out-Null\n New-Item \"$($SolutionDir)mRemoteV1\\bin\\package\" -ItemType \"directory\" | Out-Null\n \n Copy-Item \"$($SolutionDir)mRemoteV1\\Resources\\PuTTYNG.exe\" -Destination \"$($SolutionDir)mRemoteV1\\bin\\package\"\n\n Copy-Item \"$($SolutionDir)mRemoteV1\\bin\\$ConfigurationName\\*\" -Destination \"$($SolutionDir)mRemoteV1\\bin\\package\" -Recurse -Force \n Copy-Item \"$($SolutionDir)*.txt\" -Destination \"$($SolutionDir)mRemoteV1\\bin\\package\"\n\n Write-Output \"Creating portable ZIP file $($PortableZip)\"\n Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip \"$($SolutionDir)mRemoteV1\\bin\\package\\*.*\"\n}\nelse {\n Write-Output \"We will not zip anything - this isnt a portable release build.\"\n}"
test:
assemblies:
only:
- mRemoteNGTests\bin\$(configuration)\mRemoteNGTests.dll
artifacts:
- path: Release\*.msi
name: mRemoteNG-installer.msi
- path: Release\*.zip
name: mRemoteNG-portable.zip

View File

@@ -1,40 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WeifenLuo.WinFormsUI.Docking" publicKeyToken="5cded1a1a0a7b481" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.6.0" newVersion="3.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-2.16.0.0" newVersion="2.16.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.9.2.0" newVersion="3.9.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<unitTestProvider name="NUnit" />
</specFlow>
</configuration>

View File

@@ -59,7 +59,7 @@ namespace mRemoteNG.Specs.Features
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
testRunner.OnScenarioStart();
testRunner.OnScenarioStart(scenarioInfo);
}
public virtual void ScenarioCleanup()
@@ -73,7 +73,7 @@ namespace mRemoteNG.Specs.Features
[Ignore("Cred Repo not implmented currently.")]
public virtual void LoadCredentialRepository()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Load credential repository", "", new string[] {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Load credential repository", new string[] {
"credentials"});
#line 7
this.ScenarioSetup(scenarioInfo);
@@ -94,7 +94,7 @@ this.ScenarioSetup(scenarioInfo);
[Ignore("Cred Repo not implmented currently.")]
public virtual void AddCredentialRecord()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add credential record", "", ((string[])(null)));
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add credential record", ((string[])(null)));
#line 13
this.ScenarioSetup(scenarioInfo);
#line 14
@@ -116,7 +116,7 @@ this.ScenarioSetup(scenarioInfo);
[Ignore("Cred Repo not implmented currently.")]
public virtual void UnloadCredentialRepository()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Unload credential repository", "", ((string[])(null)));
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Unload credential repository", ((string[])(null)));
#line 20
this.ScenarioSetup(scenarioInfo);
#line 21

View File

@@ -60,7 +60,7 @@ namespace mRemoteNG.Specs.Features
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
testRunner.OnScenarioStart();
testRunner.OnScenarioStart(scenarioInfo);
}
public virtual void ScenarioCleanup()
@@ -74,7 +74,7 @@ namespace mRemoteNG.Specs.Features
[Ignore("Cred Repo not implmented currently.")]
public virtual void AddANewCredentialRepository()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add a new credential repository", "", new string[] {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add a new credential repository", new string[] {
"credentials"});
#line 7
this.ScenarioSetup(scenarioInfo);
@@ -95,7 +95,7 @@ this.ScenarioSetup(scenarioInfo);
[Ignore("Cred Repo not implmented currently.")]
public virtual void RemoveACredentialRepository()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Remove a credential repository", "", ((string[])(null)));
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Remove a credential repository", ((string[])(null)));
#line 13
this.ScenarioSetup(scenarioInfo);
#line 14

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props" Condition="Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props')" />
<Import Project="..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,13 +9,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mRemoteNG.Specs</RootNamespace>
<AssemblyName>mRemoteNG.Specs</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@@ -26,9 +21,8 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
@@ -37,43 +31,22 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BoDi, Version=1.4.1.0, Culture=neutral, PublicKeyToken=ff7cd5ea2744b496, processorArchitecture=MSIL">
<HintPath>..\packages\BoDi.1.4.1\lib\net45\BoDi.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Gherkin, Version=6.0.0.0, Culture=neutral, PublicKeyToken=86496cfa5b4a5851, processorArchitecture=MSIL">
<HintPath>..\packages\Gherkin.6.0.0\lib\net45\Gherkin.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="TechTalk.SpecFlow, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.3.0.225\lib\net45\TechTalk.SpecFlow.dll</HintPath>
</Reference>
<Reference Include="TechTalk.SpecFlow.NUnit.SpecFlowPlugin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.NUnit.3.0.225\lib\net45\TechTalk.SpecFlow.NUnit.SpecFlowPlugin.dll</HintPath>
</Reference>
<Reference Include="Utf8Json, Version=1.3.7.0, Culture=neutral, PublicKeyToken=8a73d3ba7e392e27, processorArchitecture=MSIL">
<HintPath>..\packages\Utf8Json.1.3.7\lib\net45\Utf8Json.dll</HintPath>
<Reference Include="TechTalk.SpecFlow, Version=2.2.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.2.2.1\lib\net45\TechTalk.SpecFlow.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -116,16 +89,6 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props'))" />
<Error Condition="!Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets'))" />
</Target>
<Import Project="..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets" Condition="Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -1,25 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BoDi" version="1.4.1" targetFramework="net46" />
<package id="Gherkin" version="6.0.0" targetFramework="net46" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net46" />
<package id="NUnit" version="3.12.0" targetFramework="net46" />
<package id="NUnit.Console" version="3.10.0" targetFramework="net46" />
<package id="NUnit.ConsoleRunner" version="3.10.0" targetFramework="net46" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
<package id="NUnit" version="3.9.0" targetFramework="net46" />
<package id="NUnit.Console" version="3.7.0" targetFramework="net46" />
<package id="NUnit.ConsoleRunner" version="3.7.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.7" targetFramework="net472" />
<package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net46" />
<package id="NUnit.Runners" version="3.10.0" targetFramework="net46" />
<package id="NUnit3TestAdapter" version="3.15.1" targetFramework="net472" />
<package id="SpecFlow" version="3.0.225" targetFramework="net472" />
<package id="SpecFlow.NUnit" version="3.0.225" targetFramework="net472" />
<package id="SpecFlow.NUnit.Runners" version="3.0.225" targetFramework="net472" />
<package id="System.Reflection.Emit" version="4.6.0" targetFramework="net472" />
<package id="System.Reflection.Emit.Lightweight" version="4.6.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net46" requireReinstallation="true" />
<package id="Utf8Json" version="1.3.7" targetFramework="net46" requireReinstallation="true" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.3" targetFramework="net46" />
<package id="NUnit.Extension.VSProjectLoader" version="3.7.0" targetFramework="net46" />
<package id="NUnit.Runners" version="3.7.0" targetFramework="net46" />
<package id="SpecFlow" version="2.2.1" targetFramework="net46" />
<package id="SpecFlow.NUnit" version="2.2.1" targetFramework="net46" />
<package id="SpecFlow.NUnit.Runners" version="2.2.1" targetFramework="net46" />
</packages>

View File

@@ -1,4 +1,9 @@
using mRemoteNG.Config;
using System;
using System.Linq;
using System.Security;
using System.Xml.Linq;
using mRemoteNG.Config;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Container;
@@ -6,10 +11,6 @@ using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
using System;
using System.Linq;
using System.Security;
using System.Xml.Linq;
namespace mRemoteNGTests.Config
@@ -121,7 +122,7 @@ namespace mRemoteNGTests.Config
{
var rootNode = new RootNodeInfo(RootNodeType.Connection) {PasswordString = _key.ConvertToUnsecureString()};
rootNode.AddChild(connectionInfo);
var nodeSerializer = new XmlConnectionNodeSerializer27(_cryptographyProvider, _key, new SaveFilter());
var nodeSerializer = new XmlConnectionNodeSerializer26(_cryptographyProvider, _key, new SaveFilter());
var serializer = new XmlConnectionsSerializer(_cryptographyProvider, nodeSerializer);
var serializedData = serializer.Serialize(rootNode);
return XDocument.Parse(serializedData);

View File

@@ -83,7 +83,6 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
PostExtApp = "SomePostExtApp",
MacAddress = "SomeMacAddress",
UserField = "SomeUserField",
VmId = "SomeVmId",
ExtApp = "SomeExtApp",
VNCProxyUsername = "SomeVNCProxyUsername",
VNCProxyPassword = "SomeVNCProxyPassword",
@@ -94,16 +93,13 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
RDGatewayHostname = "SomeRDGatewayHostname",
Protocol = ProtocolType.ICA,
Port = 999,
Favorite = true,
UseConsoleSession = true,
UseCredSsp = true,
UseVmId = false,
UseEnhancedMode = false,
RenderingEngine = HTTPBase.RenderingEngine.Gecko,
ICAEncryptionStrength = IcaProtocol.EncryptionStrength.Encr40Bit,
RDPAuthenticationLevel = AuthenticationLevel.WarnOnFailedAuth,
Colors = RDPColors.Colors16Bit,
Resolution = RDPResolutions.Res1366x768,
RDPAuthenticationLevel = RdpProtocol.AuthenticationLevel.WarnOnFailedAuth,
Colors = RdpProtocol.RDPColors.Colors16Bit,
Resolution = RdpProtocol.RDPResolutions.Res1366x768,
AutomaticResize = true,
DisplayWallpaper = true,
DisplayThemes = true,
@@ -114,8 +110,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
RedirectPorts = true,
RedirectPrinters = true,
RedirectSmartCards = true,
RedirectSound = RDPSounds.LeaveAtRemoteComputer,
RedirectAudioCapture = true,
RedirectSound = RdpProtocol.RDPSounds.LeaveAtRemoteComputer,
RedirectKeys = true,
VNCCompression = ProtocolVNC.Compression.Comp4,
VNCEncoding = ProtocolVNC.Encoding.EncRRE,
@@ -125,8 +120,8 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
VNCColors = ProtocolVNC.Colors.Col8Bit,
VNCSmartSizeMode = ProtocolVNC.SmartSizeMode.SmartSAspect,
VNCViewOnly = true,
RDGatewayUsageMethod = RDGatewayUsageMethod.Detect,
RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.SmartCard
RDGatewayUsageMethod = RdpProtocol.RDGatewayUsageMethod.Detect,
RDGatewayUseConnectionCredentials = RdpProtocol.RDGatewayUseConnectionCredentials.SmartCard
};
}
@@ -165,14 +160,25 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
public static IEnumerable InheritanceTestCases()
{
var testInheritance = GetTestConnectionWithAllInherited().Inheritance;
var properties = testInheritance.GetProperties();
var ignoreProperties = new[]
{
nameof(ConnectionInfoInheritance.EverythingInherited),
nameof(ConnectionInfoInheritance.Parent)
};
var properties = typeof(ConnectionInfoInheritance)
.GetProperties()
.Where(property => !ignoreProperties.Contains(property.Name));
var testCases = new List<TestCaseData>();
var testInheritance = GetTestConnectionWithAllInherited().Inheritance;
return properties
.Select(property =>
new TestCaseData(property.Name)
.Returns(property.GetValue(testInheritance)))
.ToList();
foreach (var property in properties)
{
testCases.Add(
new TestCaseData(property.Name)
.Returns(property.GetValue(testInheritance)));
}
return testCases;
}
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Csv;
using mRemoteNG.Connection;
using mRemoteNG.Container;

View File

@@ -1,16 +1,17 @@
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
using System;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNGTests.TestHelpers;
using NUnit.Framework;
namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
@@ -24,13 +25,9 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
[SetUp]
public void Setup()
{
_connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
root.AddChild(new ConnectionInfo());
_connectionTreeModel.AddRootNode(root);
_connectionTreeModel = new ConnectionTreeModelBuilder().Build();
_cryptographyProvider = new AeadCryptographyProvider();
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
var connectionNodeSerializer = new XmlConnectionNodeSerializer26(
_cryptographyProvider,
_connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter());
@@ -50,8 +47,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
var sb = new StringBuilder();
var xml = _serializer.Serialize(_connectionTreeModel);
var schemaFileName = $"mremoteng_confcons_v{_serializer.Version.Major}_{_serializer.Version.Minor}.xsd";
var schemaFile = GetTargetPath(schemaFileName);
var schemaFile = GetTargetPath("mremoteng_confcons_v2_6.xsd");
_xmlReaderSettings.Schemas.Add("http://mremoteng.org", schemaFile);
_xmlReaderSettings.ValidationEventHandler += (sender, args) =>
{

View File

@@ -1,4 +1,7 @@
using mRemoteNG.Config.Serializers.Xml;
using System.Linq;
using System.Xml.XPath;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
@@ -6,12 +9,10 @@ using mRemoteNG.Security.Factories;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
using System.Linq;
using System.Xml.XPath;
namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
public class XmlConnectionsDocumentCompilerTests
public class XmlConnectionsDocumentCompilerTests
{
private XmlConnectionsDocumentCompiler _documentCompiler;
private ConnectionTreeModel _connectionTreeModel;
@@ -30,7 +31,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
_connectionTreeModel = SetupConnectionTreeModel();
_cryptographyProvider = new CryptoProviderFactory(BlockCipherEngines.AES, BlockCipherModes.GCM).Build();
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
var connectionNodeSerializer = new XmlConnectionNodeSerializer26(
_cryptographyProvider,
_connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter());

View File

@@ -1,4 +1,7 @@
using mRemoteNG.Config.Serializers.Xml;
using System.Linq;
using System.Xml.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
@@ -6,12 +9,10 @@ using mRemoteNG.Security.Factories;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
using System.Linq;
using System.Xml.Linq;
namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
public class XmlConnectionsDocumentEncryptorTests
public class XmlConnectionsDocumentEncryptorTests
{
private XmlConnectionsDocumentEncryptor _documentEncryptor;
private XDocument _originalDocument;
@@ -21,7 +22,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
var connectionTreeModel = SetupConnectionTreeModel();
var cryptoProvider = new CryptoProviderFactory(BlockCipherEngines.AES, BlockCipherModes.GCM).Build();
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
var connectionNodeSerializer = new XmlConnectionNodeSerializer26(
cryptoProvider,
connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter());

View File

@@ -1,4 +1,8 @@
using mRemoteNG.Config.Serializers.Xml;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
@@ -6,13 +10,10 @@ using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
public class XmlConnectionsSerializerTests
public class XmlConnectionsSerializerTests
{
private XmlConnectionsSerializer _serializer;
private ConnectionTreeModel _connectionTreeModel;
@@ -24,7 +25,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
_connectionTreeModel = SetupConnectionTreeModel();
_cryptographyProvider = new AeadCryptographyProvider();
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
var connectionNodeSerializer = new XmlConnectionNodeSerializer26(
_cryptographyProvider,
_connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter());
@@ -58,7 +59,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
[TestCase("InheritAutomaticResize", "false")]
public void SerializerRespectsSaveFilterSettings(string attributeName, string expectedValue)
{
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
var connectionNodeSerializer = new XmlConnectionNodeSerializer26(
_cryptographyProvider,
_connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter(true));

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Xml.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
@@ -10,12 +11,11 @@ using NUnit.Framework;
namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
public class XmlRootNodeSerializerTests
public class XmlRootNodeSerializerTests
{
private XmlRootNodeSerializer _rootNodeSerializer;
private ICryptographyProvider _cryptographyProvider;
private RootNodeInfo _rootNodeInfo;
private Version _version;
[SetUp]
public void Setup()
@@ -23,21 +23,19 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
_rootNodeSerializer = new XmlRootNodeSerializer();
_cryptographyProvider = new AeadCryptographyProvider();
_rootNodeInfo = new RootNodeInfo(RootNodeType.Connection);
_version = new Version(99, 1);
}
[Test]
public void RootElementNamedConnections()
{
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider);
Assert.That(element.Name.LocalName, Is.EqualTo("Connections"));
}
[Test]
[SetUICulture("en-US")]
public void RootNodeInfoNameSerialized()
{
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider);
var attributeValue = element.Attribute(XName.Get("Name"))?.Value;
Assert.That(attributeValue, Is.EqualTo("Connections"));
}
@@ -46,7 +44,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
public void EncryptionEngineSerialized(BlockCipherEngines engine, BlockCipherModes mode)
{
var cryptoProvider = new CryptoProviderFactory(engine, mode).Build();
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, cryptoProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, cryptoProvider);
var attributeValue = element.Attribute(XName.Get("EncryptionEngine"))?.Value;
Assert.That(attributeValue, Is.EqualTo(engine.ToString()));
}
@@ -55,7 +53,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
public void EncryptionModeSerialized(BlockCipherEngines engine, BlockCipherModes mode)
{
var cryptoProvider = new CryptoProviderFactory(engine, mode).Build();
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, cryptoProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, cryptoProvider);
var attributeValue = element.Attribute(XName.Get("BlockCipherMode"))?.Value;
Assert.That(attributeValue, Is.EqualTo(mode.ToString()));
}
@@ -67,7 +65,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
public void KdfIterationsSerialized(int iterations)
{
_cryptographyProvider.KeyDerivationIterations = iterations;
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider);
var attributeValue = element.Attribute(XName.Get("KdfIterations"))?.Value;
Assert.That(attributeValue, Is.EqualTo(iterations.ToString()));
}
@@ -76,7 +74,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
[TestCase(false)]
public void FullFileEncryptionFlagSerialized(bool fullFileEncryption)
{
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, _version, fullFileEncryption);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, fullFileEncryption);
var attributeValue = element.Attribute(XName.Get("FullFileEncryption"))?.Value;
Assert.That(bool.Parse(attributeValue), Is.EqualTo(fullFileEncryption));
}
@@ -88,7 +86,7 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
public void ProtectedStringSerialized(string customPassword, string expectedPlainText)
{
_rootNodeInfo.PasswordString = customPassword;
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider);
var attributeValue = element.Attribute(XName.Get("Protected"))?.Value;
var attributeValuePlainText = _cryptographyProvider.Decrypt(attributeValue, _rootNodeInfo.PasswordString.ConvertToSecureString());
Assert.That(attributeValuePlainText, Is.EqualTo(expectedPlainText));
@@ -97,10 +95,10 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
[Test]
public void ConfVersionSerialized()
{
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider, _version);
var element = _rootNodeSerializer.SerializeRootNodeInfo(_rootNodeInfo, _cryptographyProvider);
var attributeValue = element.Attribute(XName.Get("ConfVersion"))?.Value ?? "";
var confVersion = Version.Parse(attributeValue);
Assert.That(confVersion, Is.EqualTo(_version));
var versionAsNumber = double.Parse(attributeValue);
Assert.That(versionAsNumber, Is.GreaterThan(0));
}
private class TestCaseSources

View File

@@ -1,10 +1,9 @@
using mRemoteNG.Config.Serializers.CredentialSerializer;
using System.Linq;
using System.Xml.Linq;
using mRemoteNG.Config.Serializers.CredentialSerializer;
using mRemoteNG.Credential;
using mRemoteNG.Security;
using NUnit.Framework;
using System;
using System.Linq;
using System.Xml.Linq;
namespace mRemoteNGTests.Config.Serializers.CredentialSerializers
{
@@ -42,8 +41,7 @@ namespace mRemoteNGTests.Config.Serializers.CredentialSerializers
{
var serialized = _serializer.Serialize(new[] { _cred1 });
var xdoc = XDocument.Parse(serialized);
var version = Version.Parse(xdoc.Root?.Attribute("SchemaVersion")?.Value ?? "");
Assert.That(version, Is.EqualTo(_serializer.Version));
Assert.That(xdoc.Root?.Attribute("SchemaVersion")?.Value, Is.EqualTo(_serializer.SchemaVersion));
}
}
}

View File

@@ -6,6 +6,7 @@ using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNGTests.TestHelpers;
using NSubstitute;
using NUnit.Framework;
namespace mRemoteNGTests.Config.Serializers

View File

@@ -1,11 +1,15 @@
using System.Linq;
using System.Security;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.MsSql;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNGTests.TestHelpers;
using NSubstitute;
using NUnit.Framework;
namespace mRemoteNGTests.Config.Serializers

View File

@@ -1,10 +1,10 @@
using mRemoteNG.Config.Serializers;
using System.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Tree;
using mRemoteNGTests.Properties;
using NUnit.Framework;
using System.Linq;
namespace mRemoteNGTests.Config.Serializers.MiscSerializers
{
@@ -17,11 +17,10 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const string ExpectedUserName = "myusernamehere";
private const string ExpectedDomain = "myspecialdomain";
private const string ExpectedGatewayHostname = "gatewayhostname.domain.com";
private const string ExpectedLoadBalanceInfo = "tsv://MS Terminal Services Plugin.1.RDS-NAME";
private const int ExpectedPort = 9933;
private const RDPColors ExpectedColors = RDPColors.Colors24Bit;
private const RdpProtocol.RDPColors ExpectedColors = RdpProtocol.RDPColors.Colors24Bit;
private const bool ExpectedBitmapCaching = false;
private const RDPResolutions ExpectedResolutionMode = RDPResolutions.FitToWindow;
private const RdpProtocol.RDPResolutions ExpectedResolutionMode = RdpProtocol.RDPResolutions.FitToWindow;
private const bool ExpectedWallpaperDisplay = true;
private const bool ExpectedThemesDisplay = true;
private const bool ExpectedFontSmoothing = true;
@@ -30,7 +29,7 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const bool ExpectedDriveRedirection = true;
private const bool ExpectedPortRedirection = true;
private const bool ExpectedPrinterRedirection = true;
private const RDPSounds ExpectedSoundRedirection = RDPSounds.BringToThisComputer;
private const RdpProtocol.RDPSounds ExpectedSoundRedirection = RdpProtocol.RDPSounds.BringToThisComputer;
[OneTimeSetUp]
@@ -167,13 +166,6 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
Assert.That(connectionInfo.RedirectSound, Is.EqualTo(ExpectedSoundRedirection));
}
[Test]
public void LoadBalanceInfoImportedCorrectly()
{
var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First();
Assert.That(connectionInfo.LoadBalanceInfo, Is.EqualTo(ExpectedLoadBalanceInfo));
}
//[Test]
//public void GatewayHostnameImportedCorrectly()
//{

View File

@@ -24,20 +24,20 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const string ExpectedPassword = "passwordHere!";
private const bool ExpectedUseConsoleSession = true;
private const int ExpectedPort = 9933;
private const RDGatewayUsageMethod ExpectedGatewayUsageMethod = RDGatewayUsageMethod.Always;
private const RdpProtocol.RDGatewayUsageMethod ExpectedGatewayUsageMethod = RdpProtocol.RDGatewayUsageMethod.Always;
private const string ExpectedGatewayHostname = "gatewayserverhost.innerdomain.net";
private const string ExpectedGatewayUsername = "gatewayusername";
private const string ExpectedGatewayDomain = "innerdomain";
private const string ExpectedGatewayPassword = "gatewayPassword123";
private const RDPResolutions ExpectedRdpResolution = RDPResolutions.FitToWindow;
private const RDPColors ExpectedRdpColorDepth = RDPColors.Colors24Bit;
private const RDPSounds ExpectedAudioRedirection = RDPSounds.DoNotPlay;
private const RdpProtocol.RDPResolutions ExpectedRdpResolution = RdpProtocol.RDPResolutions.FitToWindow;
private const RdpProtocol.RDPColors ExpectedRdpColorDepth = RdpProtocol.RDPColors.Colors24Bit;
private const RdpProtocol.RDPSounds ExpectedAudioRedirection = RdpProtocol.RDPSounds.DoNotPlay;
private const bool ExpectedKeyRedirection = true;
private const bool ExpectedSmartcardRedirection = true;
private const bool ExpectedDriveRedirection = true;
private const bool ExpectedPortRedirection = true;
private const bool ExpectedPrinterRedirection = true;
private const AuthenticationLevel ExpectedAuthLevel = AuthenticationLevel.WarnOnFailedAuth;
private const RdpProtocol.AuthenticationLevel ExpectedAuthLevel = RdpProtocol.AuthenticationLevel.WarnOnFailedAuth;
[OneTimeSetUp]

View File

@@ -23,20 +23,20 @@ namespace mRemoteNGTests.Config.Serializers.MiscSerializers
private const string ExpectedPassword = "passwordHere!";
private const bool ExpectedUseConsoleSession = true;
private const int ExpectedPort = 9933;
private const RDGatewayUsageMethod ExpectedGatewayUsageMethod = RDGatewayUsageMethod.Always;
private const RdpProtocol.RDGatewayUsageMethod ExpectedGatewayUsageMethod = RdpProtocol.RDGatewayUsageMethod.Always;
private const string ExpectedGatewayHostname = "gatewayserverhost.innerdomain.net";
private const string ExpectedGatewayUsername = "gatewayusername";
private const string ExpectedGatewayDomain = "innerdomain";
private const string ExpectedGatewayPassword = "gatewayPassword123";
private const RDPResolutions ExpectedRdpResolution = RDPResolutions.FitToWindow;
private const RDPColors ExpectedRdpColorDepth = RDPColors.Colors24Bit;
private const RDPSounds ExpectedAudioRedirection = RDPSounds.DoNotPlay;
private const RdpProtocol.RDPResolutions ExpectedRdpResolution = RdpProtocol.RDPResolutions.FitToWindow;
private const RdpProtocol.RDPColors ExpectedRdpColorDepth = RdpProtocol.RDPColors.Colors24Bit;
private const RdpProtocol.RDPSounds ExpectedAudioRedirection = RdpProtocol.RDPSounds.DoNotPlay;
private const bool ExpectedKeyRedirection = true;
private const bool ExpectedSmartcardRedirection = true;
private const bool ExpectedDriveRedirection = true;
private const bool ExpectedPortRedirection = true;
private const bool ExpectedPrinterRedirection = true;
private const AuthenticationLevel ExpectedAuthLevel = AuthenticationLevel.AuthRequired;
private const RdpProtocol.AuthenticationLevel ExpectedAuthLevel = RdpProtocol.AuthenticationLevel.AuthRequired;
[OneTimeSetUp]

View File

@@ -1,200 +0,0 @@
using mRemoteNG.Config.Serializers.MiscSerializers;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.VNC;
using mRemoteNGTests.Properties;
using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;
namespace mRemoteNGTests.Config.Serializers.MiscSerializers
{
public class RemoteDesktopManagerDeserializerTests
{
private readonly RemoteDesktopManagerDeserializer _sut = new RemoteDesktopManagerDeserializer();
private readonly Dictionary<ProtocolType, string> _rdmExports = new Dictionary<ProtocolType, string>
{
{ProtocolType.RDP, Resources.rdp_rdm_export},
{ProtocolType.SSH2, Resources.ssh_rdm_export},
{ProtocolType.VNC, Resources.vnc_rdm_export},
{ProtocolType.Telnet, Resources.telnet_rdm_export},
{ProtocolType.HTTPS, Resources.website_rdm_export},
};
[TestCaseSource(nameof(RdpPropertiesAndValues))]
public void CorrectlyImportsRdpProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.RDP]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.RDP);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(SshPropertiesAndValues))]
public void CorrectlyImportsSshProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.SSH2]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.SSH2);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(VncPropertiesAndValues))]
public void CorrectlyImportsVncProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.VNC]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.VNC);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(TelnetPropertiesAndValues))]
public void CorrectlyImportsTelnetProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.Telnet]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.Telnet);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(WebsitePropertiesAndValues))]
public void CorrectlyImportsWebsiteProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.HTTPS]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.HTTPS);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
private static IEnumerable<TestCaseData> RdpPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "1f36e6f0-90ca-4607-b6ec-86227738486d"),
new TestCaseData(nameof(ConnectionInfo.Name), "rdp connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.RDP),
new TestCaseData(nameof(ConnectionInfo.Hostname), "my.rdp.host.com"),
new TestCaseData(nameof(ConnectionInfo.Description), "This is a general description"),
new TestCaseData(nameof(ConnectionInfo.Username), "user1"),
new TestCaseData(nameof(ConnectionInfo.Domain), "domain1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "password1"),
new TestCaseData(nameof(ConnectionInfo.Resolution), RDPResolutions.FitToWindow),
new TestCaseData(nameof(ConnectionInfo.AutomaticResize), true),
new TestCaseData(nameof(ConnectionInfo.CacheBitmaps), false),
new TestCaseData(nameof(ConnectionInfo.DisplayThemes), false),
new TestCaseData(nameof(ConnectionInfo.DisplayWallpaper), false),
new TestCaseData(nameof(ConnectionInfo.EnableDesktopComposition), true),
new TestCaseData(nameof(ConnectionInfo.EnableFontSmoothing), true),
new TestCaseData(nameof(ConnectionInfo.RedirectSound), RDPSounds.DoNotPlay),
new TestCaseData(nameof(ConnectionInfo.RedirectAudioCapture), true),
new TestCaseData(nameof(ConnectionInfo.RedirectClipboard), false),
new TestCaseData(nameof(ConnectionInfo.RedirectDiskDrives), false),
new TestCaseData(nameof(ConnectionInfo.RedirectPrinters), true),
new TestCaseData(nameof(ConnectionInfo.RedirectPorts), false),
new TestCaseData(nameof(ConnectionInfo.RedirectSmartCards), true),
new TestCaseData(nameof(ConnectionInfo.RDPMinutesToIdleTimeout), 17),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "mac-add-goes-here"),
new TestCaseData(nameof(ConnectionInfo.UseCredSsp), true),
new TestCaseData(nameof(ConnectionInfo.Port), 1234),
new TestCaseData(nameof(ConnectionInfo.RdpVersion), RdpVersion.Rdc7),
new TestCaseData(nameof(ConnectionInfo.RedirectKeys), true),
new TestCaseData(nameof(ConnectionInfo.UseConsoleSession), true),
new TestCaseData(nameof(ConnectionInfo.RDPAuthenticationLevel), AuthenticationLevel.WarnOnFailedAuth),
new TestCaseData(nameof(ConnectionInfo.RDGatewayUsageMethod), RDGatewayUsageMethod.Always),
new TestCaseData(nameof(ConnectionInfo.RDGatewayUseConnectionCredentials), RDGatewayUseConnectionCredentials.Yes),
new TestCaseData(nameof(ConnectionInfo.RDGatewayHostname), "rdhost1"),
new TestCaseData(nameof(ConnectionInfo.RDGatewayUsername), "rduser1"),
new TestCaseData(nameof(ConnectionInfo.RDGatewayDomain), "rddomain1"),
//new TestCaseData(nameof(ConnectionInfo.RDGatewayPassword), "rdpassword1"),
new TestCaseData(nameof(ConnectionInfo.UseEnhancedMode), true),
new TestCaseData(nameof(ConnectionInfo.UseVmId), true),
new TestCaseData(nameof(ConnectionInfo.VmId), "instance-id-here"),
};
}
private static IEnumerable<TestCaseData> SshPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "44ae261f-0094-48a2-93cb-bc5abcfcc394"),
new TestCaseData(nameof(ConnectionInfo.Name), "ssh connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.SSH2),
new TestCaseData(nameof(ConnectionInfo.Hostname), "mysshhost"),
new TestCaseData(nameof(ConnectionInfo.Description), "This is a linux host description"),
new TestCaseData(nameof(ConnectionInfo.Username), "linuxuser1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "linuxpassword1"),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "some-mac-here"),
new TestCaseData(nameof(ConnectionInfo.Port), 4321),
};
}
private static IEnumerable<TestCaseData> VncPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "16ff7dd6-2ac3-4e27-96cf-435b5bfe5a00"),
new TestCaseData(nameof(ConnectionInfo.Name), "vnc connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.VNC),
new TestCaseData(nameof(ConnectionInfo.Hostname), "vnchost1"),
new TestCaseData(nameof(ConnectionInfo.Port), 9987),
new TestCaseData(nameof(ConnectionInfo.Description), "This is a VNC description"),
new TestCaseData(nameof(ConnectionInfo.Username), "winuser1"),
new TestCaseData(nameof(ConnectionInfo.Domain), "windomain1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "vncpassword1"),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "some-mac-here"),
new TestCaseData(nameof(ConnectionInfo.VNCEncoding), ProtocolVNC.Encoding.EncTight),
new TestCaseData(nameof(ConnectionInfo.VNCAuthMode), ProtocolVNC.AuthMode.AuthWin),
new TestCaseData(nameof(ConnectionInfo.VNCCompression), ProtocolVNC.Compression.Comp4),
new TestCaseData(nameof(ConnectionInfo.VNCViewOnly), true),
new TestCaseData(nameof(ConnectionInfo.VNCProxyIP), "proxyhost"),
new TestCaseData(nameof(ConnectionInfo.VNCProxyPort), 7777),
};
}
private static IEnumerable<TestCaseData> TelnetPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "8d77d3ac-b414-4b51-ac10-60304d63cc6f"),
new TestCaseData(nameof(ConnectionInfo.Name), "telnet connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.Telnet),
new TestCaseData(nameof(ConnectionInfo.Hostname), "telnethost1"),
new TestCaseData(nameof(ConnectionInfo.Description), "Telnet description"),
new TestCaseData(nameof(ConnectionInfo.Username), "user1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "password1"),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "some-mac-here"),
new TestCaseData(nameof(ConnectionInfo.Port), 7648),
};
}
private static IEnumerable<TestCaseData> WebsitePropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "65092747-6870-42c9-b8bc-35ec9fb5b3fb"),
new TestCaseData(nameof(ConnectionInfo.Name), "website connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.HTTPS),
new TestCaseData(nameof(ConnectionInfo.Hostname), "www.google.com"),
new TestCaseData(nameof(ConnectionInfo.Description), "Website description"),
new TestCaseData(nameof(ConnectionInfo.Username), "user1"),
new TestCaseData(nameof(ConnectionInfo.Domain), "domain1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "password1"),
new TestCaseData(nameof(ConnectionInfo.Port), 8080),
new TestCaseData(nameof(ConnectionInfo.RenderingEngine), HTTPBase.RenderingEngine.Gecko),
};
}
}
}

View File

@@ -13,7 +13,7 @@ namespace mRemoteNGTests.Config.Serializers.Versioning
[SetUp]
public void Setup()
{
var sqlConnector = Substitute.For<MSSqlDatabaseConnector>("", "", "", "");
var sqlConnector = Substitute.For<SqlDatabaseConnector>("", "", "", "");
_versionUpgrader = new SqlVersion22To23Upgrader(sqlConnector);
}

View File

@@ -13,7 +13,7 @@ namespace mRemoteNGTests.Config.Serializers.Versioning
[SetUp]
public void Setup()
{
var sqlConnector = Substitute.For<MSSqlDatabaseConnector>("", "", "", "");
var sqlConnector = Substitute.For<SqlDatabaseConnector>("", "", "", "");
_versionUpgrader = new SqlVersion23To24Upgrader(sqlConnector);
}

View File

@@ -13,7 +13,7 @@ namespace mRemoteNGTests.Config.Serializers.Versioning
[SetUp]
public void Setup()
{
var sqlConnector = Substitute.For<MSSqlDatabaseConnector>("", "", "", "");
var sqlConnector = Substitute.For<SqlDatabaseConnector>("", "", "", "");
_versionUpgrader = new SqlVersion24To25Upgrader(sqlConnector);
}

View File

@@ -13,7 +13,7 @@ namespace mRemoteNGTests.Config.Serializers.Versioning
[SetUp]
public void Setup()
{
var sqlConnector = Substitute.For<MSSqlDatabaseConnector>("", "", "", "");
var sqlConnector = Substitute.For<SqlDatabaseConnector>("", "", "", "");
_versionUpgrader = new SqlVersion25To26Upgrader(sqlConnector);
}

View File

@@ -165,7 +165,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.RDPAuthenticationLevel = AuthenticationLevel.AuthRequired;
_testAbstractConnectionInfoData.RDPAuthenticationLevel = RdpProtocol.AuthenticationLevel.AuthRequired;
Assert.That(wasCalled, Is.True);
}
@@ -201,7 +201,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.RDGatewayUsageMethod = RDGatewayUsageMethod.Always;
_testAbstractConnectionInfoData.RDGatewayUsageMethod = RdpProtocol.RDGatewayUsageMethod.Always;
Assert.That(wasCalled, Is.True);
}
@@ -219,7 +219,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.SmartCard;
_testAbstractConnectionInfoData.RDGatewayUseConnectionCredentials = RdpProtocol.RDGatewayUseConnectionCredentials.SmartCard;
Assert.That(wasCalled, Is.True);
}
@@ -255,7 +255,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.Resolution = RDPResolutions.Res1366x768;
_testAbstractConnectionInfoData.Resolution = RdpProtocol.RDPResolutions.Res1366x768;
Assert.That(wasCalled, Is.True);
}
@@ -273,7 +273,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.Colors = RDPColors.Colors16Bit;
_testAbstractConnectionInfoData.Colors = RdpProtocol.RDPColors.Colors16Bit;
Assert.That(wasCalled, Is.True);
}
@@ -372,7 +372,7 @@ namespace mRemoteNGTests.Connection
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.RedirectSound = RDPSounds.DoNotPlay;
_testAbstractConnectionInfoData.RedirectSound = RdpProtocol.RDPSounds.DoNotPlay;
Assert.That(wasCalled, Is.True);
}
@@ -412,15 +412,6 @@ namespace mRemoteNGTests.Connection
Assert.That(wasCalled, Is.True);
}
[Test]
public void FavoriteNotifiesOnValueChange()
{
var wasCalled = false;
_testAbstractConnectionInfoData.PropertyChanged += (sender, args) => wasCalled = true;
_testAbstractConnectionInfoData.Favorite = true;
Assert.That(wasCalled, Is.True);
}
[Test]
public void VncCompressionNotifiesOnValueChange()
{

View File

@@ -53,8 +53,7 @@ namespace mRemoteNGTests.Connection
[Test]
public void CloneCorrectlySetsParentOfInheritanceObject()
{
var originalConnection = new ConnectionInfo();
var clonedConnection = originalConnection.Clone();
var clonedConnection = _connectionInfo.Clone();
Assert.That(clonedConnection.Inheritance.Parent, Is.EqualTo(clonedConnection));
}
@@ -136,7 +135,7 @@ namespace mRemoteNGTests.Connection
{
public static IEnumerable<PropertyInfo> GetProperties()
{
return new ConnectionInfoInheritance(new ConnectionInfo()).GetProperties();
return new ConnectionInfoInheritance(new object()).GetProperties();
}
}
}

View File

@@ -50,7 +50,7 @@ namespace mRemoteNGTests.Connection
DefaultConnectionInfo.Instance.SaveTo(saveTarget);
var valueInSource = property.GetValue(DefaultConnectionInfo.Instance).ToString();
var valueInDestination = saveTarget.GetType().GetProperty(property.Name)?.GetValue(saveTarget)?.ToString();
var valueInDestination = saveTarget.GetType().GetProperty(property.Name).GetValue(saveTarget).ToString();
Assert.That(valueInDestination, Is.EqualTo(valueInSource));
}

View File

@@ -11,7 +11,7 @@ namespace mRemoteNGTests.Connection
[TestCaseSource(nameof(GetInheritanceProperties))]
public void LoadingDefaultInheritanceUpdatesAllProperties(PropertyInfo property)
{
var inheritanceSource = new ConnectionInfoInheritance(new ConnectionInfo(), true);
var inheritanceSource = new ConnectionInfoInheritance(new object(), true);
inheritanceSource.TurnOnInheritanceCompletely();
DefaultConnectionInheritance.Instance.TurnOffInheritanceCompletely();
@@ -25,7 +25,7 @@ namespace mRemoteNGTests.Connection
[TestCaseSource(nameof(GetInheritanceProperties))]
public void SavingDefaultInheritanceExportsAllProperties(PropertyInfo property)
{
var saveTarget = new ConnectionInfoInheritance(new ConnectionInfo(), true);
var saveTarget = new ConnectionInfoInheritance(new object(), true);
saveTarget.TurnOffInheritanceCompletely();
DefaultConnectionInheritance.Instance.TurnOnInheritanceCompletely();
@@ -40,7 +40,7 @@ namespace mRemoteNGTests.Connection
public void NewInheritanceInstancesCreatedWithDefaultInheritanceValues()
{
DefaultConnectionInheritance.Instance.Domain = true;
var inheritanceInstance = new ConnectionInfoInheritance(new ConnectionInfo());
var inheritanceInstance = new ConnectionInfoInheritance(new object());
Assert.That(inheritanceInstance.Domain, Is.True);
}
@@ -48,7 +48,7 @@ namespace mRemoteNGTests.Connection
public void NewInheritanceInstancesCreatedWithAllDefaultInheritanceValues(PropertyInfo property)
{
DefaultConnectionInheritance.Instance.TurnOnInheritanceCompletely();
var inheritanceInstance = new ConnectionInfoInheritance(new ConnectionInfo());
var inheritanceInstance = new ConnectionInfoInheritance(new object());
var valueInDestination = property.GetValue(inheritanceInstance);
var valueInSource = property.GetValue(DefaultConnectionInheritance.Instance);
@@ -57,7 +57,7 @@ namespace mRemoteNGTests.Connection
private static IEnumerable<PropertyInfo> GetInheritanceProperties()
{
return new ConnectionInfoInheritance(new ConnectionInfo(), true).GetProperties();
return new ConnectionInfoInheritance(new object(), true).GetProperties();
}
}
}

View File

@@ -1,4 +1,5 @@
using mRemoteNG.App;
using System.Collections.ObjectModel;
using mRemoteNG.App;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Tools;
@@ -50,8 +51,8 @@ namespace mRemoteNGTests.Connection.Protocol
private InterfaceControl BuildInterfaceControl(string extAppName, ProtocolBase sut)
{
var connectionWindow = new ConnectionWindow(new DockContent());
var connectionInfo = new ConnectionInfo {ExtApp = extAppName, Protocol = ProtocolType.IntApp};
return new InterfaceControl(connectionWindow, sut, connectionInfo);
var connectionInfo = new ConnectionInfo {ExtApp = extAppName};
return new InterfaceControl(connectionWindow, sut, connectionInfo);
}
}
}

View File

@@ -1,14 +1,14 @@
using mRemoteNG.Config.Serializers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.CredentialSerializer;
using mRemoteNG.Credential;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
using NSubstitute;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
namespace mRemoteNGTests.IntegrationTests
{

View File

@@ -1,20 +1,20 @@
using mRemoteNG.Config.Serializers.Xml;
using System;
using System.Linq;
using System.Xml.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNGTests.TestHelpers;
using NUnit.Framework;
using System;
using System.Linq;
using System.Text;
namespace mRemoteNGTests.IntegrationTests
{
public class XmlSerializationLifeCycleTests
public class XmlSerializationLifeCycleTests
{
private XmlConnectionsSerializer _serializer;
private XmlConnectionsDeserializer _deserializer;
@@ -26,7 +26,7 @@ namespace mRemoteNGTests.IntegrationTests
{
_originalModel = SetupConnectionTreeModel();
var cryptoProvider = _cryptoFactory.Build();
var nodeSerializer = new XmlConnectionNodeSerializer27(
var nodeSerializer = new XmlConnectionNodeSerializer26(
cryptoProvider,
_originalModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter());
@@ -77,7 +77,7 @@ namespace mRemoteNGTests.IntegrationTests
{
var cryptoProvider = _cryptoFactory.Build();
cryptoProvider.KeyDerivationIterations = 5000;
var nodeSerializer = new XmlConnectionNodeSerializer27(
var nodeSerializer = new XmlConnectionNodeSerializer26(
cryptoProvider,
_originalModel.RootNodes.OfType<RootNodeInfo>().First().PasswordString.ConvertToSecureString(),
new SaveFilter());
@@ -103,60 +103,6 @@ namespace mRemoteNGTests.IntegrationTests
Assert.That(Guid.TryParse(deserializedConnectionInfo.ConstantID, out var guid));
}
[Test]
public void AllPropertiesCorrectWhenSerializingThenDeserializing()
{
var originalConnectionInfo = new ConnectionInfo().RandomizeValues();
originalConnectionInfo.Inheritance.TurnOffInheritanceCompletely();
var serializedContent = _serializer.Serialize(originalConnectionInfo);
var deserializedModel = _deserializer.Deserialize(serializedContent);
var deserializedConnectionInfo = deserializedModel
.GetRecursiveChildList()
.First(info => info.GetTreeNodeType() == TreeNodeType.Connection);
var sb = new StringBuilder();
foreach (var property in originalConnectionInfo.GetSerializableProperties())
{
var originalValue = property.GetValue(originalConnectionInfo);
var deserializedValue = property.GetValue(deserializedConnectionInfo);
if (originalValue.Equals(deserializedValue))
continue;
sb.AppendLine($"Property: {property.Name}");
}
Assert.That(sb.Length, Is.EqualTo(0), "Some properties are not being serialized properly:\n" + sb);
}
[Test]
public void AllInheritanceCorrectWhenSerializingThenDeserializing()
{
var originalConnectionInfo = new ConnectionInfo();
originalConnectionInfo.Inheritance.ToggleAllBooleanProperties(excludeProperties: nameof(ConnectionInfoInheritance.EverythingInherited));
var container = new ContainerInfo();
container.AddChild(originalConnectionInfo);
var serializedContent = _serializer.Serialize(container);
var deserializedModel = _deserializer.Deserialize(serializedContent);
var deserializedConnectionInfo = deserializedModel
.GetRecursiveChildList()
.First(info => info.GetTreeNodeType() == TreeNodeType.Connection);
var sb = new StringBuilder();
foreach (var property in originalConnectionInfo.Inheritance.GetProperties())
{
var originalValue = property.GetValue(originalConnectionInfo.Inheritance);
var deserializedValue = property.GetValue(deserializedConnectionInfo.Inheritance);
if (originalValue.Equals(deserializedValue))
continue;
sb.AppendLine($"Property: Inheritance.{property.Name}");
}
Assert.That(sb.Length, Is.EqualTo(0), "Some properties are not being serialized properly:\n" + sb);
}
private ConnectionTreeModel SetupConnectionTreeModel()
{

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@@ -19,7 +19,7 @@ namespace mRemoteNGTests.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -194,71 +194,6 @@ namespace mRemoteNGTests.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;AuthentificationLevel&gt;WarnMe&lt;/AuthentificationLevel&gt;
/// &lt;AutomaticallyClose&gt;true&lt;/AutomaticallyClose&gt;
/// &lt;AutomaticallyCloseInterval&gt;17&lt;/AutomaticallyCloseInterval&gt;
/// &lt;ConnectionType&gt;RDPConfigured&lt;/ConnectionType&gt;
/// &lt;Console&gt;true&lt;/Console&gt;
/// &lt;Description&gt;This is a general description&lt;/Description&gt;
/// &lt;DesktopComposition&gt;true&lt;/DesktopComposition&gt;
/// &lt;DisableBitmapCache&gt;true&lt;/DisableBitmapCache&gt;
/// &lt;DisableThemes&gt;true&lt;/Disable [rest of string was truncated]&quot;;.
/// </summary>
internal static string rdp_rdm_export {
get {
return ResourceManager.GetString("rdp_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionType&gt;SSHShell&lt;/ConnectionType&gt;
/// &lt;Description&gt;This is a linux host description&lt;/Description&gt;
/// &lt;ID&gt;44ae261f-0094-48a2-93cb-bc5abcfcc394&lt;/ID&gt;
/// &lt;Name&gt;ssh connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;ab007011-2836-426f-a8e0-9fef1ff88865&lt;/Stamp&gt;
/// &lt;MetaInformation&gt;
/// &lt;MAC&gt;some-mac-here&lt;/MAC&gt;
/// &lt;PasswordHistory&gt;
/// &lt;PasswordHistory&gt;
/// &lt;LoggedModifiedBy&gt;LEVIATHAN\David&lt;/LoggedMo [rest of string was truncated]&quot;;.
/// </summary>
internal static string ssh_rdm_export {
get {
return ResourceManager.GetString("ssh_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionType&gt;Telnet&lt;/ConnectionType&gt;
/// &lt;Description&gt;Telnet description&lt;/Description&gt;
/// &lt;ID&gt;8d77d3ac-b414-4b51-ac10-60304d63cc6f&lt;/ID&gt;
/// &lt;Name&gt;telnet connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;08aaa9ff-3583-4dc0-8622-3a0f4d37a7c4&lt;/Stamp&gt;
/// &lt;MetaInformation&gt;
/// &lt;MAC&gt;some-mac-here&lt;/MAC&gt;
/// &lt;PasswordHistory&gt;
/// &lt;PasswordHistory&gt;
/// &lt;LoggedModifiedBy&gt;LEVIATHAN\David&lt;/LoggedModifiedBy&gt;
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string telnet_rdm_export {
get {
return ResourceManager.GetString("telnet_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
///&lt;!-- ****************************************************************--&gt;
@@ -446,16 +381,6 @@ namespace mRemoteNGTests.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap TestImage {
get {
object obj = ResourceManager.GetObject("TestImage", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.75.6164.27544
///dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Installer-1.75.6179.28160.msi
@@ -481,48 +406,5 @@ namespace mRemoteNGTests.Properties {
return ResourceManager.GetString("update_portable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionSubType&gt;UltraVNC&lt;/ConnectionSubType&gt;
/// &lt;ConnectionType&gt;VNC&lt;/ConnectionType&gt;
/// &lt;Description&gt;This is a VNC description&lt;/Description&gt;
/// &lt;ID&gt;16ff7dd6-2ac3-4e27-96cf-435b5bfe5a00&lt;/ID&gt;
/// &lt;Name&gt;vnc connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;a44e3b58-2e14-47bf-8a79-0646b1e4ba46&lt;/Stamp&gt;
/// &lt;MetaInformation&gt;
/// &lt;MAC&gt;some-mac-here&lt;/MAC&gt;
/// &lt;PasswordHistory&gt;
/// &lt;PasswordHistory&gt;
/// &lt;L [rest of string was truncated]&quot;;.
/// </summary>
internal static string vnc_rdm_export {
get {
return ResourceManager.GetString("vnc_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionSubType&gt;FireFox&lt;/ConnectionSubType&gt;
/// &lt;ConnectionType&gt;WebBrowser&lt;/ConnectionType&gt;
/// &lt;Description&gt;Website description&lt;/Description&gt;
/// &lt;ID&gt;65092747-6870-42c9-b8bc-35ec9fb5b3fb&lt;/ID&gt;
/// &lt;Name&gt;website connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;d04a9abb-4d4c-4ba5-8ef8-1699bd84b734&lt;/Stamp&gt;
/// &lt;WebBrowserApplication&gt;FireFox&lt;/WebBrowserApplication&gt;
/// &lt;WebBrowserUrl&gt;https://www.google.com:8080&lt;/WebBrow [rest of string was truncated]&quot;;.
/// </summary>
internal static string website_rdm_export {
get {
return ResourceManager.GetString("website_rdm_export", resourceCulture);
}
}
}
}

View File

@@ -154,9 +154,6 @@
<data name="dev_update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dev-update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="TestImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TestImage.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="test_puttyConnectionManager_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\test_puttyConnectionManager_database.dat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
@@ -190,19 +187,4 @@
<data name="update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="rdp_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\rdp.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="ssh_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ssh.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
</data>
<data name="telnet_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\telnet.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="vnc_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\vnc.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="website_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\website.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,65 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<AuthentificationLevel>WarnMe</AuthentificationLevel>
<AutomaticallyClose>true</AutomaticallyClose>
<AutomaticallyCloseInterval>17</AutomaticallyCloseInterval>
<ConnectionType>RDPConfigured</ConnectionType>
<Console>true</Console>
<Description>This is a general description</Description>
<DesktopComposition>true</DesktopComposition>
<DisableBitmapCache>true</DisableBitmapCache>
<DisableThemes>true</DisableThemes>
<DisableWallpaper>true</DisableWallpaper>
<FontSmoothing>true</FontSmoothing>
<ID>1f36e6f0-90ca-4607-b6ec-86227738486d</ID>
<KeyboardHook>OnTheRemoteComputer</KeyboardHook>
<Name>rdp connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<ScreenColor>C256</ScreenColor>
<ScreenSize>CurrentScreenSize</ScreenSize>
<SoundHook>DoNotPlay</SoundHook>
<Stamp>22400949-a0b8-46c1-8f27-49232ac1fb27</Stamp>
<Url>my.rdp.host.com:1234</Url>
<UsesClipboard>false</UsesClipboard>
<UsesHardDrives>false</UsesHardDrives>
<UsesPrinters>true</UsesPrinters>
<UsesSerialPorts>false</UsesSerialPorts>
<UsesSmartDevices>true</UsesSmartDevices>
<MetaInformation>
<MAC>mac-add-goes-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T14:40:54</ModifiedDateTime>
<SafePassword>T2/JO7Aps+GMZG0vk5Jo8A==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<RDP>
<AudioCaptureRedirectionMode>true</AudioCaptureRedirectionMode>
<Domain>domain1</Domain>
<EnableCredSSPSupport>True</EnableCredSSPSupport>
<GatewayCredentialsSource>UserPassword</GatewayCredentialsSource>
<GatewayDomain>rddomain1</GatewayDomain>
<GatewayHostname>rdhost1</GatewayHostname>
<GatewayProfileUsageMethod>Explicit</GatewayProfileUsageMethod>
<GatewaySafePassword>kLaEwH4EDrZEaaK21HgqHg==</GatewaySafePassword>
<GatewayUsageMethod>ModeDirect</GatewayUsageMethod>
<GatewayUserName>rduser1</GatewayUserName>
<HyperVInstanceID>instance-id-here</HyperVInstanceID>
<KeepAliveInterval>6</KeepAliveInterval>
<KeyboardLayoutText>Default</KeyboardLayoutText>
<NetworkLevelAuthentication>true</NetworkLevelAuthentication>
<PromptCredentialOnce>true</PromptCredentialOnce>
<RDPType>HyperV</RDPType>
<SafePassword>tW7TUhUf1KUzuzuAdANJvg==</SafePassword>
<ScreenSizingMode>AutoScale</ScreenSizingMode>
<ShadowSessionConsentPrompt>false</ShadowSessionConsentPrompt>
<UseEnhancedSessionMode>true</UseEnhancedSessionMode>
<UserName>user1</UserName>
<Version>RDP70</Version>
</RDP>
</Connection>
</ArrayOfConnection>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>SSHShell</ConnectionType>
<Description>This is a linux host description</Description>
<ID>44ae261f-0094-48a2-93cb-bc5abcfcc394</ID>
<Name>ssh connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>ab007011-2836-426f-a8e0-9fef1ff88865</Stamp>
<MetaInformation>
<MAC>some-mac-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T20:46:26</ModifiedDateTime>
<SafePassword>rV4oZM9LrfZ6SYHIlwTwvA==</SafePassword>
</PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T14:42:38</ModifiedDateTime>
<SafePassword>rV4oZM9LrfbUvSh5Y2lNDw==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Terminal>
<Host>mysshhost</Host>
<HostPort>4321</HostPort>
<PrivateKeyPromptForPassPhrase>false</PrivateKeyPromptForPassPhrase>
<SafePassword>/et4Enc7v6HUQXJP6chuhA==</SafePassword>
<Username>linuxuser1</Username>
</Terminal>
<TerminalMac />
</Connection>
</ArrayOfConnection>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>Telnet</ConnectionType>
<Description>Telnet description</Description>
<ID>8d77d3ac-b414-4b51-ac10-60304d63cc6f</ID>
<Name>telnet connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>08aaa9ff-3583-4dc0-8622-3a0f4d37a7c4</Stamp>
<MetaInformation>
<MAC>some-mac-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T21:50:48</ModifiedDateTime>
<SafePassword>T2/JO7Aps+GMZG0vk5Jo8A==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Terminal>
<Host>telnethost1</Host>
<HostPort>7648</HostPort>
<ProxyMode>Custom</ProxyMode>
<SafePassword>yLHh9AVRl8TilluPKnidMw==</SafePassword>
<Username>user1</Username>
</Terminal>
<TerminalMac />
</Connection>
</ArrayOfConnection>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionSubType>UltraVNC</ConnectionSubType>
<ConnectionType>VNC</ConnectionType>
<Description>This is a VNC description</Description>
<ID>16ff7dd6-2ac3-4e27-96cf-435b5bfe5a00</ID>
<Name>vnc connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>a44e3b58-2e14-47bf-8a79-0646b1e4ba46</Stamp>
<MetaInformation>
<MAC>some-mac-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T21:12:44</ModifiedDateTime>
<SafePassword>aHjuKKmVmbivKM+wovI3aA==</SafePassword>
</PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T21:08:16</ModifiedDateTime>
<SafePassword>uEGtwH/QfjSvKM+wovI3aA==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<VNC>
<CustomCompressionLevel>4</CustomCompressionLevel>
<DisableClipboard>true</DisableClipboard>
<Host>vnchost1</Host>
<JPEGCompressionLevel>3</JPEGCompressionLevel>
<MsDomain>windomain1</MsDomain>
<MsSafePassword>bUWiWCi7qod7YQ5XXK5LFQ==</MsSafePassword>
<MsUser>winuser1</MsUser>
<Port>9987</Port>
<PreferredEncoding>Tight</PreferredEncoding>
<ProxyHost>proxyhost:7777</ProxyHost>
<SafePassword>oGzaL3q/dK17YQ5XXK5LFQ==</SafePassword>
<ScreenColorDepth>C8</ScreenColorDepth>
<ViewOnly>true</ViewOnly>
<VNCEmbeddedType>UltraVNC</VNCEmbeddedType>
</VNC>
</Connection>
</ArrayOfConnection>

View File

@@ -1,29 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionSubType>FireFox</ConnectionSubType>
<ConnectionType>WebBrowser</ConnectionType>
<Description>Website description</Description>
<ID>65092747-6870-42c9-b8bc-35ec9fb5b3fb</ID>
<Name>website connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>d04a9abb-4d4c-4ba5-8ef8-1699bd84b734</Stamp>
<WebBrowserApplication>FireFox</WebBrowserApplication>
<WebBrowserUrl>https://www.google.com:8080</WebBrowserUrl>
<MetaInformation>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T22:01:26</ModifiedDateTime>
<SafePassword>T2/JO7Aps+GMZG0vk5Jo8A==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Web>
<Domain>domain1</Domain>
<SafePassword>24ifhl01e7Le3Aj8NxM4ww==</SafePassword>
<UserName>user1</UserName>
</Web>
</Connection>
</ArrayOfConnection>

View File

@@ -1,11 +1,11 @@
using mRemoteNG.Security;
using System;
using System.Collections;
using System.Security;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
using mRemoteNG.Security.SymmetricEncryption;
using NUnit.Framework;
using NUnit.Framework.Constraints;
using System;
using System.Collections;
using System.Security;
namespace mRemoteNGTests.Security
@@ -97,12 +97,6 @@ namespace mRemoteNGTests.Security
Assert.That(cryptoProvider.CipherMode, Is.EqualTo(mode));
}
[Test]
public void ProvidingEmptyEncryptionKeyThrowsException()
{
Assert.Throws<ArgumentException>(() => _cryptographyProvider.Encrypt(_plainText, new SecureString()));
}
private class TestCaseSources
{

View File

@@ -1,17 +1,93 @@
using mRemoteNG.Connection;
using mRemoteNG.Container;
using System;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.ICA;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.VNC;
namespace mRemoteNGTests.TestHelpers
{
internal static class ConnectionInfoHelpers
internal static class ConnectionInfoHelpers
{
private static readonly Random _random = new Random();
/// <summary>
/// Returns a <see cref="ConnectionInfo"/> object with randomized
/// values in all fields.
/// </summary>
internal static ConnectionInfo GetRandomizedConnectionInfo(bool randomizeInheritance = false)
{
var connectionInfo = new ConnectionInfo().RandomizeValues();
var connectionInfo = new ConnectionInfo
{
// string types
Name = RandomString(),
Hostname = RandomString(),
Description = RandomString(),
Domain = RandomString(),
ExtApp = RandomString(),
Icon = RandomString(),
LoadBalanceInfo = RandomString(),
MacAddress = RandomString(),
Panel = RandomString(),
Password = RandomString(),
PostExtApp = RandomString(),
PreExtApp = RandomString(),
PuttySession = RandomString(),
RDGatewayHostname = RandomString(),
RDGatewayUsername = RandomString(),
RDGatewayDomain = RandomString(),
RDGatewayPassword = RandomString(),
UserField = RandomString(),
Username = RandomString(),
VNCProxyIP = RandomString(),
VNCProxyPassword = RandomString(),
VNCProxyUsername = RandomString(),
// bool types
AutomaticResize = RandomBool(),
CacheBitmaps = RandomBool(),
DisplayThemes = RandomBool(),
DisplayWallpaper = RandomBool(),
EnableDesktopComposition = RandomBool(),
EnableFontSmoothing = RandomBool(),
IsContainer = RandomBool(),
IsDefault = RandomBool(),
IsQuickConnect = RandomBool(),
PleaseConnect = RandomBool(),
RDPAlertIdleTimeout = RandomBool(),
RedirectDiskDrives = RandomBool(),
RedirectKeys = RandomBool(),
RedirectPorts = RandomBool(),
RedirectPrinters = RandomBool(),
RedirectSmartCards = RandomBool(),
UseConsoleSession = RandomBool(),
UseCredSsp = RandomBool(),
VNCViewOnly = RandomBool(),
// ints
Port = RandomInt(),
RDPMinutesToIdleTimeout = RandomInt(),
VNCProxyPort = RandomInt(),
// enums
Colors = RandomEnum<RdpProtocol.RDPColors>(),
ICAEncryptionStrength = RandomEnum<IcaProtocol.EncryptionStrength> (),
Protocol = RandomEnum<ProtocolType>(),
RDGatewayUsageMethod = RandomEnum<RdpProtocol.RDGatewayUsageMethod>(),
RDGatewayUseConnectionCredentials = RandomEnum<RdpProtocol.RDGatewayUseConnectionCredentials>(),
RDPAuthenticationLevel = RandomEnum<RdpProtocol.AuthenticationLevel>(),
RedirectSound = RandomEnum<RdpProtocol.RDPSounds>(),
RenderingEngine = RandomEnum<HTTPBase.RenderingEngine>(),
Resolution = RandomEnum<RdpProtocol.RDPResolutions>(),
SoundQuality = RandomEnum<RdpProtocol.RDPSoundQuality>(),
VNCAuthMode = RandomEnum<ProtocolVNC.AuthMode>(),
VNCColors = RandomEnum<ProtocolVNC.Colors>(),
VNCCompression = RandomEnum<ProtocolVNC.Compression>(),
VNCEncoding = RandomEnum<ProtocolVNC.Encoding>(),
VNCProxyType = RandomEnum<ProtocolVNC.ProxyType>(),
VNCSmartSizeMode = RandomEnum<ProtocolVNC.SmartSizeMode>(),
};
if (randomizeInheritance)
connectionInfo.Inheritance = GetRandomizedInheritance(connectionInfo);
@@ -19,24 +95,38 @@ namespace mRemoteNGTests.TestHelpers
return connectionInfo;
}
internal static ContainerInfo GetRandomizedContainerInfo(bool randomizeInheritance = false)
{
var containerInfo = new ContainerInfo().RandomizeValues();
if (randomizeInheritance)
containerInfo.Inheritance = GetRandomizedInheritance(containerInfo);
return containerInfo;
}
internal static ConnectionInfoInheritance GetRandomizedInheritance(ConnectionInfo parent)
{
var inheritance = new ConnectionInfoInheritance(parent, true);
foreach (var property in inheritance.GetProperties())
{
property.SetValue(inheritance, Randomizer.RandomBool());
property.SetValue(inheritance, RandomBool());
}
return inheritance;
}
internal static string RandomString()
{
return Guid.NewGuid().ToString("N");
}
internal static bool RandomBool()
{
return _random.Next() % 2 == 0;
}
internal static int RandomInt()
{
return _random.Next();
}
internal static T RandomEnum<T>() where T : struct, IConvertible
{
if (!typeof(T).IsEnum)
throw new ArgumentException("T must be an enum");
var values = Enum.GetValues(typeof(T));
return (T)values.GetValue(_random.Next(values.Length));
}
}
}

View File

@@ -1,137 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Enum = System.Enum;
namespace mRemoteNGTests.TestHelpers
{
internal static class Randomizer
{
private static readonly Random Random = new Random();
internal static string RandomString(params string[] excludedStrings)
{
return GetNonExcludedValue(() => Guid.NewGuid().ToString("N"), excludedStrings);
}
internal static bool RandomBool(bool? excludedBool = null)
{
if (excludedBool.HasValue)
return !excludedBool.Value;
return Random.Next() % 2 == 0;
}
internal static int RandomInt(int minValue = int.MinValue, int maxValue = int.MaxValue, params int[] excludeInts)
{
return GetNonExcludedValue(() => Random.Next(minValue, maxValue), excludeInts);
}
internal static DateTime RandomDateTime(params DateTime[] excludeTimes)
{
var date = GetNonExcludedValue(() =>
new DateTime(
RandomInt(minValue: 1990, maxValue: 2019),
RandomInt(minValue: 1, maxValue: 13),
RandomInt(minValue: 1, maxValue: 29),
RandomInt(minValue: 0, maxValue: 24),
RandomInt(minValue: 0, maxValue: 60),
RandomInt(minValue: 0, maxValue: 60)),
excludeTimes);
return date;
}
internal static T RandomEnum<T>(params object[] excludeValues) where T : struct, IConvertible
{
if (!typeof(T).IsEnum)
throw new ArgumentException("T must be an enum");
return (T)RandomEnum(typeof(T), excludeValues);
}
internal static object RandomEnum(Type enumType, params object[] excludeValues)
{
if (!enumType.IsEnum)
throw new ArgumentException("enumType must be an enum");
var values = Enum.GetValues(enumType);
return GetNonExcludedValue(() => values.GetValue(Random.Next(values.Length)), excludeValues);
}
private static T GetNonExcludedValue<T>(Func<T> builder, params object[] excludedValues)
{
do
{
var value = builder();
if (!excludedValues.Contains(value))
return value;
} while (true);
}
/// <summary>
/// Randomizes the primitive-type settable properties of the given object.
/// Returns the same object instance to enable fluent method calls. It will
/// never choose the value that the property current holds. For booleans, this
/// means they will always be toggled rather than truly randomized.
/// </summary>
internal static T RandomizeValues<T>(this T con)
where T : class
{
var opByType = new Dictionary<Type, Action<PropertyInfo, T>>
{
{ typeof(int), (p, c) => p.SetValue(c, RandomInt(minValue: 0, excludeInts:(int)p.GetValue(c))) },
{ typeof(bool), (p, c) => p.SetValue(c, !(bool)p.GetValue(c)) },
{ typeof(string), (p, c) => p.SetValue(c, RandomString((string)p.GetValue(c))) },
{ typeof(DateTime), (p, c) => p.SetValue(c, RandomDateTime((DateTime)p.GetValue(c))) },
{ typeof(Enum), (p, c) => p.SetValue(c, RandomEnum(p.PropertyType, p.GetValue(c))) },
};
var settableProperties = con
.GetType()
.GetProperties()
.Where(p => p.GetSetMethod() != null);
foreach (var property in settableProperties)
{
if (opByType.TryGetValue(property.PropertyType, out var mutator))
mutator(property, con);
else if (property.PropertyType.BaseType != null &&
opByType.TryGetValue(property.PropertyType.BaseType, out var mutator2))
mutator2(property, con);
}
return con;
}
/// <summary>
/// Toggles all <see cref="bool"/> settable properties
/// on the given object.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj"></param>
/// <param name="excludeProperties"></param>
/// <returns></returns>
internal static T ToggleAllBooleanProperties<T>(this T obj, params string[] excludeProperties)
where T : class
{
var settableBooleanProperties = obj
.GetType()
.GetProperties()
.Where(p =>
p.GetSetMethod() != null &&
p.PropertyType == typeof(bool) &&
!excludeProperties.Contains(p.Name));
foreach (var property in settableBooleanProperties)
{
var currentValue = (bool)property.GetValue(obj);
property.SetValue(obj, !currentValue);
}
return obj;
}
}
}

View File

@@ -40,20 +40,15 @@
public TType RedirectKeys { get; set; }
public TType RedirectDiskDrives { get; set; }
public TType RedirectPrinters { get; set; }
public TType RedirectClipboard { get; set; }
public TType RedirectPorts { get; set; }
public TType RedirectPorts { get; set; }
public TType RedirectSmartCards { get; set; }
public TType RedirectSound { get; set; }
public TType SoundQuality { get; set; }
public TType RedirectAudioCapture { get; set; }
public TType PreExtApp { get; set; }
public TType PostExtApp { get; set; }
public TType MacAddress { get; set; }
public TType UserField { get; set; }
public TType Favorite { get; set; }
public TType VmId { get; set; }
public TType UseVmId { get; set; }
public TType VNCCompression { get; set; }
public TType UserField { get; set; }
public TType VNCCompression { get; set; }
public TType VNCEncoding { get; set; }
public TType VNCAuthMode { get; set; }
public TType VNCProxyType { get; set; }
@@ -64,7 +59,5 @@
public TType VNCColors { get; set; }
public TType VNCSmartSizeMode { get; set; }
public TType VNCViewOnly { get; set; }
public TType RdpVersion { get; set; }
public TType UseEnhancedMode { get; set; }
}
}
}

View File

@@ -1,50 +0,0 @@
using System;
using System.Linq;
using mRemoteNG.Tools.WindowsRegistry;
using NUnit.Framework;
namespace mRemoteNGTests.Tools.Registry
{
public class WindowsRegistryTests
{
private WindowsRegistry _registry;
[SetUp]
public void Setup()
{
_registry = new WindowsRegistry();
}
[Test]
public void CanGetSubkeyNames()
{
var subKeyNames = _registry.GetSubKeyNames(RegistryHive.CurrentUser, "Software");
Assert.That(subKeyNames, Does.Contain("Microsoft"));
}
[Test]
public void GetSubkeyNamesThrowsIfGivenNullKeyPath()
{
Assert.Throws<ArgumentNullException>(() => _registry.GetSubKeyNames(RegistryHive.CurrentUser, null));
}
[Test]
public void CanGetKeyValue()
{
var keyValue = _registry.GetKeyValue(RegistryHive.ClassesRoot, @".dll\PersistentHandler", "");
Assert.That(keyValue.FirstOrDefault(), Is.EqualTo("{098f2470-bae0-11cd-b579-08002b30bfeb}"));
}
[Test]
public void GetKeyValueThrowsIfGivenNullKeyPath()
{
Assert.Throws<ArgumentNullException>(() => _registry.GetKeyValue(RegistryHive.CurrentUser, null, ""));
}
[Test]
public void GetKeyValueThrowsIfGivenNullPropertyName()
{
Assert.Throws<ArgumentNullException>(() => _registry.GetKeyValue(RegistryHive.CurrentUser, "", null));
}
}
}

View File

@@ -1,7 +1,7 @@
using mRemoteNG.Connection;
using System.Windows.Forms;
using mRemoteNG.Connection;
using mRemoteNG.Tree;
using NUnit.Framework;
using System.Windows.Forms;
namespace mRemoteNGTests.Tree
@@ -30,12 +30,12 @@ namespace mRemoteNGTests.Tree
Assert.That(deletionConfirmer.Confirm(_testConnectionInfo), Is.False);
}
private DialogResult MockClickYes(string promptMessage)
private DialogResult MockClickYes(string promptMessage, string title, MessageBoxButtons buttons, MessageBoxIcon icon)
{
return DialogResult.Yes;
}
private DialogResult MockClickNo(string promptMessage)
private DialogResult MockClickNo(string promptMessage, string title, MessageBoxButtons buttons, MessageBoxIcon icon)
{
return DialogResult.No;
}

View File

@@ -2,16 +2,14 @@
using System.Threading;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Tools.Clipboard;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNG.UI.Controls;
using NSubstitute;
using NUnit.Framework;
namespace mRemoteNGTests.UI.Controls
{
public class ConnectionTreeTests
public class ConnectionTreeTests
{
private ConnectionTreeSearchTextFilter _filter;
private ConnectionTree _connectionTree;
@@ -75,9 +73,8 @@ namespace mRemoteNGTests.UI.Controls
connectionTreeModel.AddRootNode(puttyRoot);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = puttyRoot;
_connectionTree.SelectedObject = puttyRoot;
_connectionTree.AddConnection();
Assert.That(puttyRoot.Children, Is.Empty);
@@ -94,9 +91,8 @@ namespace mRemoteNGTests.UI.Controls
connectionTreeModel.AddRootNode(puttyRoot);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = puttyRoot;
_connectionTree.SelectedObject = puttyRoot;
_connectionTree.AddFolder();
Assert.That(puttyRoot.Children, Is.Empty);
@@ -110,9 +106,8 @@ namespace mRemoteNGTests.UI.Controls
var root = new RootNodeInfo(RootNodeType.Connection);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = root;
_connectionTree.SelectedObject = root;
_connectionTree.DuplicateSelectedNode();
Assert.That(connectionTreeModel.RootNodes, Has.One.Items);
@@ -120,33 +115,14 @@ namespace mRemoteNGTests.UI.Controls
[Test]
[Apartment(ApartmentState.STA)]
public void CanDuplicateConnectionNode()
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
var con1 = new ConnectionInfo();
root.AddChild(con1);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = con1;
_connectionTree.DuplicateSelectedNode();
Assert.That(root.Children, Has.Exactly(2).Items);
}
[Test]
[Apartment(ApartmentState.STA)]
public void CannotDuplicateRootPuttyNode()
{
var connectionTreeModel = new ConnectionTreeModel();
var puttyRoot = new RootNodeInfo(RootNodeType.PuttySessions);
connectionTreeModel.AddRootNode(puttyRoot);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = puttyRoot;
_connectionTree.SelectedObject = puttyRoot;
_connectionTree.DuplicateSelectedNode();
Assert.That(connectionTreeModel.RootNodes, Has.One.Items);
@@ -178,9 +154,8 @@ namespace mRemoteNGTests.UI.Controls
var puttyRoot = new RootNodeInfo(RootNodeType.PuttySessions);
connectionTreeModel.AddRootNode(puttyRoot);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = null;
_connectionTree.SelectedObject = null;
_connectionTree.DuplicateSelectedNode();
Assert.That(connectionTreeModel.RootNodes, Has.One.Items);
@@ -219,105 +194,9 @@ namespace mRemoteNGTests.UI.Controls
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = null;
_connectionTree.SelectedObject = null;
Assert.DoesNotThrow(() => _connectionTree.RenameSelectedNode());
}
[Test]
[Apartment(ApartmentState.STA)]
public void CopyHostnameCopiesTheHostnameOfTheSelectedConnection()
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
var con1 = new ConnectionInfo {Hostname = "MyHost"};
root.AddChild(con1);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = con1;
var clipboard = Substitute.For<IClipboard>();
_connectionTree.CopyHostnameSelectedNode(clipboard);
clipboard.Received(1).SetText(con1.Hostname);
}
[Test]
[Apartment(ApartmentState.STA)]
public void CopyHostnameCopiesTheNodeNameOfTheSelectedContainer()
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
var container = new ContainerInfo { Name = "MyFolder" };
root.AddChild(container);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = container;
var clipboard = Substitute.For<IClipboard>();
_connectionTree.CopyHostnameSelectedNode(clipboard);
clipboard.Received(1).SetText(container.Name);
}
[Test]
[Apartment(ApartmentState.STA)]
public void CopyHostnameDoesNotCopyAnythingIfNoNodeSelected()
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
var con1 = new ConnectionInfo { Hostname = "MyHost" };
root.AddChild(con1);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = null;
var clipboard = Substitute.For<IClipboard>();
_connectionTree.CopyHostnameSelectedNode(clipboard);
clipboard.DidNotReceiveWithAnyArgs().SetText("");
}
[Test]
[Apartment(ApartmentState.STA)]
public void CopyHostnameDoesNotCopyAnythingIfHostnameOfSelectedConnectionIsEmpty()
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
var con1 = new ConnectionInfo { Hostname = string.Empty };
root.AddChild(con1);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = con1;
var clipboard = Substitute.For<IClipboard>();
_connectionTree.CopyHostnameSelectedNode(clipboard);
clipboard.DidNotReceiveWithAnyArgs().SetText("");
}
[Test]
[Apartment(ApartmentState.STA)]
public void CopyHostnameDoesNotCopyAnythingIfNameOfSelectedContainerIsEmpty()
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
var con1 = new ContainerInfo { Name = string.Empty};
root.AddChild(con1);
connectionTreeModel.AddRootNode(root);
_connectionTree.ConnectionTreeModel = connectionTreeModel;
_connectionTree.ExpandAll();
_connectionTree.SelectedObject = con1;
var clipboard = Substitute.For<IClipboard>();
_connectionTree.CopyHostnameSelectedNode(clipboard);
clipboard.DidNotReceiveWithAnyArgs().SetText("");
}
}
}
}

View File

@@ -1,133 +0,0 @@
using System;
using System.Linq;
using mRemoteNG.UI.Controls.FilteredPropertyGrid;
using NUnit.Framework;
namespace mRemoteNGTests.UI.Controls
{
public class FilteredPropertyGridTests
{
[Test]
public void AllPropertiesVisibleByDefault()
{
var grid = new FilteredPropertyGrid();
var obj = new {Prop1 = "hello"};
grid.SelectedObject = obj;
Assert.That(grid.VisibleProperties, Is.EquivalentTo(new []{ nameof(obj.Prop1) }));
}
[Test]
public void PropertiesOnTheHiddenPropertiesListAreNotShown()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = "world" };
grid.HiddenProperties = new[] { nameof(obj.Prop1) };
grid.SelectedObject = obj;
Assert.That(grid.VisibleProperties, Is.EquivalentTo(new[] { nameof(obj.Prop2) }));
}
[Test]
public void OnlyPropertiesOnTheBrowsablePropertiesListAreShown()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = "world" };
grid.BrowsableProperties = new[] { nameof(obj.Prop1) };
grid.SelectedObject = obj;
Assert.That(grid.VisibleProperties, Is.EquivalentTo(new[] { nameof(obj.Prop1) }));
}
[Test]
public void APropertyOnBothTheBrowsableAndHiddenListWillNotBeShown()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = "world", Prop3 = "!" };
grid.BrowsableProperties = new[] { nameof(obj.Prop1), nameof(obj.Prop2) };
grid.HiddenProperties = new[] { nameof(obj.Prop1) };
grid.SelectedObject = obj;
Assert.That(grid.VisibleProperties, Is.EquivalentTo(new[] { nameof(obj.Prop2) }));
}
[Test]
public void ExceptionThrownWhenNonExistantPropertyFoundInBrowsablePropertiesList()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello" };
grid.SelectedObject = obj;
Assert.Throws<InvalidOperationException>(() =>
grid.BrowsableProperties = new[] {"NonExistantProperty"});
}
[Test]
public void HiddenPropertiesListCanHandleNonExistentProperties()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello" };
grid.SelectedObject = obj;
Assert.DoesNotThrow(() => grid.HiddenProperties = new[] { "NonExistantProperty" });
}
[Test]
public void GetVisibleGridItemsReturnsAllExpandedItems()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = new{Prop3 = "world"} };
grid.SelectedObject = obj;
var visibleGridItems = grid.GetVisibleGridItems();
Assert.That(visibleGridItems.Select(i => i.Label),
Is.EquivalentTo(new[]
{
nameof(obj.Prop1),
nameof(obj.Prop2)
}));
}
[Test]
public void CanSelectGridItem()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = "world" };
grid.SelectedObject = obj;
grid.SelectGridItem(nameof(obj.Prop2));
Assert.That(grid.SelectedGridItem.PropertyDescriptor?.Name,
Is.EqualTo(nameof(obj.Prop2)));
}
[Test]
public void FindNextGridItemPropertyReturnsTheCorrectItem()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = "world" };
grid.SelectedObject = obj;
grid.SelectGridItem(nameof(obj.Prop1));
var nextGridItem = grid.FindNextGridItemProperty(grid.SelectedGridItem);
Assert.That(nextGridItem?.PropertyDescriptor?.Name,
Is.EqualTo(nameof(obj.Prop2)));
}
[Test]
public void FindPreviousGridItemPropertyReturnsTheCorrectItem()
{
var grid = new FilteredPropertyGrid();
var obj = new { Prop1 = "hello", Prop2 = "world", Prop3 = "!" };
grid.SelectedObject = obj;
grid.SelectGridItem(nameof(obj.Prop3));
var nextGridItem = grid.FindPreviousGridItemProperty(grid.SelectedGridItem);
Assert.That(nextGridItem?.PropertyDescriptor?.Name,
Is.EqualTo(nameof(obj.Prop2)));
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Linq;
using System.Windows.Forms;
using mRemoteNG.UI.Controls.PageSequence;
using NSubstitute;
using NUnit.Framework;
namespace mRemoteNGTests.UI.Controls

View File

@@ -43,8 +43,8 @@ namespace mRemoteNGTests.UI.Controls
//
// SecureTextBoxTestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(256, 45);
this.Controls.Add(this.secureTextBox1);
this.Name = "SecureTextBoxTestForm";

View File

@@ -32,8 +32,8 @@
//
// TestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Name = "TestForm";
this.Text = "TestForm";

View File

@@ -1,4 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace mRemoteNGTests.UI.Controls

View File

@@ -40,8 +40,8 @@
//
// TextBoxExtensionsTestForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(220, 48);
this.Controls.Add(this.textBox1);
this.Name = "TextBoxExtensionsTestForm";

View File

@@ -1,123 +0,0 @@
using System;
using System.Drawing;
using mRemoteNG.UI;
using mRemoteNG.UI.GraphicsUtilities;
using mRemoteNGTests.Properties;
using NSubstitute;
using NUnit.Framework;
namespace mRemoteNGTests.UI
{
public class DisplayPropertiesTests
{
[Test]
public void ScaleHeightReturnsValueScaledByHeightScalingFactor()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 2));
var sut = new DisplayProperties(graphics);
var initialValue = 10;
var scaledValue = sut.ScaleHeight(initialValue);
Assert.That(scaledValue, Is.EqualTo(sut.ResolutionScalingFactor.Height * initialValue));
}
[Test]
public void ScaleWidthReturnsValueScaledByWidthScalingFactor()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 2));
var sut = new DisplayProperties(graphics);
var initialValue = 10;
var scaledValue = sut.ScaleWidth(initialValue);
Assert.That(scaledValue, Is.EqualTo(sut.ResolutionScalingFactor.Width * initialValue));
}
[Test]
public void ScaleSizeReturnsNewSizeWithCorrectlyScaledHeight()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 2));
var sut = new DisplayProperties(graphics);
var initialValue = new Size(12, 16);
var scaledValue = sut.ScaleSize(initialValue);
Assert.That(scaledValue.Height, Is.EqualTo(sut.ResolutionScalingFactor.Height * initialValue.Height));
}
[Test]
public void ScaleSizeReturnsNewSizeWithCorrectlyScaledWidth()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 2));
var sut = new DisplayProperties(graphics);
var initialValue = new Size(12, 16);
var scaledValue = sut.ScaleSize(initialValue);
Assert.That(scaledValue.Width, Is.EqualTo(sut.ResolutionScalingFactor.Width * initialValue.Width));
}
[Test]
public void ScaleImageReturnsNewImageWithCorrectlyScaledHeight()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 2));
var sut = new DisplayProperties(graphics);
var initialValue = Resources.TestImage;
var scaledValue = sut.ScaleImage(initialValue);
Assert.That(scaledValue.Height, Is.EqualTo(sut.ResolutionScalingFactor.Height * initialValue.Height));
}
[Test]
public void ScaleImageReturnsNewImageWithCorrectlyScaledWidth()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 2));
var sut = new DisplayProperties(graphics);
var initialValue = Resources.TestImage;
var scaledValue = sut.ScaleImage(initialValue);
Assert.That(scaledValue.Width, Is.EqualTo(sut.ResolutionScalingFactor.Width * initialValue.Width));
}
[Test]
public void ResolutionScalingFactorAlwaysReturnsMostUpdatedValue()
{
var graphics = Substitute.For<IGraphicsProvider>();
graphics.GetResolutionScalingFactor().Returns(new SizeF(4, 4));
var sut = new DisplayProperties(graphics);
graphics.GetResolutionScalingFactor().Returns(new SizeF(8, 8));
Assert.That(sut.ResolutionScalingFactor.Width, Is.EqualTo(8));
}
[Test]
public void AttemptingToScaleANullImageWillThrowAnException()
{
var sut = new DisplayProperties(Substitute.For<IGraphicsProvider>());
Assert.Throws<ArgumentNullException>(() => sut.ScaleImage((Image)null));
}
[Test]
public void AttemptingToScaleANullIconWillThrowAnException()
{
var sut = new DisplayProperties(Substitute.For<IGraphicsProvider>());
Assert.Throws<ArgumentNullException>(() => sut.ScaleImage((Icon)null));
}
[Test]
public void AttemptingToCallConstructorWithNullGraphicsProviderWillThrow()
{
// ReSharper disable once ObjectCreationAsStatement
Assert.Throws<ArgumentNullException>(() => new DisplayProperties(null));
}
}
}

View File

@@ -5,7 +5,7 @@ namespace mRemoteNGTests.UI.Forms
{
public class OptionsFormSetupAndTeardown
{
protected FrmOptions _optionsForm;
protected frmOptions _optionsForm;
[OneTimeSetUp]
public void OnetimeSetup()
@@ -15,7 +15,7 @@ namespace mRemoteNGTests.UI.Forms
[SetUp]
public void Setup()
{
_optionsForm = new FrmOptions();
_optionsForm = new frmOptions();
_optionsForm.Show();
}

View File

@@ -1,10 +1,10 @@
using mRemoteNG.UI.Forms;
using NUnit.Framework;
using NUnit.Extensions.Forms;
using NUnit.Framework;
using mRemoteNG.UI.Forms;
namespace mRemoteNGTests.UI.Forms
{
[TestFixture]
[TestFixture]
public class PasswordFormTests
{
PasswordForm _passwordForm;
@@ -27,11 +27,10 @@ namespace mRemoteNGTests.UI.Forms
}
[Test]
[SetUICulture("en-US")]
public void PasswordFormText()
{
var formTester = new FormTester("PasswordForm");
Assert.That(formTester.Text, Does.Match("mRemoteNG password"));
FormTester formTester = new FormTester("PasswordForm");
Assert.That(formTester.Text, Does.Match("Password"));
}
[Test]

View File

@@ -12,14 +12,17 @@ using NUnit.Framework;
namespace mRemoteNGTests.UI.Window.ConfigWindowTests
{
public class ConfigWindowGeneralTests
public class ConfigWindowGeneralTests
{
private ConfigWindow _configWindow;
[SetUp]
public void Setup()
{
_configWindow = new ConfigWindow();
_configWindow = new ConfigWindow
{
PropertiesVisible = true
};
}
[TestCaseSource(nameof(ConnectionInfoGeneralTestCases))]
@@ -54,92 +57,7 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
Assert.That(_configWindow.VisibleObjectProperties, Is.EquivalentTo(expectedVisibleProperties));
}
[Test]
public void SwitchFromInheritanceToConnectionPropertiesWhenClickingRootNode()
{
// connection with a normal parent container
var connection = new ConnectionInfo();
connection.SetParent(new ContainerInfo());
_configWindow.SelectedTreeNode = connection;
_configWindow.ShowInheritanceProperties();
_configWindow.SelectedTreeNode = new RootNodeInfo(RootNodeType.Connection);
Assert.That(_configWindow.PropertiesVisible, Is.True,
() => "The property mode should switch from inheritance to connection properties when clicking on the root node.");
}
[Test]
public void SwitchFromInheritanceToConnectionPropertiesWhenClickingRootPuttyNode()
{
// connection with a normal parent container
var connection = new ConnectionInfo();
connection.SetParent(new ContainerInfo());
_configWindow.SelectedTreeNode = connection;
_configWindow.ShowInheritanceProperties();
_configWindow.SelectedTreeNode = new RootPuttySessionsNodeInfo();
Assert.That(_configWindow.PropertiesVisible, Is.True,
() => "The property mode should switch from inheritance to connection properties when clicking on the root node.");
}
[Test]
public void SwitchFromInheritanceToConnectionPropertiesWhenClickingChildOfRootNode()
{
// connection with a normal parent container
var root = new RootNodeInfo(RootNodeType.Connection);
var containerWhoseParentIsRoot = new ContainerInfo();
var connection = new ConnectionInfo();
root.AddChild(containerWhoseParentIsRoot);
containerWhoseParentIsRoot.AddChild(connection);
_configWindow.SelectedTreeNode = connection;
_configWindow.ShowInheritanceProperties();
_configWindow.SelectedTreeNode = containerWhoseParentIsRoot;
Assert.That(_configWindow.PropertiesVisible, Is.True,
() => "The property mode should switch from inheritance to connection properties " +
"when clicking on a container whose parent is the root node.");
}
[TestCaseSource(nameof(EveryNodeType))]
public void DefaultConnectionPropertiesCanBeShownRegardlessOfWhichNodeIsSelected(ConnectionInfo selectedObject)
{
_configWindow.SelectedTreeNode = selectedObject;
Assert.That(_configWindow.CanShowDefaultProperties, Is.True);
}
[TestCaseSource(nameof(EveryNodeType))]
public void DefaultInheritancePropertiesCanBeShownRegardlessOfWhichNodeIsSelected(ConnectionInfo selectedObject)
{
_configWindow.SelectedTreeNode = selectedObject;
Assert.That(_configWindow.CanShowDefaultInheritance, Is.True);
}
[TestCaseSource(nameof(EveryNodeType))]
public void ConnectionPropertiesCanAlwaysBeShownUnlessNothingIsSelected(ConnectionInfo selectedObject)
{
_configWindow.SelectedTreeNode = selectedObject;
var selectedObjectNotNull = selectedObject != null;
Assert.That(_configWindow.CanShowProperties, Is.EqualTo(selectedObjectNotNull));
}
[TestCaseSource(nameof(EveryNodeType))]
public void InheritancePropertiesAreVisibleInCertainCases(ConnectionInfo selectedObject)
{
_configWindow.SelectedTreeNode = selectedObject;
var shouldBeAvailable = selectedObject != null &&
!(selectedObject is RootNodeInfo) &&
!(selectedObject is PuttySessionInfo) &&
!(selectedObject.Parent is RootNodeInfo);
Assert.That(_configWindow.CanShowInheritance, Is.EqualTo(shouldBeAvailable));
}
private static IEnumerable<TestCaseData> ConnectionInfoGeneralTestCases()
private static IEnumerable<TestCaseData> ConnectionInfoGeneralTestCases()
{
var protocolTypes = typeof(ProtocolType).GetEnumValues().OfType<ProtocolType>();
var testCases = new List<TestCaseData>();
@@ -162,56 +80,6 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
return testCases;
}
private static IEnumerable<TestCaseData> EveryNodeType()
{
var protocolTypes = typeof(ProtocolType).GetEnumValues().OfType<ProtocolType>().ToList();
var root = new RootNodeInfo(RootNodeType.Connection);
var container = new ContainerInfo();
var connectionsWithNormalParent = protocolTypes
.Select(protocolType =>
{
var c = new ConnectionInfo {Protocol = protocolType};
c.SetParent(container);
return new TestCaseData(c).SetName(protocolType + ", Connection, NormalParent");
});
var connectionsWithRootParent = protocolTypes
.Select(protocolType =>
{
var c = new ConnectionInfo { Protocol = protocolType };
c.SetParent(root);
return new TestCaseData(c).SetName(protocolType + ", Connection, RootParent");
});
var contianersWithNormalParent = protocolTypes
.Select(protocolType =>
{
var c = new ContainerInfo { Protocol = protocolType };
c.SetParent(container);
return new TestCaseData(c).SetName(protocolType + ", Connection, NormalParent");
});
var containersWithRootParent = protocolTypes
.Select(protocolType =>
{
var c = new ContainerInfo { Protocol = protocolType };
c.SetParent(root);
return new TestCaseData(c).SetName(protocolType + ", Connection, RootParent");
});
return connectionsWithNormalParent
.Concat(connectionsWithRootParent)
.Concat(contianersWithNormalParent)
.Concat(containersWithRootParent)
.Concat(new[]
{
new TestCaseData(root).SetName("RootNode"),
new TestCaseData(new RootPuttySessionsNodeInfo()).SetName("RootPuttyNode"),
new TestCaseData(new PuttySessionInfo()).SetName("PuttyNode"),
new TestCaseData(null).SetName("Null"),
});
}
internal static ConnectionInfo ConstructConnectionInfo(ProtocolType protocol, bool isContainer)
{
// build connection info. set certain connection properties so
@@ -222,13 +90,12 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
: new ConnectionInfo();
node.Protocol = protocol;
node.Resolution = RDPResolutions.Res800x600;
node.RDGatewayUsageMethod = RDGatewayUsageMethod.Never;
node.RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.Yes;
node.RedirectSound = RDPSounds.DoNotPlay;
node.Resolution = RdpProtocol.RDPResolutions.Res800x600;
node.RDGatewayUsageMethod = RdpProtocol.RDGatewayUsageMethod.Never;
node.RDGatewayUseConnectionCredentials = RdpProtocol.RDGatewayUseConnectionCredentials.Yes;
node.RedirectSound = RdpProtocol.RDPSounds.DoNotPlay;
node.VNCAuthMode = ProtocolVNC.AuthMode.AuthVNC;
node.VNCProxyType = ProtocolVNC.ProxyType.ProxyNone;
node.UseVmId = false;
node.Inheritance.TurnOffInheritanceCompletely();
return node;
@@ -247,7 +114,6 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
nameof(ConnectionInfo.PostExtApp),
nameof(ConnectionInfo.MacAddress),
nameof(ConnectionInfo.UserField),
nameof(ConnectionInfo.Favorite),
};
if (!isContainer)
@@ -267,7 +133,6 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
nameof(ConnectionInfo.Password),
nameof(ConnectionInfo.Domain),
nameof(ConnectionInfo.Port),
nameof(ConnectionInfo.UseVmId),
nameof(ConnectionInfo.UseConsoleSession),
nameof(ConnectionInfo.RDPAuthenticationLevel),
nameof(ConnectionInfo.RDPMinutesToIdleTimeout),
@@ -284,12 +149,9 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
nameof(ConnectionInfo.RedirectKeys),
nameof(ConnectionInfo.RedirectDiskDrives),
nameof(ConnectionInfo.RedirectPrinters),
nameof(ConnectionInfo.RedirectClipboard),
nameof(ConnectionInfo.RedirectPorts),
nameof(ConnectionInfo.RedirectSmartCards),
nameof(ConnectionInfo.RedirectSound),
nameof(ConnectionInfo.RedirectAudioCapture),
nameof(ConnectionInfo.RdpVersion)
});
break;
case ProtocolType.VNC:
@@ -342,15 +204,6 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
nameof(ConnectionInfo.CacheBitmaps),
});
break;
case ProtocolType.PowerShell:
expectedProperties.AddRange(new[]
{
nameof(ConnectionInfo.Username),
nameof(ConnectionInfo.Password),
nameof(ConnectionInfo.Domain),
nameof(ConnectionInfo.Port),
});
break;
case ProtocolType.IntApp:
expectedProperties.AddRange(new[]
{

Some files were not shown because too many files have changed in this diff Show More