Compare commits

...

279 Commits

Author SHA1 Message Date
Sean Kaim
3a173821d7 1.75 Alpha 3 2016-08-12 14:12:57 -04:00
Sean Kaim
4555db8e97 MR-965, MR-871, MR-629: Error 264 on RDP Connect
Error 264 is a timeout:
RDP disconnected!
264 This computer can't connect to the remote computer.

The two computers couldn't connect in the amount of time allotted. Try
connecting again. If the problem continues, contact your network
administrator or technical support.
2016-08-11 16:52:57 -04:00
Sean Kaim
1bbd20de3c Merge PR #130 - port scan button width 2016-08-10 16:48:42 -04:00
Sean Kaim
d1f4164498 Update changelog 2016-08-10 16:41:56 -04:00
Sean Kaim
d1c238a812 Merge pull request #134 from mRemoteNG/MR-946_Initial_SSH.NET
MR-946 initial ssh.net - File xfer
2016-08-10 16:03:56 -04:00
Sean Kaim
675bbd602f Remove old components, update credits.txt 2016-08-10 15:59:14 -04:00
Sean Kaim
ab1be61fda SFTP file transfer now works fully 2016-08-10 15:52:02 -04:00
Sean Kaim
8097ab146c Merge remote-tracking branch 'refs/remotes/origin/develop' into MR-946_Initial_SSH.NET 2016-08-10 12:04:02 -04:00
David Sparer
c0c4b69c64 Rename interface "Inheritance" to "IInheritable" 2016-08-10 09:24:48 -06:00
David Sparer
315d90391c Merge branch 'MR-906_default_Inherit_All_not_saved' into develop 2016-08-10 09:14:18 -06:00
David Sparer
869a5fd773 Created several simple unit & integration tests for DefaultConnectionInheritance 2016-08-10 09:06:44 -06:00
David Sparer
9940cfcf12 Minor cleanup of the Config window class 2016-08-10 08:28:35 -06:00
Sean Kaim
463b6cd791 progress bar style 2016-08-09 17:53:02 -04:00
David Sparer
b981516913 Fix issue setting ICAEncryptionStrength through inheritance 2016-08-09 15:50:56 -06:00
David Sparer
9ffdbee400 Fix self-reference initialization error 2016-08-09 15:49:52 -06:00
Sean Kaim
def55c9dfe code formatting/clean up 2016-08-09 17:48:22 -04:00
Sean Kaim
69668c5e55 background transfer 2016-08-09 17:45:46 -04:00
David Sparer
f41adec096 Minor cleanup of ConnectionInfo 2016-08-09 15:25:21 -06:00
David Sparer
3cc56f9886 Minor cleanup of ConnectionInfoInheritance 2016-08-09 15:25:03 -06:00
Sean Kaim
be8b302e20 Merge remote-tracking branch 'refs/remotes/origin/develop' into MR-946_Initial_SSH.NET 2016-08-09 16:58:57 -04:00
Sean Kaim
6da05af387 code clean up & fix complier warnings 2016-08-09 16:58:44 -04:00
Sean Kaim
2eb74afc20 upload with progress bar working 2016-08-09 16:41:46 -04:00
David Sparer
c44bb1e27d Made DefaultConnectionInheritance.SaveTo a generic method to decouple it from Settings 2016-08-09 11:08:06 -06:00
David Sparer
12cd38a047 Made DefaultConnectionInheritance LoadFrom a generic method to decouple it from the Settings class 2016-08-09 11:02:53 -06:00
David Sparer
e5c896cb36 Refactored much of the inheritance code to use System.Reflection instead of hardcoded values.
Refactored DefaultInheritance to its own class which inherits from the ConnectionInfoInheritance class.
Fixed issue with DefaultInheritance not saving to settings.
2016-08-09 10:34:51 -06:00
Sean Kaim
d89a2487e7 Merge remote-tracking branch 'refs/remotes/origin/develop' into MR-946_Initial_SSH.NET 2016-08-08 17:56:10 -04:00
David Sparer
e59f91a976 Minor refactoring 2016-08-05 09:37:22 -06:00
David Sparer
9a80777fe9 Minor code cleanup in ConnectionInfoInheritance 2016-08-05 09:02:17 -06:00
David Sparer
69b1da50b8 Removed redundant namespace qualifier 2016-08-05 08:55:45 -06:00
Sean Kaim
04ada28ffc Latest SSH.NET package 2016-08-04 17:48:26 -04:00
David Sparer
369a6c2f04 Merge branch 'MR-896_RDP_Class_not_registered' into develop 2016-08-04 13:39:37 -06:00
David Sparer
f438fb65f8 Installer now checkes for KB2574819 on win7 before installation can occur 2016-08-04 13:37:36 -06:00
David Sparer
6590011ef1 Refactored the CustomActions for checking if a KB is installed. Made it more generic 2016-08-04 13:36:08 -06:00
David Sparer
b6eb3d2361 Added the CustomActions project to build by default for Release and Debug builds 2016-08-03 13:26:32 -06:00
David Sparer
13b9b77f0d Added exception catching to a CustomAction method 2016-08-03 13:25:38 -06:00
David Sparer
20419856c1 Minor update to changelog 2016-08-03 13:25:02 -06:00
David Sparer
43100930cd update changelog for 1.75 alpha 2 2016-08-03 12:40:56 -06:00
David Sparer
aac7e4cc53 Merge branch 'MR-874_incorrect_rdp_check_in_installer' into develop 2016-08-03 12:16:31 -06:00
David Sparer
1c8f3e2328 Some more code cleanup 2016-08-03 12:10:36 -06:00
David Sparer
a54f0a2e89 Cleaned up some CustomActions code 2016-08-03 12:08:03 -06:00
David Sparer
fdb3cecf8e Refactored CustomActions to extract a class 2016-08-03 12:07:13 -06:00
David Sparer
8762c39dd5 Refactored the way we verify the minimum RDP version is installed. Now, instead of using a dynamically named variable based on the required KB, we boil this down to a statically named variable that indicates if the minimum KB is installed. 2016-08-03 11:57:17 -06:00
David Sparer
fc56c56883 Cleanup of some custom action code 2016-08-03 11:14:36 -06:00
David Sparer
ae950ac075 Use var for local variables in CustomActions file 2016-08-03 10:26:37 -06:00
Sean Kaim
8bbb9a70c6 code clean up, ui tweaks, new backend class 2016-07-29 21:52:06 -04:00
Sean Kaim
e6532dc155 code clean up, Eng translation for reconn all 2016-07-29 15:47:44 -04:00
Sean Kaim
ee6af8c187 Merge pull request #133 from yegorich/reconnect
Add an option to reconnect all opened tabs
2016-07-29 15:32:57 -04:00
David Sparer
bc1a0725df Merge branch 'develop' into MR-942_refactor_connection_loader 2016-07-28 14:56:30 -06:00
Sean Kaim
37905f8249 Add nuget packages to tests 2016-07-28 16:49:44 -04:00
Sean Kaim
8163e7273e Add nuget packages to tests 2016-07-28 16:47:45 -04:00
Yegor Yefremov
58fdba1d89 Add an option to reconnect all opened tabs 2016-07-28 09:40:17 +02:00
Sean Kaim
203dcf714f Initial SSH.NET file transfer
Upload succeeds. UI status/etc needs work.
2016-07-27 22:56:28 -04:00
David Sparer
649f864236 Extracted some methods from the sql connection loader 2016-07-27 12:11:17 -06:00
David Sparer
292f3b03cc Refactored AddNodeFromXml to improve readability 2016-07-27 10:51:47 -06:00
David Sparer
ec8fe3c343 Extracted methods for adding connections / containers to the TreeView 2016-07-27 10:36:37 -06:00
David Sparer
823b0518ae Extracted a method for authenticating protected data 2016-07-27 09:59:41 -06:00
David Sparer
c48caf5bdc Minor cleanup of the Runtime methods that use the connections loader 2016-07-26 14:02:59 -06:00
David Sparer
20bc6d079f Extraced method for expanding folders 2016-07-26 12:45:37 -06:00
David Sparer
dccd318f60 Fixed an oversight with bool initialization 2016-07-26 12:44:24 -06:00
David Sparer
2b0f670fb7 Extracted method for opening connections from last session 2016-07-26 12:42:08 -06:00
David Sparer
b5c431dca8 Extracted more methods 2016-07-26 12:40:38 -06:00
David Sparer
57dd93f136 Extracted method for initializing the root tree node 2016-07-26 12:39:37 -06:00
David Sparer
976e02effb Extracted method to load xml data 2016-07-26 12:19:54 -06:00
David Sparer
396387340a Extracted method to validate confcon file version 2016-07-26 12:15:11 -06:00
David Sparer
d9bf021597 Use object initializer 2016-07-26 12:14:27 -06:00
David Sparer
b4e26f513b Removed unnecessary property from xml connection loader 2016-07-26 11:44:50 -06:00
David Sparer
2eef31f74d Renamed several database related properties to be more generic ("sql" -> "database") 2016-07-26 11:34:47 -06:00
David Sparer
cc96e2b3eb Removed more unused code 2016-07-26 11:30:52 -06:00
David Sparer
4526a0b875 Removed unnecessary using directives 2016-07-26 11:29:24 -06:00
David Sparer
4568bcc0ae Split Xml connection loader to its own class 2016-07-26 11:27:31 -06:00
David Sparer
cf3af14c6a Split connection loader code for Sql to its own class 2016-07-26 11:13:43 -06:00
David Sparer
d320c84bc8 Removed some more redundant code 2016-07-26 10:26:03 -06:00
David Sparer
8eff262e8f Removed redundant code 2016-07-26 10:10:41 -06:00
David Sparer
8c7d90f0c4 Use object initializers 2016-07-26 10:02:16 -06:00
David Sparer
0e189551dd Simplify conditional statements 2016-07-26 09:58:26 -06:00
David Sparer
981acd6510 Modified a few function names to adhere to style guidelines 2016-07-26 09:48:45 -06:00
David Sparer
404aae6bf3 Fixed some spacing and caught a few more place that var should have been used 2016-07-26 09:44:11 -06:00
David Sparer
57cc9b8de4 Import Messages namespace 2016-07-26 09:36:24 -06:00
David Sparer
d2def0a34d Use var for local variable declarations 2016-07-26 09:34:40 -06:00
David Sparer
f1a5e1c029 Renamed fields and properties to adhere to style guide and be more descriptive 2016-07-26 09:19:46 -06:00
David Sparer
19ae192887 Converted properties to auto-properties where possible 2016-07-26 09:16:31 -06:00
Sean Kaim
cc87227559 minor tweaks to AeadCryptographyProvider 2016-07-20 11:33:55 -04:00
Sean Kaim
9ad0c74a56 code clean up 2016-07-15 09:36:34 -04:00
Sean Kaim
55a8b743c8 Fix exception opening in Designer 2016-07-15 09:08:34 -04:00
Sean Kaim
7adb150d1c minor code clean up & logging 2016-07-14 15:33:41 -04:00
David Sparer
afdb392289 Jenkinsfile change may not be working properly. This is a test commit 2016-07-14 12:50:44 -06:00
David Sparer
1c8e24a117 Found a way to simplify the git checkout stage of the Jenkins pipeline 2016-07-14 12:46:52 -06:00
David Sparer
266e79a2c3 Fixed a merge mistake regarding the Geckofx package version 2016-07-14 10:48:15 -06:00
David Sparer
6c5d629a88 Merge branch 'MR-917_Improve_cryptographic_support' into develop
# Conflicts:
#	mRemoteV1/mRemoteV1.csproj
#	mRemoteV1/packages.config
2016-07-14 08:43:16 -06:00
David Sparer
84ed778b67 Merge pull request #131 from jamesrenaud/MR-910_RDP_Gateway_Credentials_Applied_Incorrectly
MR-910 Fixes to support Remote Desktop Gateways
2016-07-13 18:13:58 -06:00
jamesrenaud
c1d41847a2 Removed inline comment per style feedback 2016-07-13 19:07:15 -04:00
David Sparer
73c50837d8 Created class for building and using encrypted secure strings 2016-07-13 12:51:21 -06:00
David Sparer
89075aa3e9 Removed unnecessary crypto experiment 2016-07-13 10:42:44 -06:00
David Sparer
bffe4454ba Moved AeasCryptographyProvider to the mRemoteNG.Security.SymmetricEncryption namespace 2016-07-13 10:34:36 -06:00
David Sparer
69a8f50b58 Moved LegacyRijndaelCryptographyProvider to the mRemoteNG.Security.SymmetricEncryption namespace 2016-07-13 10:32:36 -06:00
David Sparer
8c6f6534b6 Added method to the crypto factory and unit test 2016-07-13 10:10:08 -06:00
David Sparer
791a78154d Fixed a decryption bug introduced while cleaning up code in the LegacyRinjdaelCryptographyProvider class 2016-07-13 09:59:57 -06:00
David Sparer
f08ce0acd5 LegacyRijndaelCryptographyProvider now implements ICryptographyProvider 2016-07-13 09:39:27 -06:00
David Sparer
757b195d5c Made the LegacyRijndaelCryptographyProvider class non-static 2016-07-13 08:41:18 -06:00
David Sparer
c6a39a9220 Rename "Crypt" class to "LegacyRijndaelCryptographyProvider" 2016-07-13 08:22:06 -06:00
David Sparer
a2054b458b Code cleanup on the legacy crypt class 2016-07-13 08:16:06 -06:00
James Renaud
6ee12d447f Fixes to support Remote Desktop Gateways 2016-07-12 22:44:27 -04:00
Hayato Iriumi
f95e3fb719 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG.git 2016-07-11 21:44:16 -07:00
Hayato Iriumi
aa9141505f More Japanese translation 2016-07-11 19:56:09 -07:00
David Sparer
b4f0d2f2ae Removing un-needed experiments 2016-07-11 18:12:44 -06:00
David Sparer
5bc67ab796 Changed default engine from AesFastEngine to AesEngine 2016-07-11 18:07:42 -06:00
David Sparer
4f86e0da62 Added a factory class for instantiating crypto providers 2016-07-11 18:07:22 -06:00
David Sparer
12165ac9a6 Added required property to the ICryptographyProvider interface to get the underlying crypto algorithm 2016-07-11 18:06:28 -06:00
David Sparer
dd783c2dc0 Forgot to save project 2016-07-11 15:43:42 -06:00
David Sparer
4b65086622 Some cleanup 2016-07-11 15:42:48 -06:00
David Sparer
de2542c172 Renamed AesGcm to AeadCryptographyProvider 2016-07-11 15:38:13 -06:00
David Sparer
973de3507e AesGcm does not actually benefit from generics. Removed that support 2016-07-11 15:35:13 -06:00
Sean Kaim
1945d5ac6b Update changelog.txt 2016-07-11 17:27:23 -04:00
Sean Kaim
cb3614d54c Fix LargeAddressAware test 2016-07-11 17:27:01 -04:00
David Sparer
4375f2d5d1 Some cleanup of AesGcm class 2016-07-11 15:23:02 -06:00
David Sparer
92b6cf201e Modified AesGcm to accept different string encodings (besides UTF-8) 2016-07-11 15:17:07 -06:00
David Sparer
b2b53561ba Modified AESGCM to support specifying the block cipher engine through generics 2016-07-11 15:10:43 -06:00
Sean Kaim
73a1923db6 Fix conflicts 2016-07-11 16:25:53 -04:00
David Sparer
76e290f6b7 AESGCM implements ICryptographyProvider 2016-07-11 14:24:22 -06:00
Sean Kaim
be02814021 Update GeckoFx and NUnit nuget packages 2016-07-11 16:22:33 -04:00
David Sparer
d60c007ac6 Make AESGCM non-static 2016-07-11 14:22:20 -06:00
David Sparer
e92c1eaa9d Add some tests for the AesGcm class 2016-07-11 14:17:50 -06:00
David Sparer
8d638602b9 Fix encryptor class 2016-07-11 14:17:28 -06:00
David Sparer
48161aca47 Changed the unit tests to use to Encryptor class, which is a better implementation than the AesCryptographyProvider. 2016-07-11 14:16:20 -06:00
Sean Kaim
11314972fa Merge pull request #129 from mRemoteNG/dockpanelsuite_nuget
Dockpanelsuite nuget packages
2016-07-11 16:16:07 -04:00
David Sparer
83ac202a6b The "AESThenHMAC" file is not particularly helpful. This uses .Net crypto - trying to stick with BouncyCastle 2016-07-11 14:14:29 -06:00
Sean Kaim
02c601fd3a Remove local DockPanelSuite 2016-07-11 16:13:48 -04:00
Sean Kaim
86f6f85142 DockPanelSuite 2.10 Final NuGet packages 2016-07-11 16:12:32 -04:00
David Sparer
ca4cb433a9 Testing another implementation for crypto 2016-07-11 13:41:07 -06:00
David Sparer
e5bed0afcb Testing out some encryption implementations 2016-07-11 13:39:30 -06:00
Sean Kaim
11cf85f771 Delete "old installer" files 2016-07-11 15:01:03 -04:00
Sean Kaim
18d7a9cfe9 Update to correct chat room. 2016-07-11 14:23:19 -04:00
David Sparer
b3bac32441 Moved enhancements made in the CredentialManager branch to a dedicated branch 2016-07-11 11:41:42 -06:00
Sean Kaim
0b9fb06c08 fix Gitter badge 2016-07-11 12:44:04 -04:00
Sean Kaim
c6219ff315 Gitter badge 2016-07-11 12:42:30 -04:00
Sean Kaim
2b7668aa68 Updated installer post build steps 2016-07-08 17:59:25 -04:00
Sean Kaim
c8a684e10d Add readme.txt back (no markdown syntax) 2016-07-08 17:18:29 -04:00
Sean Kaim
5a5d675f3e Update version to 1.75 2016-07-08 17:09:02 -04:00
Sean Kaim
a4acc60f1d Updated change log
Fixed some formatting issues
2016-07-08 17:02:34 -04:00
Sean Kaim
b3bc04251b Update .gitignre
.editorconfig is a user preference
2016-07-08 17:01:50 -04:00
Sean Kaim
203111eb5a Revert "Update .gitignore"
This reverts commit 472168b9e4.
2016-07-08 17:01:16 -04:00
Sean Kaim
472168b9e4 Update .gitignore 2016-07-08 17:00:53 -04:00
Sean Kaim
328ebbe3f7 Merge pull request #127 from mRemoteNG/MR-902_vncsharp_lib_updates
MR-902 vncsharp lib updates
2016-07-08 16:52:31 -04:00
Sean Kaim
999cd19d81 Updated dll including fixes from VncSharpNG.dll
Updated credits.txt

Sent changes to upstream: https://github.com/humphd/VncSharp/pull/21
2016-07-08 16:49:53 -04:00
Sean Kaim
d23f6a69e5 MR-905 - Crash at startup
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidCastException
Stack:
at
mRemoteNG.App.CompatibilityChecker.FipsPolicyEnabledForServer2008AndNewer()
at mRemoteNG.App.CompatibilityChecker.CheckFipsPolicy()
at mRemoteNG.App.CompatibilityChecker.CheckCompatibility()
at mRemoteNG.App.Startup.InitializeProgram()
at mRemoteNG.App.ProgramRoot.StartApplication()
at mRemoteNG.App.ProgramRoot.Main(System.String[])
2016-07-08 13:42:13 -04:00
Sean Kaim
38c7fe9e0a links/formatting 2016-07-06 11:32:46 -04:00
Sean Kaim
dc02f51a15 Twitter shield linking to wrong page/formatting 2016-07-06 11:30:28 -04:00
Sean Kaim
dd7ea02c9f one last time - readme formatting 2016-07-06 10:23:57 -04:00
Sean Kaim
5e0bf0da6e more readme formatting 2016-07-06 10:19:20 -04:00
Sean Kaim
f2f4b14f5e Readme formatting 2016-07-06 10:18:27 -04:00
Sean Kaim
e27b4fa2f9 Twitter Sheild 2016-07-06 10:10:15 -04:00
Sean Kaim
c71a57bd69 Fix download stats 2016-07-06 09:58:09 -04:00
Sean Kaim
8c57b271d8 Download stats shield 2016-07-06 09:54:29 -04:00
Sean Kaim
e167602a32 Update build status 2016-07-06 09:52:20 -04:00
Sean Kaim
590f4ba2c6 Build status shield 2016-07-06 09:51:01 -04:00
Sean Kaim
b2c0dc235c Basic necessary changes
Upstream VncSharp doesn't support Ctrl + C currently.
2016-07-02 14:48:16 -04:00
Sean Kaim
f357a53e0e code clean up 2016-06-30 12:00:35 -04:00
Sean Kaim
5f7d1f9f3f Merge pull request #123 from mRemoteNG/Release_v1.74
MR-874: Added work-around to installer to ignore installation prereq
2016-06-30 10:18:38 -04:00
David Sparer
5ebd255a22 MR-874: Added work-around to installer to ignore installation prerequisites 2016-06-28 08:26:25 -06:00
Sean Kaim
010c0a5061 Merge pull request #121 from mRemoteNG/Release_v1.74
Merge latest 1.74 fixes into develop
2016-06-28 10:21:36 -04:00
Sean Kaim
6ec4bdd926 Updated change log 2016-06-28 10:09:35 -04:00
Sean Kaim
fe023b798d MR-884 - Slow startup
https://blogs.technet.microsoft.com/markrussinovich/2009/05/23/the-case-of-the-slow-keynote-demo/

https://msdn.microsoft.com/en-us/library/cc656914(v=vs.100).aspx#Anchor_8
2016-06-28 10:06:48 -04:00
Sean Kaim
141c916b7b MR-884: Attempt to optimize startup 2016-06-27 11:46:41 -04:00
Sean Kaim
f160e456ae Merge pull request #120 from mRemoteNG/Release_v1.74
Merge latest 1.74 fixes into develop
2016-06-27 10:47:34 -04:00
Sean Kaim
49c6219a84 MR-854: Additional code clean up
New (.NET) method for getting file icons.
Additional ReShaper fixes
Additional null checks/protections
2016-06-25 21:34:32 -04:00
Sean Kaim
0db444e78c MR-854: Code Clean up and logging 2016-06-24 13:08:35 -04:00
Sean Kaim
57c2dc0a88 Fix log message for debugging exception 2016-06-24 12:21:40 -04:00
Sean Kaim
15ba2d3156 Fix incorrect Language Selection on Reconnect 2016-06-24 12:11:41 -04:00
David Sparer
48e2ba11bf Resolved MR-882 by removing a ProtocolType enum value that was being tested some time back. This should not have made it into the develop branch. 2016-06-24 08:21:59 -06:00
David Sparer
2a3fc01937 Merge branch 'Release_v1.74' into develop 2016-06-23 09:58:48 -06:00
David Sparer
aa3e8344fb Modified installer postbuild actions to only attempt to sign the MSI during Release builds 2016-06-23 09:58:16 -06:00
David Sparer
df5e619349 - Moved the PuTTYNG dependency file to $(SolutionDir)\Resources
- Added postbuild task to mRemoteV1 project to copy PuTTYNG file to $(TargetDir)
- Modified installer to point to the new PuTTYNG location
2016-06-23 09:57:46 -06:00
Sean Kaim
0c06983411 MR-875 - Win native compress can't extract
Removed LZMA options
Checked for file existance
2016-06-22 10:11:54 -04:00
Sean Kaim
dda9c1f1af Additional fixes for MR-872
Additional code clean up
Fixed some casting errors likely from the initial c# conversion
2016-06-22 09:35:01 -04:00
Sean Kaim
6779a02cf9 MR-872: Prevent outofbounds ex parsing args 2016-06-21 15:30:07 -04:00
David Sparer
7671328245 Merge branch 'Release_v1.74' into develop 2016-06-20 15:18:38 -06:00
David Sparer
ba7608602b Restricted code signing postbuild task to only Release configurations 2016-06-20 12:52:04 -06:00
David Sparer
92dcd8981d Fixed bug with Help window where clicking a treenode that does not have a .html file associated with it would produce an error. 2016-06-20 12:51:25 -06:00
David Sparer
cbe18b70ca Fixed bug when clicking the root tree node in the Help window 2016-06-20 12:46:47 -06:00
David Sparer
ab26b94808 Remove references to the Help page for Sessions. This feature was removed 2016-06-20 12:38:29 -06:00
David Sparer
0e176cee74 Point postbuild action at the correct location of build-relport 2016-06-20 11:53:05 -06:00
David Sparer
23eaba0d47 - Added scripts to rename and copy the MSI installer to the $(SolutionDir)\Release folder
- Added conditional post build to run the build-relport script when building the Release Portable configuration
2016-06-20 11:52:01 -06:00
David Sparer
c6b079c9cb Moved build-relport.cmd to Tools directory 2016-06-20 11:50:08 -06:00
Sean Kaim
9d544fa7fe Updated date. 2016-06-20 10:25:55 -04:00
Sean Kaim
8aba1be3e6 Remove sessions.htm 2016-06-20 10:24:00 -04:00
Sean Kaim
72d28c5219 Minor build fixes 2016-06-20 10:19:12 -04:00
David Sparer
85dc45a479 Merge branch 'Release_v1.74' into develop 2016-06-19 20:23:06 -06:00
David Sparer
283714f88c - Moved various build tools to the Tools folder
- Modified the build-relport script to point to the Tools folder for its required external programs
2016-06-19 20:12:18 -06:00
David Sparer
eb696b49fe Merge branch 'Release_v1.74' into develop 2016-06-19 08:53:42 -06:00
David Sparer
063be0dbe2 Move all files under "Installer Projects" to "InstallerProjects" to make post build tasks a bit easier 2016-06-18 16:50:01 -06:00
David Sparer
1e4656769e - Began tracking changes to the signing script.
- Added post build event for moving Resources\Help to the correct location
- Added post build events for removing unnecessary files for all "Release" configurations
- Removed lines from the release portable script that are now present in the post build events
2016-06-18 12:03:00 -06:00
David Sparer
3079cad8d6 Somehow this file was not being tracked correctly 2016-06-18 12:01:22 -06:00
Sean Kaim
d5c86b91c3 Updated change log and help files 2016-06-17 17:37:57 -04:00
David Sparer
d5de0b8fa3 Modified postbuild actions to sign the binaries. This will only run if a specific script exists 2016-06-17 12:41:45 -06:00
Sean Kaim
167c02f433 Don't build by default, just package 2016-06-17 08:47:51 -04:00
David Sparer
327e03c3b1 Turned debugging symbol generation off for Release and Release Portable configurations 2016-06-16 19:27:29 -06:00
David Sparer
5304ecb71d Prevent .pdb files from being harvested for the installer 2016-06-16 19:20:33 -06:00
Sean Kaim
64dfa2fa33 Updated Assembly Info 2016-06-16 16:28:34 -04:00
Sean Kaim
8f6431f657 fix display issues on about screen 2016-06-16 16:26:12 -04:00
Sean Kaim
5a59c8c179 Merge pull request #118 from mRemoteNG/develop
merge develop into release (again)
2016-06-16 16:16:09 -04:00
Sean Kaim
2a7fa03df1 3G -> NG 2016-06-16 16:14:15 -04:00
David Sparer
be009d55f4 Jenkinsfile: add support for branches with a period (.) in the name 2016-06-16 14:10:01 -06:00
Sean Kaim
d8789926a7 Updated Credits 2016-06-16 16:09:15 -04:00
Sean Kaim
e7de6bd42b French Spell and typographic checking
From @SebThieu
2016-06-16 16:05:31 -04:00
David Sparer
3f6b70e783 Few changes to build configurations.
- Removed the 'AnyCPU' platform. Should always use x86
- Removed installer projects from being built by default in Release configuration
2016-06-16 13:59:42 -06:00
Sean Kaim
d1ab5cc40f Merge pull request #117 from mRemoteNG/develop
merge develop into release
2016-06-16 12:17:15 -04:00
Sean Kaim
a8376ebb96 fix a typo in the changelog. 2016-06-16 12:10:06 -04:00
Sean Kaim
f0456cce0e minor change log update 2016-06-16 12:09:33 -04:00
David Sparer
bc46f8c432 Merge branch 'develop' of github.com:mRemoteNG/mRemoteNG into develop 2016-06-14 15:23:44 -06:00
Sean Kaim
4de8a8e915 More detailed messages for RDP Disconnected events 2016-06-14 16:46:55 -04:00
David Sparer
4f0d425711 - Created a unit test to verify that the LARGEADDRESSAWARE flag is set on mRemoteNG.exe
- Created configurations for the unit test project to support the PORTABLE compilation symbol. This is required for the unit test to work correctly.
2016-06-14 14:28:45 -06:00
Sean Kaim
7679c255f3 better compression for the portable zip 2016-06-14 16:26:14 -04:00
David Sparer
3027ba6dc7 Fixed issue with setting LARGEADDRESSAWARE flag on the binary 2016-06-14 13:36:08 -06:00
Sean Kaim
9b556436bb Spell check and other minor updates
"offiginally" - seriously?  😕
2016-06-11 17:35:14 -04:00
Sean Kaim
1c84205a5e Updated Changelog 2016-06-11 17:08:02 -04:00
Sean Kaim
d39373a4f5 Remove files that are no longer needed 2016-06-10 09:08:55 -04:00
Sean Kaim
3dbfdf3b5b Merge pull request #116 from mRemoteNG/GeckoFx
Replaced XULRunner with GeckoFx
2016-06-10 09:02:55 -04:00
David Sparer
286cfc961e Set the unit tests to always build with "AnyCpu" configuration 2016-06-09 16:37:52 -06:00
David Sparer
3148879bf7 Removed the installer projects from being built in the Debug, Debug Portable, and Release Portable build configurations. 2016-06-09 16:20:36 -06:00
David Sparer
70924b6823 Modified jenkinsfile to force build server to build x86 2016-06-09 15:54:29 -06:00
Sean Kaim
2a63fe6a09 build fix 2016-06-09 17:42:49 -04:00
Sean Kaim
91c09ebd7e Fix jenkins unit test build/run 2016-06-09 17:39:42 -04:00
David Sparer
4957e62765 Fixed a missing apostrophe in the jenkinsfile 2016-06-09 14:57:10 -06:00
David Sparer
80ef32b8b5 Updated the jenkinsfile to restore nuget packages before build. This is done automatically in VS2015 but not in msbuild. 2016-06-09 14:55:26 -06:00
Sean Kaim
39bf3e754d Clarify option 2016-06-09 12:20:15 -04:00
hiriumi
3d8c0ce181 More Japanese translations 2016-06-09 08:26:54 -07:00
hiriumi
07042d16b0 More Japanese translation. About 60% done. 2016-06-08 13:02:48 -07:00
hiriumi
fce583a346 Option page weren't displaying target language so I added apply language in frmOptions. 2016-06-08 10:16:45 -07:00
hiriumi
7ba5a3b8cd Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG.git 2016-06-08 10:07:56 -07:00
Sean Kaim
ae16c021da Remove XULRunner path from settings 2016-06-08 10:40:29 -04:00
Sean Kaim
70ff34438f Update component check for GeckoFx 2016-06-08 10:00:23 -04:00
Sean Kaim
b105585f5a Update Credits.txt 2016-06-07 16:12:16 -04:00
Sean Kaim
29c7859ea1 Replace XULRunner with GeckoFX 2016-06-07 15:43:44 -04:00
Sean Kaim
678194f4f7 minor code clean up 2016-06-07 10:41:56 -04:00
hiriumi
60353be2c0 Japanese translation 2016-06-06 07:05:35 -07:00
Sean Kaim
6410acbb48 minor tweaks to the port scan UI
This seems like a better user experience.  This will also allow for
further (future) changes in the import window when using custom ports
and have it make even more sense.
2016-06-05 14:55:31 -04:00
Sean Kaim
731c2e22b8 PortScan: Actually scan asynchronously
Speeds up the port scan signifigantly
2016-06-05 14:09:51 -04:00
Sean Kaim
cd950f39b4 refactor/cleanup + make portscan work
The non-import version of a portscan didn't test any ports and never
found any open ports (due to backwards logic).
2016-06-04 23:34:51 -04:00
Sean Kaim
8cbf56f7a5 Build FilteredPropertyGrid into mRemoteNG
No longer load the dll.
Makes the small amount of source more maintainable then from the code
project.
Gets rebuilt with latest build env.
2016-06-03 22:13:12 -04:00
David Sparer
17f986ea26 Few fixes for casting errors. These occurred due to commit e5f9fce01e 2016-06-03 15:56:15 -06:00
David Sparer
e5f9fce01e Cleaned up WindowPlacement class by moving native Win32 functions to the NativeMethods class 2016-06-03 15:53:11 -06:00
David Sparer
4c34a88a10 Cleaned up ProcessController tool by moving all native win32 methods to the NativeMethods class 2016-06-03 15:40:09 -06:00
David Sparer
324d34aa3c Moved the TreeImageType to the mRemoteNG.Tree namespace. Removed all references to the mRemoteNG.Images namespace, which no longer exists. 2016-06-03 15:24:01 -06:00
David Sparer
3f984fb65e Removed unused file (contained enum had no references) 2016-06-03 15:19:18 -06:00
David Sparer
c108c60c30 Merge branch 'release/v1.74' into develop 2016-06-03 15:11:44 -06:00
David Sparer
cf1a84f4b2 Resolved MR-855 - Resource not found error when testing proxy settings.
This was introduced in 634df366bd
2016-06-03 15:10:19 -06:00
hiriumi
350afcdb70 more Japanese translations 2016-06-03 12:01:20 -07:00
hiriumi
e5b319e518 Added question mark to MessageBox and more Japanese translation. 2016-06-02 17:07:45 -07:00
David Sparer
a43785d1f0 Small cleanup in Startup.cs 2016-06-02 15:29:24 -06:00
David Sparer
b90981a17c Made a couple more Startup methods non-static 2016-06-02 15:26:51 -06:00
David Sparer
47bbe20001 Startup: clean up some 'using' directives and sort them 2016-06-02 15:23:42 -06:00
David Sparer
668b9dd903 Refactored some Startup functions to their own class 2016-06-02 15:22:22 -06:00
David Sparer
6ca98149a7 Made Startup slightly less static 2016-06-02 15:21:30 -06:00
David Sparer
af2de33809 Forgot to save project when deleting the ApplicationEvents file... I do this a lot it seems. 2016-06-02 14:59:02 -06:00
Sean Kaim
737054873e Update Credits.txt 2016-06-02 16:46:23 -04:00
Sean Kaim
1dd0961a48 Just a comment... 2016-06-02 16:35:39 -04:00
David Sparer
3fcb6bcbd0 Removed unnecessary file. These functions were reimplemented in commit 996af9b268 2016-06-02 14:28:59 -06:00
David Sparer
53660cc7dc Merge branch 'release/v1.74' into develop 2016-06-02 13:49:21 -06:00
David Sparer
996af9b268 Fixed MR-852 - Option "Allow only a single instance of the application" non-functional 2016-06-02 13:47:04 -06:00
Sean Kaim
512044617c Last VB references removed 2016-06-02 15:45:47 -04:00
Sean Kaim
a91f712735 Remove more VB referneces 2016-06-02 14:35:12 -04:00
Sean Kaim
fb7a0fcb50 Remove VB references + fix exception 2016-06-02 14:34:56 -04:00
David Sparer
749ed5432b Merge branch 'release/v1.74' into develop 2016-06-01 11:17:10 -06:00
David Sparer
53be4c259e Fixed MR-847 - Renaming folder in connection tree does not update config panel name 2016-06-01 11:16:47 -06:00
Sean Kaim
e32630511d fix portable build
Move help files to proper location
Don't include unnecessary files
2016-06-01 10:51:02 -04:00
Sean Kaim
c9a6d69d6f README update 2016-05-31 22:38:37 -04:00
Sean Kaim
5a78a71316 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2016-05-31 21:07:47 -04:00
Sean Kaim
da9680d210 Minor form changes
Ported from PR #105
Thanks @aplocher
2016-05-31 21:06:56 -04:00
Sean Kaim
1ec37d657d Minor form changes
Ported from PR #105
2016-05-31 21:04:58 -04:00
Sean Kaim
99df3df42c avoid exception when disposing external tools items
Similar to #114
Thanks @Brandhor
2016-05-31 20:53:10 -04:00
David Sparer
1c83609971 Merge pull request #114 from Brandhor/exttools
External Tools Fixes
2016-05-31 17:59:55 -06:00
Brandon
32da8433bb avoid exception when disposing external tools items 2016-06-01 01:05:15 +02:00
Brandon
485536dc90 fix launching external tools 2016-06-01 00:46:14 +02:00
David Sparer
0b605ddb70 Merge branch 'release/v1.74' into develop 2016-05-31 16:24:32 -06:00
David Sparer
755d7b0742 Resolved MR-846 - help files not being copied with installer 2016-05-31 15:31:47 -06:00
Sean Kaim
15030ab7cb Release Portable Build script 2016-05-31 16:59:06 -04:00
hiriumi
a438d6c3c3 Merging Japanese translation 2016-05-31 09:33:24 -07:00
hiriumi
865a926047 saving Japanese translation. 2016-05-31 09:27:56 -07:00
Sean Kaim
a36ec166cf Initial 1.74 Changelog update 2016-05-31 12:27:06 -04:00
256 changed files with 7513 additions and 91009 deletions

6
.gitignore vendored
View File

@@ -279,3 +279,9 @@ Installer/Resources/License.rtf
Installer/Fragments/FilesFragment.wxs
Installer Projects/Installer/Resources/License.rtf
Installer Projects/Installer/Fragments/FilesFragment.wxs
Installer Projects/Installer/Fragments/HelpFilesFragment.wxs
InstallerProjects/Installer/Fragments/FilesFragment.wxs
InstallerProjects/Installer/Resources/License.rtf
# user preference: .editorconfig - http://editorconfig.org/
.editorconfig

View File

@@ -1,8 +1,117 @@
1.73 Beta 2 ():
1.75 Alpha 3 (2016-08-12):
Fixes:
------
MR-965, MR-871, MR-629: Error 264 on RDP Connect attempt - Added timeout value to Tools -> Options -> Connections
MR-946: Remove old/insecure SharpSSH and related components. Replace with SSH.NET for File Transfer Functionality
MR-896: Added prerequisite installer check for KB2574819. Prevents "Class not registered" errors when opening RDP connections.
PR-130: Fix Scan button width to fit russian translation
1.75 Alpha 2 (2016-08-03):
General Changes:
----------------
Updated GeckoFx pacakge
Updated DockPanelSuite library to 2.10 Final
Japanese translation updated
MR-942: Refactored code relating to loading the connections file
Features/Enhancements:
----------------------
MR-961, PR-133: Option to reconnect all currently opened connection tabs
MR-917: Improved cryptographic support
Fixes:
------
MR-910: Fixes to support Remote Desktop Gateways
MR-874: Incorrect RDP prerequisite check in installer
1.75 Alpha 1 (2016-07-08):
General Changes:
----------------
Additional code cleanup
Fixes:
------
MR-905: mRemoteNG crashes at startup (in FIPS policy check)
MR-902: mRemoteNG crashes after locking/unlocking the local system after loading a VNC connection
1.74 (2016-06-28):
Supported Platforms/Components:
-------------------------------
Windows 7 SP1 (with RDP Client v8: KB2592687/KB2923545) or later
.NET Framework 4 or later
XULRunner is no longer required for Gecko support (see below)
General Changes:
----------------
Converted source from Visual Basic to C Sharp
Lots of code refactoring/clean up/general stability changes
MR-714: Removed Keyboard shortcut functionality
- Introduced in 1.73 beta that was never officially released
- This caused stability issues
- May be re-added in a future release
- Removal does *NOT* impact the ability to send keyboard shortcuts to RDP sessions (when redirect key combinations is set to "yes")
MR-559: Removed RDP Sessions panel functionality. This required a library for which no trusted origin/source could be located
Removed a bunch of old code/libraries and replaced them accordingly
Security Updates:
-----------------
MR-775, MR-745: Updated PuTTY to 0.67
Features/Enhancements:
----------------------
Updated to latest DockPanelSuite and enabled a slick new theme!
MR-145: Installer is now MSI based
MR-255: Updated RDP Client to version 8
MR-389: Updates to IE rendering engine
- Support for latest version of IE (9-11)
- Dropped support for IE 7 & IE 8
MR-850: Replaced XULRunner with GeckoFx
- No need to manually configure to have the Gecko rendering engine available now
- Install image is now significantly larger due to the inclusion of the Gecko Engine
MR-821: Initial Japanese translation included
Port Scan is now Asynchronous (and is significantly faster)
Fixes:
------
MR-874: Added work-around to installer to ignore installation prerequisites
MR-884: Slow startup in some scnearios checking authenticode certificate
MR-872: Crash in External Tools when arguments aren't quoted
MR-854: crashes when right clicking on connection tab
MR-852: Option "Allow only a single instance of the application" non-functional
MR-836: Trying to delete a folder of connections only deletes 2 connections at a time
MR-824, MR-706: Suppress Script Errors when using the IE rendering engine
MR-822: Improve RDP error code messages
MR-640: Fixed Inheritance not working
MR-639: RDP: Connect to console session
MR-610, MR-582, MR-451: RDP: Protocol Error 3334 or exceptions with large number of connections open
- This problem appears largely resolved by most reports and testing
- Further workarounds/problem avoidance: Disable Bitmap Caching on all RDP session configuration
MR-429: Display issue on the Options -> Advanced panel
MR-385: Inheritance settings lost when moving item to the root of the tree
1.73 Beta 2 (NEVER RELEASED):
Fixed issue MR-619 - Keyboard shortcuts stop working after locking the screen with Win+L
Added support for importing files from PuTTY Connection Manager.
Improved the import and export functionality.
1.73 Beta 1 (2013-11-19):
Added feature MR-16 - Add keyboard shortcuts to switch between tabs
Added feature MR-141 - Add a default protocol option
@@ -19,7 +128,7 @@
Fixed issue MR-556 - Export fails when overwriting an existing file
Fixed issue MR-594 - Crash on startup if write access is denied to the IE browser emulation registry key
Fixed issue MR-603 - Some configuration options are still shown even when inheritance is enabled
Added "Reset" to config panel context menu to allow resetting some config settings to their default value.
MR-590: Added "Reset" to config panel context menu to allow resetting some config settings to their default value.
Added and improved menu icons.
Removed misleading log messages about RD Gateway support.
Removed invalid "Site" configuration option from PuTTY Saved Sessions.
@@ -27,10 +136,14 @@
Fixed config panel showing settings from previously loaded connection file after loading a new one.
Improved handling of variables in external tool arguments.
1.72 (2013-11-13):
Fixed issue MR-592 - Unable to run VBS script as an external tool
Fixed issue MR-596 - Incorrect escaping of quotation marks in external tool arguments
1.71 (2013-10-29):
Fixed issue MR-574 - Crash when retrieving RDP session list if eolwtscom.dll is not registered
Fixed issue MR-578 - Connections file is reset
@@ -40,12 +153,16 @@
Improved error reporting when loading connections files.
Removed warning message when mRemoteNG is started for the first time about new connections file being created.
1.71 Release Candidate 2 (2013-10-16):
Fixed issue MR-560 - Cannot Auto-Update With Open Connections: Unable to find an entry point named 'TaskDialogIndirect' in DLL 'ComCtl32'
Fixed issue MR-565 - Double Folder keep heritage on the initial Folder
Fixed issue MR-566 - Typo in German UI Automatic Update Settings
Fixed duplicated folders possibly being named "New Connection" instead of the original folder's name.
1.71 Release Candidate 1 (2013-10-01):
Fixed issue MR-495 - Having a negative range in port scan creates memory exhaustion.
Fixed issue MR-514 - Window Proxy test failed without close button
@@ -62,11 +179,15 @@
Added Chinese (Traditional) translation.
Added partial Greek and Hungarian translations.
1.71 Beta 5 (2013-06-09):
Fixed issue MR-491 - Could not start RDP Connection
Fixed issue MR-499 - TS Gateway is not working in latest release 1.71
Fixed typo in SQL queries.
1.71 Beta 4 (2013-05-28):
Added feature MR-435 - Add digital signature check to updater
Fixed issue MR-255 - The version of the RDP AX client should be updated to 7
@@ -98,6 +219,8 @@
Lowered required version of RDC from 6.1 to 6.0.
Updated VncSharpNG to 1.3.4896.25007.
1.71 Beta 3 (2013-03-20):
Fixed issue MR-397 - Putty disappears from the screen
Fixed issue MR-398 - Full Screen mode doesn't correctly make use of available space
@@ -109,6 +232,8 @@
Fixed the category names in the themes tab of the options dialog on Windows XP not showing correctly.
Fixed PuTTY saved sessions with spaces or special characters not being listed.
1.71 Beta 2 (2013-03-19):
Added feature MR-336 - Customizable background color for the windows/panels
Added feature MR-345 - Two separate options for confirming closure of Tabs and Connection Panels
@@ -124,6 +249,8 @@
Changed "Automatically get session information" to be disabled by default.
RDP connections can now be switched to full screen mode when redirect key combinations is enabled.
1.71 Beta 1 (2013-03-04):
Added feature MR-329 - Create Option to disable the "Quick: " prefix
Fixed issue MR-67 - Sort does not recursively sort
@@ -142,6 +269,8 @@
If RDC 7.0 or higher is installed, the connection bar is no longer briefly shown when connecting to an RDP connection with redirect key combinations enabled.
If RDC 8.0 or higher is installed, RDP connections automatically adjust their size when the window is resized or when toggling full screen mode.
1.70 (2013-03-07):
Fixed issue MR-339 - Connection group collapses with just one click
Fixed issue MR-340 - Object reference not set to an instance of an object.
@@ -150,11 +279,15 @@
Fixed issue MR-355 - Moving sub folders to top level causes property loss
Fixed tabs not closing on double-click when the active tab is a PuTTY connection.
1.70 Release Candidate 2 (2013-02-25):
Fixed issue MR-332 - Can't select different tab with one click after disconnecting existing tab
Fixed issue MR-338 - PuTTYNG crashing on fresh install of mRemoteNG
Re-enabled PuTTYNG integration enhancements on Windows 8
1.70 Release Candidate 1 (2013-02-22):
Fixed issue MR-183 - Error trying to save connections when using SQL - Invalid column name _parentConstantId
Fixed issue MR-225 - Tabs do not open in a panel until multiple panels are displayed.
@@ -168,6 +301,8 @@
Fixed "Decryption failed. Padding is invalid and cannot be removed." notification.
Fixed KiTTY opening in a separate window when using a saved session.
1.70 Beta 2 (2013-02-18):
Fixed issue MR-47 - Silent Installation Prompts for Language
Fixed issue MR-54 - Error When disconnecting from SSL channel RDP
@@ -210,6 +345,7 @@
Improved the use of Tab and Shift-Tab to cycle through entries in the Config grid.
Improved loading of XML files from older versions of mRemote/mRemoteNG.
1.70 Beta 1 (2012-02-27):
Fixed issue MR-77 - VerifyDatabaseVersion (Config.Connections.Save) failed. Version string portion was too short or too long.
Fixed issue MR-78 - Renaming Connections
@@ -234,6 +370,8 @@
Updated VncSharpNG to version 1.2.4440.36644.
Added debugging symbols for VncSharpNG.
1.69 (2011-12-09):
Fixed issue #66 - Fresh Install Fails to Create Config
Fixed issue #69 - Connection file gets erased
@@ -245,11 +383,15 @@
Binaries are now digitally signed
Added Credits, License, and Version History items to the Start Menu and made Start Menu item names localizable.
1.68 (2011-07-07):
Fixed issue #48 - VerifyDatabaseVersion fails with new (empty) database tables.
Fixed issue #60 - Can't save connections file
Fixed issue #62 - Connection file error upon launch.
1.67 (2011-06-05):
Fixed migration of external tools configuration and panel layout from Local to Roaming folder.
Disable ICA Hotkeys for Citrix connections. Fixes issue with international users.
@@ -281,9 +423,13 @@
Fixed tab order of controls in Options dialog.
Fixed bug 45 - Changing some settings in the config file may not save.
1.66 (2011-05-02):
Fixed connections not working
1.65 (2011-05-02):
Fixed Ctrl-Tab and Ctrl-Shift-Tab not working in any other applications while mRemoteNG is running
Ctrl-Tab and Ctrl-Shift-Tab no longer work to switch tabs within mRemoteNG
@@ -291,6 +437,8 @@
Fixed bug 38 - Application uses the wrong Application Data settings folder (in Local Settings)
Added code to the installer to check that the user is in the 'Power Users' or 'Administrators' group
1.64 (2011-04-27):
Fixed bug 6 - VNC CTRL+key & keyboard combo mappings are broken
Fixed bug 12 - Tab switch is not working in config panel
@@ -310,6 +458,8 @@
Updated DockPanel Suite to version 2.5 RC1
Updated VNCSharpNG to correct Ctrl and Alt key pass-through behavior
1.63 (2010-02-02):
New icon and logo
Fixed problems moving or resizing the main window while PuTTY (SSH/telnet/rlogin/raw) connections are open
@@ -325,6 +475,8 @@
Popups can now be allowed in Internet Explorer by holding Ctrl+Alt when clicking a link
Added PuTTY Settings item to tab context menu
1.62 (2010-01-19):
Switched to VncSharp, an open source VNC component
VNC is supported again except for the following features:
@@ -341,10 +493,14 @@
Added RDP, VNC and ICA version numbers to Components Check page
Fixed a bug with the inheritance buttons on the Config panel disappearing after awhile
1.61 (2010-01-14):
Removed unlicensed SmartCode Solutions ViewerX VNC Viewer ActiveX
This version of mRemoteNG does not support VNC
1.60 (2010-01-09):
Changed name to mRemoteNG
Fixed menu bar not staying docked to left side
@@ -357,6 +513,8 @@
Moved Check for Updates to the Help menu
Changed website links in Help menu and About page to load within mRemoteNG instead of launching an external browser
-----
1.50:
Added the following formats to the "Save Connections As" function:
mRemote CSV (standard CSV file with all properties)

View File

@@ -1,20 +1,29 @@
Contributors
============
Current mRemoteNG dev team:
David Sparer (github.com/sparerd)
Hayato Iriumi (github.com/hiriumi)
Sean Kaim (github.com/kmscode)
Felix Deimel - mRemote original developer
Riley McArdle - mRemoteNG original developer
Past Contributors
=================
Jason Barbier
Wiktor Beryt
Lionel Caignec
Ruben d'Arco
Felix Deimel
Holger Henke
Tom Hiller
Riley McArdle
Apisitt Rattana
Andreas Rehm
David Vidmar
David Sparer
Hayato Iriumi
Sean Kaim
github.com/Brandhor
github.com/Kvarkas
Translators
@@ -24,6 +33,8 @@ Eugenio "Ryo567" Mart
Mathieu Pape
Emanuel Silva
Robert Siwiec
Hayato Iriumi
Sebastien Thieury (github.com/SebThieu)
Included Source Code
@@ -34,15 +45,18 @@ Copyright
MIT License
http://www.codeproject.com/KB/recipes/command_line.aspx
DotNetVer
Copyright <20> 2010 David Grinberg
Copyright <20> 2010-2011 Brandon Hansen
http://nsis.sourceforge.net/DotNetVer
FilteredPropertyGrid
Copyright <20> 2006 Azuria
http://www.codeproject.com/KB/cs/FilteredPropertyGrid.aspx
Hotkey Selection Control for .NET
Copyright <20> 2006 Thomas Backman
http://www.codeproject.com/Articles/15085/A-simple-hotkey-selection-control-for-NET
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
@@ -56,24 +70,15 @@ Copyright
Copyright <20> 2008 Felix Deimel
http://www.codeproject.com/KB/selection/ADPickerCtrl.aspx
DiffieHellman 1.0
Copyright <20> 2003 The Mentalis.org Team
Modified New BSD License
http://www.mentalis.org/
DockPanel Suite 2.3.1
Copyright <20> 2007 Weifen Luo
DockPanel Suite 2.10.0.beta2
Copyright <20> 2015 @roken and @lextm (formerly Weifen Luo)
MIT License
http://sourceforge.net/projects/dockpanelsuite/
https://github.com/dockpanelsuite/dockpanelsuite
FilteredPropertyGrid 1.0.0.0
Copyright <20> 2006 Azuria
http://www.codeproject.com/KB/cs/FilteredPropertyGrid.aspx
GeckoFX 1.8.1.4
Copyright <20> 2008 Skybound Software
Mozilla Public License 1.1
http://www.geckofx.org/
GeckoFX 45
Copyright <20> 2016 Tom Hindle
Mozilla Public License
https://bitbucket.org/geckofx/
log4net 1.2.15.0
Copyright <20> 2001-2015 The Apache Software Foundation
@@ -85,32 +90,22 @@ Copyright
Freely redistributable with attribution
http://www.dotnetmagic.com/magic_download.html
Mentalis.org Security Library 1.0.13.715
Copyright <20> 2002-2005 The Mentalis.org Team
Modified New BSD License
http://www.mentalis.org/
MiniGeckoBrowser 1.0
Copyright <20> 2008 Felix Deimel
http://www.appjuice.org/
PuTTY 0.67
Copyright <20> 1997-2016 Simon Tatham
MIT License
http://www.chiark.greenend.org.uk/~sgtatham/putty/
SharpSSH 1.1.1.13
Copyright <20> 2002-2008 Atsuhiko Yamanaka, JCraft, Inc.
Copyright <20> 2007 Tamir Gal
BSD Style License
http://www.tamirgal.com/blog/page/SharpSSH.aspx
Silk Icon Set
Copyright <20> 2005-2008 FAMFAMFAM
Creative Commons Attribution 2.5 License
http://www.famfamfam.com/
VncSharp 1.0
SSH.NET v2016.0.0
Copyright <20> 2016
MIT License
https://github.com/sshnet/SSH.NET
VncSharp 1.1
Copyright <20> 2004-2009 David Humphrey
GNU General Public License (GPL) Version 2
http://cdot.senecac.on.ca/projects/vncsharp/
https://github.com/humphd/VncSharp

View File

@@ -1,60 +0,0 @@
using Microsoft.Deployment.WindowsInstaller;
namespace CustomActions
{
public class CustomActions
{
[CustomAction]
public static ActionResult IsKBInstalled(Session session)
{
session.Log("Begin IsKBInstalled");
string kb = session["KB"];
session.Log("Checking if '{0}' is installed", kb);
InstalledWindowsUpdateGatherer updateGatherer = new InstalledWindowsUpdateGatherer();
bool isUpdateInstalled = updateGatherer.IsUpdateInstalled(kb);
session.Log("KB is installed = '{0}'", isUpdateInstalled);
if (isUpdateInstalled)
{
session[kb] = "1";
session.Log("Set property '{0}' to '1'", kb);
}
else
{
session[kb] = "0";
session.Log("Set property '{0}' to '0'", kb);
}
session.Log("End IsKBInstalled");
return ActionResult.Success;
}
[CustomAction]
public static ActionResult IsLegacyVersionInstalled(Session session)
{
session.Log("Begin IsLegacyVersionInstalled");
UninstallNSISVersions uninstaller = new UninstallNSISVersions();
if (uninstaller.IsLegacymRemoteNGInstalled())
{
session["LEGACYVERSIONINSTALLED"] = "1";
}
else
{
session["LEGACYVERSIONINSTALLED"] = "0";
}
session.Log("End IsLegacyVersionInstalled");
return ActionResult.Success;
}
[CustomAction]
public static ActionResult UninstallLegacyVersion(Session session)
{
session.Log("Begin UninstallLegacyVersion");
UninstallNSISVersions uninstaller = new UninstallNSISVersions();
string uninstallString = uninstaller.GetLegacyUninstallString();
uninstaller.UninstallLegacyVersion(true);
session.Log("End UninstallLegacyVersion");
return ActionResult.Success;
}
}
}

View File

@@ -1,54 +0,0 @@
using System;
using System.Management;
using System.Collections;
namespace CustomActions
{
public class InstalledWindowsUpdateGatherer
{
private ManagementScope _managementScope;
private ManagementClass _managementClass;
public InstalledWindowsUpdateGatherer()
{
_managementScope = Connect();
_managementClass = new ManagementClass("Win32_QuickFixEngineering");
}
public ManagementScope Connect()
{
try
{
return new ManagementScope(@"root\cimv2");
}
catch (ManagementException e)
{
Console.WriteLine("Failed to connect", e.Message);
throw;
}
}
public ArrayList GetInstalledUpdates()
{
string query = "SELECT * FROM Win32_QuickFixEngineering";
ArrayList installedUpdates = new ArrayList();
ManagementObjectSearcher searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
foreach(ManagementObject queryObj in searcher.Get())
{
installedUpdates.Add(queryObj["HotFixID"]);
}
return installedUpdates;
}
public bool IsUpdateInstalled(string KB)
{
bool updateIsInstalled = false;
string query = string.Format("SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID='{0}'", KB);
ManagementObjectSearcher searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
if (searcher.Get().Count > 0)
updateIsInstalled = true;
return updateIsInstalled;
}
}
}

View File

@@ -1,81 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
using System.Diagnostics;
using System.IO;
namespace CustomActions
{
public class UninstallNSISVersions
{
private const string REGISTRY_PATH = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
private const string REGISTRY_PATH_Wow6432 = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
private RegistryKey _activeRegistryPath;
public UninstallNSISVersions()
{
GetLegacymRemoteNGRegistryKeyPath();
}
public void UninstallLegacyVersion(bool Silent = false)
{
if (!IsLegacymRemoteNGInstalled())
return;
string uninstallString = GetLegacyUninstallString();
string forceNonTempUninstaller = string.Format("_?={0}", uninstallString.Replace("Uninstall.exe", "").Replace(@"""", ""));
string silentUninstall = "";
if (Silent)
{
silentUninstall = "/S";
}
ProcessStartInfo processStartInfo = new ProcessStartInfo(uninstallString);
processStartInfo.UseShellExecute = true;
processStartInfo.Arguments = string.Format("{0} {1}", forceNonTempUninstaller, silentUninstall);
Process uninstallProcess = Process.Start(processStartInfo);
while (uninstallProcess.HasExited == false)
{
Debug.WriteLine("Waiting for uninstaller to exit");
}
}
public bool IsLegacymRemoteNGInstalled()
{
return (_activeRegistryPath != null);
}
public string GetLegacyUninstallString()
{
if (IsLegacymRemoteNGInstalled())
return _activeRegistryPath.GetValue("UninstallString").ToString();
return "";
}
private void GetLegacymRemoteNGRegistryKeyPath()
{
GetUninstallKeyPath();
GetUninstallKeyPath6432();
}
private void GetUninstallKeyPath()
{
try
{
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH);
}
catch (Exception ex)
{ }
}
private void GetUninstallKeyPath6432()
{
try
{
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH_Wow6432);
}
catch (Exception ex)
{ }
}
}
}

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include $(sys.CURRENTDIR)Includes\Config.wxi?>
<Fragment>
<CustomAction Id="SetRDP80KBValue" Return="check" Execute="immediate" Property="KB" Value="$(var.RDP80KB)" />
<CustomAction Id="CheckIfRDP80Installed" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsKBInstalled" />
</Fragment>
<Fragment>
<CustomAction Id="SetRDP81KBValue" Return="check" Execute="immediate" Property="KB" Value="$(var.RDP81KB)" />
<CustomAction Id="CheckIfRDP81Installed" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsKBInstalled" />
</Fragment>
</Wix>

View File

@@ -0,0 +1,52 @@
using Microsoft.Deployment.WindowsInstaller;
namespace CustomActions
{
public class CustomActions
{
[CustomAction]
public static ActionResult IsMinimumRdpVersionInstalled(Session session)
{
var rdpVersionChecker = new InstalledKbChecker("MINIMUM_RDP_KB", "MINIMUM_RDP_VERSION_INSTALLED", session);
rdpVersionChecker.Execute();
return ActionResult.Success;
}
[CustomAction]
public static ActionResult IsRdpDtlsUpdateInstalled(Session session)
{
var rdpVersionChecker = new InstalledKbChecker("RDP_DTLS_KB", "RDP_DTLS_UPDATE_INSTALLED", session);
rdpVersionChecker.Execute();
return ActionResult.Success;
}
[CustomAction]
public static ActionResult IsLegacyVersionInstalled(Session session)
{
session.Log("Begin IsLegacyVersionInstalled");
var uninstaller = new UninstallNsisVersions();
if (uninstaller.IsLegacymRemoteNgInstalled())
{
session["LEGACYVERSIONINSTALLED"] = "1";
}
else
{
session["LEGACYVERSIONINSTALLED"] = "0";
}
session.Log("End IsLegacyVersionInstalled");
return ActionResult.Success;
}
[CustomAction]
public static ActionResult UninstallLegacyVersion(Session session)
{
session.Log("Begin UninstallLegacyVersion");
var uninstaller = new UninstallNsisVersions();
uninstaller.GetLegacyUninstallString();
uninstaller.UninstallLegacyVersion(true);
session.Log("End UninstallLegacyVersion");
return ActionResult.Success;
}
}
}

View File

@@ -47,7 +47,8 @@
<Compile Include="CustomActions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="InstalledWindowsUpdateGatherer.cs" />
<Compile Include="UninstallNSISVersions.cs" />
<Compile Include="InstalledKbChecker.cs" />
<Compile Include="UninstallNsisVersions.cs" />
<Content Include="CustomAction.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -0,0 +1,53 @@
using System;
using Microsoft.Deployment.WindowsInstaller;
namespace CustomActions
{
public class InstalledKbChecker
{
private readonly Session _session;
private readonly string _kbVariable;
private readonly string _returnVar;
public InstalledKbChecker(string kbVariable, string returnVar, Session session)
{
_kbVariable = kbVariable;
_returnVar = returnVar;
_session = session;
}
public bool Execute()
{
try
{
_session.Log("Begin InstalledKbChecker");
var minimumKb = _session[_kbVariable];
var isUpdateInstalled = IsUpdateInstalled(minimumKb);
SetReturnValue(isUpdateInstalled);
_session.Log("End InstalledKbChecker");
return true;
}
catch (Exception e)
{
_session.Log($"There was an issue executing the RdpVersionChecker. Exception: {e}");
return false;
}
}
private bool IsUpdateInstalled(string kb)
{
_session.Log($"Checking if '{kb}' is installed");
var updateGatherer = new InstalledWindowsUpdateGatherer();
var isUpdateInstalled = updateGatherer.IsUpdateInstalled(kb);
_session.Log($"KB is installed = '{isUpdateInstalled}'");
return isUpdateInstalled;
}
private void SetReturnValue(bool isUpdateInstalled)
{
var updateInstalledVal = isUpdateInstalled ? "1" : "0";
_session[_returnVar] = updateInstalledVal;
_session.Log($"Set property '{_returnVar}' to '{updateInstalledVal}'");
}
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Management;
using System.Collections;
namespace CustomActions
{
public class InstalledWindowsUpdateGatherer
{
private readonly ManagementScope _managementScope;
public InstalledWindowsUpdateGatherer()
{
_managementScope = Connect();
}
public ManagementScope Connect()
{
try
{
return new ManagementScope(@"root\cimv2");
}
catch (ManagementException e)
{
Console.WriteLine($"Failed to connect: {e.Message}");
throw;
}
}
public ArrayList GetInstalledUpdates()
{
const string query = "SELECT * FROM Win32_QuickFixEngineering";
var installedUpdates = new ArrayList();
var searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
foreach(var o in searcher.Get())
{
var queryObj = (ManagementObject) o;
installedUpdates.Add(queryObj["HotFixID"]);
}
return installedUpdates;
}
public bool IsUpdateInstalled(string kb)
{
var updateIsInstalled = false;
var query = $"SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID='{kb}'";
var searcher = new ManagementObjectSearcher(_managementScope, new ObjectQuery(query));
if (searcher.Get().Count > 0)
updateIsInstalled = true;
return updateIsInstalled;
}
}
}

View File

@@ -0,0 +1,83 @@
using System;
using Microsoft.Win32;
using System.Diagnostics;
namespace CustomActions
{
public class UninstallNsisVersions
{
private const string RegistryPath = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
private const string RegistryPathWow6432 = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\mRemoteNG";
private RegistryKey _activeRegistryPath;
public UninstallNsisVersions()
{
GetLegacymRemoteNgRegistryKeyPath();
}
public void UninstallLegacyVersion(bool silent = false)
{
if (!IsLegacymRemoteNgInstalled())
return;
var uninstallString = GetLegacyUninstallString();
var forceNonTempUninstaller = $"_?={uninstallString.Replace("Uninstall.exe", "").Replace(@"""", "")}";
var silentUninstall = "";
if (silent)
{
silentUninstall = "/S";
}
var processStartInfo = new ProcessStartInfo(uninstallString)
{
UseShellExecute = true,
Arguments = $"{forceNonTempUninstaller} {silentUninstall}"
};
var uninstallProcess = Process.Start(processStartInfo);
while (uninstallProcess != null && uninstallProcess.HasExited == false)
{
Debug.WriteLine("Waiting for uninstaller to exit");
}
}
public bool IsLegacymRemoteNgInstalled()
{
return (_activeRegistryPath != null);
}
public string GetLegacyUninstallString()
{
return IsLegacymRemoteNgInstalled() ? _activeRegistryPath.GetValue("UninstallString").ToString() : "";
}
private void GetLegacymRemoteNgRegistryKeyPath()
{
GetUninstallKeyPath();
GetUninstallKeyPath6432();
}
private void GetUninstallKeyPath()
{
try
{
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(RegistryPath);
}
catch (Exception)
{
// ignored
}
}
private void GetUninstallKeyPath6432()
{
try
{
_activeRegistryPath = Registry.LocalMachine.OpenSubKey(RegistryPathWow6432);
}
catch (Exception)
{
// ignored
}
}
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include $(sys.CURRENTDIR)Includes\Config.wxi?>
<Fragment>
<CustomAction Id="CheckIfMinimumRdpInstalled" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsMinimumRdpVersionInstalled" />
</Fragment>
<Fragment>
<CustomAction Id="CheckIfRdpDtlsUpdateInstalled" Return="check" Execute="immediate" BinaryKey="CustomActions.CA.dll" DllEntry="IsRdpDtlsUpdateInstalled" />
</Fragment>
</Wix>

View File

@@ -8,13 +8,13 @@ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, '.pdb')]" use="@Id" />
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, '.xml')]" use="@Id" />
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'app.config')]" use="@Id" />
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'vshost')]" use="@Id" />
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'manifest')]" use="@Id" />
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, '.application')]" use="@Id" />
<xsl:key name="service-search" match="wix:Component[wix:File/@Source = '$(var.HarvestPath)\mRemoteNG.exe']" use="@Id" />
<xsl:key name="service-search" match="wix:Component[wix:File/@Source = '$(var.HarvestPath)\PuTTYNG.exe']" use="@Id" />
<xsl:template match="wix:Component[key('service-search', @Id)]" />
<xsl:template match="wix:ComponentRef[key('service-search', @Id)]" />
</xsl:stylesheet>

View File

@@ -4,7 +4,8 @@
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="$(var.ProductName)" />
<Directory Id="APPLICATIONROOTDIRECTORY" Name="$(var.ProductName)">
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="!(loc.Folders_Desktop)" />

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="C.PuttyNGFile" Guid="*">
<File Id="PuttyNGFile" Name="PuTTYNG.exe" Source="Dependencies\PuTTYNG.exe" KeyPath="yes" />
<File Id="PuttyNGFile" Name="PuTTYNG.exe" Source="$(var.HarvestPath)\PuTTYNG.exe" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>

View File

@@ -16,8 +16,11 @@
<?define RequiredDotNetFrameworkMinorVersion = "0" ?>
<?define RequiredDotNetFrameworkServicePackLevel = "" ?>
<?define RequiredDotNetFrameworkVersion = "$(var.RequiredDotNetFrameworkMajorVersion).$(var.RequiredDotNetFrameworkMinorVersion)" ?>
<?define RDP80KB = "KB2592687" ?>
<?define RDP81KB = "KB2923545" ?>
<?define Rdp80Kb = "KB2592687" ?>
<?define Rdp81Kb = "KB2923545" ?>
<?define MinimumRdpKb = $(var.Rdp80Kb) ?>
<?define RdpDtlsKb = "KB2574819" ?>
<?define IGNOREPREREQUISITES = 0 ?>
<?if $(var.Platform) = x64 ?>
<?define ProductNameWithPlatform = "$(var.ProductName) (64 bit)" ?>

View File

@@ -98,22 +98,46 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<LinkerAdditionalOptions>
</LinkerAdditionalOptions>
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release;</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>REM Harvest bin directory of the mRemoteV1 project
call "$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag -dr APPLICATIONROOTDIRECTORY -var var.HarvestPath -srd -cg MandatoryComponents -template fragment -out "$(ProjectDir)Fragments\FilesFragment.wxs" -t "$(ProjectDir)Filters\Harvest_Filter.xslt" -v
REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the installer GUI
call "$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
<Cultures>en-US</Cultures>
<SuppressPdbOutput>True</SuppressPdbOutput>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<Cultures>en-US</Cultures>
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Debug;</DefineConstants>
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Debug;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug Portable|x86' ">
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Debug Portable;</DefineConstants>
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Debug Portable;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Portable|x86' ">
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release Portable;</DefineConstants>
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release Portable;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>REM Clean the TargetDir
rmdir /S /Q "$(TargetDir)"
echo $(ConfigurationName) &gt; buildenv.tmp
REM Harvest bin directory of the mRemoteV1 project
call "$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag -dr APPLICATIONROOTDIRECTORY -var var.HarvestPath -srd -cg MandatoryComponents -template fragment -out "$(ProjectDir)Fragments\FilesFragment.wxs" -t "$(ProjectDir)Filters\Harvest_Filter.xslt" -v
REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the installer GUI
call "$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>set /p buildenv=&lt;buildenv.tmp
REM Sign MSI
IF EXIST C:\mRemoteNG_code_signing_cert.pfx (
IF %25buildenv: Portable=%25==Release (
powershell "&amp;""$(SolutionDir)Tools\signfiles.ps1""" %27%25cd%25%27
)
)
REM Rename MSI to include version number
powershell -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\rename_installer_with_version.ps1" $(SolutionDir)
REM Copy MSI to Release folder
IF %25buildenv: Portable=%25==Release (powershell -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\copy_release_installer.ps1" $(TargetDir) $(SolutionDir)Release)</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -7,6 +7,7 @@
<String Id="Install_NeedDotNetFrameworkVersion">mRemoteNG requires Microsoft .NET Framework [REQUIREDDOTNETFRAMEWORKVERSION] or higher.</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_RDPDtlsRequirement">mRemoteNG requires KB2574819 in order to create RDP connections. Windows 7 users will need to install this KB.</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 -->

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 451 KiB

View File

@@ -9,22 +9,27 @@
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="!(loc.Upgrade_NewerVersionInstalled)" Schedule="afterInstallExecute" />
<MediaTemplate EmbedCab="yes" />
<Binary Id="CustomActions.CA.dll" SourceFile="$(var.SolutionDir)Installer Projects\CustomActions\bin\$(var.Configuration)\CustomActions.CA.dll" />
<Binary Id="CustomActions.CA.dll" SourceFile="$(var.SolutionDir)InstallerProjects\CustomActions\bin\$(var.Configuration)\CustomActions.CA.dll" />
<Property Id="ARPPRODUCTICON" Value="mRemoteNG.ico" />
<Property Id="ARPHELPLINK" Value="http://www.mremoteng.org" />
<Property Id="MAINEXE" Value="$(var.ExeProcessName)" />
<Property Id="APPLICATIONROOTDIRECTORY">
<RegistrySearch Id='mRemoteNGRegistry' Type='raw' Root='HKLM' Key='Software\mRemoteNG' Name='InstallDir' />
</Property>
<Property Id='RDP_DTLS_KB' Value='$(var.RdpDtlsKb)' />
<Property Id='RDP_DTLS_UPDATE_INSTALLED' Value='0' Secure='yes' />
<Property Id='MINIMUM_RDP_KB' Value='$(var.MinimumRdpKb)' />
<Property Id='MINIMUM_RDP_VERSION_INSTALLED' Value='0' Secure='yes' />
<Property Id='REQUIREDDOTNETFRAMEWORKVERSION' Value='$(var.RequiredDotNetFrameworkVersion)' />
<Property Id='LEGACYVERSIONINSTALLED' Value='0' />
<PropertyRef Id="NETFRAMEWORK40FULL" />
<PropertyRef Id="WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED" />
<Icon Id="mRemoteNG.ico" SourceFile="Resources\mRemoteNG.ico" />
<InstallUISequence>
<Custom Action="SetRDP80KBValue" After="AppSearch" />
<Custom Action="CheckIfRDP80Installed" After="SetRDP80KBValue">(NOT Installed) AND (VersionNT = 601 OR VersionNT64 = 601)</Custom>
<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>
@@ -37,19 +42,23 @@
</Condition>
<!-- Windows 7 or higher required -->
<Condition Message="!(loc.Install_OSVersionRequirement)">
<![CDATA[Installed OR (VersionNT >= 601) OR (VersionNT64 >= 601)]]>
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 601) OR (VersionNT64 >= 601)]]>
</Condition>
<!-- If Windows 7, SP 1 is required -->
<Condition Message="!(loc.Install_Win7RequiresSP1)">
<![CDATA[Installed OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND ServicePackLevel >= 1)]]>
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND ServicePackLevel >= 1)]]>
</Condition>
<!-- .Net Framework Version Condition -->
<Condition Message="!(loc.Install_NeedDotNetFrameworkVersion)">
<![CDATA[Installed OR WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED = 1]]>
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED = 1]]>
</Condition>
<!-- If Win7, require RDP DTLS update (KB2574819) -->
<Condition Message="!(loc.Install_RDPDtlsRequirement)">
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (RDP_DTLS_UPDATE_INSTALLED = 1))]]>
</Condition>
<!-- If Win7, require RDP 8.0 update (KB2592687) -->
<Condition Message="!(loc.Install_RDP80Requirement)">
<![CDATA[Installed OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) ]]>AND ($(var.RDP80KB) = 1 OR $(var.RDP81KB) = 1))
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND (MINIMUM_RDP_VERSION_INSTALLED = 1))]]>
</Condition>
@@ -71,7 +80,6 @@
<Feature Id="F.ApplicationStartMenuShortcut" Title="!(loc.Feature_StartMenuShortcut)" Absent="allow" AllowAdvertise="no" Level="1">
<ComponentRef Id="C.ApplicationStartMenuShortcut" Primary="yes" />
</Feature>
</Feature>

41
Jenkinsfile vendored
View File

@@ -1,44 +1,27 @@
node('windows') {
def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
def vsToolsDir = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools"
def vsExtensionsDir = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow"
stage 'Checkout Branch'
def gitUrl = "https://github.com/mRemoteNG/mRemoteNG.git"
def branchName = GetBranchName()
echo "BranchName: ${branchName}"
git([url: gitUrl, branch: branchName])
checkout([
$class: 'GitSCM',
branches: scm.branches,
userRemoteConfigs: scm.userRemoteConfigs
])
stage 'Restore NuGet Packages'
def nugetPath = "C:\\nuget.exe"
bat "${nugetPath} restore ${solutionFilePath}"
stage 'Build mRemoteNG (Normal)'
bat "\"${vsToolsDir}\\VsDevCmd.bat\" && msbuild.exe /nologo \"${jobDir}\\mRemoteV1.sln\""
bat "\"${vsToolsDir}\\VsDevCmd.bat\" && msbuild.exe /nologo /p:Platform=x86 \"${jobDir}\\mRemoteV1.sln\""
stage 'Build mRemoteNG (Portable)'
bat "\"${vsToolsDir}\\VsDevCmd.bat\" && msbuild.exe /nologo /p:Configuration=\"Debug Portable\" \"${jobDir}\\mRemoteV1.sln\""
bat "\"${vsToolsDir}\\VsDevCmd.bat\" && msbuild.exe /nologo /p:Configuration=\"Debug Portable\";Platform=x86 \"${jobDir}\\mRemoteV1.sln\""
stage 'Run Unit Tests'
def nunitTestAdapterPath = "C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\VisualStudio\\14.0\\Extensions"
bat "\"${vsToolsDir}\\VsDevCmd.bat\" && VSTest.Console.exe /TestAdapterPath:${nunitTestAdapterPath} \"${jobDir}\\mRemoteNGTests\\bin\\debug\\mRemoteNGTests.dll\""
}
def GetBranchName() {
def jobDir = pwd()
echo "JobDir: ${jobDir}"
def patternToUse = GetPatternToMatchBranchNameFromDirectory()
echo "PatternToUse: ${patternToUse}"
java.util.regex.Matcher matcher = jobDir =~ patternToUse
echo "Ran the matcher"
matcher ? matcher[0][1] : null
}
def GetPatternToMatchBranchNameFromDirectory() {
def patternToUse = ""
def folderSeparator = ""
def branchNamePattern = "[a-zA-Z0-9\\-_]*"
def jenkinsJobInfoTag = "@*[0-9]*"
echo "isUnix: ${isUnix()}"
if (isUnix()) {
folderSeparator = "/"
} else {
folderSeparator = "\\\\"
}
patternToUse = "${folderSeparator}(${branchNamePattern})(${jenkinsJobInfoTag})\$"
patternToUse
}

View File

@@ -1,296 +0,0 @@
; ---------------------
; DotNetVer.nsh
; Written by: David Grinberg
; Homepage: http://ontheperiphery.veraida.com/
; Updated By: Brandon Hansen (http://www.remotehams.com/)
; ---------------------
;
; LogicLib extensions for checking Microsoft .NET Framework versions and service packs.
;
; Latests Updates by Brandon Hansen, KG6YPI (RemoteHams.com)
; Dec 26, 2011 - .NET Framework 4.0 detection fixes - client profile not being found
; Dec 07, 2010 - .NET Framework 4.0 detection added by Brandon Hansen (KG6YPI)
;
; Usage examples:
;
; ${If} ${HasDotNet4.0}
; DetailPrint "Microsoft .NET Framework 4.0 installed."
; ${If} ${DOTNETVER_4_0} AtLeastDotNetServicePack 1
; DetailPrint "Microsoft .NET Framework 4.0 is at least SP1."
; ${Else}
; DetailPrint "Microsoft .NET Framework 4.0 SP1 not installed."
; ${EndIf}
; ${If} ${DOTNETVER_4_0} HasDotNetClientProfile 1
; DetailPrint "Microsoft .NET Framework 4.0 (Client Profile) available."
; ${EndIf}
; ${If} ${DOTNETVER_4_0} HasDotNetFullProfile 1
; DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) available."
; ${EndIf}
; ${If} ${DOTNETVER_4_0} HasDotNetFullProfile 0
; DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) not available."
; ${EndIf}
; ${EndIf}
!verbose push
!verbose 3
!ifndef ___DOTNETVER__NSH___
!define ___DOTNETVER__NSH___
!include LogicLib.nsh
!include Util.nsh
# constants
!define DOTNETVER_1_0 "1.0"
!define DOTNETVER_1_1 "1.1"
!define DOTNETVER_2_0 "2.0"
!define DOTNETVER_3_0 "3.0"
!define DOTNETVER_3_5 "3.5"
!define DOTNETVER_4_0 "4.0"
# variable declaration
Var /GLOBAL __DONTNET_FOUNDVER
!macro __DotNetVer_DeclareVars
!ifndef __DOTNETVER_VARS_DECLARED
!define __DOTNETVER_VARS_DECLARED
Var /GLOBAL __DOTNET_1.0
Var /GLOBAL __DOTNET_1.1
Var /GLOBAL __DOTNET_2.0
Var /GLOBAL __DOTNET_3.0
Var /GLOBAL __DOTNET_3.5
Var /GLOBAL __DOTNET_4.0
Var /GLOBAL __DOTNETVER_1.0_SP
Var /GLOBAL __DOTNETVER_1.1_SP
Var /GLOBAL __DOTNETVER_2.0_SP
Var /GLOBAL __DOTNETVER_3.0_SP
Var /GLOBAL __DOTNETVER_3.5_SP
Var /GLOBAL __DOTNETVER_4.0_SP
Var /GLOBAL __DOTNET_1.0_CLIENT
Var /GLOBAL __DOTNET_1.1_CLIENT
Var /GLOBAL __DOTNET_2.0_CLIENT
Var /GLOBAL __DOTNET_3.0_CLIENT
Var /GLOBAL __DOTNET_3.5_CLIENT
Var /GLOBAL __DOTNET_4.0_CLIENT
Var /GLOBAL __DOTNET_1.0_FULL
Var /GLOBAL __DOTNET_1.1_FULL
Var /GLOBAL __DOTNET_2.0_FULL
Var /GLOBAL __DOTNET_3.0_FULL
Var /GLOBAL __DOTNET_3.5_FULL
Var /GLOBAL __DOTNET_4.0_FULL
StrCpy $__DOTNET_1.0 0
StrCpy $__DOTNET_1.1 0
StrCpy $__DOTNET_2.0 0
StrCpy $__DOTNET_3.0 0
StrCpy $__DOTNET_3.5 0
StrCpy $__DOTNET_4.0 0
StrCpy $__DOTNETVER_1.0_SP 0
StrCpy $__DOTNETVER_1.1_SP 0
StrCpy $__DOTNETVER_2.0_SP 0
StrCpy $__DOTNETVER_3.0_SP 0
StrCpy $__DOTNETVER_3.5_SP 0
StrCpy $__DOTNETVER_4.0_SP 0
StrCpy $__DOTNET_1.0_CLIENT 0
StrCpy $__DOTNET_1.1_CLIENT 0
StrCpy $__DOTNET_2.0_CLIENT 0
StrCpy $__DOTNET_3.0_CLIENT 0
StrCpy $__DOTNET_3.5_CLIENT 0
StrCpy $__DOTNET_4.0_CLIENT 0
StrCpy $__DOTNET_1.0_FULL 0
StrCpy $__DOTNET_1.1_FULL 0
StrCpy $__DOTNET_2.0_FULL 0
StrCpy $__DOTNET_3.0_FULL 0
StrCpy $__DOTNET_3.5_FULL 0
StrCpy $__DOTNET_4.0_FULL 0
!endif
!macroend
# lazy initialization macro
!macro __DotNetVer_InitVars
# only calculate version once
StrCmp $__DONTNET_FOUNDVER "" dotnetver.noveryet
Return
dotnetver.noveryet:
!insertmacro __DotNetVer_DeclareVars
Push $0 ;registry count
Push $1 ;registry key
Push $2 ;version number
Push $3 ;installed
Push $4 ;service pack number
Push $8 ;strLen helper var
StrCpy $0 0
dotnetver.startenum:
EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0
StrCmp $1 "" dotnetver.done
IntOp $0 $0 + 1
StrCpy $2 $1 1 0
StrCmp $2 "v" +1 dotnetver.startenum
StrCpy $2 $1 3 1
; Check for .NET 1.0 to 3.5
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\$1" "Install"
ReadRegDWORD $4 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\$1" "SP"
IntCmp $3 1 dotnetcheck.skipalt
; Alternate check for versions that don't set the Install key
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\$1\Setup" "InstallSuccess"
dotnetcheck.skipalt:
; This is a sanity check that works on .NET 1.0 to 3.5
; if it fails check for dotnet 4
IntCmp $3 0 dotnetcheck.40
StrCmp $2 ${DOTNETVER_1_0} dotnetver.10
StrCmp $2 ${DOTNETVER_1_1} dotnetver.11
StrCmp $2 ${DOTNETVER_2_0} dotnetver.20
StrCmp $2 ${DOTNETVER_3_0} dotnetver.30
StrCmp $2 ${DOTNETVER_3_5} dotnetver.35
dotnetcheck.40:
StrCmp $2 ${DOTNETVER_4_0} dotnetver.40
StrCmp $2 "4" dotnetver.40
Goto dotnetver.startenum
dotnetver.10:
StrCpy $__DOTNET_1.0 1
StrCpy $__DOTNETVER_1.0_SP $4
StrCpy $__DOTNET_1.0_FULL 1
Goto dotnetver.startenum
dotnetver.11:
StrCpy $__DOTNET_1.1 1
StrCpy $__DOTNETVER_1.1_SP $4
StrCpy $__DOTNET_1.1_FULL 1
Goto dotnetver.startenum
dotnetver.20:
StrCpy $__DOTNET_2.0 1
StrCpy $__DOTNETVER_2.0_SP $4
StrCpy $__DOTNET_2.0_FULL 1
Goto dotnetver.startenum
dotnetver.30:
StrCpy $__DOTNET_3.0 1
StrCpy $__DOTNETVER_3.0_SP $4
StrCpy $__DOTNET_3.0_FULL 1
Goto dotnetver.startenum
dotnetver.35:
StrCpy $__DOTNET_3.5 1
StrCpy $__DOTNETVER_3.5_SP $4
StrCpy $__DOTNET_3.5_FULL 1
Goto dotnetver.startenum
dotnetver.40:
; Check for .NET 4.0 (Full Profile)
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Install"
ReadRegDWORD $4 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "SP"
StrLen $8 $3
IntCmp $8 0 dotnetcheck.40c
IntCmp $3 0 dotnetcheck.40c
StrCmp $2 ${DOTNETVER_4_0} dotnetver.40_Full
StrCmp $2 "4" dotnetver.40_Full
dotnetcheck.40c:
; Check for .NET 4.0 (Client Profile)
ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" "Install"
ReadRegDWORD $4 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" "SP"
StrLen $8 $3
IntCmp $8 0 dotnetver.startenum
IntCmp $3 0 dotnetver.startenum
StrCmp $2 ${DOTNETVER_4_0} dotnetver.40_Client
StrCmp $2 "4" dotnetver.40_Client
Goto dotnetver.startenum
dotnetver.40_Full:
StrCpy $__DOTNET_4.0 1
StrCpy $__DOTNETVER_4.0_SP $4
StrCpy $__DOTNET_4.0_FULL 1
Goto dotnetcheck.40c ; continue looking for other profiles
dotnetver.40_Client:
StrCpy $__DOTNET_4.0 1
StrCpy $__DOTNETVER_4.0_SP $4
StrCpy $__DOTNET_4.0_CLIENT 1
Goto dotnetver.startenum
dotnetver.done:
StrCpy $__DONTNET_FOUNDVER "1"
Pop $8
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
!macroend
!macro _HasDotNet _a _b _t _f
${CallArtificialFunction} __DotNetVer_InitVars
!insertmacro _= `$__DOTNET_${_b}` `1` `${_t}` `${_f}`
!macroend
!macro __DotNetVer_DefineTest Ver
!define HasDotNet${Ver} `"" HasDotNet ${Ver}`
!macroend
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_1_0}
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_1_1}
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_2_0}
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_3_0}
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_3_5}
!insertmacro __DotNetVer_DefineTest ${DOTNETVER_4_0}
!macro _AtLeastDotNetServicePack _a _b _t _f
${CallArtificialFunction} __DotNetVer_InitVars
!insertmacro _>= `$__DOTNETVER_${_a}_SP` `${_b}` `${_t}` `${_f}`
!macroend
!define AtLeastDotNetServicePack `AtLeastDotNetServicePack`
!macro _AtMostDotNetServicePack _a _b _t _f
${CallArtificialFunction} __DotNetVer_InitVars
!insertmacro _<= `$__DOTNETVER_${_a}_SP` `${_b}` `${_t}` `${_f}`
!macroend
!define AtMostDotNetServicePack `AtMostDotNetServicePack`
!macro _IsDotNetServicePack _a _b _t _f
${CallArtificialFunction} __DotNetVer_InitVars
!insertmacro _= `$__DOTNETVER_${_a}_SP` `${_b}` `${_t}` `${_f}`
!macroend
!define IsDotNetServicePack `IsDotNetServicePack`
!macro _HasDotNetClientProfile _a _b _t _f
${CallArtificialFunction} __DotNetVer_InitVars
!insertmacro _= `$__DOTNET_${_a}_CLIENT` `${_b}` `${_t}` `${_f}`
!macroend
!define HasDotNetClientProfile `HasDotNetClientProfile`
!macro _HasDotNetFullProfile _a _b _t _f
${CallArtificialFunction} __DotNetVer_InitVars
!insertmacro _= `$__DOTNET_${_a}_FULL` `${_b}` `${_t}` `${_f}`
!macroend
!define HasDotNetFullProfile `HasDotNetFullProfile`
# done
!endif # !___DOTNETVER__NSH___
!verbose pop

View File

@@ -1,22 +0,0 @@
; Czech installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_CZECH} "mRemoteNG run CZECH message"
; Installer Language
LangString InstallerLanguage ${LANG_CZECH} "Installer Language"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_CZECH} "Please select the language of the installer"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_CZECH} "mRemoteNG requires Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_CZECH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
; Start Menu items
LangString CreditsLinkName ${LANG_CZECH} "Credits"
LangString CopyingLinkName ${LANG_CZECH} "License"
LangString UninstallLinkName ${LANG_CZECH} "Uninstall"
LangString ChangeLogLinkName ${LANG_CZECH} "Version History"

View File

@@ -1,22 +0,0 @@
; Dutch installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_DUTCH} "mRemoteNG run DUTCH message"
; Installer Language
LangString InstallerLanguage ${LANG_DUTCH} "Installer Language"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_DUTCH} "Please select the language of the installer"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_DUTCH} "mRemoteNG requires Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_DUTCH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
; Start Menu items
LangString CreditsLinkName ${LANG_DUTCH} "Credits"
LangString CopyingLinkName ${LANG_DUTCH} "License"
LangString UninstallLinkName ${LANG_DUTCH} "Uninstall"
LangString ChangeLogLinkName ${LANG_DUTCH} "Version History"

View File

@@ -1,22 +0,0 @@
; English installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_ENGLISH} "Launch mRemoteNG Now"
; Installer Language
LangString InstallerLanguage ${LANG_ENGLISH} "Installer Language"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_ENGLISH} "Please select the language of the installer"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_ENGLISH} "mRemoteNG requires Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_ENGLISH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
; Start Menu items
LangString CreditsLinkName ${LANG_ENGLISH} "Credits"
LangString CopyingLinkName ${LANG_ENGLISH} "License"
LangString UninstallLinkName ${LANG_ENGLISH} "Uninstall"
LangString ChangeLogLinkName ${LANG_ENGLISH} "Version History"

View File

@@ -1,22 +0,0 @@
; French installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_FRENCH} "mRemoteNG run FRENCH message"
; Installer Language
LangString InstallerLanguage ${LANG_FRENCH} "Installer Language"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_FRENCH} "Please select the language of the installer"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_FRENCH} "mRemoteNG requires Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_FRENCH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
; Start Menu items
LangString CreditsLinkName ${LANG_FRENCH} "Credits"
LangString CopyingLinkName ${LANG_FRENCH} "License"
LangString UninstallLinkName ${LANG_FRENCH} "Uninstall"
LangString ChangeLogLinkName ${LANG_FRENCH} "Version History"

View File

@@ -1,22 +0,0 @@
; German installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_GERMAN} "mRemoteNG jetzt Starten"
; Installer Language
LangString InstallerLanguage ${LANG_GERMAN} "Installationsprogamm Sprache"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_GERMAN} "Bitte w<>hlen Sie die Sprache f<>r das Installationsprogramm"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_GERMAN} "mRemoteNG ben<65>tigt das Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_GERMAN} "Sie m<>ssen Mitglied der Grupper 'Power Users' or 'Administratoren' sein, damit Sie mRemoteNG installieren k<>nnen."
; Start Menu items
LangString CreditsLinkName ${LANG_GERMAN} "Credits"
LangString CopyingLinkName ${LANG_GERMAN} "License"
LangString UninstallLinkName ${LANG_GERMAN} "Uninstall"
LangString ChangeLogLinkName ${LANG_GERMAN} "Version History"

View File

@@ -1,31 +0,0 @@
!define LanguageNameEnglish "English"
!insertmacro MUI_LANGUAGE "English"
!include "Language\english.nsi"
!define LanguageNameCzech "Čeština"
!insertmacro MUI_LANGUAGE "Czech"
!include "Language\czech.nsi"
!define LanguageNameGerman "Deutsch"
!insertmacro MUI_LANGUAGE "German"
!include "Language\german.nsi"
!define LanguageNameSpanish "Español"
!insertmacro MUI_LANGUAGE "Spanish"
!include "Language\spanish.nsi"
!define LanguageNameFrench "Français"
!insertmacro MUI_LANGUAGE "French"
!include "Language\french.nsi"
!define LanguageNameDutch "Nederlands"
!insertmacro MUI_LANGUAGE "Dutch"
!include "Language\dutch.nsi"
!define LanguageNamePolish "Polski"
!insertmacro MUI_LANGUAGE "Polish"
!include "Language\polish.nsi"
!define LanguageNameThai "ภาษาไทย"
!insertmacro MUI_LANGUAGE "Thai"
!include "Language\thai.nsi"

View File

@@ -1,22 +0,0 @@
; Polish installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_POLISH} "mRemoteNG run POLISH message"
; Installer Language
LangString InstallerLanguage ${LANG_POLISH} "Installer Language"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_POLISH} "Please select the language of the installer"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_POLISH} "mRemoteNG requires Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_POLISH} "You must be a member of the 'Power Users' or 'Administrators' group to install mRemoteNG."
; Start Menu items
LangString CreditsLinkName ${LANG_POLISH} "Credits"
LangString CopyingLinkName ${LANG_POLISH} "License"
LangString UninstallLinkName ${LANG_POLISH} "Uninstall"
LangString ChangeLogLinkName ${LANG_POLISH} "Version History"

View File

@@ -1,22 +0,0 @@
; Spanish installer translation
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_SPANISH} "Iniciando de mRemoteNG"
; Installer Language
LangString InstallerLanguage ${LANG_SPANISH} "Lenguaje de Instalación"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_SPANISH} "Seleccione el lenguaje de instalación"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_SPANISH} "mRemoteNG requiere Microsoft .NET Framework 3.0."
; User needs to be Admin
LangString RequiresAdminUser ${LANG_SPANISH} "Debe ser miembro del grupo 'Administradores' para poder instalar mRemoteNG."
; Start Menu items
LangString CreditsLinkName ${LANG_SPANISH} "Créditos"
LangString CopyingLinkName ${LANG_SPANISH} "Licencia"
LangString UninstallLinkName ${LANG_SPANISH} "Desinstalar"
LangString ChangeLogLinkName ${LANG_SPANISH} "Historial de Versiones"

View File

@@ -1,23 +0,0 @@
; Thai installer translation
; Contributed by Apisitt Rattana
; Start mRemoteNG after installation
LangString LaunchMremoteNow ${LANG_THAI} "ขณะนี้กำลังติดตั้ง mRemoteNG"
; Installer Language
LangString InstallerLanguage ${LANG_THAI} "ภาษาสำหรับการติดตั้ง"
; Select installer Language
LangString SelectInstallerLanguage ${LANG_THAI} "กรุณาเลือกภาษาสำหรับการติดตั้ง"
; Requires .NET Framework
LangString RequiresNetFramework ${LANG_THAI} "mRemoteNG มีความต้องการ Microsoft .NET Framework 3.0. เป็นพื้นฐาน"
; User needs to be Admin
LangString RequiresAdminUser ${LANG_THAI} "คุณต้องเป็นสมาชิกในกลุ่มของ 'Power Users' หรือ 'Administrators' เพื่อการติดตั้ง mRemoteNG"
; Start Menu items
LangString CreditsLinkName ${LANG_THAI} "Credits"
LangString CopyingLinkName ${LANG_THAI} "License"
LangString UninstallLinkName ${LANG_THAI} "Uninstall"
LangString ChangeLogLinkName ${LANG_THAI} "Version History"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -1,197 +0,0 @@
!include "MUI.nsh"
!include "WordFunc.nsh"
!insertmacro VersionCompare
!include "DotNetVer.nsh"
!include "..\Release\Version.nsh"
; This will be passed in using the /D switch by BUILD.CMD
!ifdef PRODUCT_VERSION_TAG
!define PRODUCT_VERSION_FRIENDLY "${PRODUCT_VERSION_SHORT}"
!define PRODUCT_VERSION_TAGGED "${PRODUCT_VERSION_SHORT}-${PRODUCT_VERSION_TAG}"
!else
!define PRODUCT_VERSION_FRIENDLY "${PRODUCT_VERSION_SHORT}"
!define PRODUCT_VERSION_TAGGED "${PRODUCT_VERSION_SHORT}"
!endif
; Basic Config
Name "mRemoteNG ${PRODUCT_VERSION_FRIENDLY}"
OutFile "..\Release\mRemoteNG-Installer-${PRODUCT_VERSION_TAGGED}.exe"
SetCompressor /SOLID lzma
InstallDir "$PROGRAMFILES\mRemoteNG"
InstallDirRegKey HKLM "Software\mRemoteNG" "InstallPath"
RequestExecutionLevel admin
; Version Information
VIProductVersion ${PRODUCT_VERSION}
VIAddVersionKey "CompanyName" "Next Generation Software"
VIAddVersionKey "ProductName" "mRemoteNG"
VIAddVersionKey "ProductVersion" ${PRODUCT_VERSION}
VIAddVersionKey "LegalCopyright" "Copyright © 2007-2009 Felix Deimel, 2010-2013 Riley McArdle"
VIAddVersionKey "FileDescription" "mRemoteNG ${PRODUCT_VERSION_FRIENDLY} Installer"
VIAddVersionKey "FileVersion" ${PRODUCT_VERSION}
; Design
!define MUI_ICON "Setup_Install.ico"
!define MUI_UNICON "RecycleBin.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "header.bmp" ; optional
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!define MUI_HEADERIMAGE_UNBITMAP "header.bmp" ; optional
!define MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH
!define MUI_HEADER_TRANSPARENT_TEXT
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcomefinish.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "welcomefinish.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
; Install Pages
!insertmacro MUI_PAGE_LICENSE "..\COPYING.TXT"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_NOAUTOCLOSE
; Finish Page
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN "$INSTDIR\mRemoteNG.exe"
!insertmacro MUI_PAGE_FINISH
; Uninstall Pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Get Languages
!include "Language\languages.nsi"
; Set finish page text
!define MUI_FINISHPAGE_RUN_Text "$(LaunchMremoteNow)"
Function .onInit
ClearErrors
UserInfo::GetName
IfErrors Win9x
Pop $0
UserInfo::GetAccountType
Pop $1
# GetOriginalAccountType will check the tokens of the original user of the
# current thread/process. If the user tokens were elevated or limited for
# this process, GetOriginalAccountType will return the non-restricted
# account type.
# On Vista with UAC, for example, this is not the same value when running
# with `RequestExecutionLevel user`. GetOriginalAccountType will return
# "admin" while GetAccountType will return "user".
StrCmp $1 "Admin" 0 +3
Goto doit
StrCmp $1 "Power" 0 +3
Goto doit
StrCmp $1 "User" 0 +3
Goto noop
StrCmp $1 "Guest" 0 +3
Goto noop
MessageBox MB_OK "Unknown error"
Goto doit
Win9x:
doit:
# We can install
IfSilent +2
Call SelectLanguage
Goto end
noop:
MessageBox MB_OK "$(RequiresAdminUser)"
Quit
end:
FunctionEnd
Function SelectLanguage
;Language selection dialog
Push ""
Push ${LANG_ENGLISH}
Push ${LanguageNameEnglish}
Push ${LANG_GERMAN}
Push ${LanguageNameGerman}
Push ${LANG_DUTCH}
Push ${LanguageNameDutch}
Push ${LANG_FRENCH}
Push ${LanguageNameFrench}
Push ${LANG_POLISH}
Push ${LanguageNamePolish}
Push ${LANG_SPANISH}
Push ${LanguageNameSpanish}
Push ${LANG_CZECH}
Push ${LanguageNameCzech}
Push ${LANG_THAI}
Push ${LanguageNameThai}
Push A ; A means auto count languages
; for the auto count to work the first empty push (Push "") must remain
LangDLL::LangDialog "$(InstallerLanguage)" "$(SelectInstallerLanguage)"
Pop $LANGUAGE
StrCmp $LANGUAGE "cancel" 0 +2
Abort
; Check .NET version
${IfNot} ${HasDotNet3.0}
MessageBox MB_OK|MB_ICONEXCLAMATION "$(RequiresNetFramework)"
Quit
${EndIf}
FunctionEnd
Section "" ; Install
SetOutPath $INSTDIR
SetShellVarContext all
; AddFiles
File /r /x "mRemoteNG.vshost.*" "..\mRemoteV1\bin\Release\*.*"
File /r "Dependencies\*.*"
File "..\*.txt"
; Uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
; Register ActiveX components
RegDLL "$INSTDIR\eolwtscom.dll"
; Start Menu
CreateDirectory "$SMPROGRAMS\mRemoteNG"
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(CreditsLinkName).lnk" "$INSTDIR\CREDITS.TXT"
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(CopyingLinkName).lnk" "$INSTDIR\COPYING.TXT"
CreateShortCut "$SMPROGRAMS\mRemoteNG\mRemoteNG.lnk" "$INSTDIR\mRemoteNG.exe"
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(UninstallLinkName).lnk" "$INSTDIR\Uninstall.exe"
CreateShortCut "$SMPROGRAMS\mRemoteNG\$(ChangeLogLinkName).lnk" "$INSTDIR\CHANGELOG.TXT"
; Registry
WriteRegStr HKLM "Software\mRemoteNG" "InstallPath" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "DisplayName" "mRemoteNG"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "Publisher" "Next Generation Software"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "DisplayIcon" "$INSTDIR\mRemoteNG.exe"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "EstimatedSize" 7080
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "DisplayVersion" ${PRODUCT_VERSION}
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "VersionMajor" ${PRODUCT_VERSION_MAJOR}
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "VersionMinor" ${PRODUCT_VERSION_MINOR}
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG" "NoRepair" 1
SectionEnd
Section "un.Uninstall"
; Unregister ActiveX components
UnregDLL "$INSTDIR\eolwtscom.dll"
; Delete Files
RMDIR /r $INSTDIR
; Start Menu
SetShellVarContext all
RMDir /r "$SMPROGRAMS\mRemoteNG"
SetShellVarContext current
RMDir /r "$SMPROGRAMS\mRemoteNG"
; Registry
DeleteRegValue HKLM "Software\mRemoteNG" "InstallPath"
DeleteRegKey /ifempty HKLM "Software\mRemoteNG"
DeleteRegKey /ifempty HKCU "Software\mRemoteNG"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\mRemoteNG"
SectionEnd

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

34
README.MD Normal file
View File

@@ -0,0 +1,34 @@
[![Twitter Follow](https://img.shields.io/twitter/follow/mRemoteNG.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=mRemoteNG)
[![Join the chat at https://gitter.im/mRemoteNG/PublicChat/](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mRemoteNG/PublicChat)
[![Build Status](http://ec2-52-39-111-114.us-west-2.compute.amazonaws.com:8080/buildStatus/icon?job=mRemoteNG/mRemoteNG/develop)](http://ec2-52-39-111-114.us-west-2.compute.amazonaws.com:8080/job/mRemoteNG/job/mRemoteNG/job/develop/)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.74/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.74)
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

@@ -11,4 +11,15 @@ Currently these protocols are supported:
* Telnet (TELecommunication NETwork)
* HTTP/S (Hypertext Transfer Protocol)
* Rlogin (Rlogin)
* RAW
* 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).

BIN
Tools/7zip/7za.dll Normal file

Binary file not shown.

BIN
Tools/7zip/7za.exe Normal file

Binary file not shown.

BIN
Tools/7zip/7zxa.dll Normal file

Binary file not shown.

31
Tools/7zip/License.txt Normal file
View File

@@ -0,0 +1,31 @@
7-Zip Extra
~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (C) 1999-2016 Igor Pavlov.
7-Zip Extra files are under the GNU LGPL license.
Notes:
You can use 7-Zip Extra on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/

77
Tools/7zip/history.txt Normal file
View File

@@ -0,0 +1,77 @@
7-Zip Extra history
-------------------
9.35 beta 2014-12-07
------------------------------
- SFX modules were moved to LZMA SDK package.
9.34 alpha 2014-06-22
------------------------------
- Minimum supported system now is Windows 2000 for EXE and DLL files.
- all EXE and DLL files use msvcrt.dll.
- 7zr.exe now support AES encryption.
9.18 2010-11-02
------------------------------
- New small SFX module for installers.
9.17 2010-10-04
------------------------------
- New 7-Zip plugin for FAR Manager x64.
9.10 2009-12-30
------------------------------
- 7-Zip for installers now supports LZMA2.
9.09 2009-12-12
------------------------------
- LZMA2 compression method support.
- Some bugs were fixed.
4.65 2009-02-03
------------------------------
- Some bugs were fixed.
4.38 beta 2006-04-13
------------------------------
- SFX for installers now supports new properties in config file:
Progress, Directory, ExecuteFile, ExecuteParameters.
4.34 beta 2006-02-27
------------------------------
- ISetProperties::SetProperties:
it's possible to specify desirable number of CPU threads:
PROPVARIANT: name=L"mt", vt = VT_UI4, ulVal = NumberOfThreads
If "mt" is not defined, 7za.dll will check number of processors in system to set
number of desirable threads.
Now 7za.dll can use:
2 threads for LZMA compressing
N threads for BZip2 compressing
4 threads for BZip2 decompressing
Other codecs use only one thread.
Note: 7za.dll can use additional "small" threads with low CPU load.
- It's possible to call ISetProperties::SetProperties to specify "mt" property for decoder.
4.33 beta 2006-02-05
------------------------------
- Compressing speed and Memory requirements were increased.
Default dictionary size was increased: Fastest: 64 KB, Fast: 1 MB,
Normal: 4 MB, Max: 16 MB, Ultra: 64 MB.
- 7z/LZMA now can use only these match finders: HC4, BT2, BT3, BT4
4.27 2005-09-21
------------------------------
- Some GUIDs/interfaces were changed.
IStream.h:
ISequentialInStream::Read now works as old ReadPart
ISequentialOutStream::Write now works as old WritePart

124
Tools/7zip/readme.txt Normal file
View File

@@ -0,0 +1,124 @@
7-Zip Extra 16.02
-----------------
7-Zip Extra is package of extra modules of 7-Zip.
7-Zip Copyright (C) 1999-2016 Igor Pavlov.
7-Zip is free software. Read License.txt for more information about license.
Source code of binaries can be found at:
http://www.7-zip.org/
This package contains the following files:
7za.exe - standalone console version of 7-Zip with reduced formats support.
7za.dll - library for working with 7z archives
7zxa.dll - library for extracting from 7z archives
License.txt - license information
readme.txt - this file
Far\ - plugin for Far Manager
x64\ - binaries for x64
All 32-bit binaries can work in:
Windows 2000 / 2003 / 2008 / XP / Vista / 7 / 8 / 10
and in any Windows x64 version with WoW64 support.
All x64 binaries can work in any Windows x64 version.
All binaries use msvcrt.dll.
7za.exe
-------
7za.exe - is a standalone console version of 7-Zip with reduced formats support.
Extra: 7za.exe : support for only some formats of 7-Zip.
7-Zip: 7z.exe with 7z.dll : support for all formats of 7-Zip.
7za.exe and 7z.exe from 7-Zip have same command line interface.
7za.exe doesn't use external DLL files.
You can read Help File (7-zip.chm) from 7-Zip package for description
of all commands and switches for 7za.exe and 7z.exe.
7za.exe features:
- High compression ratio in 7z format
- Supported formats:
- Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR
- Unpacking only: Z, lzma, CAB.
- Highest compression ratio for ZIP and GZIP formats.
- Fast compression and decompression
- Strong AES-256 encryption in 7z and ZIP formats.
Note: LZMA SDK contains 7zr.exe - more reduced version of 7za.exe.
But you can use 7zr.exe as "public domain" code.
DLL files
---------
7za.dll and 7zxa.dll are reduced versions of 7z.dll from 7-Zip.
7za.dll and 7zxa.dll support only 7z format.
Note: 7z.dll is main DLL file that works with all archive types in 7-Zip.
7za.dll and 7zxa.dll support the following decoding methods:
- LZMA, LZMA2, PPMD, BCJ, BCJ2, COPY, 7zAES, BZip2, Deflate.
7za.dll also supports 7z encoding with the following encoding methods:
- LZMA, LZMA2, PPMD, BCJ, BCJ2, COPY, 7zAES.
7za.dll and 7zxa.dll work via COM interfaces.
But these DLLs don't use standard COM interfaces for objects creating.
Look also example code that calls DLL functions (in source code of 7-Zip):
7zip\UI\Client7z
Another example of binary that uses these interface is 7-Zip itself.
The following binaries from 7-Zip use 7z.dll:
- 7z.exe (console version)
- 7zG.exe (GUI version)
- 7zFM.exe (7-Zip File Manager)
Note: The source code of LZMA SDK also contains the code for similar DLLs
(DLLs without BZip2, Deflate support). And these files from LZMA SDK can be
used as "public domain" code. If you use LZMA SDK files, you don't need to
follow GNU LGPL rules, if you want to change the code.
License FAQ
-----------
Can I use the EXE or DLL files from 7-Zip in a commercial application?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yes, but you are required to specify in documentation for your application:
(1) that you used parts of the 7-Zip program,
(2) that 7-Zip is licensed under the GNU LGPL license and
(3) you must give a link to www.7-zip.org, where the source code can be found.
Can I use the source code of 7-Zip in a commercial application?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since 7-Zip is licensed under the GNU LGPL you must follow the rules of that license.
In brief, it means that any LGPL'ed code must remain licensed under the LGPL.
For instance, you can change the code from 7-Zip or write a wrapper for some
code from 7-Zip and compile it into a DLL; but, the source code of that DLL
(including your modifications / additions / wrapper) must be licensed under
the LGPL or GPL.
Any other code in your application can be licensed as you wish. This scheme allows
users and developers to change LGPL'ed code and recompile that DLL. That is the
idea of free software. Read more here: http://www.gnu.org/.
Note: You can look also LZMA SDK, which is available under a more liberal license.
---
End of document

45
Tools/build-relport.cmd Normal file
View File

@@ -0,0 +1,45 @@
@echo off
setlocal enabledelayedexpansion
set SOLUTIONDIR=%~dp0..
rem Windows Sysinternals Sigcheck from http://technet.microsoft.com/en-us/sysinternals/bb897441
set SIGCHECK="%SOLUTIONDIR%\Tools\sigcheck.exe"
set SEVENZIP="%SOLUTIONDIR%\Tools\7zip\7za.exe"
set VCVARSALL="%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
call %VCVARSALL% x86
IF NOT "%~1"=="build" goto skipbuild
echo Building...
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" "%SOLUTIONDIR%\mRemoteV1.sln" /Rebuild "Release Portable"
:skipbuild
IF NOT EXIST "%SOLUTIONDIR%\mRemoteV1\bin\Release Portable\mRemoteNG.exe" echo Did you forget to build? && goto end
set SIGCHECK=!SIGCHECK:"=^"!
set SIGCHECK=!SIGCHECK: =^^ !
set SIGCHECK=!SIGCHECK:(=^^(!
set SIGCHECK=!SIGCHECK:)=^^)!
for /F "usebackq delims=. tokens=1-4" %%i in (`!SIGCHECK! /accepteula -q -n "%SOLUTIONDIR%\mRemoteV1\bin\Release Portable\mRemoteNG.exe"`) do (
set PRODUCT_VERSION_SHORT=%%i.%%j
set PRODUCT_VERSION=%%i.%%j.%%k.%%l
)
echo Version is %PRODUCT_VERSION%
set PORTABLEZIP="%SOLUTIONDIR%\Release\mRemoteNG-Portable-%PRODUCT_VERSION%.zip"
rmdir /S /Q "%SOLUTIONDIR%\mRemoteV1\bin\package"
mkdir "%SOLUTIONDIR%\mRemoteV1\bin\package"
copy "%SOLUTIONDIR%\*.txt" "%SOLUTIONDIR%\mRemoteV1\bin\package"
copy "%SOLUTIONDIR%\Installer Projects\Installer\Dependencies\PuTTYNG.exe" "%SOLUTIONDIR%\mRemoteV1\bin\package"
xcopy /S /Y "%SOLUTIONDIR%\mRemoteV1\bin\Release Portable" "%SOLUTIONDIR%\mRemoteV1\bin\package"
echo Creating portable ZIP file...
echo %PORTABLEZIP%
del /f /q %PORTABLEZIP% > nul 2>&1
%SEVENZIP% a -bt -mx=9 -tzip -y -r %PORTABLEZIP% "%SOLUTIONDIR%\mRemoteV1\bin\package\*.*"
%SEVENZIP% a -bt -mx=9 -tzip -y %PORTABLEZIP% "%SOLUTIONDIR%\*.TXT"
:end

View File

@@ -0,0 +1,16 @@
$sourcePath = $args[0]
$destinationDir = $args[1]
Write-Host $sourcePath
Write-Host $destinationDir
if (!(Test-Path -Path $destinationDir))
{
New-Item -Path $destinationDir -ItemType "directory"
}
$sourceFiles = Get-ChildItem -Path $sourcePath -Recurse | ?{$_.Extension -match "exe|msi"}
foreach ($item in $sourceFiles)
{
Copy-Item -Path $item.FullName -Destination $destinationDir -Force
}

View File

@@ -0,0 +1,25 @@
$solutionDir = $args[0]
$renameTarget = $solutionDir + "InstallerProjects\Installer\bin\Release\en-US\mRemoteNG-Installer.msi"
Write-Host $solutionDir
Write-Host $renameTarget
$targetVersionedFile = "$solutionDir\mRemoteV1\bin\Release\mRemoteNG.exe"
$version = &"$solutionDir\Tools\sigcheck.exe" /accepteula -q -n $targetVersionedFile
$renameTargetFileObject = Get-Item -Path $renameTarget -ErrorAction SilentlyContinue
if ($renameTargetFileObject)
{
# Build the new file name
$oldFileName = $renameTargetFileObject.Name
$newFileName = $oldFileName -replace "$("\"+$renameTargetFileObject.Extension)",$("-"+$version+$renameTargetFileObject.Extension)
Write-Host $oldFileName
Write-Host $newFileName
# Delete any items that already exist with the new name (effectively an overwrite)
Remove-Item -Path "$($renameTargetFileObject.Directory.FullName)\$newFileName" -ErrorAction SilentlyContinue
# Rename file
Rename-Item -Path $renameTarget -NewName $newFileName -ErrorAction SilentlyContinue
}

BIN
Tools/sigcheck.exe Normal file

Binary file not shown.

13
Tools/signfiles.ps1 Normal file
View File

@@ -0,0 +1,13 @@
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
$certPath = "C:\mRemoteNG_code_signing_cert.pfx"
$certPassword = (Get-Credential -Message "Enter the password for the certificate" -UserName "USERNAME NOT NEEDED").Password
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath, $certPassword)
$targetPath = $args[0]
Write-Output "Getting files from path: $targetPath"
$signableFiles = Get-ChildItem -Path $targetPath -Recurse | ?{$_.Extension -match "dll|exe|msi"}
Write-Output "Signable files count: $($signableFiles.Count)"
foreach ($file in $signableFiles) {
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
}

View File

@@ -0,0 +1,68 @@
using NUnit.Framework;
using System.IO;
namespace mRemoteNGTests
{
[TestFixture]
public class BinaryFileTests
{
[Test]
public void LargeAddressAwareFlagIsSet()
{
var exePath = GetTargetPath();
Assert.That(IsLargeAware(exePath), Is.True);
}
static string GetTargetPath([System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "")
{
string debugOrRelease = "";
string normalOrPortable = "";
#if DEBUG
debugOrRelease = "Debug";
#else
debugOrRelease = "Release";
#endif
#if PORTABLE
normalOrPortable = " Portable";
#else
normalOrPortable = "";
#endif
var path = Path.GetDirectoryName(sourceFilePath);
string FilePath = $"{path}\\..\\mRemoteV1\\bin\\{debugOrRelease}{normalOrPortable}\\mRemoteNG.exe";
return FilePath;
}
static bool IsLargeAware(string file)
{
using (var fs = File.OpenRead(file))
{
return IsLargeAware(fs);
}
}
/// <summary>
/// Checks if the stream is a MZ header and if it is large address aware
/// </summary>
/// <param name="stream">Stream to check, make sure its at the start of the MZ header</param>
/// <exception cref=""></exception>
/// <returns></returns>
static bool IsLargeAware(Stream stream)
{
const int IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x20;
var br = new BinaryReader(stream);
if (br.ReadInt16() != 0x5A4D) //No MZ Header
return false;
br.BaseStream.Position = 0x3C;
var peloc = br.ReadInt32(); //Get the PE header location.
br.BaseStream.Position = peloc;
if (br.ReadInt32() != 0x4550) //No PE header
return false;
br.BaseStream.Position += 0x12;
return (br.ReadInt16() & IMAGE_FILE_LARGE_ADDRESS_AWARE) == IMAGE_FILE_LARGE_ADDRESS_AWARE;
}
}
}

View File

@@ -2,6 +2,7 @@
using NUnit.Framework;
using System.Reflection;
using System.Collections;
using System.Linq;
namespace mRemoteNGTests.Connection
{
@@ -59,10 +60,23 @@ namespace mRemoteNGTests.Connection
Assert.That(_inheritance.Username, Is.True);
}
[Test]
public void GetPropertiesReturnsListOfSettableProperties()
{
var hasIconProperty = _inheritance.GetProperties().Contains(typeof(ConnectionInfoInheritance).GetProperty("Icon"));
Assert.That(hasIconProperty, Is.True);
}
[Test]
public void GetPropertiesExludesPropertiesThatShouldNotBeSet()
{
var hasEverythingInheritedProperty = _inheritance.GetProperties().Contains(typeof(ConnectionInfoInheritance).GetProperty("EverythingInherited"));
Assert.That(hasEverythingInheritedProperty, Is.False);
}
private bool AllInheritancePropertiesAreTrue()
{
bool allPropertiesTrue = true;
var allPropertiesTrue = true;
foreach (var property in _inheritanceProperties)
{
if (PropertyIsBoolean(property) && PropertyIsChangedWhenSettingInheritAll(property) && BooleanPropertyIsSetToFalse(property))
@@ -73,7 +87,7 @@ namespace mRemoteNGTests.Connection
private bool AllInheritancePropertiesAreFalse()
{
bool allPropertiesFalse = true;
var allPropertiesFalse = true;
foreach (var property in _inheritanceProperties)
{
if (PropertyIsBoolean(property) && PropertyIsChangedWhenSettingInheritAll(property) && BooleanPropertyIsSetToTrue(property))
@@ -84,8 +98,7 @@ namespace mRemoteNGTests.Connection
private bool PropertyIsChangedWhenSettingInheritAll(PropertyInfo property)
{
ArrayList propertiesIgnoredByInheritAll = new ArrayList();
propertiesIgnoredByInheritAll.Add("IsDefault");
var propertiesIgnoredByInheritAll = new ArrayList {"IsDefault"};
return propertiesIgnoredByInheritAll.Contains(property);
}
@@ -101,7 +114,7 @@ namespace mRemoteNGTests.Connection
private bool BooleanPropertyIsSetToTrue(PropertyInfo property)
{
return (bool)property.GetValue(_inheritance) == true;
return (bool)property.GetValue(_inheritance);
}
}
}

View File

@@ -0,0 +1,49 @@
using mRemoteNG.Connection;
using NUnit.Framework;
namespace mRemoteNGTests.Connection
{
public class DefaultConnectionInheritanceTests
{
[SetUp]
public void Setup()
{
DefaultConnectionInheritance.Instance.TurnOffInheritanceCompletely();
}
[Test]
public void LoadingDefaultInheritanceUpdatesAllProperties()
{
var inheritanceSource = new ConnectionInfoInheritance(new object(), true);
inheritanceSource.TurnOnInheritanceCompletely();
DefaultConnectionInheritance.Instance.LoadFrom(inheritanceSource);
Assert.That(DefaultConnectionInheritance.Instance.EverythingInherited, Is.True);
}
[Test]
public void SavingDefaultInheritanceExportsAllProperties()
{
var inheritanceDestination = new ConnectionInfoInheritance(new object(), true);
DefaultConnectionInheritance.Instance.AutomaticResize = true;
DefaultConnectionInheritance.Instance.SaveTo(inheritanceDestination);
Assert.That(inheritanceDestination.AutomaticResize, Is.True);
}
[Test]
public void NewInheritanceInstancesCreatedWithDefaultInheritanceValues()
{
DefaultConnectionInheritance.Instance.Domain = true;
var inheritanceInstance = new ConnectionInfoInheritance(new object());
Assert.That(inheritanceInstance.Domain, Is.True);
}
[Test]
public void NewInheritanceInstancesCreatedWithAllDefaultInheritanceValues()
{
DefaultConnectionInheritance.Instance.TurnOnInheritanceCompletely();
var inheritanceInstance = new ConnectionInfoInheritance(new object());
Assert.That(inheritanceInstance.EverythingInherited, Is.True);
}
}
}

View File

@@ -0,0 +1,58 @@
using System.Security;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using NUnit.Framework;
namespace mRemoteNGTests.Security
{
public class AeadCryptographyProviderTests
{
private ICryptographyProvider _cryptographyProvider;
private SecureString _encryptionKey;
private string _plainText;
[SetUp]
public void Setup()
{
_cryptographyProvider = new AeadCryptographyProvider();
_encryptionKey = "mypassword111111".ConvertToSecureString();
_plainText = "MySecret!";
}
[TearDown]
public void TearDown()
{
_cryptographyProvider = null;
}
[Test]
public void GetBlockSizeReturnsProperValueForAes()
{
Assert.That(_cryptographyProvider.BlockSizeInBytes, Is.EqualTo(16));
}
[Test]
public void EncryptionOutputsBase64String()
{
var cipherText = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
Assert.That(cipherText.IsBase64String, Is.True);
}
[Test]
public void DecryptedTextIsEqualToOriginalPlainText()
{
var cipherText = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
var decryptedCipherText = _cryptographyProvider.Decrypt(cipherText, _encryptionKey);
Assert.That(decryptedCipherText, Is.EqualTo(_plainText));
}
[Test]
public void EncryptingTheSameValueReturnsNewCipherTextEachTime()
{
var cipherText1 = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
var cipherText2 = _cryptographyProvider.Encrypt(_plainText, _encryptionKey);
Assert.That(cipherText1, Is.Not.EqualTo(cipherText2));
}
}
}

View File

@@ -0,0 +1,112 @@
using mRemoteNG.Security;
using NUnit.Framework;
namespace mRemoteNGTests.Security
{
[TestFixture]
public class CryptographyProviderFactoryTests
{
private CryptographyProviderFactory _cryptographyProviderFactory;
[SetUp]
public void SetUp()
{
_cryptographyProviderFactory = new CryptographyProviderFactory();
}
[TearDown]
public void TearDown()
{
_cryptographyProviderFactory = null;
}
[Test]
public void CanCreateAesGcm()
{
var engine = BlockCipherEngines.AES;
var mode = BlockCipherModes.GCM;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateAesCcm()
{
var engine = BlockCipherEngines.AES;
var mode = BlockCipherModes.CCM;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateAesEax()
{
var engine = BlockCipherEngines.AES;
var mode = BlockCipherModes.EAX;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateSerpentGcm()
{
var engine = BlockCipherEngines.Serpent;
var mode = BlockCipherModes.GCM;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateSerpentCcm()
{
var engine = BlockCipherEngines.Serpent;
var mode = BlockCipherModes.CCM;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateSerpentEax()
{
var engine = BlockCipherEngines.Serpent;
var mode = BlockCipherModes.EAX;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateTwofishCcm()
{
var engine = BlockCipherEngines.Twofish;
var mode = BlockCipherModes.CCM;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateTwofishEax()
{
var engine = BlockCipherEngines.Twofish;
var mode = BlockCipherModes.EAX;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateTwofishGcm()
{
var engine = BlockCipherEngines.Twofish;
var mode = BlockCipherModes.GCM;
var cryptoProvider = _cryptographyProviderFactory.CreateAeadCryptographyProvider(engine, mode);
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo($"{engine}/{mode}"));
}
[Test]
public void CanCreateLegacyRijndael()
{
var cryptoProvider = _cryptographyProviderFactory.CreateLegacyRijndaelCryptographyProvider();
Assert.That(cryptoProvider.CipherEngine, Is.EqualTo("Rijndael"));
}
}
}

View File

@@ -0,0 +1,45 @@
using mRemoteNG.Security;
using NUnit.Framework;
namespace mRemoteNGTests.Security
{
[TestFixture()]
public class EncryptedSecureStringTests
{
private readonly string _clearTextData = "MySecureData";
[Test]
public void CanCreateEncryptedSecureString()
{
Assert.That(new EncryptedSecureString(), Is.InstanceOf<EncryptedSecureString>());
}
[Test]
public void CanAssignStringValue()
{
var encryptedSecString = new EncryptedSecureString();
TestDelegate testDelegate = () => encryptedSecString.SetValue(_clearTextData);
Assert.DoesNotThrow(testDelegate);
}
[Test]
public void EncryptedValueIsSameAsOriginalValue()
{
var encryptedSecString = new EncryptedSecureString();
encryptedSecString.SetValue(_clearTextData);
var decryptedData = encryptedSecString.GetClearTextValue();
Assert.That(decryptedData, Is.EqualTo(_clearTextData));
}
[Test]
public void CreatingMultipleEncryptedSecureStrings()
{
var encString1 = new EncryptedSecureString();
encString1.SetValue(_clearTextData);
var encString2 = new EncryptedSecureString();
encString2.SetValue("somevalue");
var decryptedString = encString1.GetClearTextValue();
Assert.That(decryptedString, Is.EqualTo(_clearTextData));
}
}
}

View File

@@ -0,0 +1,59 @@
using System.Security;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using NUnit.Framework;
namespace mRemoteNGTests.Security
{
[TestFixture()]
public class LegacyRijndaelCryptographyProviderTests
{
private ICryptographyProvider _rijndaelCryptographyProvider;
private SecureString _encryptionKey;
private string _plainText;
[SetUp]
public void SetUp()
{
_rijndaelCryptographyProvider = new LegacyRijndaelCryptographyProvider();
_encryptionKey = "mR3m".ConvertToSecureString();
_plainText = "MySecret!";
}
[TearDown]
public void Teardown()
{
_rijndaelCryptographyProvider = null;
}
[Test]
public void GetBlockSizeReturnsProperValueForRijndael()
{
Assert.That(_rijndaelCryptographyProvider.BlockSizeInBytes, Is.EqualTo(16));
}
[Test]
public void EncryptionOutputsBase64String()
{
var cipherText = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
Assert.That(cipherText.IsBase64String, Is.True);
}
[Test]
public void DecryptedTextIsEqualToOriginalPlainText()
{
var cipherText = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
var decryptedCipherText = _rijndaelCryptographyProvider.Decrypt(cipherText, _encryptionKey);
Assert.That(decryptedCipherText, Is.EqualTo(_plainText));
}
[Test]
public void EncryptingTheSameValueReturnsNewCipherTextEachTime()
{
var cipherText1 = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
var cipherText2 = _rijndaelCryptographyProvider.Encrypt(_plainText, _encryptionKey);
Assert.That(cipherText1, Is.Not.EqualTo(cipherText2));
}
}
}

View File

@@ -17,26 +17,47 @@
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Portable|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug Portable\</OutputPath>
<DefineConstants>TRACE;DEBUG;PORTABLE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release Portable|x86'">
<OutputPath>bin\x86\Release Portable\</OutputPath>
<DefineConstants>TRACE;PORTABLE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\mRemoteV1\References\log4net.dll</HintPath>
@@ -45,8 +66,8 @@
<HintPath>..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NUnitForms">
@@ -57,9 +78,13 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=2.5.0.15095, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\mRemoteV1\References\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=2.9.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.2.10.0\lib\net40\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light, Version=2.9.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.ThemeVS2012Light.2.10.0\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2012Light.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<Choose>
@@ -76,12 +101,18 @@
</Choose>
<ItemGroup>
<Compile Include="App\LoggerTests.cs" />
<Compile Include="BinaryFileTests.cs" />
<Compile Include="Connection\ConnectionInfoInheritanceTests.cs" />
<Compile Include="Connection\DefaultConnectionInheritanceTests.cs" />
<Compile Include="ListViewTester.cs" />
<Compile Include="Config\Connections\SqlConnectionUpdateCheckerTests.cs" />
<Compile Include="Config\Connections\SqlUpdateQueryBuilderTest.cs" />
<Compile Include="Config\Connections\SqlUpdateTimerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Security\AeadCryptographyProviderTests.cs" />
<Compile Include="Security\CryptographyProviderFactoryTests.cs" />
<Compile Include="Security\EncryptedSecureStringTests.cs" />
<Compile Include="Security\LegacyRijndaelCryptographyProviderTests.cs" />
<Compile Include="UI\Controls\CustomListViewTests.cs" />
<Compile Include="UI\Controls\TestForm.cs">
<SubType>Form</SubType>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.8.1" targetFramework="net45" />
<package id="DockPanelSuite" version="2.10.0" targetFramework="net45" />
<package id="DockPanelSuite.ThemeVS2012Light" version="2.10.0" targetFramework="net45" />
<package id="NSubstitute" version="1.10.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnit" version="3.4.1" targetFramework="net45" />
</packages>

View File

@@ -7,88 +7,49 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mRemoteV1", "mRemoteV1\mRem
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mRemoteNGTests", "mRemoteNGTests\mRemoteNGTests.csproj", "{1453B37F-8621-499E-B0B2-6091F76DC0BB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installer Projects", "Installer Projects", "{4FE795BE-646E-4F1B-BAD0-A68EA26394DD}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "InstallerProjects", "InstallerProjects", "{4FE795BE-646E-4F1B-BAD0-A68EA26394DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomActions", "Installer Projects\CustomActions\CustomActions.csproj", "{5423D985-CB48-4344-B47F-E8C6D60C8B04}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomActions", "InstallerProjects\CustomActions\CustomActions.csproj", "{5423D985-CB48-4344-B47F-E8C6D60C8B04}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "Installer Projects\Installer\Installer.wixproj", "{F0168B9F-6815-40DF-BA53-46CEE7683B68}"
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "InstallerProjects\Installer\Installer.wixproj", "{F0168B9F-6815-40DF-BA53-46CEE7683B68}"
ProjectSection(ProjectDependencies) = postProject
{5423D985-CB48-4344-B47F-E8C6D60C8B04} = {5423D985-CB48-4344-B47F-E8C6D60C8B04}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug Portable|Any CPU = Debug Portable|Any CPU
Debug Portable|x86 = Debug Portable|x86
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release Portable|Any CPU = Release Portable|Any CPU
Release Portable|x86 = Release Portable|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|Any CPU.ActiveCfg = Debug Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|Any CPU.Build.0 = Debug Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|x86.ActiveCfg = Debug Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|x86.Build.0 = Debug Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|x86.ActiveCfg = Debug|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|x86.Build.0 = Debug|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|Any CPU.ActiveCfg = Release Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|Any CPU.Build.0 = Release Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|x86.ActiveCfg = Release Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|x86.Build.0 = Release Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|Any CPU.Build.0 = Release|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|x86.ActiveCfg = Release|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|x86.Build.0 = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|Any CPU.ActiveCfg = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|Any CPU.Build.0 = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|x86.ActiveCfg = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|x86.Build.0 = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|x86.ActiveCfg = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|x86.Build.0 = Debug|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|Any CPU.ActiveCfg = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|Any CPU.Build.0 = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|x86.ActiveCfg = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|x86.Build.0 = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|Any CPU.Build.0 = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|x86.ActiveCfg = Release|Any CPU
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|x86.Build.0 = Release|Any CPU
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|Any CPU.ActiveCfg = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|Any CPU.Build.0 = Debug|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|x86.ActiveCfg = Debug Portable|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|x86.Build.0 = Debug Portable|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|x86.ActiveCfg = Debug|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|x86.Build.0 = Debug|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|x86.ActiveCfg = Release Portable|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|x86.Build.0 = Release Portable|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|x86.ActiveCfg = Release|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|x86.Build.0 = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|x86.ActiveCfg = Debug Portable|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|x86.Build.0 = Debug Portable|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|x86.ActiveCfg = Debug|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|x86.Build.0 = Debug|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|x86.ActiveCfg = Release Portable|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|x86.Build.0 = Release Portable|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|x86.ActiveCfg = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|x86.Build.0 = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|x86.ActiveCfg = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|x86.Build.0 = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug|Any CPU.ActiveCfg = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug|Any CPU.Build.0 = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug|x86.ActiveCfg = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug|x86.Build.0 = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|Any CPU.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|Any CPU.Build.0 = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|x86.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|x86.Build.0 = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release|Any CPU.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release|Any CPU.Build.0 = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release|x86.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release|x86.Build.0 = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|Any CPU.ActiveCfg = Debug Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|x86.ActiveCfg = Debug Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|x86.Build.0 = Debug Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug|Any CPU.ActiveCfg = Debug|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug|x86.ActiveCfg = Debug|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug|x86.Build.0 = Debug|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Portable|Any CPU.ActiveCfg = Release Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Portable|x86.ActiveCfg = Release Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Portable|x86.Build.0 = Release Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release|Any CPU.ActiveCfg = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release|Any CPU.Build.0 = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release|x86.ActiveCfg = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -1,82 +0,0 @@
////using System;
////using System.Diagnostics;
////using Microsoft.VisualBasic.CompilerServices;
//using System;
//using System.Diagnostics;
//using Microsoft.VisualBasic.CompilerServices;
//namespace mRemoteNG.App
//{
// // The following events are available for MyApplication:
// //
// // Startup: Raised when the application starts, before the startup form is created.
// // Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
// // UnhandledException: Raised if the application encounters an unhandled exception.
// // StartupNextInstance: Raised when launching a single-instance application and the application is already active.
// // NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
// partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
//{
// public System.Threading.Mutex mutex;
// private void MyApplication_Startup(object sender, Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e)
// {
// if (mRemoteNG.Settings.Default.SingleInstance)
// {
// string mutexID = "mRemoteNG_SingleInstanceMutex";
// mutex = new System.Threading.Mutex(false, mutexID);
// if (!mutex.WaitOne(0, false))
// {
// try
// {
// SwitchToCurrentInstance();
// }
// catch (Exception)
// {
// }
// ProjectData.EndApp();
// }
// GC.KeepAlive(mutex);
// }
// }
// private IntPtr GetCurrentInstanceWindowHandle()
// {
// IntPtr hWnd = IntPtr.Zero;
// Process curProc = Process.GetCurrentProcess();
// foreach (Process proc in Process.GetProcessesByName(curProc.ProcessName))
// {
// if (proc.Id != curProc.Id && proc.MainModule.FileName == curProc.MainModule.FileName && proc.MainWindowHandle != IntPtr.Zero)
// {
// hWnd = proc.MainWindowHandle;
// break;
// }
// }
// return hWnd;
// }
// private void SwitchToCurrentInstance()
// {
// IntPtr hWnd = GetCurrentInstanceWindowHandle();
// if (hWnd != IntPtr.Zero)
// {
// //Restore window if minimized. Do not restore if already in
// //normal or maximised window state, since we don't want to
// //change the current state of the window.
// if (App.NativeMethods.IsIconic(hWnd) != 0)
// {
// App.NativeMethods.ShowWindow(hWnd, App.NativeMethods.SW_RESTORE);
// }
// App.NativeMethods.SetForegroundWindow(hWnd);
// }
// }
// private void MyApplication_Shutdown(object sender, System.EventArgs e)
// {
// mutex?.Close();
// }
//}
//}

View File

@@ -0,0 +1,69 @@
using Microsoft.Win32;
using mRemoteNG.App.Info;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace mRemoteNG.App
{
public class CompatibilityChecker
{
public void CheckCompatibility()
{
CheckFipsPolicy();
CheckLenovoAutoScrollUtility();
}
private void CheckFipsPolicy()
{
if (FipsPolicyEnabledForServer2003() || FipsPolicyEnabledForServer2008AndNewer())
{
MessageBox.Show(frmMain.Default, string.Format(Language.strErrorFipsPolicyIncompatible, GeneralAppInfo.ProdName, GeneralAppInfo.ProdName, MessageBoxButtons.OK, MessageBoxIcon.Error));
Environment.Exit(1);
}
}
private bool FipsPolicyEnabledForServer2003()
{
var regKey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Lsa");
var fipsPolicy = regKey?.GetValue("FIPSAlgorithmPolicy");
if (fipsPolicy == null) return false;
fipsPolicy = Convert.ToInt32(fipsPolicy);
return (int)fipsPolicy != 0;
}
private bool FipsPolicyEnabledForServer2008AndNewer()
{
var regKey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy");
var fipsPolicy = regKey?.GetValue("Enabled");
if (fipsPolicy == null) return false;
fipsPolicy = Convert.ToInt32(fipsPolicy);
return (int)fipsPolicy != 0;
}
private void CheckLenovoAutoScrollUtility()
{
if (!Settings.Default.CompatibilityWarnLenovoAutoScrollUtility)
return;
Process[] proccesses = new Process[] { };
try
{
proccesses = Process.GetProcessesByName("virtscrl");
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("Error in CheckLenovoAutoScrollUtility", ex);
}
if (proccesses.Length > 0)
{
CTaskDialog.MessageBox(Application.ProductName, Language.strCompatibilityProblemDetected, string.Format(Language.strCompatibilityLenovoAutoScrollUtilityDetected, Application.ProductName), "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.Ok, ESysIcons.Warning, ESysIcons.Warning);
if (CTaskDialog.VerificationChecked)
Settings.Default.CompatibilityWarnLenovoAutoScrollUtility = false;
}
}
}
}

View File

@@ -2,8 +2,10 @@ using System.Collections.Generic;
using System;
using System.IO;
using System.Reflection;
using System.Security;
using System.Threading;
using System.Windows.Forms;
using mRemoteNG.Security;
using static System.Environment;
@@ -19,7 +21,7 @@ namespace mRemoteNG.App.Info
public static readonly string ProdName = Application.ProductName;
public static readonly string copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright;
public static readonly string HomePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
public static readonly string EncryptionKey = "mR3m";
public static readonly SecureString EncryptionKey = "mR3m".ConvertToSecureString();
public static string ReportingFilePath = "";
public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
public static string UserAgent

View File

@@ -32,11 +32,17 @@ namespace mRemoteNG.App
internal static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
internal static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern int SendMessage(IntPtr hWnd, int msg, int wparam, int lparam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, System.Text.StringBuilder lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
@@ -57,8 +63,20 @@ namespace mRemoteNG.App
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern IntPtr WindowFromPoint(Point point);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern void GetClassName(IntPtr hWnd, System.Text.StringBuilder lpClassName, int nMaxCount);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int GetDlgCtrlID(int hwndCtl);
[DllImport("user32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
[DllImport("user32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
public static extern bool SetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
#endregion
#region Structures
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
@@ -71,8 +89,32 @@ namespace mRemoteNG.App
public int cy;
public int flags;
}
public struct WINDOWPLACEMENT
{
public uint length;
public uint flags;
public uint showCmd;
public POINT ptMinPosition;
public POINT ptMaxPosition;
public RECT rcNormalPosition;
}
public struct POINT
{
public long x;
public long y;
}
public struct RECT
{
public long left;
public long top;
public long right;
public long bottom;
}
#endregion
#region Helpers
public static int MAKELONG(int wLow, int wHigh)
{
@@ -106,6 +148,8 @@ namespace mRemoteNG.App
#endregion
#region Constants
public const int TRUE = 1;
#region GetWindowLong
public const int GWL_STYLE = (-16);
#endregion
@@ -123,8 +167,17 @@ namespace mRemoteNG.App
#endregion
#region ShowWindow
public const int SW_SHOWMAXIMIZED = 3;
public const int SW_RESTORE = 9;
public const uint SW_HIDE = 0;
public const uint SW_SHOWNORMAL = 1;
public const uint SW_SHOWMINIMIZED = 2;
public const uint SW_SHOWMAXIMIZED = 3;
public const uint SW_MAXIMIZE = 3;
public const uint SW_SHOWNOACTIVATE = 4;
public const uint SW_SHOW = 5;
public const uint SW_MINIMIZE = 6;
public const uint SW_SHOWMINNOACTIVE = 7;
public const uint SW_SHOWNA = 8;
public const uint SW_RESTORE = 9;
#endregion
#region SetWindowPos / WM_WINDOWPOSCHANGING / WM_WINDOWPOSCHANGED
@@ -214,6 +267,12 @@ namespace mRemoteNG.App
public const int SWP_STATECHANGED = 0x8000;
#endregion
#region Window Placement Flags (WPF)
public const uint WPF_SETMINPOSITION = 0x1;
public const uint WPF_RESTORETOMAXIMIZED = 0x2;
public const uint WPF_ASYNCWINDOWPLACEMENT = 0x4;
#endregion
#region WM_ACTIVATE
/// <summary>
///
@@ -247,6 +306,11 @@ namespace mRemoteNG.App
/// </summary>
public const int WM_ACTIVATE = 0x6;
/// <summary>
///
/// </summary>
public const int WM_SETTEXT = 0xC;
/// <summary>
/// Copies the text that corresponds to a window into a buffer provided by the caller.
/// </summary>
@@ -292,6 +356,11 @@ namespace mRemoteNG.App
/// </summary>
public const int WM_KEYUP = 0x101;
/// <summary>
///
/// </summary>
public const int WM_COMMAND = 0x111;
/// <summary>
/// A window receives this message when the user chooses a command from the Window menu (formerly known as the system or control menu) or when the user chooses the maximize button, minimize button, restore button, or close button.
/// </summary>
@@ -379,6 +448,12 @@ namespace mRemoteNG.App
public const int VK_CONTROL = 0x11;
public const int VK_C = 0x67;
#endregion
#region LB
public const int LB_ERR = -1;
public const int LB_SELECTSTRING = 0x18C;
#endregion
#endregion
}
}

View File

@@ -1,19 +1,73 @@
using System;
using mRemoteNG.UI.Forms;
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using mRemoteNG.UI.Forms;
namespace mRemoteNG.App
{
public static class ProgramRoot
{
private static Mutex mutex;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main(string[] args)
{
Startup.InitializeProgram();
if (Settings.Default.SingleInstance)
StartApplicationAsSingleInstance();
else
StartApplication();
}
private static void StartApplication()
{
Startup.Instance.InitializeProgram();
Application.Run(frmMain.Default);
}
public static void CloseSingletonInstanceMutex()
{
mutex?.Close();
}
private static void StartApplicationAsSingleInstance()
{
var mutexID = "mRemoteNG_SingleInstanceMutex";
bool newInstanceCreated;
mutex = new Mutex(false, mutexID, out newInstanceCreated);
if (!newInstanceCreated)
{
SwitchToCurrentInstance();
return;
}
StartApplication();
GC.KeepAlive(mutex);
}
private static void SwitchToCurrentInstance()
{
var singletonInstanceWindowHandle = GetRunningSingletonInstanceWindowHandle();
if (singletonInstanceWindowHandle != IntPtr.Zero)
{
if (NativeMethods.IsIconic(singletonInstanceWindowHandle) != 0)
NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE);
}
}
private static IntPtr GetRunningSingletonInstanceWindowHandle()
{
var windowHandle = IntPtr.Zero;
var currentProcess = Process.GetCurrentProcess();
foreach (Process enumeratedProcess in Process.GetProcessesByName(currentProcess.ProcessName))
{
if (enumeratedProcess.Id != currentProcess.Id && enumeratedProcess.MainModule.FileName == currentProcess.MainModule.FileName && enumeratedProcess.MainWindowHandle != IntPtr.Zero)
windowHandle = enumeratedProcess.MainWindowHandle;
}
return windowHandle;
}
}
}
}

View File

@@ -1,4 +1,3 @@
using Microsoft.VisualBasic;
using mRemoteNG.App.Info;
using mRemoteNG.Config.Connections;
using mRemoteNG.Connection;
@@ -6,7 +5,6 @@ using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Container;
using mRemoteNG.Credential;
using mRemoteNG.Images;
using mRemoteNG.Messages;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
@@ -19,7 +17,9 @@ using System.IO;
using System.Threading;
using System.Windows.Forms;
using System.Xml;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.Forms.Input;
using mRemoteNG.UI.TaskDialog;
using WeifenLuo.WinFormsUI.Docking;
using TabPage = Crownwood.Magic.Controls.TabPage;
@@ -99,7 +99,7 @@ namespace mRemoteNG.App
Settings.Default.ConDefaultDomain = DefaultConnection.Domain;
Settings.Default.ConDefaultProtocol = DefaultConnection.Protocol.ToString();
Settings.Default.ConDefaultPuttySession = DefaultConnection.PuttySession;
Settings.Default.ConDefaultICAEncryptionStrength = DefaultConnection.ICAEncryption.ToString();
Settings.Default.ConDefaultICAEncryptionStrength = DefaultConnection.ICAEncryptionStrength.ToString();
Settings.Default.ConDefaultRDPAuthenticationLevel = DefaultConnection.RDPAuthenticationLevel.ToString();
Settings.Default.ConDefaultLoadBalanceInfo = DefaultConnection.LoadBalanceInfo;
Settings.Default.ConDefaultUseConsoleSession = DefaultConnection.UseConsoleSession;
@@ -144,73 +144,6 @@ namespace mRemoteNG.App
}
#endregion
#region Default Inheritance
public static ConnectionInfoInheritance DefaultInheritanceFromSettings()
{
DefaultInheritance = new ConnectionInfoInheritance(null);
DefaultInheritance.IsDefault = true;
return DefaultInheritance;
}
public static void DefaultInheritanceToSettings()
{
Settings.Default.InhDefaultDescription = DefaultInheritance.Description;
Settings.Default.InhDefaultIcon = DefaultInheritance.Icon;
Settings.Default.InhDefaultPanel = DefaultInheritance.Panel;
Settings.Default.InhDefaultUsername = DefaultInheritance.Username;
Settings.Default.InhDefaultPassword = DefaultInheritance.Password;
Settings.Default.InhDefaultDomain = DefaultInheritance.Domain;
Settings.Default.InhDefaultProtocol = DefaultInheritance.Protocol;
Settings.Default.InhDefaultPort = DefaultInheritance.Port;
Settings.Default.InhDefaultPuttySession = DefaultInheritance.PuttySession;
Settings.Default.InhDefaultUseConsoleSession = DefaultInheritance.UseConsoleSession;
Settings.Default.InhDefaultUseCredSsp = DefaultInheritance.UseCredSsp;
Settings.Default.InhDefaultRenderingEngine = DefaultInheritance.RenderingEngine;
Settings.Default.InhDefaultICAEncryptionStrength = DefaultInheritance.ICAEncryption;
Settings.Default.InhDefaultRDPAuthenticationLevel = DefaultInheritance.RDPAuthenticationLevel;
Settings.Default.InhDefaultLoadBalanceInfo = DefaultInheritance.LoadBalanceInfo;
Settings.Default.InhDefaultResolution = DefaultInheritance.Resolution;
Settings.Default.InhDefaultAutomaticResize = DefaultInheritance.AutomaticResize;
Settings.Default.InhDefaultColors = DefaultInheritance.Colors;
Settings.Default.InhDefaultCacheBitmaps = DefaultInheritance.CacheBitmaps;
Settings.Default.InhDefaultDisplayWallpaper = DefaultInheritance.DisplayWallpaper;
Settings.Default.InhDefaultDisplayThemes = DefaultInheritance.DisplayThemes;
Settings.Default.InhDefaultEnableFontSmoothing = DefaultInheritance.EnableFontSmoothing;
Settings.Default.InhDefaultEnableDesktopComposition = DefaultInheritance.EnableDesktopComposition;
Settings.Default.InhDefaultRedirectKeys = DefaultInheritance.RedirectKeys;
Settings.Default.InhDefaultRedirectDiskDrives = DefaultInheritance.RedirectDiskDrives;
Settings.Default.InhDefaultRedirectPrinters = DefaultInheritance.RedirectPrinters;
Settings.Default.InhDefaultRedirectPorts = DefaultInheritance.RedirectPorts;
Settings.Default.InhDefaultRedirectSmartCards = DefaultInheritance.RedirectSmartCards;
Settings.Default.InhDefaultRedirectSound = DefaultInheritance.RedirectSound;
Settings.Default.InhDefaultPreExtApp = DefaultInheritance.PreExtApp;
Settings.Default.InhDefaultPostExtApp = DefaultInheritance.PostExtApp;
Settings.Default.InhDefaultMacAddress = DefaultInheritance.MacAddress;
Settings.Default.InhDefaultUserField = DefaultInheritance.UserField;
// VNC inheritance
Settings.Default.InhDefaultVNCAuthMode = DefaultInheritance.VNCAuthMode;
Settings.Default.InhDefaultVNCColors = DefaultInheritance.VNCColors;
Settings.Default.InhDefaultVNCCompression = DefaultInheritance.VNCCompression;
Settings.Default.InhDefaultVNCEncoding = DefaultInheritance.VNCEncoding;
Settings.Default.InhDefaultVNCProxyIP = DefaultInheritance.VNCProxyIP;
Settings.Default.InhDefaultVNCProxyPassword = DefaultInheritance.VNCProxyPassword;
Settings.Default.InhDefaultVNCProxyPort = DefaultInheritance.VNCProxyPort;
Settings.Default.InhDefaultVNCProxyType = DefaultInheritance.VNCProxyType;
Settings.Default.InhDefaultVNCProxyUsername = DefaultInheritance.VNCProxyUsername;
Settings.Default.InhDefaultVNCSmartSizeMode = DefaultInheritance.VNCSmartSizeMode;
Settings.Default.InhDefaultVNCViewOnly = DefaultInheritance.VNCViewOnly;
// Ext. App inheritance
Settings.Default.InhDefaultExtApp = DefaultInheritance.ExtApp;
// RDP gateway inheritance
Settings.Default.InhDefaultRDGatewayUsageMethod = DefaultInheritance.RDGatewayUsageMethod;
Settings.Default.InhDefaultRDGatewayHostname = DefaultInheritance.RDGatewayHostname;
Settings.Default.InhDefaultRDGatewayUsername = DefaultInheritance.RDGatewayUsername;
Settings.Default.InhDefaultRDGatewayPassword = DefaultInheritance.RDGatewayPassword;
Settings.Default.InhDefaultRDGatewayDomain = DefaultInheritance.RDGatewayDomain;
Settings.Default.InhDefaultRDGatewayUseConnectionCredentials = DefaultInheritance.RDGatewayUseConnectionCredentials;
}
#endregion
#region Panels
public static Form AddPanel(string title = "", bool noTabber = false)
{
@@ -285,9 +218,10 @@ namespace mRemoteNG.App
try
{
ConnectionWindow conW = default(ConnectionWindow);
conW = (ConnectionWindow)((Control)sender).Tag;
conW = (ConnectionWindow)((ToolStripMenuItem)sender).Tag;
string nTitle = Interaction.InputBox(Prompt: Language.strNewTitle + ":", DefaultResponse: Convert.ToString(((Control)((Control)sender).Tag).Text.Replace("&&", "&")));
string nTitle = "";
input.InputBox(Language.strNewTitle, Language.strNewTitle + ":", ref nTitle);
if (!string.IsNullOrEmpty(nTitle))
{
@@ -411,12 +345,12 @@ namespace mRemoteNG.App
}
}
public static void LoadConnectionsBG(bool WithDialog = false, bool Update = false)
public static void LoadConnectionsBG(bool withDialog = false, bool update = false)
{
_withDialog = false;
_loadUpdate = true;
Thread t = new Thread(LoadConnectionsBGd);
var t = new Thread(LoadConnectionsBGd);
t.SetApartmentState(ApartmentState.STA);
t.Start();
}
@@ -430,12 +364,11 @@ namespace mRemoteNG.App
public static void LoadConnections(bool withDialog = false, bool update = false)
{
ConnectionsLoader connectionsLoader = new ConnectionsLoader();
var connectionsLoader = new ConnectionsLoader();
try
{
// disable sql update checking while we are loading updates
if (SQLConnProvider != null)
SQLConnProvider.Disable();
SQLConnProvider?.Disable();
if (ConnectionList != null && ContainerList != null)
{
@@ -450,15 +383,9 @@ namespace mRemoteNG.App
{
if (withDialog)
{
OpenFileDialog loadDialog = Tools.Controls.ConnectionsLoadDialog();
if (loadDialog.ShowDialog() == DialogResult.OK)
{
connectionsLoader.ConnectionFileName = loadDialog.FileName;
}
else
{
return;
}
var loadDialog = Tools.Controls.ConnectionsLoadDialog();
if (loadDialog.ShowDialog() != DialogResult.OK) return;
connectionsLoader.ConnectionFileName = loadDialog.FileName;
}
else
{
@@ -485,12 +412,13 @@ namespace mRemoteNG.App
ConnectionTree.ResetTree();
connectionsLoader.RootTreeNode = Windows.treeForm.tvConnections.Nodes[0];
connectionsLoader.UseSQL = Settings.Default.UseSQLServer;
connectionsLoader.SQLHost = Settings.Default.SQLHost;
connectionsLoader.SQLDatabaseName = Settings.Default.SQLDatabaseName;
connectionsLoader.SQLUsername = Settings.Default.SQLUser;
connectionsLoader.SQLPassword = Security.Crypt.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
connectionsLoader.SQLUpdate = update;
connectionsLoader.UseDatabase = Settings.Default.UseSQLServer;
connectionsLoader.DatabaseHost = Settings.Default.SQLHost;
connectionsLoader.DatabaseName = Settings.Default.SQLDatabaseName;
connectionsLoader.DatabaseUsername = Settings.Default.SQLUser;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
connectionsLoader.DatabasePassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
connectionsLoader.DatabaseUpdate = update;
connectionsLoader.LoadConnections(false);
if (Settings.Default.UseSQLServer)
@@ -511,17 +439,14 @@ namespace mRemoteNG.App
}
// re-enable sql update checking after updates are loaded
if (Settings.Default.UseSQLServer && SQLConnProvider != null)
{
SQLConnProvider.Enable();
}
SQLConnProvider?.Enable();
}
catch (Exception ex)
{
if (Settings.Default.UseSQLServer)
{
MessageCollector.AddExceptionMessage(Language.strLoadFromSqlFailed, ex);
string commandButtons = string.Join("|", new[] { Language.strCommandTryAgain, Language.strCommandOpenConnectionFile, string.Format(Language.strCommandExitProgram, Application.ProductName) });
var commandButtons = string.Join("|", Language.strCommandTryAgain, Language.strCommandOpenConnectionFile, string.Format(Language.strCommandExitProgram, Application.ProductName));
CTaskDialog.ShowCommandBox(Application.ProductName, Language.strLoadFromSqlFailed, Language.strLoadFromSqlFailedContent, MiscTools.GetExceptionMessageRecursive(ex), "", "", commandButtons, false, ESysIcons.Error, ESysIcons.Error);
switch (CTaskDialog.CommandButtonResult)
{
@@ -537,29 +462,24 @@ namespace mRemoteNG.App
return;
}
}
if (ex is FileNotFoundException && !withDialog)
{
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoadedNew, connectionsLoader.ConnectionFileName), ex, MessageClass.InformationMsg);
NewConnections(Convert.ToString(connectionsLoader.ConnectionFileName));
return;
}
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoaded, connectionsLoader.ConnectionFileName), ex);
if (connectionsLoader.ConnectionFileName != GetStartupConnectionFileName())
{
LoadConnections(withDialog, update);
}
else
{
if (ex is FileNotFoundException && !withDialog)
{
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoadedNew, connectionsLoader.ConnectionFileName), ex, MessageClass.InformationMsg);
NewConnections(Convert.ToString(connectionsLoader.ConnectionFileName));
return;
}
MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoaded, connectionsLoader.ConnectionFileName), ex);
if (connectionsLoader.ConnectionFileName != GetStartupConnectionFileName())
{
LoadConnections(withDialog, update);
return;
}
else
{
MessageBox.Show(frmMain.Default,
string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine, Application.ProductName, GetStartupConnectionFileName(), MiscTools.GetExceptionMessageRecursive(ex)),
"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
return;
}
MessageBox.Show(frmMain.Default,
string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine, Application.ProductName, GetStartupConnectionFileName(), MiscTools.GetExceptionMessageRecursive(ex)),
"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
}
}
@@ -692,7 +612,8 @@ namespace mRemoteNG.App
conS.SQLHost = Convert.ToString(Settings.Default.SQLHost);
conS.SQLDatabaseName = Convert.ToString(Settings.Default.SQLDatabaseName);
conS.SQLUsername = Convert.ToString(Settings.Default.SQLUser);
conS.SQLPassword = Security.Crypt.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
conS.SQLPassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
}
conS.SaveConnections();
@@ -1095,19 +1016,12 @@ namespace mRemoteNG.App
ProtocolBase Prot = (ProtocolBase)sender;
if (Prot.InterfaceControl.Info.Protocol == ProtocolType.RDP)
{
string[] Reason = DisconnectedMessage.Split("\r\n".ToCharArray());
string ReasonCode = Reason[0];
string ReasonDescription = Reason[1];
string ReasonCode = DisconnectedMessage.Split("\r\n".ToCharArray())[0];
string desc = DisconnectedMessage.Replace("\r\n", " ");
if (Convert.ToInt32(ReasonCode) > 3)
{
if (!string.IsNullOrEmpty(ReasonDescription))
{
MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strRdpDisconnected + Environment.NewLine + ReasonDescription + Environment.NewLine + string.Format(Language.strErrorCode, ReasonCode));
}
else
{
MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strRdpDisconnected + Environment.NewLine + string.Format(Language.strErrorCode, ReasonCode));
}
MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strRdpDisconnected + Environment.NewLine + desc);
}
}
}

View File

@@ -23,6 +23,7 @@ namespace mRemoteNG.App
{
_updateFilePath = updateFilePath;
frmMain.Default.Close();
ProgramRoot.CloseSingletonInstanceMutex();
}
public static void Cleanup()

View File

@@ -1,33 +1,38 @@
using Microsoft.Win32;
using mRemoteNG.App.Info;
using mRemoteNG.App.Update;
using mRemoteNG.Config.Connections;
using mRemoteNG.Connection;
using mRemoteNG.Messages;
using mRemoteNG.Tools;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.Window;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Management;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using mRemoteNG.Config.Connections;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
using System.Globalization;
using mRemoteNG.App.Info;
namespace mRemoteNG.App
{
public class Startup
{
private static readonly Startup _singletonInstance = new Startup();
private CompatibilityChecker _compatibilityChecker;
private AppUpdater _appUpdate;
public static Startup Instance
{
get { return _singletonInstance; }
}
private Startup()
{
_compatibilityChecker = new CompatibilityChecker();
_appUpdate = new AppUpdater();
}
@@ -35,84 +40,19 @@ namespace mRemoteNG.App
{
}
public static void InitializeProgram()
public void InitializeProgram()
{
Debug.Print("---------------------------" + Environment.NewLine + "[START] - " + Convert.ToString(DateTime.Now, CultureInfo.InvariantCulture));
_singletonInstance.LogStartupData();
//CheckCompatibility();
_singletonInstance.ParseCommandLineArgs();
LogStartupData();
_compatibilityChecker.CheckCompatibility();
ParseCommandLineArgs();
IeBrowserEmulation.Register();
_singletonInstance.GetConnectionIcons();
GetConnectionIcons();
DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, (a)=>"InhDefault"+a);
}
private void CheckCompatibility()
{
CheckFipsPolicy();
CheckLenovoAutoScrollUtility();
}
private void CheckFipsPolicy()
{
RegistryKey regKey = default(RegistryKey);
bool isFipsPolicyEnabled = false;
// Windows XP/Windows Server 2003
regKey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Lsa");
if (regKey != null)
{
if ((int)regKey.GetValue("FIPSAlgorithmPolicy") != 0)
{
isFipsPolicyEnabled = true;
}
}
// Windows Vista/Windows Server 2008 and newer
regKey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy");
if (regKey != null)
{
if ((int)regKey.GetValue("Enabled") != 0)
{
isFipsPolicyEnabled = true;
}
}
if (isFipsPolicyEnabled)
{
MessageBox.Show(frmMain.Default, string.Format(Language.strErrorFipsPolicyIncompatible, GeneralAppInfo.ProdName, GeneralAppInfo.ProdName, MessageBoxButtons.OK, MessageBoxIcon.Error));
Environment.Exit(1);
}
}
private void CheckLenovoAutoScrollUtility()
{
if (!Settings.Default.CompatibilityWarnLenovoAutoScrollUtility)
{
return;
}
Process[] proccesses = new Process[] { };
try
{
proccesses = Process.GetProcessesByName("virtscrl");
}
catch(Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("Error in CheckLenovoAutoScrollUtility", ex);
}
if (proccesses.Length == 0)
{
return;
}
CTaskDialog.MessageBox(Application.ProductName, Language.strCompatibilityProblemDetected, string.Format(Language.strCompatibilityLenovoAutoScrollUtilityDetected, Application.ProductName), "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.Ok, ESysIcons.Warning, ESysIcons.Warning);
if (CTaskDialog.VerificationChecked)
{
Settings.Default.CompatibilityWarnLenovoAutoScrollUtility = false;
}
}
public static void SetDefaultLayout()
public void SetDefaultLayout()
{
frmMain.Default.pnlDock.Visible = false;
@@ -129,6 +69,7 @@ namespace mRemoteNG.App
frmMain.Default.pnlDock.Visible = true;
}
private void GetConnectionIcons()
{
string iPath = GeneralAppInfo.HomePath + "\\Icons\\";
@@ -157,12 +98,14 @@ namespace mRemoteNG.App
LogCultureData();
}
}
private void LogSystemData()
{
string osData = GetOperatingSystemData();
string architecture = GetArchitectureData();
Logger.Instance.InfoFormat(string.Join(" ", Array.FindAll(new string[] { osData, architecture }, s => !string.IsNullOrEmpty(Convert.ToString(s)))));
Logger.Instance.InfoFormat(string.Join(" ", Array.FindAll(new[] { osData, architecture }, s => !string.IsNullOrEmpty(Convert.ToString(s)))));
}
private string GetOperatingSystemData()
{
string osVersion = string.Empty;
@@ -170,73 +113,78 @@ namespace mRemoteNG.App
try
{
foreach (ManagementObject managementObject in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True").Get())
foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True").Get())
{
osVersion = GetOSVersion(osVersion, managementObject);
var managementObject = (ManagementObject) o;
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
servicePack = GetOSServicePack(servicePack, managementObject);
}
}
catch (Exception ex)
{
Logger.Instance.WarnFormat("Error retrieving operating system information from WMI. {0}", ex.Message);
Logger.Instance.WarnFormat($"Error retrieving operating system information from WMI. {ex.Message}");
}
string osData = string.Join(" ", new string[] { osVersion, servicePack });
return osData;
}
private string GetOSVersion(string osVersion, ManagementObject managementObject)
{
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
return osVersion;
}
private string GetOSServicePack(string servicePack, ManagementObject managementObject)
{
int servicePackNumber = Convert.ToInt32(managementObject.GetPropertyValue("ServicePackMajorVersion"));
if (!(servicePackNumber == 0))
if (servicePackNumber != 0)
{
servicePack = string.Format("Service Pack {0}", servicePackNumber);
servicePack = $"Service Pack {servicePackNumber}";
}
return servicePack;
}
private string GetArchitectureData()
{
string architecture = string.Empty;
try
{
foreach (ManagementObject managementObject in new ManagementObjectSearcher("SELECT * FROM Win32_Processor WHERE DeviceID=\'CPU0\'").Get())
foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_Processor WHERE DeviceID=\'CPU0\'").Get())
{
var managementObject = (ManagementObject) o;
int addressWidth = Convert.ToInt32(managementObject.GetPropertyValue("AddressWidth"));
architecture = string.Format("{0}-bit", addressWidth);
architecture = $"{addressWidth}-bit";
}
}
catch (Exception ex)
{
Logger.Instance.WarnFormat("Error retrieving operating system address width from WMI. {0}", ex.Message);
Logger.Instance.WarnFormat($"Error retrieving operating system address width from WMI. {ex.Message}");
}
return architecture;
}
private void LogApplicationData()
{
#if !PORTABLE
Logger.Instance.InfoFormat("{0} {1} starting.", System.Windows.Forms.Application.ProductName, System.Windows.Forms.Application.ProductVersion);
Logger.Instance.InfoFormat($"{Application.ProductName} {Application.ProductVersion} starting.");
#else
Logger.Instance.InfoFormat("{0} {1} {2} starting.", Application.ProductName, Application.ProductVersion, Language.strLabelPortableEdition);
Logger.Instance.InfoFormat(
$"{Application.ProductName} {Application.ProductVersion} {Language.strLabelPortableEdition} starting.");
#endif
}
private void LogCmdLineArgs()
{
Logger.Instance.InfoFormat("Command Line: {0}", Environment.GetCommandLineArgs());
Logger.Instance.InfoFormat($"Command Line: {Environment.GetCommandLineArgs()}");
}
private void LogCLRData()
{
Logger.Instance.InfoFormat("Microsoft .NET CLR {0}", Environment.Version);
Logger.Instance.InfoFormat($"Microsoft .NET CLR {Environment.Version}");
}
private void LogCultureData()
{
Logger.Instance.InfoFormat("System Culture: {0}/{1}", Thread.CurrentThread.CurrentUICulture.Name, Thread.CurrentThread.CurrentUICulture.NativeName);
Logger.Instance.InfoFormat(
$"System Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}");
}
public static void CreateConnectionsProvider()
public void CreateConnectionsProvider()
{
if (Settings.Default.UseSQLServer)
{
@@ -264,6 +212,7 @@ namespace mRemoteNG.App
_appUpdate.GetUpdateInfoCompletedEvent += GetUpdateInfoCompleted;
_appUpdate.GetUpdateInfoAsync();
}
private void GetUpdateInfoCompleted(object sender, AsyncCompletedEventArgs e)
{
if (frmMain.Default.InvokeRequired)
@@ -307,6 +256,7 @@ namespace mRemoteNG.App
_appUpdate.GetAnnouncementInfoCompletedEvent += GetAnnouncementInfoCompleted;
_appUpdate.GetAnnouncementInfoAsync();
}
private void GetAnnouncementInfoCompleted(object sender, AsyncCompletedEventArgs e)
{
if (frmMain.Default.InvokeRequired)

View File

@@ -6,6 +6,8 @@ using System.Threading;
using mRemoteNG.Tools;
using System.Reflection;
using mRemoteNG.App.Info;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
namespace mRemoteNG.App.Update
@@ -107,7 +109,15 @@ namespace mRemoteNG.App.Update
public void SetProxySettings()
{
SetProxySettings(Convert.ToBoolean(Settings.Default.UpdateUseProxy), Convert.ToString(Settings.Default.UpdateProxyAddress), Convert.ToInt32(Settings.Default.UpdateProxyPort), Convert.ToBoolean(Settings.Default.UpdateProxyUseAuthentication), Convert.ToString(Settings.Default.UpdateProxyAuthUser), Security.Crypt.Decrypt(Convert.ToString(Settings.Default.UpdateProxyAuthPass), GeneralAppInfo.EncryptionKey));
var shouldWeUseProxy = Settings.Default.UpdateUseProxy;
var proxyAddress = Settings.Default.UpdateProxyAddress;
var port = Settings.Default.UpdateProxyPort;
var useAuthentication = Settings.Default.UpdateProxyUseAuthentication;
var username = Settings.Default.UpdateProxyAuthUser;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
var password = cryptographyProvider.Decrypt(Settings.Default.UpdateProxyAuthPass, GeneralAppInfo.EncryptionKey);
SetProxySettings(shouldWeUseProxy, proxyAddress, port, useAuthentication, username, password);
}
public void SetProxySettings(bool useProxy, string address, int port, bool useAuthentication, string username, string password)

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@ using System.Data.SqlClient;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Security;
using System.Text;
using System.Windows.Forms;
using System.Xml;
@@ -14,6 +15,7 @@ using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Container;
using mRemoteNG.Messages;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
@@ -37,7 +39,7 @@ namespace mRemoteNG.Config.Connections
#region Private Properties
private XmlTextWriter _xmlTextWriter;
private string _password = "mR3m";
private SecureString _password = GeneralAppInfo.EncryptionKey;
private SqlConnection _sqlConnection;
private SqlCommand _sqlQuery;
@@ -99,8 +101,7 @@ namespace mRemoteNG.Config.Connections
{
bool isVerified = false;
SqlDataReader sqlDataReader = null;
Version databaseVersion = null;
try
try
{
SqlCommand sqlCommand = new SqlCommand("SELECT * FROM tblRoot", sqlConnection);
sqlDataReader = sqlCommand.ExecuteReader();
@@ -110,7 +111,7 @@ namespace mRemoteNG.Config.Connections
}
sqlDataReader.Read();
databaseVersion = new Version(Convert.ToString(sqlDataReader["confVersion"], CultureInfo.InvariantCulture));
var databaseVersion = new Version(Convert.ToString(sqlDataReader["confVersion"], CultureInfo.InvariantCulture));
sqlDataReader.Close();
@@ -175,8 +176,9 @@ namespace mRemoteNG.Config.Connections
{
_sqlConnection = new SqlConnection("Data Source=" + SQLHost + ";Initial Catalog=" + SQLDatabaseName + ";Integrated Security=True");
}
_sqlConnection.Open();
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
_sqlConnection.Open();
if (!VerifyDatabaseVersion(_sqlConnection))
{
@@ -191,17 +193,17 @@ namespace mRemoteNG.Config.Connections
{
if (((RootNodeInfo) tN.Tag).Password)
{
_password = Convert.ToString(((RootNodeInfo) tN.Tag).PasswordString);
strProtected = Crypt.Encrypt("ThisIsProtected", _password);
_password = Convert.ToString(((RootNodeInfo) tN.Tag).PasswordString).ConvertToSecureString();
strProtected = cryptographyProvider.Encrypt("ThisIsProtected", _password);
}
else
{
strProtected = Crypt.Encrypt("ThisIsNotProtected", _password);
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", _password);
}
}
else
{
strProtected = Crypt.Encrypt("ThisIsNotProtected", _password);
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", _password);
}
_sqlQuery = new SqlCommand("DELETE FROM tblRoot", _sqlConnection);
@@ -231,7 +233,7 @@ namespace mRemoteNG.Config.Connections
{
_currentNodeIndex++;
ConnectionInfo curConI = default(ConnectionInfo);
ConnectionInfo curConI;
_sqlQuery = new SqlCommand("INSERT INTO tblCons (Name, Type, Expanded, Description, Icon, Panel, Username, " + "DomainName, Password, Hostname, Protocol, PuttySession, " + "Port, ConnectToConsole, RenderingEngine, ICAEncryptionStrength, RDPAuthenticationLevel, LoadBalanceInfo, Colors, Resolution, AutomaticResize, DisplayWallpaper, " + "DisplayThemes, EnableFontSmoothing, EnableDesktopComposition, CacheBitmaps, RedirectDiskDrives, RedirectPorts, " + "RedirectPrinters, RedirectSmartCards, RedirectSound, RedirectKeys, " + "Connected, PreExtApp, PostExtApp, MacAddress, UserField, ExtApp, VNCCompression, VNCEncoding, VNCAuthMode, " + "VNCProxyType, VNCProxyIP, VNCProxyPort, VNCProxyUsername, VNCProxyPassword, " + "VNCColors, VNCSmartSizeMode, VNCViewOnly, " + "RDGatewayUsageMethod, RDGatewayHostname, RDGatewayUseConnectionCredentials, RDGatewayUsername, RDGatewayPassword, RDGatewayDomain, " + "UseCredSsp, " + "InheritCacheBitmaps, InheritColors, " + "InheritDescription, InheritDisplayThemes, InheritDisplayWallpaper, InheritEnableFontSmoothing, InheritEnableDesktopComposition, InheritDomain, " + "InheritIcon, InheritPanel, InheritPassword, InheritPort, " + "InheritProtocol, InheritPuttySession, InheritRedirectDiskDrives, " + "InheritRedirectKeys, InheritRedirectPorts, InheritRedirectPrinters, " + "InheritRedirectSmartCards, InheritRedirectSound, InheritResolution, InheritAutomaticResize, " + "InheritUseConsoleSession, InheritRenderingEngine, InheritUsername, InheritICAEncryptionStrength, InheritRDPAuthenticationLevel, InheritLoadBalanceInfo, " + "InheritPreExtApp, InheritPostExtApp, InheritMacAddress, InheritUserField, InheritExtApp, InheritVNCCompression, InheritVNCEncoding, " + "InheritVNCAuthMode, InheritVNCProxyType, InheritVNCProxyIP, InheritVNCProxyPort, " + "InheritVNCProxyUsername, InheritVNCProxyPassword, InheritVNCColors, " + "InheritVNCSmartSizeMode, InheritVNCViewOnly, " + "InheritRDGatewayUsageMethod, InheritRDGatewayHostname, InheritRDGatewayUseConnectionCredentials, InheritRDGatewayUsername, InheritRDGatewayPassword, InheritRDGatewayDomain, "
+ "InheritUseCredSsp, " + "PositionID, ParentID, ConstantID, LastChange)" + "VALUES (", _sqlConnection
);
@@ -272,7 +274,8 @@ namespace mRemoteNG.Config.Connections
private void SaveConnectionFieldsSQL(ConnectionInfo curConI)
{
ConnectionInfo with_1 = curConI;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
ConnectionInfo with_1 = curConI;
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Description) + "\',";
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Icon) + "\',";
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Panel) + "\',";
@@ -297,7 +300,7 @@ namespace mRemoteNG.Config.Connections
if (SaveSecurity.Password)
{
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(Crypt.Encrypt(with_1.Password, _password)) + "\',";
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(cryptographyProvider.Encrypt(with_1.Password, _password)) + "\',";
}
else
{
@@ -310,7 +313,7 @@ namespace mRemoteNG.Config.Connections
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Port) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.UseConsoleSession) + "\',";
_sqlQuery.CommandText += "\'" + with_1.RenderingEngine + "\',";
_sqlQuery.CommandText += "\'" + with_1.ICAEncryption + "\',";
_sqlQuery.CommandText += "\'" + with_1.ICAEncryptionStrength + "\',";
_sqlQuery.CommandText += "\'" + with_1.RDPAuthenticationLevel + "\',";
_sqlQuery.CommandText += "\'" + with_1.LoadBalanceInfo + "\',";
_sqlQuery.CommandText += "\'" + with_1.Colors + "\',";
@@ -350,7 +353,7 @@ namespace mRemoteNG.Config.Connections
_sqlQuery.CommandText += "\'" + with_1.VNCProxyIP + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.VNCProxyPort) + "\',";
_sqlQuery.CommandText += "\'" + with_1.VNCProxyUsername + "\',";
_sqlQuery.CommandText += "\'" + Crypt.Encrypt(with_1.VNCProxyPassword, _password) + "\',";
_sqlQuery.CommandText += "\'" + cryptographyProvider.Encrypt(with_1.VNCProxyPassword, _password) + "\',";
_sqlQuery.CommandText += "\'" + with_1.VNCColors + "\',";
_sqlQuery.CommandText += "\'" + with_1.VNCSmartSizeMode + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.VNCViewOnly) + "\',";
@@ -370,7 +373,7 @@ namespace mRemoteNG.Config.Connections
if (SaveSecurity.Password)
{
_sqlQuery.CommandText += "\'" + Crypt.Encrypt(with_1.RDGatewayPassword, _password) + "\',";
_sqlQuery.CommandText += "\'" + cryptographyProvider.Encrypt(with_1.RDGatewayPassword, _password) + "\',";
}
else
{
@@ -415,7 +418,7 @@ namespace mRemoteNG.Config.Connections
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.UseConsoleSession) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.RenderingEngine) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.Username) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.ICAEncryption) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.ICAEncryptionStrength) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.RDPAuthenticationLevel) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.LoadBalanceInfo) + "\',";
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.PreExtApp) + "\',";
@@ -536,15 +539,16 @@ namespace mRemoteNG.Config.Connections
private void EncryptCompleteFile()
{
StreamReader streamReader = new StreamReader(ConnectionFileName);
string fileContents;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
string fileContents;
fileContents = streamReader.ReadToEnd();
streamReader.Close();
if (!string.IsNullOrEmpty(fileContents))
{
StreamWriter streamWriter = new StreamWriter(ConnectionFileName);
streamWriter.Write(Crypt.Encrypt(fileContents, _password));
streamWriter.Write(cryptographyProvider.Encrypt(fileContents, _password));
streamWriter.Close();
}
}
@@ -557,8 +561,8 @@ namespace mRemoteNG.Config.Connections
{
return;
}
TreeNode treeNode = default(TreeNode);
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
TreeNode treeNode;
if (ConnectionTreeNode.GetNodeType(RootTreeNode) == TreeNodeType.Root)
{
@@ -584,25 +588,24 @@ namespace mRemoteNG.Config.Connections
if (Export)
{
_xmlTextWriter.WriteAttributeString("Protected", "", Crypt.Encrypt("ThisIsNotProtected", _password));
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsNotProtected", _password));
}
else
{
if (((RootNodeInfo) treeNode.Tag).Password)
{
_password = Convert.ToString(((RootNodeInfo) treeNode.Tag).PasswordString);
_xmlTextWriter.WriteAttributeString("Protected", "", Crypt.Encrypt("ThisIsProtected", _password));
_password = Convert.ToString(((RootNodeInfo) treeNode.Tag).PasswordString).ConvertToSecureString();
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsProtected", _password));
}
else
{
_xmlTextWriter.WriteAttributeString("Protected", "", Crypt.Encrypt("ThisIsNotProtected", _password));
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsNotProtected", _password));
}
}
_xmlTextWriter.WriteAttributeString("ConfVersion", "", ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture));
TreeNodeCollection treeNodeCollection = default(TreeNodeCollection);
treeNodeCollection = treeNode.Nodes;
var treeNodeCollection = treeNode.Nodes;
SaveNode(treeNodeCollection);
@@ -626,8 +629,9 @@ namespace mRemoteNG.Config.Connections
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveToXml failed" + Environment.NewLine + ex.Message, false);
}
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveToXml failed" + Environment.NewLine + ex.Message);
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveToXml failed" + Environment.NewLine + ex.StackTrace, true);
}
}
private void SaveNode(TreeNodeCollection tNC)
@@ -636,7 +640,7 @@ namespace mRemoteNG.Config.Connections
{
foreach (TreeNode node in tNC)
{
ConnectionInfo curConI = default(ConnectionInfo);
ConnectionInfo curConI;
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
{
@@ -672,7 +676,8 @@ namespace mRemoteNG.Config.Connections
{
try
{
_xmlTextWriter.WriteAttributeString("Descr", "", curConI.Description);
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
_xmlTextWriter.WriteAttributeString("Descr", "", curConI.Description);
_xmlTextWriter.WriteAttributeString("Icon", "", curConI.Icon);
@@ -698,7 +703,7 @@ namespace mRemoteNG.Config.Connections
if (SaveSecurity.Password)
{
_xmlTextWriter.WriteAttributeString("Password", "", Crypt.Encrypt(curConI.Password, _password));
_xmlTextWriter.WriteAttributeString("Password", "", cryptographyProvider.Encrypt(curConI.Password, _password));
}
else
{
@@ -719,7 +724,7 @@ namespace mRemoteNG.Config.Connections
_xmlTextWriter.WriteAttributeString("RenderingEngine", "", curConI.RenderingEngine.ToString());
_xmlTextWriter.WriteAttributeString("ICAEncryptionStrength", "", curConI.ICAEncryption.ToString());
_xmlTextWriter.WriteAttributeString("ICAEncryptionStrength", "", curConI.ICAEncryptionStrength.ToString());
_xmlTextWriter.WriteAttributeString("RDPAuthenticationLevel", "", curConI.RDPAuthenticationLevel.ToString());
@@ -775,7 +780,7 @@ namespace mRemoteNG.Config.Connections
_xmlTextWriter.WriteAttributeString("VNCProxyIP", "", curConI.VNCProxyIP);
_xmlTextWriter.WriteAttributeString("VNCProxyPort", "", Convert.ToString(curConI.VNCProxyPort));
_xmlTextWriter.WriteAttributeString("VNCProxyUsername", "", curConI.VNCProxyUsername);
_xmlTextWriter.WriteAttributeString("VNCProxyPassword", "", Crypt.Encrypt(curConI.VNCProxyPassword, _password));
_xmlTextWriter.WriteAttributeString("VNCProxyPassword", "", cryptographyProvider.Encrypt(curConI.VNCProxyPassword, _password));
_xmlTextWriter.WriteAttributeString("VNCColors", "", curConI.VNCColors.ToString());
_xmlTextWriter.WriteAttributeString("VNCSmartSizeMode", "", curConI.VNCSmartSizeMode.ToString());
_xmlTextWriter.WriteAttributeString("VNCViewOnly", "", Convert.ToString(curConI.VNCViewOnly));
@@ -796,7 +801,7 @@ namespace mRemoteNG.Config.Connections
if (SaveSecurity.Password)
{
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", Crypt.Encrypt(curConI.RDGatewayPassword, _password));
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", cryptographyProvider.Encrypt(curConI.RDGatewayPassword, _password));
}
else
{
@@ -840,7 +845,7 @@ namespace mRemoteNG.Config.Connections
_xmlTextWriter.WriteAttributeString("InheritUseCredSsp", "", Convert.ToString(curConI.Inheritance.UseCredSsp));
_xmlTextWriter.WriteAttributeString("InheritRenderingEngine", "", Convert.ToString(curConI.Inheritance.RenderingEngine));
_xmlTextWriter.WriteAttributeString("InheritUsername", "", Convert.ToString(curConI.Inheritance.Username));
_xmlTextWriter.WriteAttributeString("InheritICAEncryptionStrength", "", Convert.ToString(curConI.Inheritance.ICAEncryption));
_xmlTextWriter.WriteAttributeString("InheritICAEncryptionStrength", "", Convert.ToString(curConI.Inheritance.ICAEncryptionStrength));
_xmlTextWriter.WriteAttributeString("InheritRDPAuthenticationLevel", "", Convert.ToString(curConI.Inheritance.RDPAuthenticationLevel));
_xmlTextWriter.WriteAttributeString("InheritLoadBalanceInfo", "", Convert.ToString(curConI.Inheritance.LoadBalanceInfo));
_xmlTextWriter.WriteAttributeString("InheritPreExtApp", "", Convert.ToString(curConI.Inheritance.PreExtApp));
@@ -936,12 +941,10 @@ namespace mRemoteNG.Config.Connections
{
return;
}
TreeNode tN = default(TreeNode);
tN = (TreeNode)RootTreeNode.Clone();
TreeNodeCollection tNC = default(TreeNodeCollection);
tNC = tN.Nodes;
var tN = (TreeNode)RootTreeNode.Clone();
var tNC = tN.Nodes;
csvWr = new StreamWriter(ConnectionFileName);
@@ -1000,9 +1003,9 @@ namespace mRemoteNG.Config.Connections
{
string nodePath = con.TreeNode.FullPath;
int firstSlash = nodePath.IndexOf("\\");
int firstSlash = nodePath.IndexOf("\\", StringComparison.Ordinal);
nodePath = nodePath.Remove(0, firstSlash + 1);
int lastSlash = nodePath.LastIndexOf("\\");
int lastSlash = nodePath.LastIndexOf("\\", StringComparison.Ordinal);
if (lastSlash > 0)
{
@@ -1032,11 +1035,11 @@ namespace mRemoteNG.Config.Connections
csvLn += con.Domain + ";";
}
csvLn += con.Hostname + ";" + con.Protocol + ";" + con.PuttySession + ";" + Convert.ToString(con.Port) + ";" + Convert.ToString(con.UseConsoleSession) + ";" + Convert.ToString(con.UseCredSsp) + ";" + con.RenderingEngine + ";" + con.ICAEncryption + ";" + con.RDPAuthenticationLevel + ";" + con.LoadBalanceInfo + ";" + con.Colors + ";" + con.Resolution + ";" + Convert.ToString(con.AutomaticResize) + ";" + Convert.ToString(con.DisplayWallpaper) + ";" + Convert.ToString(con.DisplayThemes) + ";" + Convert.ToString(con.EnableFontSmoothing) + ";" + Convert.ToString(con.EnableDesktopComposition) + ";" + Convert.ToString(con.CacheBitmaps) + ";" + Convert.ToString(con.RedirectDiskDrives) + ";" + Convert.ToString(con.RedirectPorts) + ";" + Convert.ToString(con.RedirectPrinters) + ";" + Convert.ToString(con.RedirectSmartCards) + ";" + con.RedirectSound + ";" + Convert.ToString(con.RedirectKeys) + ";" + con.PreExtApp + ";" + con.PostExtApp + ";" + con.MacAddress + ";" + con.UserField + ";" + con.ExtApp + ";" + con.VNCCompression + ";" + con.VNCEncoding + ";" + con.VNCAuthMode + ";" + con.VNCProxyType + ";" + con.VNCProxyIP + ";" + Convert.ToString(con.VNCProxyPort) + ";" + con.VNCProxyUsername + ";" + con.VNCProxyPassword + ";" + con.VNCColors + ";" + con.VNCSmartSizeMode + ";" + Convert.ToString(con.VNCViewOnly) + ";";
csvLn += con.Hostname + ";" + con.Protocol + ";" + con.PuttySession + ";" + Convert.ToString(con.Port) + ";" + Convert.ToString(con.UseConsoleSession) + ";" + Convert.ToString(con.UseCredSsp) + ";" + con.RenderingEngine + ";" + con.ICAEncryptionStrength + ";" + con.RDPAuthenticationLevel + ";" + con.LoadBalanceInfo + ";" + con.Colors + ";" + con.Resolution + ";" + Convert.ToString(con.AutomaticResize) + ";" + Convert.ToString(con.DisplayWallpaper) + ";" + Convert.ToString(con.DisplayThemes) + ";" + Convert.ToString(con.EnableFontSmoothing) + ";" + Convert.ToString(con.EnableDesktopComposition) + ";" + Convert.ToString(con.CacheBitmaps) + ";" + Convert.ToString(con.RedirectDiskDrives) + ";" + Convert.ToString(con.RedirectPorts) + ";" + Convert.ToString(con.RedirectPrinters) + ";" + Convert.ToString(con.RedirectSmartCards) + ";" + con.RedirectSound + ";" + Convert.ToString(con.RedirectKeys) + ";" + con.PreExtApp + ";" + con.PostExtApp + ";" + con.MacAddress + ";" + con.UserField + ";" + con.ExtApp + ";" + con.VNCCompression + ";" + con.VNCEncoding + ";" + con.VNCAuthMode + ";" + con.VNCProxyType + ";" + con.VNCProxyIP + ";" + Convert.ToString(con.VNCProxyPort) + ";" + con.VNCProxyUsername + ";" + con.VNCProxyPassword + ";" + con.VNCColors + ";" + con.VNCSmartSizeMode + ";" + Convert.ToString(con.VNCViewOnly) + ";";
if (SaveSecurity.Inheritance)
{
csvLn += con.Inheritance.CacheBitmaps + ";" + Convert.ToString(con.Inheritance.Colors) + ";" + Convert.ToString(con.Inheritance.Description) + ";" + Convert.ToString(con.Inheritance.DisplayThemes) + ";" + Convert.ToString(con.Inheritance.DisplayWallpaper) + ";" + Convert.ToString(con.Inheritance.EnableFontSmoothing) + ";" + Convert.ToString(con.Inheritance.EnableDesktopComposition) + ";" + Convert.ToString(con.Inheritance.Domain) + ";" + Convert.ToString(con.Inheritance.Icon) + ";" + Convert.ToString(con.Inheritance.Panel) + ";" + Convert.ToString(con.Inheritance.Password) + ";" + Convert.ToString(con.Inheritance.Port) + ";" + Convert.ToString(con.Inheritance.Protocol) + ";" + Convert.ToString(con.Inheritance.PuttySession) + ";" + Convert.ToString(con.Inheritance.RedirectDiskDrives) + ";" + Convert.ToString(con.Inheritance.RedirectKeys) + ";" + Convert.ToString(con.Inheritance.RedirectPorts) + ";" + Convert.ToString(con.Inheritance.RedirectPrinters) + ";" + Convert.ToString(con.Inheritance.RedirectSmartCards) + ";" + Convert.ToString(con.Inheritance.RedirectSound) + ";" + Convert.ToString(con.Inheritance.Resolution) + ";" + Convert.ToString(con.Inheritance.AutomaticResize) + ";" + Convert.ToString(con.Inheritance.UseConsoleSession) + ";" + Convert.ToString(con.Inheritance.UseCredSsp) + ";" + Convert.ToString(con.Inheritance.RenderingEngine) + ";" + Convert.ToString(con.Inheritance.Username) + ";" + Convert.ToString(con.Inheritance.ICAEncryption) + ";" + Convert.ToString(con.Inheritance.RDPAuthenticationLevel) + ";" + Convert.ToString(con.Inheritance.LoadBalanceInfo) + ";" + Convert.ToString(con.Inheritance.PreExtApp) + ";" + Convert.ToString(con.Inheritance.PostExtApp) + ";" + Convert.ToString(con.Inheritance.MacAddress) + ";" + Convert.ToString(con.Inheritance.UserField) + ";" + Convert.ToString(con.Inheritance.ExtApp) + ";" + Convert.ToString(con.Inheritance.VNCCompression) + ";"
csvLn += con.Inheritance.CacheBitmaps + ";" + Convert.ToString(con.Inheritance.Colors) + ";" + Convert.ToString(con.Inheritance.Description) + ";" + Convert.ToString(con.Inheritance.DisplayThemes) + ";" + Convert.ToString(con.Inheritance.DisplayWallpaper) + ";" + Convert.ToString(con.Inheritance.EnableFontSmoothing) + ";" + Convert.ToString(con.Inheritance.EnableDesktopComposition) + ";" + Convert.ToString(con.Inheritance.Domain) + ";" + Convert.ToString(con.Inheritance.Icon) + ";" + Convert.ToString(con.Inheritance.Panel) + ";" + Convert.ToString(con.Inheritance.Password) + ";" + Convert.ToString(con.Inheritance.Port) + ";" + Convert.ToString(con.Inheritance.Protocol) + ";" + Convert.ToString(con.Inheritance.PuttySession) + ";" + Convert.ToString(con.Inheritance.RedirectDiskDrives) + ";" + Convert.ToString(con.Inheritance.RedirectKeys) + ";" + Convert.ToString(con.Inheritance.RedirectPorts) + ";" + Convert.ToString(con.Inheritance.RedirectPrinters) + ";" + Convert.ToString(con.Inheritance.RedirectSmartCards) + ";" + Convert.ToString(con.Inheritance.RedirectSound) + ";" + Convert.ToString(con.Inheritance.Resolution) + ";" + Convert.ToString(con.Inheritance.AutomaticResize) + ";" + Convert.ToString(con.Inheritance.UseConsoleSession) + ";" + Convert.ToString(con.Inheritance.UseCredSsp) + ";" + Convert.ToString(con.Inheritance.RenderingEngine) + ";" + Convert.ToString(con.Inheritance.Username) + ";" + Convert.ToString(con.Inheritance.ICAEncryptionStrength) + ";" + Convert.ToString(con.Inheritance.RDPAuthenticationLevel) + ";" + Convert.ToString(con.Inheritance.LoadBalanceInfo) + ";" + Convert.ToString(con.Inheritance.PreExtApp) + ";" + Convert.ToString(con.Inheritance.PostExtApp) + ";" + Convert.ToString(con.Inheritance.MacAddress) + ";" + Convert.ToString(con.Inheritance.UserField) + ";" + Convert.ToString(con.Inheritance.ExtApp) + ";" + Convert.ToString(con.Inheritance.VNCCompression) + ";"
+ Convert.ToString(con.Inheritance.VNCEncoding) + ";" + Convert.ToString(con.Inheritance.VNCAuthMode) + ";" + Convert.ToString(con.Inheritance.VNCProxyType) + ";" + Convert.ToString(con.Inheritance.VNCProxyIP) + ";" + Convert.ToString(con.Inheritance.VNCProxyPort) + ";" + Convert.ToString(con.Inheritance.VNCProxyUsername) + ";" + Convert.ToString(con.Inheritance.VNCProxyPassword) + ";" + Convert.ToString(con.Inheritance.VNCColors) + ";" + Convert.ToString(con.Inheritance.VNCSmartSizeMode) + ";" + Convert.ToString(con.Inheritance.VNCViewOnly);
}
@@ -1051,12 +1054,10 @@ namespace mRemoteNG.Config.Connections
{
return;
}
TreeNode tN = default(TreeNode);
tN = (TreeNode)RootTreeNode.Clone();
TreeNodeCollection tNC = default(TreeNodeCollection);
tNC = tN.Nodes;
var tN = (TreeNode)RootTreeNode.Clone();
var tNC = tN.Nodes;
csvWr = new StreamWriter(ConnectionFileName);
@@ -1089,9 +1090,9 @@ namespace mRemoteNG.Config.Connections
{
string nodePath = con.TreeNode.FullPath;
int firstSlash = nodePath.IndexOf("\\");
int firstSlash = nodePath.IndexOf("\\", StringComparison.Ordinal);
nodePath = nodePath.Remove(0, firstSlash + 1);
int lastSlash = nodePath.LastIndexOf("\\");
int lastSlash = nodePath.LastIndexOf("\\", StringComparison.Ordinal);
if (lastSlash > 0)
{
@@ -1113,12 +1114,10 @@ namespace mRemoteNG.Config.Connections
{
return;
}
TreeNode tN = default(TreeNode);
tN = (TreeNode)RootTreeNode.Clone();
TreeNodeCollection tNC = default(TreeNodeCollection);
tNC = tN.Nodes;
var tN = (TreeNode)RootTreeNode.Clone();
var tNC = tN.Nodes;
_xmlTextWriter = new XmlTextWriter(ConnectionFileName, Encoding.UTF8);
_xmlTextWriter.Formatting = Formatting.Indented;

View File

@@ -0,0 +1,510 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Globalization;
using System.Security;
using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.App.Info;
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;
using mRemoteNG.Container;
using mRemoteNG.Messages;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
namespace mRemoteNG.Config.Connections
{
public class SqlConnectionsLoader
{
private SqlConnection _sqlConnection;
private SqlCommand _sqlQuery;
private SqlDataReader _sqlDataReader;
private TreeNode _selectedTreeNode;
private double _confVersion;
private SecureString _pW = GeneralAppInfo.EncryptionKey;
public string DatabaseHost { get; set; }
public string DatabaseName { get; set; }
public string DatabaseUsername { get; set; }
public string DatabasePassword { get; set; }
public bool DatabaseUpdate { get; set; }
public string PreviousSelected { get; set; }
public TreeNode RootTreeNode { get; set; }
public ConnectionList ConnectionList { get; set; }
public ContainerList ContainerList { get; set; }
public ConnectionList PreviousConnectionList { get; set; }
public ContainerList PreviousContainerList { get; set; }
private delegate void LoadFromSqlDelegate();
public void LoadFromSql()
{
if (Windows.treeForm == null || Windows.treeForm.tvConnections == null)
return;
if (Windows.treeForm.tvConnections.InvokeRequired)
{
Windows.treeForm.tvConnections.Invoke(new LoadFromSqlDelegate(LoadFromSql));
return;
}
try
{
Runtime.IsConnectionsFileLoaded = false;
_sqlConnection = !string.IsNullOrEmpty(DatabaseUsername) ? new SqlConnection("Data Source=" + DatabaseHost + ";Initial Catalog=" + DatabaseName + ";User Id=" + DatabaseUsername + ";Password=" + DatabasePassword) : new SqlConnection("Data Source=" + DatabaseHost + ";Initial Catalog=" + DatabaseName + ";Integrated Security=True");
_sqlConnection.Open();
_sqlQuery = new SqlCommand("SELECT * FROM tblRoot", _sqlConnection);
_sqlDataReader = _sqlQuery.ExecuteReader(CommandBehavior.CloseConnection);
_sqlDataReader.Read();
if (_sqlDataReader.HasRows == false)
{
Runtime.SaveConnections();
_sqlQuery = new SqlCommand("SELECT * FROM tblRoot", _sqlConnection);
_sqlDataReader = _sqlQuery.ExecuteReader(CommandBehavior.CloseConnection);
_sqlDataReader.Read();
}
_confVersion = Convert.ToDouble(_sqlDataReader["confVersion"], CultureInfo.InvariantCulture);
const double maxSupportedSchemaVersion = 2.5;
if (_confVersion > maxSupportedSchemaVersion)
{
CTaskDialog.ShowTaskDialogBox(
frmMain.Default,
Application.ProductName,
"Incompatible database schema",
$"The database schema on the server is not supported. Please upgrade to a newer version of {Application.ProductName}.",
string.Format("Schema Version: {1}{0}Highest Supported Version: {2}", Environment.NewLine, _confVersion, maxSupportedSchemaVersion),
"",
"",
"",
"",
ETaskDialogButtons.Ok,
ESysIcons.Error,
ESysIcons.Error
);
throw (new Exception($"Incompatible database schema (schema version {_confVersion})."));
}
RootTreeNode.Name = Convert.ToString(_sqlDataReader["Name"]);
var rootInfo = new RootNodeInfo(RootNodeType.Connection)
{
Name = RootTreeNode.Name,
TreeNode = RootTreeNode
};
RootTreeNode.Tag = rootInfo;
RootTreeNode.ImageIndex = (int)TreeImageType.Root;
RootTreeNode.SelectedImageIndex = (int)TreeImageType.Root;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
if (cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["Protected"]), _pW) != "ThisIsNotProtected")
{
if (Authenticate(Convert.ToString(_sqlDataReader["Protected"]), false, rootInfo) == false)
{
mRemoteNG.Settings.Default.LoadConsFromCustomLocation = false;
mRemoteNG.Settings.Default.CustomConsPath = "";
RootTreeNode.Remove();
return;
}
}
_sqlDataReader.Close();
Windows.treeForm.tvConnections.BeginUpdate();
// SECTION 3. Populate the TreeView with the DOM nodes.
AddNodesFromSql(RootTreeNode);
RootTreeNode.Expand();
//expand containers
foreach (ContainerInfo contI in ContainerList)
{
if (contI.IsExpanded)
contI.TreeNode.Expand();
}
Windows.treeForm.tvConnections.EndUpdate();
//open connections from last mremote session
if (mRemoteNG.Settings.Default.OpenConsFromLastSession && !mRemoteNG.Settings.Default.NoReconnect)
{
foreach (ConnectionInfo conI in ConnectionList)
{
if (conI.PleaseConnect)
Runtime.OpenConnection(conI);
}
}
Runtime.IsConnectionsFileLoaded = true;
Windows.treeForm.InitialRefresh();
SetSelectedNode(_selectedTreeNode);
}
finally
{
_sqlConnection?.Close();
}
}
private void AddNodesFromSql(TreeNode baseNode)
{
try
{
_sqlConnection.Open();
_sqlQuery = new SqlCommand("SELECT * FROM tblCons ORDER BY PositionID ASC", _sqlConnection);
_sqlDataReader = _sqlQuery.ExecuteReader(CommandBehavior.CloseConnection);
if (_sqlDataReader.HasRows == false)
return;
while (_sqlDataReader.Read())
{
var tNode = new TreeNode(Convert.ToString(_sqlDataReader["Name"]));
var nodeType = ConnectionTreeNode.GetNodeTypeFromString(Convert.ToString(_sqlDataReader["Type"]));
if (nodeType == TreeNodeType.Connection)
AddConnectionToList(tNode);
else if (nodeType == TreeNodeType.Container)
AddContainerToList(tNode);
var parentId = Convert.ToString(_sqlDataReader["ParentID"].ToString().Trim());
if (string.IsNullOrEmpty(parentId) || parentId == "0")
{
baseNode.Nodes.Add(tNode);
}
else
{
var pNode = ConnectionTreeNode.GetNodeFromConstantID(Convert.ToString(_sqlDataReader["ParentID"]));
if (pNode != null)
{
pNode.Nodes.Add(tNode);
switch (ConnectionTreeNode.GetNodeType(tNode))
{
case TreeNodeType.Connection:
((ConnectionInfo) tNode.Tag).Parent = (ContainerInfo)pNode.Tag;
break;
case TreeNodeType.Container:
((ContainerInfo) tNode.Tag).Parent = (ContainerInfo)pNode.Tag;
break;
}
}
else
{
baseNode.Nodes.Add(tNode);
}
}
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strAddNodesFromSqlFailed + Environment.NewLine + ex.Message, true);
}
}
private void AddConnectionToList(TreeNode tNode)
{
var conI = GetConnectionInfoFromSql();
conI.TreeNode = tNode;
ConnectionList.Add(conI);
tNode.Tag = conI;
if (DatabaseUpdate)
{
var prevCon = PreviousConnectionList.FindByConstantID(conI.ConstantID);
if (prevCon != null)
{
foreach (ProtocolBase prot in prevCon.OpenConnections)
{
prot.InterfaceControl.Info = conI;
conI.OpenConnections.Add(prot);
}
if (conI.OpenConnections.Count > 0)
{
tNode.ImageIndex = (int) TreeImageType.ConnectionOpen;
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionOpen;
}
else
{
tNode.ImageIndex = (int) TreeImageType.ConnectionClosed;
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionClosed;
}
}
else
{
tNode.ImageIndex = (int) TreeImageType.ConnectionClosed;
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionClosed;
}
if (conI.ConstantID == PreviousSelected)
_selectedTreeNode = tNode;
}
else
{
tNode.ImageIndex = (int) TreeImageType.ConnectionClosed;
tNode.SelectedImageIndex = (int) TreeImageType.ConnectionClosed;
}
}
private void AddContainerToList(TreeNode tNode)
{
var contI = new ContainerInfo
{
TreeNode = tNode,
Name = Convert.ToString(_sqlDataReader["Name"])
};
var conI = GetConnectionInfoFromSql();
conI.Parent = contI;
conI.IsContainer = true;
contI.ConnectionInfo = conI;
if (DatabaseUpdate)
{
var prevCont = PreviousContainerList.FindByConstantID(conI.ConstantID);
if (prevCont != null)
contI.IsExpanded = prevCont.IsExpanded;
if (conI.ConstantID == PreviousSelected)
_selectedTreeNode = tNode;
}
else
{
contI.IsExpanded = Convert.ToBoolean(_sqlDataReader["Expanded"]);
}
ContainerList.Add(contI);
ConnectionList.Add(conI);
tNode.Tag = contI;
tNode.ImageIndex = (int)TreeImageType.Container;
tNode.SelectedImageIndex = (int)TreeImageType.Container;
}
private ConnectionInfo GetConnectionInfoFromSql()
{
try
{
var connectionInfo = new ConnectionInfo
{
PositionID = Convert.ToInt32(_sqlDataReader["PositionID"]),
ConstantID = Convert.ToString(_sqlDataReader["ConstantID"]),
Name = Convert.ToString(_sqlDataReader["Name"]),
Description = Convert.ToString(_sqlDataReader["Description"]),
Hostname = Convert.ToString(_sqlDataReader["Hostname"]),
Username = Convert.ToString(_sqlDataReader["Username"])
};
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
connectionInfo.Password = cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["Password"]), _pW);
connectionInfo.Domain = Convert.ToString(_sqlDataReader["DomainName"]);
connectionInfo.DisplayWallpaper = Convert.ToBoolean(_sqlDataReader["DisplayWallpaper"]);
connectionInfo.DisplayThemes = Convert.ToBoolean(_sqlDataReader["DisplayThemes"]);
connectionInfo.CacheBitmaps = Convert.ToBoolean(_sqlDataReader["CacheBitmaps"]);
connectionInfo.UseConsoleSession = Convert.ToBoolean(_sqlDataReader["ConnectToConsole"]);
connectionInfo.RedirectDiskDrives = Convert.ToBoolean(_sqlDataReader["RedirectDiskDrives"]);
connectionInfo.RedirectPrinters = Convert.ToBoolean(_sqlDataReader["RedirectPrinters"]);
connectionInfo.RedirectPorts = Convert.ToBoolean(_sqlDataReader["RedirectPorts"]);
connectionInfo.RedirectSmartCards = Convert.ToBoolean(_sqlDataReader["RedirectSmartCards"]);
connectionInfo.RedirectKeys = Convert.ToBoolean(_sqlDataReader["RedirectKeys"]);
connectionInfo.RedirectSound = (ProtocolRDP.RDPSounds)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPSounds), Convert.ToString(_sqlDataReader["RedirectSound"]));
connectionInfo.Protocol = (ProtocolType)Tools.MiscTools.StringToEnum(typeof(ProtocolType), Convert.ToString(_sqlDataReader["Protocol"]));
connectionInfo.Port = Convert.ToInt32(_sqlDataReader["Port"]);
connectionInfo.PuttySession = Convert.ToString(_sqlDataReader["PuttySession"]);
connectionInfo.Colors = (ProtocolRDP.RDPColors)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPColors), Convert.ToString(_sqlDataReader["Colors"]));
connectionInfo.Resolution = (ProtocolRDP.RDPResolutions)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPResolutions), Convert.ToString(_sqlDataReader["Resolution"]));
connectionInfo.Icon = Convert.ToString(_sqlDataReader["Icon"]);
connectionInfo.Panel = Convert.ToString(_sqlDataReader["Panel"]);
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo)
{
CacheBitmaps = Convert.ToBoolean(_sqlDataReader["InheritCacheBitmaps"]),
Colors = Convert.ToBoolean(_sqlDataReader["InheritColors"]),
Description = Convert.ToBoolean(_sqlDataReader["InheritDescription"]),
DisplayThemes = Convert.ToBoolean(_sqlDataReader["InheritDisplayThemes"]),
DisplayWallpaper = Convert.ToBoolean(_sqlDataReader["InheritDisplayWallpaper"]),
Domain = Convert.ToBoolean(_sqlDataReader["InheritDomain"]),
Icon = Convert.ToBoolean(_sqlDataReader["InheritIcon"]),
Panel = Convert.ToBoolean(_sqlDataReader["InheritPanel"]),
Password = Convert.ToBoolean(_sqlDataReader["InheritPassword"]),
Port = Convert.ToBoolean(_sqlDataReader["InheritPort"]),
Protocol = Convert.ToBoolean(_sqlDataReader["InheritProtocol"]),
PuttySession = Convert.ToBoolean(_sqlDataReader["InheritPuttySession"]),
RedirectDiskDrives = Convert.ToBoolean(_sqlDataReader["InheritRedirectDiskDrives"]),
RedirectKeys = Convert.ToBoolean(_sqlDataReader["InheritRedirectKeys"]),
RedirectPorts = Convert.ToBoolean(_sqlDataReader["InheritRedirectPorts"]),
RedirectPrinters = Convert.ToBoolean(_sqlDataReader["InheritRedirectPrinters"]),
RedirectSmartCards = Convert.ToBoolean(_sqlDataReader["InheritRedirectSmartCards"]),
RedirectSound = Convert.ToBoolean(_sqlDataReader["InheritRedirectSound"]),
Resolution = Convert.ToBoolean(_sqlDataReader["InheritResolution"]),
UseConsoleSession = Convert.ToBoolean(_sqlDataReader["InheritUseConsoleSession"]),
Username = Convert.ToBoolean(_sqlDataReader["InheritUsername"])
};
if (_confVersion > 1.5) //1.6
{
connectionInfo.ICAEncryptionStrength = (ProtocolICA.EncryptionStrength)Tools.MiscTools.StringToEnum(typeof(ProtocolICA.EncryptionStrength), Convert.ToString(_sqlDataReader["ICAEncryptionStrength"]));
connectionInfo.Inheritance.ICAEncryptionStrength = Convert.ToBoolean(_sqlDataReader["InheritICAEncryptionStrength"]);
connectionInfo.PreExtApp = Convert.ToString(_sqlDataReader["PreExtApp"]);
connectionInfo.PostExtApp = Convert.ToString(_sqlDataReader["PostExtApp"]);
connectionInfo.Inheritance.PreExtApp = Convert.ToBoolean(_sqlDataReader["InheritPreExtApp"]);
connectionInfo.Inheritance.PostExtApp = Convert.ToBoolean(_sqlDataReader["InheritPostExtApp"]);
}
if (_confVersion > 1.6) //1.7
{
connectionInfo.VNCCompression = (ProtocolVNC.Compression)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Compression), Convert.ToString(_sqlDataReader["VNCCompression"]));
connectionInfo.VNCEncoding = (ProtocolVNC.Encoding)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Encoding), Convert.ToString(_sqlDataReader["VNCEncoding"]));
connectionInfo.VNCAuthMode = (ProtocolVNC.AuthMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.AuthMode), Convert.ToString(_sqlDataReader["VNCAuthMode"]));
connectionInfo.VNCProxyType = (ProtocolVNC.ProxyType)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.ProxyType), Convert.ToString(_sqlDataReader["VNCProxyType"]));
connectionInfo.VNCProxyIP = Convert.ToString(_sqlDataReader["VNCProxyIP"]);
connectionInfo.VNCProxyPort = Convert.ToInt32(_sqlDataReader["VNCProxyPort"]);
connectionInfo.VNCProxyUsername = Convert.ToString(_sqlDataReader["VNCProxyUsername"]);
connectionInfo.VNCProxyPassword = cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["VNCProxyPassword"]), _pW);
connectionInfo.VNCColors = (ProtocolVNC.Colors)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Colors), Convert.ToString(_sqlDataReader["VNCColors"]));
connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.SmartSizeMode), Convert.ToString(_sqlDataReader["VNCSmartSizeMode"]));
connectionInfo.VNCViewOnly = Convert.ToBoolean(_sqlDataReader["VNCViewOnly"]);
connectionInfo.Inheritance.VNCCompression = Convert.ToBoolean(_sqlDataReader["InheritVNCCompression"]);
connectionInfo.Inheritance.VNCEncoding = Convert.ToBoolean(_sqlDataReader["InheritVNCEncoding"]);
connectionInfo.Inheritance.VNCAuthMode = Convert.ToBoolean(_sqlDataReader["InheritVNCAuthMode"]);
connectionInfo.Inheritance.VNCProxyType = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyType"]);
connectionInfo.Inheritance.VNCProxyIP = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyIP"]);
connectionInfo.Inheritance.VNCProxyPort = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyPort"]);
connectionInfo.Inheritance.VNCProxyUsername = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyUsername"]);
connectionInfo.Inheritance.VNCProxyPassword = Convert.ToBoolean(_sqlDataReader["InheritVNCProxyPassword"]);
connectionInfo.Inheritance.VNCColors = Convert.ToBoolean(_sqlDataReader["InheritVNCColors"]);
connectionInfo.Inheritance.VNCSmartSizeMode = Convert.ToBoolean(_sqlDataReader["InheritVNCSmartSizeMode"]);
connectionInfo.Inheritance.VNCViewOnly = Convert.ToBoolean(_sqlDataReader["InheritVNCViewOnly"]);
}
if (_confVersion > 1.7) //1.8
{
connectionInfo.RDPAuthenticationLevel = (ProtocolRDP.AuthenticationLevel)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.AuthenticationLevel), Convert.ToString(_sqlDataReader["RDPAuthenticationLevel"]));
connectionInfo.Inheritance.RDPAuthenticationLevel = Convert.ToBoolean(_sqlDataReader["InheritRDPAuthenticationLevel"]);
}
if (_confVersion > 1.8) //1.9
{
connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Tools.MiscTools.StringToEnum(typeof(HTTPBase.RenderingEngine), Convert.ToString(_sqlDataReader["RenderingEngine"]));
connectionInfo.MacAddress = Convert.ToString(_sqlDataReader["MacAddress"]);
connectionInfo.Inheritance.RenderingEngine = Convert.ToBoolean(_sqlDataReader["InheritRenderingEngine"]);
connectionInfo.Inheritance.MacAddress = Convert.ToBoolean(_sqlDataReader["InheritMacAddress"]);
}
if (_confVersion > 1.9) //2.0
{
connectionInfo.UserField = Convert.ToString(_sqlDataReader["UserField"]);
connectionInfo.Inheritance.UserField = Convert.ToBoolean(_sqlDataReader["InheritUserField"]);
}
if (_confVersion > 2.0) //2.1
{
connectionInfo.ExtApp = Convert.ToString(_sqlDataReader["ExtApp"]);
connectionInfo.Inheritance.ExtApp = Convert.ToBoolean(_sqlDataReader["InheritExtApp"]);
}
if (_confVersion >= 2.2)
{
connectionInfo.RDGatewayUsageMethod = (ProtocolRDP.RDGatewayUsageMethod)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUsageMethod), Convert.ToString(_sqlDataReader["RDGatewayUsageMethod"]));
connectionInfo.RDGatewayHostname = Convert.ToString(_sqlDataReader["RDGatewayHostname"]);
connectionInfo.RDGatewayUseConnectionCredentials = (ProtocolRDP.RDGatewayUseConnectionCredentials)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUseConnectionCredentials), Convert.ToString(_sqlDataReader["RDGatewayUseConnectionCredentials"]));
connectionInfo.RDGatewayUsername = Convert.ToString(_sqlDataReader["RDGatewayUsername"]);
connectionInfo.RDGatewayPassword = cryptographyProvider.Decrypt(Convert.ToString(_sqlDataReader["RDGatewayPassword"]), _pW);
connectionInfo.RDGatewayDomain = Convert.ToString(_sqlDataReader["RDGatewayDomain"]);
connectionInfo.Inheritance.RDGatewayUsageMethod = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayUsageMethod"]);
connectionInfo.Inheritance.RDGatewayHostname = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayHostname"]);
connectionInfo.Inheritance.RDGatewayUsername = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayUsername"]);
connectionInfo.Inheritance.RDGatewayPassword = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayPassword"]);
connectionInfo.Inheritance.RDGatewayDomain = Convert.ToBoolean(_sqlDataReader["InheritRDGatewayDomain"]);
}
if (_confVersion >= 2.3)
{
connectionInfo.EnableFontSmoothing = Convert.ToBoolean(_sqlDataReader["EnableFontSmoothing"]);
connectionInfo.EnableDesktopComposition = Convert.ToBoolean(_sqlDataReader["EnableDesktopComposition"]);
connectionInfo.Inheritance.EnableFontSmoothing = Convert.ToBoolean(_sqlDataReader["InheritEnableFontSmoothing"]);
connectionInfo.Inheritance.EnableDesktopComposition = Convert.ToBoolean(_sqlDataReader["InheritEnableDesktopComposition"]);
}
if (_confVersion >= 2.4)
{
connectionInfo.UseCredSsp = Convert.ToBoolean(_sqlDataReader["UseCredSsp"]);
connectionInfo.Inheritance.UseCredSsp = Convert.ToBoolean(_sqlDataReader["InheritUseCredSsp"]);
}
if (_confVersion >= 2.5)
{
connectionInfo.LoadBalanceInfo = Convert.ToString(_sqlDataReader["LoadBalanceInfo"]);
connectionInfo.AutomaticResize = Convert.ToBoolean(_sqlDataReader["AutomaticResize"]);
connectionInfo.Inheritance.LoadBalanceInfo = Convert.ToBoolean(_sqlDataReader["InheritLoadBalanceInfo"]);
connectionInfo.Inheritance.AutomaticResize = Convert.ToBoolean(_sqlDataReader["InheritAutomaticResize"]);
}
if (DatabaseUpdate)
connectionInfo.PleaseConnect = Convert.ToBoolean(_sqlDataReader["Connected"]);
return connectionInfo;
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strGetConnectionInfoFromSqlFailed + Environment.NewLine + ex.Message, true);
}
return null;
}
private delegate void SetSelectedNodeDelegate(TreeNode treeNode);
private static void SetSelectedNode(TreeNode treeNode)
{
if (ConnectionTree.TreeView != null && ConnectionTree.TreeView.InvokeRequired)
{
Windows.treeForm.Invoke(new SetSelectedNodeDelegate(SetSelectedNode), treeNode);
return;
}
Windows.treeForm.tvConnections.SelectedNode = treeNode;
}
private bool Authenticate(string value, bool compareToOriginalValue, RootNodeInfo rootInfo = null)
{
var passwordName = "";
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
passwordName = Language.strSQLServer.TrimEnd(':');
if (compareToOriginalValue)
{
while (cryptographyProvider.Decrypt(value, _pW) == value)
{
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
if (_pW.Length == 0)
return false;
}
}
else
{
while (cryptographyProvider.Decrypt(value, _pW) != "ThisIsProtected")
{
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
if (_pW.Length == 0)
return false;
}
if (rootInfo == null) return true;
rootInfo.Password = true;
rootInfo.PasswordString = _pW.ConvertToUnsecureString();
}
return true;
}
}
}

View File

@@ -0,0 +1,650 @@
using System;
using System.Globalization;
using System.IO;
using System.Security;
using System.Windows.Forms;
using System.Xml;
using mRemoteNG.App;
using mRemoteNG.App.Info;
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;
using mRemoteNG.Container;
using mRemoteNG.Messages;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
namespace mRemoteNG.Config.Connections
{
public class XmlConnectionsLoader
{
private XmlDocument _xmlDocument;
private double _confVersion;
private SecureString _pW = GeneralAppInfo.EncryptionKey;
private ContainerInfo _previousContainer;
public string ConnectionFileName { get; set; }
public TreeNode RootTreeNode { get; set; }
public ConnectionList ConnectionList { get; set; }
public ContainerList ContainerList { get; set; }
public void LoadFromXml(bool import)
{
try
{
if (!import)
Runtime.IsConnectionsFileLoaded = false;
// SECTION 1. Create a DOM Document and load the XML data into it.
LoadXmlConnectionData();
ValidateConnectionFileVersion();
// SECTION 2. Initialize the treeview control.
var rootInfo = InitializeRootNode();
if (!ConnectionsFileIsAuthentic(rootInfo)) return;
if (import && !IsExportFile())
{
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strCannotImportNormalSessionFile);
return;
}
if (!IsExportFile())
{
RootTreeNode.ImageIndex = (int)TreeImageType.Root;
RootTreeNode.SelectedImageIndex = (int)TreeImageType.Root;
}
// SECTION 3. Populate the TreeView with the DOM nodes.
PopulateTreeview();
RootTreeNode.EnsureVisible();
Windows.treeForm.InitialRefresh();
SetSelectedNode(RootTreeNode);
//open connections from last mremote session
OpenConnectionsFromLastSession();
if (!import)
Runtime.IsConnectionsFileLoaded = true;
}
catch (Exception ex)
{
Runtime.IsConnectionsFileLoaded = false;
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strLoadFromXmlFailed + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace, true);
throw;
}
}
private bool ConnectionsFileIsAuthentic(RootNodeInfo rootInfo)
{
if (!(_confVersion > 1.3)) return true;
var protectedString = _xmlDocument.DocumentElement.Attributes["Protected"].Value;
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
var connectionsFileIsNotEncrypted = cryptographyProvider.Decrypt(protectedString, _pW) == "ThisIsNotProtected";
if (connectionsFileIsNotEncrypted) return true;
if (Authenticate(protectedString, false, rootInfo)) return true;
mRemoteNG.Settings.Default.LoadConsFromCustomLocation = false;
mRemoteNG.Settings.Default.CustomConsPath = "";
RootTreeNode.Remove();
return false;
}
private void OpenConnectionsFromLastSession()
{
if (!mRemoteNG.Settings.Default.OpenConsFromLastSession || mRemoteNG.Settings.Default.NoReconnect) return;
foreach (ConnectionInfo conI in ConnectionList)
{
if (conI.PleaseConnect)
Runtime.OpenConnection(conI);
}
}
private void PopulateTreeview()
{
Windows.treeForm.tvConnections.BeginUpdate();
AddNodeFromXml(_xmlDocument.DocumentElement, RootTreeNode);
RootTreeNode.Expand();
ExpandPreviouslyOpenedFolders();
Windows.treeForm.tvConnections.EndUpdate();
}
private void AddNodeFromXml(XmlNode parentXmlNode, TreeNode parentTreeNode)
{
try
{
// Loop through the XML nodes until the leaf is reached.
// Add the nodes to the TreeView during the looping process.
if (parentXmlNode.HasChildNodes)
{
foreach (XmlNode xmlNode in parentXmlNode.ChildNodes)
{
var treeNode = new TreeNode(xmlNode.Attributes?["Name"].Value);
parentTreeNode.Nodes.Add(treeNode);
var nodeType = ConnectionTreeNode.GetNodeTypeFromString(xmlNode.Attributes?["Type"].Value);
if (nodeType == TreeNodeType.Connection)
AddConnectionToList(xmlNode, treeNode);
else if (nodeType == TreeNodeType.Container)
AddContainerToList(xmlNode, treeNode);
AddNodeFromXml(xmlNode, treeNode);
}
}
else
{
var nameAttribute = parentXmlNode.Attributes?["Name"];
var nodeName = nameAttribute?.Value.Trim();
parentTreeNode.Text = !string.IsNullOrEmpty(nodeName) ? nodeName : parentXmlNode.Name;
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strAddNodeFromXmlFailed + Environment.NewLine + ex.Message + ex.StackTrace, true);
throw;
}
}
private void AddConnectionToList(XmlNode xmlNode, TreeNode treeNode)
{
var connectionInfo = GetConnectionInfoFromXml(xmlNode);
connectionInfo.TreeNode = treeNode;
connectionInfo.Parent = _previousContainer; //NEW
ConnectionList.Add(connectionInfo);
treeNode.Tag = connectionInfo;
treeNode.ImageIndex = (int)TreeImageType.ConnectionClosed;
treeNode.SelectedImageIndex = (int)TreeImageType.ConnectionClosed;
}
private void AddContainerToList(XmlNode xmlNode, TreeNode treeNode)
{
var containerInfo = new ContainerInfo();
if (treeNode.Parent != null)
{
if (ConnectionTreeNode.GetNodeType(treeNode.Parent) == TreeNodeType.Container)
containerInfo.Parent = (ContainerInfo) treeNode.Parent.Tag;
}
_previousContainer = containerInfo; //NEW
containerInfo.TreeNode = treeNode;
containerInfo.Name = xmlNode.Attributes["Name"].Value;
if (_confVersion >= 0.8)
{
containerInfo.IsExpanded = xmlNode.Attributes["Expanded"].Value == "True";
}
var connectionInfo = _confVersion >= 0.9 ? GetConnectionInfoFromXml(xmlNode) : new ConnectionInfo();
connectionInfo.Parent = containerInfo;
connectionInfo.IsContainer = true;
containerInfo.ConnectionInfo = connectionInfo;
ContainerList.Add(containerInfo);
treeNode.Tag = containerInfo;
treeNode.ImageIndex = (int) TreeImageType.Container;
treeNode.SelectedImageIndex = (int) TreeImageType.Container;
}
private ConnectionInfo GetConnectionInfoFromXml(XmlNode xxNode)
{
var connectionInfo = new ConnectionInfo();
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
try
{
var xmlnode = xxNode;
if (_confVersion > 0.1) //0.2
{
connectionInfo.Name = xmlnode.Attributes["Name"].Value;
connectionInfo.Description = xmlnode.Attributes["Descr"].Value;
connectionInfo.Hostname = xmlnode.Attributes["Hostname"].Value;
connectionInfo.Username = xmlnode.Attributes["Username"].Value;
connectionInfo.Password = cryptographyProvider.Decrypt(xmlnode.Attributes["Password"].Value, _pW);
connectionInfo.Domain = xmlnode.Attributes["Domain"].Value;
connectionInfo.DisplayWallpaper = bool.Parse(xmlnode.Attributes["DisplayWallpaper"].Value);
connectionInfo.DisplayThemes = bool.Parse(xmlnode.Attributes["DisplayThemes"].Value);
connectionInfo.CacheBitmaps = bool.Parse(xmlnode.Attributes["CacheBitmaps"].Value);
if (_confVersion < 1.1) //1.0 - 0.1
{
connectionInfo.Resolution = Convert.ToBoolean(xmlnode.Attributes["Fullscreen"].Value) ? ProtocolRDP.RDPResolutions.Fullscreen : ProtocolRDP.RDPResolutions.FitToWindow;
}
}
if (_confVersion > 0.2) //0.3
{
if (_confVersion < 0.7)
{
if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value))
{
connectionInfo.Protocol = ProtocolType.VNC;
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["VNCPort"].Value);
}
else
{
connectionInfo.Protocol = ProtocolType.RDP;
}
}
}
else
{
connectionInfo.Port = (int)ProtocolRDP.Defaults.Port;
connectionInfo.Protocol = ProtocolType.RDP;
}
if (_confVersion > 0.3) //0.4
{
if (_confVersion < 0.7)
{
if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value))
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["VNCPort"].Value);
else
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["RDPPort"].Value);
}
connectionInfo.UseConsoleSession = bool.Parse(xmlnode.Attributes["ConnectToConsole"].Value);
}
else
{
if (_confVersion < 0.7)
{
if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value))
connectionInfo.Port = (int)ProtocolVNC.Defaults.Port;
else
connectionInfo.Port = (int)ProtocolRDP.Defaults.Port;
}
connectionInfo.UseConsoleSession = false;
}
if (_confVersion > 0.4) //0.5 and 0.6
{
connectionInfo.RedirectDiskDrives = bool.Parse(xmlnode.Attributes["RedirectDiskDrives"].Value);
connectionInfo.RedirectPrinters = bool.Parse(xmlnode.Attributes["RedirectPrinters"].Value);
connectionInfo.RedirectPorts = bool.Parse(xmlnode.Attributes["RedirectPorts"].Value);
connectionInfo.RedirectSmartCards = bool.Parse(xmlnode.Attributes["RedirectSmartCards"].Value);
}
else
{
connectionInfo.RedirectDiskDrives = false;
connectionInfo.RedirectPrinters = false;
connectionInfo.RedirectPorts = false;
connectionInfo.RedirectSmartCards = false;
}
if (_confVersion > 0.6) //0.7
{
connectionInfo.Protocol = (ProtocolType)Tools.MiscTools.StringToEnum(typeof(ProtocolType), xmlnode.Attributes["Protocol"].Value);
connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["Port"].Value);
}
if (_confVersion > 0.9) //1.0
{
connectionInfo.RedirectKeys = bool.Parse(xmlnode.Attributes["RedirectKeys"].Value);
}
if (_confVersion > 1.1) //1.2
{
connectionInfo.PuttySession = xmlnode.Attributes["PuttySession"].Value;
}
if (_confVersion > 1.2) //1.3
{
connectionInfo.Colors = (ProtocolRDP.RDPColors)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPColors), xmlnode.Attributes["Colors"].Value);
connectionInfo.Resolution = (ProtocolRDP.RDPResolutions)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPResolutions), Convert.ToString(xmlnode.Attributes["Resolution"].Value));
connectionInfo.RedirectSound = (ProtocolRDP.RDPSounds)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDPSounds), Convert.ToString(xmlnode.Attributes["RedirectSound"].Value));
}
else
{
switch (Convert.ToInt32(xmlnode.Attributes["Colors"].Value))
{
case 0:
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors256;
break;
case 1:
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors16Bit;
break;
case 2:
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors24Bit;
break;
case 3:
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors32Bit;
break;
case 4:
connectionInfo.Colors = ProtocolRDP.RDPColors.Colors15Bit;
break;
}
connectionInfo.RedirectSound = (ProtocolRDP.RDPSounds)Convert.ToInt32(xmlnode.Attributes["RedirectSound"].Value);
}
if (_confVersion > 1.2) //1.3
{
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo)
{
CacheBitmaps = bool.Parse(xmlnode.Attributes["InheritCacheBitmaps"].Value),
Colors = bool.Parse(xmlnode.Attributes["InheritColors"].Value),
Description = bool.Parse(xmlnode.Attributes["InheritDescription"].Value),
DisplayThemes = bool.Parse(xmlnode.Attributes["InheritDisplayThemes"].Value),
DisplayWallpaper = bool.Parse(xmlnode.Attributes["InheritDisplayWallpaper"].Value),
Domain = bool.Parse(xmlnode.Attributes["InheritDomain"].Value),
Icon = bool.Parse(xmlnode.Attributes["InheritIcon"].Value),
Panel = bool.Parse(xmlnode.Attributes["InheritPanel"].Value),
Password = bool.Parse(xmlnode.Attributes["InheritPassword"].Value),
Port = bool.Parse(xmlnode.Attributes["InheritPort"].Value),
Protocol = bool.Parse(xmlnode.Attributes["InheritProtocol"].Value),
PuttySession = bool.Parse(xmlnode.Attributes["InheritPuttySession"].Value),
RedirectDiskDrives = bool.Parse(xmlnode.Attributes["InheritRedirectDiskDrives"].Value),
RedirectKeys = bool.Parse(xmlnode.Attributes["InheritRedirectKeys"].Value),
RedirectPorts = bool.Parse(xmlnode.Attributes["InheritRedirectPorts"].Value),
RedirectPrinters = bool.Parse(xmlnode.Attributes["InheritRedirectPrinters"].Value),
RedirectSmartCards = bool.Parse(xmlnode.Attributes["InheritRedirectSmartCards"].Value),
RedirectSound = bool.Parse(xmlnode.Attributes["InheritRedirectSound"].Value),
Resolution = bool.Parse(xmlnode.Attributes["InheritResolution"].Value),
UseConsoleSession = bool.Parse(xmlnode.Attributes["InheritUseConsoleSession"].Value),
Username = bool.Parse(xmlnode.Attributes["InheritUsername"].Value)
};
connectionInfo.Icon = xmlnode.Attributes["Icon"].Value;
connectionInfo.Panel = xmlnode.Attributes["Panel"].Value;
}
else
{
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo);
if (Convert.ToBoolean(xmlnode.Attributes["Inherit"].Value))
connectionInfo.Inheritance.TurnOnInheritanceCompletely();
connectionInfo.Icon = Convert.ToString(xmlnode.Attributes["Icon"].Value.Replace(".ico", ""));
connectionInfo.Panel = Language.strGeneral;
}
if (_confVersion > 1.4) //1.5
{
connectionInfo.PleaseConnect = bool.Parse(xmlnode.Attributes["Connected"].Value);
}
if (_confVersion > 1.5) //1.6
{
connectionInfo.ICAEncryptionStrength = (ProtocolICA.EncryptionStrength)Tools.MiscTools.StringToEnum(typeof(ProtocolICA.EncryptionStrength), xmlnode.Attributes["ICAEncryptionStrength"].Value);
connectionInfo.Inheritance.ICAEncryptionStrength = bool.Parse(xmlnode.Attributes["InheritICAEncryptionStrength"].Value);
connectionInfo.PreExtApp = xmlnode.Attributes["PreExtApp"].Value;
connectionInfo.PostExtApp = xmlnode.Attributes["PostExtApp"].Value;
connectionInfo.Inheritance.PreExtApp = bool.Parse(xmlnode.Attributes["InheritPreExtApp"].Value);
connectionInfo.Inheritance.PostExtApp = bool.Parse(xmlnode.Attributes["InheritPostExtApp"].Value);
}
if (_confVersion > 1.6) //1.7
{
connectionInfo.VNCCompression = (ProtocolVNC.Compression)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Compression), xmlnode.Attributes["VNCCompression"].Value);
connectionInfo.VNCEncoding = (ProtocolVNC.Encoding)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Encoding), Convert.ToString(xmlnode.Attributes["VNCEncoding"].Value));
connectionInfo.VNCAuthMode = (ProtocolVNC.AuthMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.AuthMode), xmlnode.Attributes["VNCAuthMode"].Value);
connectionInfo.VNCProxyType = (ProtocolVNC.ProxyType)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.ProxyType), xmlnode.Attributes["VNCProxyType"].Value);
connectionInfo.VNCProxyIP = xmlnode.Attributes["VNCProxyIP"].Value;
connectionInfo.VNCProxyPort = Convert.ToInt32(xmlnode.Attributes["VNCProxyPort"].Value);
connectionInfo.VNCProxyUsername = xmlnode.Attributes["VNCProxyUsername"].Value;
connectionInfo.VNCProxyPassword = cryptographyProvider.Decrypt(xmlnode.Attributes["VNCProxyPassword"].Value, _pW);
connectionInfo.VNCColors = (ProtocolVNC.Colors)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.Colors), xmlnode.Attributes["VNCColors"].Value);
connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Tools.MiscTools.StringToEnum(typeof(ProtocolVNC.SmartSizeMode), xmlnode.Attributes["VNCSmartSizeMode"].Value);
connectionInfo.VNCViewOnly = bool.Parse(xmlnode.Attributes["VNCViewOnly"].Value);
connectionInfo.Inheritance.VNCCompression = bool.Parse(xmlnode.Attributes["InheritVNCCompression"].Value);
connectionInfo.Inheritance.VNCEncoding = bool.Parse(xmlnode.Attributes["InheritVNCEncoding"].Value);
connectionInfo.Inheritance.VNCAuthMode = bool.Parse(xmlnode.Attributes["InheritVNCAuthMode"].Value);
connectionInfo.Inheritance.VNCProxyType = bool.Parse(xmlnode.Attributes["InheritVNCProxyType"].Value);
connectionInfo.Inheritance.VNCProxyIP = bool.Parse(xmlnode.Attributes["InheritVNCProxyIP"].Value);
connectionInfo.Inheritance.VNCProxyPort = bool.Parse(xmlnode.Attributes["InheritVNCProxyPort"].Value);
connectionInfo.Inheritance.VNCProxyUsername = bool.Parse(xmlnode.Attributes["InheritVNCProxyUsername"].Value);
connectionInfo.Inheritance.VNCProxyPassword = bool.Parse(xmlnode.Attributes["InheritVNCProxyPassword"].Value);
connectionInfo.Inheritance.VNCColors = bool.Parse(xmlnode.Attributes["InheritVNCColors"].Value);
connectionInfo.Inheritance.VNCSmartSizeMode = bool.Parse(xmlnode.Attributes["InheritVNCSmartSizeMode"].Value);
connectionInfo.Inheritance.VNCViewOnly = bool.Parse(xmlnode.Attributes["InheritVNCViewOnly"].Value);
}
if (_confVersion > 1.7) //1.8
{
connectionInfo.RDPAuthenticationLevel = (ProtocolRDP.AuthenticationLevel)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.AuthenticationLevel), xmlnode.Attributes["RDPAuthenticationLevel"].Value);
connectionInfo.Inheritance.RDPAuthenticationLevel = bool.Parse(xmlnode.Attributes["InheritRDPAuthenticationLevel"].Value);
}
if (_confVersion > 1.8) //1.9
{
connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Tools.MiscTools.StringToEnum(typeof(HTTPBase.RenderingEngine), xmlnode.Attributes["RenderingEngine"].Value);
connectionInfo.MacAddress = xmlnode.Attributes["MacAddress"].Value;
connectionInfo.Inheritance.RenderingEngine = bool.Parse(xmlnode.Attributes["InheritRenderingEngine"].Value);
connectionInfo.Inheritance.MacAddress = bool.Parse(xmlnode.Attributes["InheritMacAddress"].Value);
}
if (_confVersion > 1.9) //2.0
{
connectionInfo.UserField = xmlnode.Attributes["UserField"].Value;
connectionInfo.Inheritance.UserField = bool.Parse(xmlnode.Attributes["InheritUserField"].Value);
}
if (_confVersion > 2.0) //2.1
{
connectionInfo.ExtApp = xmlnode.Attributes["ExtApp"].Value;
connectionInfo.Inheritance.ExtApp = bool.Parse(xmlnode.Attributes["InheritExtApp"].Value);
}
if (_confVersion > 2.1) //2.2
{
// Get settings
connectionInfo.RDGatewayUsageMethod = (ProtocolRDP.RDGatewayUsageMethod)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUsageMethod), Convert.ToString(xmlnode.Attributes["RDGatewayUsageMethod"].Value));
connectionInfo.RDGatewayHostname = xmlnode.Attributes["RDGatewayHostname"].Value;
connectionInfo.RDGatewayUseConnectionCredentials = (ProtocolRDP.RDGatewayUseConnectionCredentials)Tools.MiscTools.StringToEnum(typeof(ProtocolRDP.RDGatewayUseConnectionCredentials), Convert.ToString(xmlnode.Attributes["RDGatewayUseConnectionCredentials"].Value));
connectionInfo.RDGatewayUsername = xmlnode.Attributes["RDGatewayUsername"].Value;
connectionInfo.RDGatewayPassword = cryptographyProvider.Decrypt(Convert.ToString(xmlnode.Attributes["RDGatewayPassword"].Value), _pW);
connectionInfo.RDGatewayDomain = xmlnode.Attributes["RDGatewayDomain"].Value;
// Get inheritance settings
connectionInfo.Inheritance.RDGatewayUsageMethod = bool.Parse(xmlnode.Attributes["InheritRDGatewayUsageMethod"].Value);
connectionInfo.Inheritance.RDGatewayHostname = bool.Parse(xmlnode.Attributes["InheritRDGatewayHostname"].Value);
connectionInfo.Inheritance.RDGatewayUseConnectionCredentials = bool.Parse(xmlnode.Attributes["InheritRDGatewayUseConnectionCredentials"].Value);
connectionInfo.Inheritance.RDGatewayUsername = bool.Parse(xmlnode.Attributes["InheritRDGatewayUsername"].Value);
connectionInfo.Inheritance.RDGatewayPassword = bool.Parse(xmlnode.Attributes["InheritRDGatewayPassword"].Value);
connectionInfo.Inheritance.RDGatewayDomain = bool.Parse(xmlnode.Attributes["InheritRDGatewayDomain"].Value);
}
if (_confVersion > 2.2) //2.3
{
// Get settings
connectionInfo.EnableFontSmoothing = bool.Parse(xmlnode.Attributes["EnableFontSmoothing"].Value);
connectionInfo.EnableDesktopComposition = bool.Parse(xmlnode.Attributes["EnableDesktopComposition"].Value);
// Get inheritance settings
connectionInfo.Inheritance.EnableFontSmoothing = bool.Parse(xmlnode.Attributes["InheritEnableFontSmoothing"].Value);
connectionInfo.Inheritance.EnableDesktopComposition = bool.Parse(xmlnode.Attributes["InheritEnableDesktopComposition"].Value);
}
if (_confVersion >= 2.4)
{
connectionInfo.UseCredSsp = bool.Parse(xmlnode.Attributes["UseCredSsp"].Value);
connectionInfo.Inheritance.UseCredSsp = bool.Parse(xmlnode.Attributes["InheritUseCredSsp"].Value);
}
if (_confVersion >= 2.5)
{
connectionInfo.LoadBalanceInfo = xmlnode.Attributes["LoadBalanceInfo"].Value;
connectionInfo.AutomaticResize = bool.Parse(xmlnode.Attributes["AutomaticResize"].Value);
connectionInfo.Inheritance.LoadBalanceInfo = bool.Parse(xmlnode.Attributes["InheritLoadBalanceInfo"].Value);
connectionInfo.Inheritance.AutomaticResize = bool.Parse(xmlnode.Attributes["InheritAutomaticResize"].Value);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strGetConnectionInfoFromXmlFailed, connectionInfo.Name, ConnectionFileName, ex.Message));
}
return connectionInfo;
}
private void ExpandPreviouslyOpenedFolders()
{
foreach (ContainerInfo contI in ContainerList)
{
if (contI.IsExpanded)
contI.TreeNode.Expand();
}
}
private bool IsExportFile()
{
var isExportFile = false;
if (!(_confVersion >= 1.0)) return isExportFile;
if (Convert.ToBoolean(_xmlDocument.DocumentElement.Attributes["Export"].Value))
isExportFile = true;
return isExportFile;
}
private RootNodeInfo InitializeRootNode()
{
var rootNodeName = "";
if (_xmlDocument.DocumentElement.HasAttribute("Name"))
rootNodeName = Convert.ToString(_xmlDocument.DocumentElement.Attributes["Name"].Value.Trim());
RootTreeNode.Name = !string.IsNullOrEmpty(rootNodeName) ? rootNodeName : _xmlDocument.DocumentElement.Name;
RootTreeNode.Text = RootTreeNode.Name;
var rootInfo = new RootNodeInfo(RootNodeType.Connection)
{
Name = RootTreeNode.Name,
TreeNode = RootTreeNode
};
RootTreeNode.Tag = rootInfo;
return rootInfo;
}
private void LoadXmlConnectionData()
{
var connections = DecryptCompleteFile();
_xmlDocument = new XmlDocument();
if (connections != "")
_xmlDocument.LoadXml(connections);
else
_xmlDocument.Load(ConnectionFileName);
}
private void ValidateConnectionFileVersion()
{
if (_xmlDocument.DocumentElement.HasAttribute("ConfVersion"))
_confVersion = Convert.ToDouble(_xmlDocument.DocumentElement.Attributes["ConfVersion"].Value.Replace(",", "."),
CultureInfo.InvariantCulture);
else
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strOldConffile);
const double maxSupportedConfVersion = 2.5;
if (!(_confVersion > maxSupportedConfVersion)) return;
CTaskDialog.ShowTaskDialogBox(
frmMain.Default,
Application.ProductName,
"Incompatible connection file format",
$"The format of this connection file is not supported. Please upgrade to a newer version of {Application.ProductName}.",
string.Format("{1}{0}File Format Version: {2}{0}Highest Supported Version: {3}", Environment.NewLine,
ConnectionFileName, _confVersion, maxSupportedConfVersion),
"",
"",
"",
"",
ETaskDialogButtons.Ok,
ESysIcons.Error,
ESysIcons.Error
);
throw (new Exception($"Incompatible connection file format (file format version {_confVersion})."));
}
private delegate void SetSelectedNodeDelegate(TreeNode treeNode);
private static void SetSelectedNode(TreeNode treeNode)
{
if (ConnectionTree.TreeView != null && ConnectionTree.TreeView.InvokeRequired)
{
Windows.treeForm.Invoke(new SetSelectedNodeDelegate(SetSelectedNode), treeNode);
return;
}
Windows.treeForm.tvConnections.SelectedNode = treeNode;
}
private string DecryptCompleteFile()
{
var sRd = new StreamReader(ConnectionFileName);
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
var strCons = "";
strCons = sRd.ReadToEnd();
sRd.Close();
if (string.IsNullOrEmpty(strCons)) return "";
var strDecr = "";
bool notDecr;
if (strCons.Contains("<?xml version=\"1.0\" encoding=\"utf-8\"?>"))
{
strDecr = strCons;
return strDecr;
}
try
{
strDecr = cryptographyProvider.Decrypt(strCons, _pW);
notDecr = strDecr == strCons;
}
catch (Exception)
{
notDecr = true;
}
if (notDecr)
{
if (Authenticate(strCons, true))
{
strDecr = cryptographyProvider.Decrypt(strCons, _pW);
notDecr = false;
}
if (notDecr == false)
return strDecr;
}
else
{
return strDecr;
}
return "";
}
private bool Authenticate(string value, bool compareToOriginalValue, RootNodeInfo rootInfo = null)
{
var passwordName = "";
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
passwordName = Path.GetFileName(ConnectionFileName);
if (compareToOriginalValue)
{
while (cryptographyProvider.Decrypt(value, _pW) == value)
{
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
if (_pW.Length == 0)
return false;
}
}
else
{
while (cryptographyProvider.Decrypt(value, _pW) != "ThisIsProtected")
{
_pW = Tools.MiscTools.PasswordDialog(passwordName, false);
if (_pW.Length == 0)
return false;
}
if (rootInfo == null) return true;
rootInfo.Password = true;
rootInfo.PasswordString = _pW.ConvertToUnsecureString();
}
return true;
}
}
}

View File

@@ -87,7 +87,8 @@ namespace mRemoteNG.Config.Import
var treeNode = ConnectionTreeNode.AddNode(TreeNodeType.Connection, displayName);
var connectionInfo = new ConnectionInfo();
var inheritanceInfo = new ConnectionInfoInheritance(connectionInfo, true);
var inheritanceInfo = new ConnectionInfoInheritance(connectionInfo);
inheritanceInfo.TurnOnInheritanceCompletely();
inheritanceInfo.Description = false;
if (parentTreeNode.Tag is ContainerInfo)
{

View File

@@ -4,15 +4,16 @@ using mRemoteNG.App;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Container;
using mRemoteNG.Tools;
namespace mRemoteNG.Config.Import
{
public class PortScan
public static class PortScan
{
public static void Import(IEnumerable hosts, ProtocolType protocol, TreeNode parentTreeNode)
{
foreach (Tools.PortScan.ScanHost host in hosts)
foreach (ScanHost host in hosts)
{
var finalProtocol = default(ProtocolType);
var protocolValid = false;

View File

@@ -4,7 +4,6 @@ using System.Xml;
using System.IO;
using mRemoteNG.App;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Images;
using mRemoteNG.Connection;
using mRemoteNG.Tree;
using mRemoteNG.Container;

View File

@@ -3,10 +3,9 @@ using System.Windows.Forms;
using System.IO;
using mRemoteNG.App;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Images;
using mRemoteNG.Container;
using mRemoteNG.Connection;
using mRemoteNG.Tree;
namespace mRemoteNG.Config.Import
{

View File

@@ -5,7 +5,6 @@ using System.IO;
using System.Runtime.InteropServices;
using mRemoteNG.App;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Images;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Tree;

View File

@@ -1,7 +1,6 @@
using System.Windows.Forms;
using System.IO;
using mRemoteNG.App;
using mRemoteNG.Images;
using mRemoteNG.Config.Connections;
using mRemoteNG.Container;
using mRemoteNG.Connection;

View File

@@ -1,22 +1,13 @@
using System.Collections.Generic;
using System;
using AxWFICALib;
using System.Drawing;
using System.Diagnostics;
using System.Data;
using AxMSTSCLib;
using Microsoft.VisualBasic;
using System.Collections;
using System.Windows.Forms;
using mRemoteNG.My;
using mRemoteNG.Tree;
using mRemoteNG.Images;
using mRemoteNG.Connection;
namespace mRemoteNG.Config.Putty
{
public abstract class Provider
public abstract class Provider
{
#region Public Methods
private TreeNode _rootTreeNode;

View File

@@ -1,5 +1,4 @@
using mRemoteNG.Connection;
using mRemoteNG.Images;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using System.Collections.Generic;
@@ -78,7 +77,7 @@ namespace mRemoteNG.Config.Putty
sessionInfo.RootPuttySessionsInfo = provider.RootInfo;
sessionInfo.TreeNode = treeNode;
//sessionInfo.Inheritance.TurnOffInheritanceCompletely();
//sessionInfo.IInheritable.TurnOffInheritanceCompletely();
treeNode.Tag = sessionInfo;

View File

@@ -49,7 +49,7 @@ namespace mRemoteNG.Config.Settings
}
else
{
Startup.SetDefaultLayout();
Startup.Instance.SetDefaultLayout();
}
}
catch (Exception ex)

View File

@@ -8,6 +8,8 @@ using System.Globalization;
using mRemoteNG.Themes;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.App.Info;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.UI.Forms;
@@ -67,7 +69,8 @@ namespace mRemoteNG.Config.Settings
private static void SetConDefaultPassword()
{
mRemoteNG.Settings.Default.ConDefaultPassword = Security.Crypt.Decrypt(mRemoteNG.Settings.Default.ConDefaultPassword, GeneralAppInfo.EncryptionKey);
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
mRemoteNG.Settings.Default.ConDefaultPassword = cryptographyProvider.Decrypt(mRemoteNG.Settings.Default.ConDefaultPassword, GeneralAppInfo.EncryptionKey);
}
private static void SetAlwaysShowPanelTabs()

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