Compare commits
266 Commits
1.74Alpha1
...
v1.75Alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43100930cd | ||
|
|
aac7e4cc53 | ||
|
|
1c8f3e2328 | ||
|
|
a54f0a2e89 | ||
|
|
fdb3cecf8e | ||
|
|
8762c39dd5 | ||
|
|
fc56c56883 | ||
|
|
ae950ac075 | ||
|
|
e6532dc155 | ||
|
|
ee6af8c187 | ||
|
|
bc1a0725df | ||
|
|
8163e7273e | ||
|
|
58fdba1d89 | ||
|
|
649f864236 | ||
|
|
292f3b03cc | ||
|
|
ec8fe3c343 | ||
|
|
823b0518ae | ||
|
|
c48caf5bdc | ||
|
|
20bc6d079f | ||
|
|
dccd318f60 | ||
|
|
2b0f670fb7 | ||
|
|
b5c431dca8 | ||
|
|
57dd93f136 | ||
|
|
976e02effb | ||
|
|
396387340a | ||
|
|
d9bf021597 | ||
|
|
b4e26f513b | ||
|
|
2eef31f74d | ||
|
|
cc96e2b3eb | ||
|
|
4526a0b875 | ||
|
|
4568bcc0ae | ||
|
|
cf3af14c6a | ||
|
|
d320c84bc8 | ||
|
|
8eff262e8f | ||
|
|
8c7d90f0c4 | ||
|
|
0e189551dd | ||
|
|
981acd6510 | ||
|
|
404aae6bf3 | ||
|
|
57cc9b8de4 | ||
|
|
d2def0a34d | ||
|
|
f1a5e1c029 | ||
|
|
19ae192887 | ||
|
|
cc87227559 | ||
|
|
9ad0c74a56 | ||
|
|
55a8b743c8 | ||
|
|
7adb150d1c | ||
|
|
afdb392289 | ||
|
|
1c8e24a117 | ||
|
|
266e79a2c3 | ||
|
|
6c5d629a88 | ||
|
|
84ed778b67 | ||
|
|
c1d41847a2 | ||
|
|
73c50837d8 | ||
|
|
89075aa3e9 | ||
|
|
bffe4454ba | ||
|
|
69a8f50b58 | ||
|
|
8c6f6534b6 | ||
|
|
791a78154d | ||
|
|
f08ce0acd5 | ||
|
|
757b195d5c | ||
|
|
c6a39a9220 | ||
|
|
a2054b458b | ||
|
|
6ee12d447f | ||
|
|
f95e3fb719 | ||
|
|
aa9141505f | ||
|
|
b4f0d2f2ae | ||
|
|
5bc67ab796 | ||
|
|
4f86e0da62 | ||
|
|
12165ac9a6 | ||
|
|
dd783c2dc0 | ||
|
|
4b65086622 | ||
|
|
de2542c172 | ||
|
|
973de3507e | ||
|
|
1945d5ac6b | ||
|
|
cb3614d54c | ||
|
|
4375f2d5d1 | ||
|
|
92b6cf201e | ||
|
|
b2b53561ba | ||
|
|
73a1923db6 | ||
|
|
76e290f6b7 | ||
|
|
be02814021 | ||
|
|
d60c007ac6 | ||
|
|
e92c1eaa9d | ||
|
|
8d638602b9 | ||
|
|
48161aca47 | ||
|
|
11314972fa | ||
|
|
83ac202a6b | ||
|
|
02c601fd3a | ||
|
|
86f6f85142 | ||
|
|
ca4cb433a9 | ||
|
|
e5bed0afcb | ||
|
|
11cf85f771 | ||
|
|
18d7a9cfe9 | ||
|
|
b3bac32441 | ||
|
|
0b9fb06c08 | ||
|
|
c6219ff315 | ||
|
|
2b7668aa68 | ||
|
|
c8a684e10d | ||
|
|
5a5d675f3e | ||
|
|
a4acc60f1d | ||
|
|
b3bc04251b | ||
|
|
203111eb5a | ||
|
|
472168b9e4 | ||
|
|
328ebbe3f7 | ||
|
|
999cd19d81 | ||
|
|
d23f6a69e5 | ||
|
|
38c7fe9e0a | ||
|
|
dc02f51a15 | ||
|
|
dd7ea02c9f | ||
|
|
5e0bf0da6e | ||
|
|
f2f4b14f5e | ||
|
|
e27b4fa2f9 | ||
|
|
c71a57bd69 | ||
|
|
8c57b271d8 | ||
|
|
e167602a32 | ||
|
|
590f4ba2c6 | ||
|
|
b2c0dc235c | ||
|
|
f357a53e0e | ||
|
|
5f7d1f9f3f | ||
|
|
5ebd255a22 | ||
|
|
010c0a5061 | ||
|
|
6ec4bdd926 | ||
|
|
fe023b798d | ||
|
|
141c916b7b | ||
|
|
f160e456ae | ||
|
|
49c6219a84 | ||
|
|
0db444e78c | ||
|
|
57c2dc0a88 | ||
|
|
15ba2d3156 | ||
|
|
48e2ba11bf | ||
|
|
2a3fc01937 | ||
|
|
aa3e8344fb | ||
|
|
df5e619349 | ||
|
|
0c06983411 | ||
|
|
dda9c1f1af | ||
|
|
6779a02cf9 | ||
|
|
7671328245 | ||
|
|
ba7608602b | ||
|
|
92dcd8981d | ||
|
|
cbe18b70ca | ||
|
|
ab26b94808 | ||
|
|
0e176cee74 | ||
|
|
23eaba0d47 | ||
|
|
c6b079c9cb | ||
|
|
9d544fa7fe | ||
|
|
8aba1be3e6 | ||
|
|
72d28c5219 | ||
|
|
85dc45a479 | ||
|
|
283714f88c | ||
|
|
eb696b49fe | ||
|
|
063be0dbe2 | ||
|
|
1e4656769e | ||
|
|
3079cad8d6 | ||
|
|
d5c86b91c3 | ||
|
|
d5de0b8fa3 | ||
|
|
167c02f433 | ||
|
|
327e03c3b1 | ||
|
|
5304ecb71d | ||
|
|
64dfa2fa33 | ||
|
|
8f6431f657 | ||
|
|
5a59c8c179 | ||
|
|
2a7fa03df1 | ||
|
|
be009d55f4 | ||
|
|
d8789926a7 | ||
|
|
e7de6bd42b | ||
|
|
3f6b70e783 | ||
|
|
d1ab5cc40f | ||
|
|
a8376ebb96 | ||
|
|
f0456cce0e | ||
|
|
bc46f8c432 | ||
|
|
4de8a8e915 | ||
|
|
4f0d425711 | ||
|
|
7679c255f3 | ||
|
|
3027ba6dc7 | ||
|
|
9b556436bb | ||
|
|
1c84205a5e | ||
|
|
d39373a4f5 | ||
|
|
3dbfdf3b5b | ||
|
|
286cfc961e | ||
|
|
3148879bf7 | ||
|
|
70924b6823 | ||
|
|
2a63fe6a09 | ||
|
|
91c09ebd7e | ||
|
|
4957e62765 | ||
|
|
80ef32b8b5 | ||
|
|
39bf3e754d | ||
|
|
3d8c0ce181 | ||
|
|
07042d16b0 | ||
|
|
fce583a346 | ||
|
|
7ba5a3b8cd | ||
|
|
ae16c021da | ||
|
|
70ff34438f | ||
|
|
b105585f5a | ||
|
|
29c7859ea1 | ||
|
|
678194f4f7 | ||
|
|
60353be2c0 | ||
|
|
6410acbb48 | ||
|
|
731c2e22b8 | ||
|
|
cd950f39b4 | ||
|
|
8cbf56f7a5 | ||
|
|
17f986ea26 | ||
|
|
e5f9fce01e | ||
|
|
4c34a88a10 | ||
|
|
324d34aa3c | ||
|
|
3f984fb65e | ||
|
|
c108c60c30 | ||
|
|
cf1a84f4b2 | ||
|
|
350afcdb70 | ||
|
|
e5b319e518 | ||
|
|
a43785d1f0 | ||
|
|
b90981a17c | ||
|
|
47bbe20001 | ||
|
|
668b9dd903 | ||
|
|
6ca98149a7 | ||
|
|
af2de33809 | ||
|
|
737054873e | ||
|
|
1dd0961a48 | ||
|
|
3fcb6bcbd0 | ||
|
|
53660cc7dc | ||
|
|
996af9b268 | ||
|
|
512044617c | ||
|
|
a91f712735 | ||
|
|
fb7a0fcb50 | ||
|
|
749ed5432b | ||
|
|
53be4c259e | ||
|
|
e32630511d | ||
|
|
c9a6d69d6f | ||
|
|
5a78a71316 | ||
|
|
da9680d210 | ||
|
|
1ec37d657d | ||
|
|
99df3df42c | ||
|
|
1c83609971 | ||
|
|
32da8433bb | ||
|
|
485536dc90 | ||
|
|
0b605ddb70 | ||
|
|
755d7b0742 | ||
|
|
15030ab7cb | ||
|
|
a438d6c3c3 | ||
|
|
865a926047 | ||
|
|
a36ec166cf | ||
|
|
77e702da6c | ||
|
|
1560339377 | ||
|
|
f0aaab1299 | ||
|
|
4eced42981 | ||
|
|
1da2839cc3 | ||
|
|
0200281732 | ||
|
|
3d9f9ff4c2 | ||
|
|
60048b4450 | ||
|
|
4bd67c15c0 | ||
|
|
3237e18d2d | ||
|
|
fe17123707 | ||
|
|
a51df79925 | ||
|
|
efbe78a77e | ||
|
|
9f860a3f3e | ||
|
|
9dc5442743 | ||
|
|
e2d66235b5 | ||
|
|
cafad5599d | ||
|
|
6d8f375ae1 | ||
|
|
a055d7f4a8 | ||
|
|
09102325eb | ||
|
|
33c9774b21 | ||
|
|
d7f64fec4f | ||
|
|
eab5a42d93 | ||
|
|
5c7f120a7e | ||
|
|
d7d78d8053 | ||
|
|
cde7f114f9 |
6
.gitignore
vendored
@@ -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
|
||||
150
CHANGELOG.TXT
@@ -1,8 +1,105 @@
|
||||
1.73 Beta 2 ():
|
||||
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:
|
||||
----------------------
|
||||
PR-133: Option to reconnect all currently opened connection tabs
|
||||
MR-917: Improved cryptographic support
|
||||
|
||||
Fixes:
|
||||
------
|
||||
MR-910: Fixes to support Remote Desktop Gateways
|
||||
|
||||
|
||||
|
||||
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 +116,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 +124,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 +141,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 +167,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 +207,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 +220,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 +237,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 +257,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 +267,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 +289,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 +333,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 +358,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 +371,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 +411,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 +425,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 +446,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 +463,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 +481,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 +501,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)
|
||||
|
||||
57
CREDITS.TXT
@@ -1,20 +1,28 @@
|
||||
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
|
||||
|
||||
github.com/Brandhor
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
Translators
|
||||
@@ -24,6 +32,8 @@ Eugenio "Ryo567" Mart
|
||||
Mathieu Pape
|
||||
Emanuel Silva
|
||||
Robert Siwiec
|
||||
Hayato Iriumi
|
||||
Sebastien Thieury (github.com/SebThieu)
|
||||
|
||||
|
||||
Included Source Code
|
||||
@@ -34,15 +44,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
|
||||
@@ -61,19 +74,15 @@ Copyright
|
||||
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
|
||||
@@ -90,10 +99,6 @@ Copyright
|
||||
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
|
||||
@@ -110,7 +115,7 @@ Copyright
|
||||
Creative Commons Attribution 2.5 License
|
||||
http://www.famfamfam.com/
|
||||
|
||||
VncSharp 1.0
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
44
InstallerProjects/CustomActions/CustomActions.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Microsoft.Deployment.WindowsInstaller;
|
||||
|
||||
namespace CustomActions
|
||||
{
|
||||
public class CustomActions
|
||||
{
|
||||
[CustomAction]
|
||||
public static ActionResult IsMinimumRdpVersionInstalled(Session session)
|
||||
{
|
||||
var rdpVersionChecker = new RdpVersionChecker(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,8 @@
|
||||
<Compile Include="CustomActions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="InstalledWindowsUpdateGatherer.cs" />
|
||||
<Compile Include="UninstallNSISVersions.cs" />
|
||||
<Compile Include="RdpVersionChecker.cs" />
|
||||
<Compile Include="UninstallNsisVersions.cs" />
|
||||
<Content Include="CustomAction.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
InstallerProjects/CustomActions/RdpVersionChecker.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Microsoft.Deployment.WindowsInstaller;
|
||||
|
||||
namespace CustomActions
|
||||
{
|
||||
public class RdpVersionChecker
|
||||
{
|
||||
private readonly Session _session;
|
||||
private const string MinimumVersionInstalledReturnVar = "MINIMUM_RDP_VERSION_INSTALLED";
|
||||
private const string MinimumRdpKbVariable = "MINIMUM_RDP_KB";
|
||||
|
||||
public RdpVersionChecker(Session session)
|
||||
{
|
||||
_session = session;
|
||||
}
|
||||
|
||||
public bool Execute()
|
||||
{
|
||||
_session.Log("Begin IsMinimumRdpVersionInstalled");
|
||||
var minimumKb = _session[MinimumRdpKbVariable];
|
||||
var isUpdateInstalled = IsUpdateInstalled(minimumKb);
|
||||
SetReturnValue(isUpdateInstalled);
|
||||
_session.Log("End IsMinimumRdpVersionInstalled");
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsUpdateInstalled(string minimumKb)
|
||||
{
|
||||
_session.Log("Checking if '{0}' is installed", minimumKb);
|
||||
var updateGatherer = new InstalledWindowsUpdateGatherer();
|
||||
var isUpdateInstalled = updateGatherer.IsUpdateInstalled(minimumKb);
|
||||
_session.Log("KB is installed = '{0}'", isUpdateInstalled);
|
||||
return isUpdateInstalled;
|
||||
}
|
||||
|
||||
private void SetReturnValue(bool isUpdateInstalled)
|
||||
{
|
||||
var updateInstalledVal = isUpdateInstalled ? "1" : "0";
|
||||
_session[MinimumVersionInstalledReturnVar] = updateInstalledVal;
|
||||
_session.Log($"Set property '{MinimumVersionInstalledReturnVar}' to '{updateInstalledVal}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
83
InstallerProjects/CustomActions/UninstallNSISVersions.cs
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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>
|
||||
</Wix>
|
||||
@@ -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>
|
||||
@@ -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)" />
|
||||
@@ -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>
|
||||
@@ -16,8 +16,10 @@
|
||||
<?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 IGNOREPREREQUISITES = 0 ?>
|
||||
|
||||
<?if $(var.Platform) = x64 ?>
|
||||
<?define ProductNameWithPlatform = "$(var.ProductName) (64 bit)" ?>
|
||||
@@ -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) > 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=<buildenv.tmp
|
||||
|
||||
REM Sign MSI
|
||||
IF EXIST C:\mRemoteNG_code_signing_cert.pfx (
|
||||
IF %25buildenv: Portable=%25==Release (
|
||||
powershell "&""$(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>
|
||||
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 451 KiB After Width: | Height: | Size: 451 KiB |
@@ -9,22 +9,24 @@
|
||||
<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='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="CheckIfMinimumRdpInstalled" After="AppSearch">(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 +39,19 @@
|
||||
</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 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 +73,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
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 83 KiB |
@@ -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
|
||||
|
Before Width: | Height: | Size: 151 KiB |
34
README.MD
Normal file
@@ -0,0 +1,34 @@
|
||||
[](https://twitter.com/intent/follow?screen_name=mRemoteNG)
|
||||
|
||||
|
||||
[](https://gitter.im/mRemoteNG/PublicChat)
|
||||
|
||||
[](http://ec2-52-39-111-114.us-west-2.compute.amazonaws.com:8080/job/mRemoteNG/job/mRemoteNG/job/develop/)
|
||||
[](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).
|
||||
@@ -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
BIN
Tools/7zip/7za.exe
Normal file
BIN
Tools/7zip/7zxa.dll
Normal file
31
Tools/7zip/License.txt
Normal 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
@@ -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
@@ -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
@@ -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
|
||||
16
Tools/copy_release_installer.ps1
Normal 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
|
||||
}
|
||||
25
Tools/rename_installer_with_version.ps1
Normal 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
13
Tools/signfiles.ps1
Normal 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
|
||||
}
|
||||
68
mRemoteNGTests/BinaryFileTests.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
58
mRemoteNGTests/Security/AeadCryptographyProviderTests.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
112
mRemoteNGTests/Security/CryptographyProviderFactoryTests.cs
Normal 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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
45
mRemoteNGTests/Security/EncryptedSecureStringTests.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,17 @@
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="App\LoggerTests.cs" />
|
||||
<Compile Include="BinaryFileTests.cs" />
|
||||
<Compile Include="Connection\ConnectionInfoInheritanceTests.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>
|
||||
|
||||
@@ -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>
|
||||
@@ -7,88 +7,47 @@ 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
|
||||
|
||||
@@ -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();
|
||||
// }
|
||||
//}
|
||||
//}
|
||||
69
mRemoteV1/App/CompatibilityChecker.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +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;
|
||||
|
||||
|
||||
@@ -14,8 +17,11 @@ namespace mRemoteNG.App.Info
|
||||
public static readonly string UrlDonate = "http://donate.mremoteng.org/";
|
||||
public static readonly string UrlForum = "http://forum.mremoteng.org/";
|
||||
public static readonly string UrlBugs = "http://bugs.mremoteng.org/";
|
||||
public static readonly string HomePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
public static readonly string EncryptionKey = "mR3m";
|
||||
public static readonly string version = Application.ProductVersion;
|
||||
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 SecureString EncryptionKey = "mR3m".ConvertToSecureString();
|
||||
public static string ReportingFilePath = "";
|
||||
public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
|
||||
public static string UserAgent
|
||||
@@ -33,8 +39,15 @@ namespace mRemoteNG.App.Info
|
||||
details.Add($".NET CLR {Environment.Version}");
|
||||
string detailsString = string.Join("; ", details.ToArray());
|
||||
|
||||
return $"Mozilla/5.0 ({detailsString}) {System.Windows.Forms.Application.ProductName}/{System.Windows.Forms.Application.ProductVersion}";
|
||||
return $"Mozilla/5.0 ({detailsString}) {ProdName}/{version}";
|
||||
}
|
||||
}
|
||||
|
||||
public static Version getVer()
|
||||
{
|
||||
System.Version v = new Version();
|
||||
System.Version.TryParse(version, out v);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using log4net;
|
||||
using Microsoft.VisualBasic;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.Connection;
|
||||
@@ -7,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;
|
||||
@@ -20,7 +17,10 @@ using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using mRemoteNG.Security;
|
||||
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;
|
||||
@@ -286,9 +286,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))
|
||||
{
|
||||
@@ -412,12 +413,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();
|
||||
}
|
||||
@@ -431,12 +432,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)
|
||||
{
|
||||
@@ -451,15 +451,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
|
||||
{
|
||||
@@ -486,12 +480,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)
|
||||
@@ -512,17 +507,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)
|
||||
{
|
||||
@@ -538,27 +530,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
|
||||
{
|
||||
Interaction.MsgBox(string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine, Application.ProductName, GetStartupConnectionFileName(), MiscTools.GetExceptionMessageRecursive(ex)), (int)MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, null);
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -691,7 +680,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();
|
||||
@@ -1094,19 +1084,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace mRemoteNG.App
|
||||
{
|
||||
_updateFilePath = updateFilePath;
|
||||
frmMain.Default.Close();
|
||||
ProgramRoot.CloseSingletonInstanceMutex();
|
||||
}
|
||||
|
||||
public static void Cleanup()
|
||||
|
||||
@@ -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,18 @@ 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();
|
||||
}
|
||||
|
||||
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, (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName), (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName, 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 +68,7 @@ namespace mRemoteNG.App
|
||||
|
||||
frmMain.Default.pnlDock.Visible = true;
|
||||
}
|
||||
|
||||
private void GetConnectionIcons()
|
||||
{
|
||||
string iPath = GeneralAppInfo.HomePath + "\\Icons\\";
|
||||
@@ -157,12 +97,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 +112,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 +211,7 @@ namespace mRemoteNG.App
|
||||
_appUpdate.GetUpdateInfoCompletedEvent += GetUpdateInfoCompleted;
|
||||
_appUpdate.GetUpdateInfoAsync();
|
||||
}
|
||||
|
||||
private void GetUpdateInfoCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
if (frmMain.Default.InvokeRequired)
|
||||
@@ -307,6 +255,7 @@ namespace mRemoteNG.App
|
||||
_appUpdate.GetAnnouncementInfoCompletedEvent += GetAnnouncementInfoCompleted;
|
||||
_appUpdate.GetAnnouncementInfoAsync();
|
||||
}
|
||||
|
||||
private void GetAnnouncementInfoCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
if (frmMain.Default.InvokeRequired)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
@@ -6,6 +5,9 @@ using System.ComponentModel;
|
||||
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(mRemoteNG.Settings.Default.UpdateUseProxy), Convert.ToString(mRemoteNG.Settings.Default.UpdateProxyAddress), Convert.ToInt32(mRemoteNG.Settings.Default.UpdateProxyPort), Convert.ToBoolean(mRemoteNG.Settings.Default.UpdateProxyUseAuthentication), Convert.ToString(mRemoteNG.Settings.Default.UpdateProxyAuthUser), Security.Crypt.Decrypt(Convert.ToString(mRemoteNG.Settings.Default.UpdateProxyAuthPass), Info.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)
|
||||
@@ -145,7 +155,7 @@ namespace mRemoteNG.App.Update
|
||||
return false;
|
||||
}
|
||||
|
||||
return _currentUpdateInfo.Version > (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.Version;
|
||||
return _currentUpdateInfo.Version > GeneralAppInfo.getVer();
|
||||
}
|
||||
|
||||
public bool IsAnnouncementAvailable()
|
||||
@@ -155,7 +165,7 @@ namespace mRemoteNG.App.Update
|
||||
return false;
|
||||
}
|
||||
|
||||
return !(_currentAnnouncementInfo.Name == mRemoteNG.Settings.Default.LastAnnouncement);
|
||||
return (_currentAnnouncementInfo.Name != Settings.Default.LastAnnouncement);
|
||||
}
|
||||
|
||||
public void GetUpdateInfoAsync()
|
||||
@@ -165,7 +175,7 @@ namespace mRemoteNG.App.Update
|
||||
_getUpdateInfoThread.Abort();
|
||||
}
|
||||
|
||||
_getUpdateInfoThread = new Thread(new System.Threading.ThreadStart(GetUpdateInfo));
|
||||
_getUpdateInfoThread = new Thread(new ThreadStart(GetUpdateInfo));
|
||||
_getUpdateInfoThread.SetApartmentState(ApartmentState.STA);
|
||||
_getUpdateInfoThread.IsBackground = true;
|
||||
_getUpdateInfoThread.Start();
|
||||
@@ -183,7 +193,7 @@ namespace mRemoteNG.App.Update
|
||||
_getChangeLogThread.Abort();
|
||||
}
|
||||
|
||||
_getChangeLogThread = new Thread(new System.Threading.ThreadStart(GetChangeLog));
|
||||
_getChangeLogThread = new Thread(new ThreadStart(GetChangeLog));
|
||||
_getChangeLogThread.SetApartmentState(ApartmentState.STA);
|
||||
_getChangeLogThread.IsBackground = true;
|
||||
_getChangeLogThread.Start();
|
||||
@@ -196,7 +206,7 @@ namespace mRemoteNG.App.Update
|
||||
_getAnnouncementInfoThread.Abort();
|
||||
}
|
||||
|
||||
_getAnnouncementInfoThread = new Thread(new System.Threading.ThreadStart(GetAnnouncementInfo));
|
||||
_getAnnouncementInfoThread = new Thread(new ThreadStart(GetAnnouncementInfo));
|
||||
_getAnnouncementInfoThread.SetApartmentState(ApartmentState.STA);
|
||||
_getAnnouncementInfoThread.IsBackground = true;
|
||||
_getAnnouncementInfoThread.Start();
|
||||
@@ -244,7 +254,7 @@ namespace mRemoteNG.App.Update
|
||||
private WebClient CreateWebClient()
|
||||
{
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.Headers.Add("user-agent", Info.GeneralAppInfo.UserAgent);
|
||||
webClient.Headers.Add("user-agent", GeneralAppInfo.UserAgent);
|
||||
webClient.Proxy = _webProxy;
|
||||
return webClient;
|
||||
}
|
||||
@@ -285,17 +295,17 @@ namespace mRemoteNG.App.Update
|
||||
|
||||
private void GetUpdateInfo()
|
||||
{
|
||||
Uri updateFileUri = new Uri(new Uri(Convert.ToString(mRemoteNG.Settings.Default.UpdateAddress)), new Uri(Info.UpdateChannelInfo.FileName, UriKind.Relative));
|
||||
Uri updateFileUri = new Uri(new Uri(Convert.ToString(Settings.Default.UpdateAddress)), new Uri(UpdateChannelInfo.FileName, UriKind.Relative));
|
||||
DownloadStringCompletedEventArgs e = DownloadString(updateFileUri);
|
||||
|
||||
if (!e.Cancelled && e.Error == null)
|
||||
{
|
||||
_currentUpdateInfo = UpdateInfo.FromString(e.Result);
|
||||
|
||||
mRemoteNG.Settings.Default.CheckForUpdatesLastCheck = DateTime.UtcNow;
|
||||
if (!mRemoteNG.Settings.Default.UpdatePending)
|
||||
|
||||
Settings.Default.CheckForUpdatesLastCheck = DateTime.UtcNow;
|
||||
if (!Settings.Default.UpdatePending)
|
||||
{
|
||||
mRemoteNG.Settings.Default.UpdatePending = IsUpdateAvailable();
|
||||
Settings.Default.UpdatePending = IsUpdateAvailable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +328,7 @@ namespace mRemoteNG.App.Update
|
||||
|
||||
private void GetAnnouncementInfo()
|
||||
{
|
||||
Uri announcementFileUri = new Uri(Convert.ToString(mRemoteNG.Settings.Default.AnnouncementAddress));
|
||||
Uri announcementFileUri = new Uri(Convert.ToString(Settings.Default.AnnouncementAddress));
|
||||
DownloadStringCompletedEventArgs e = DownloadString(announcementFileUri);
|
||||
|
||||
if (!e.Cancelled && e.Error == null)
|
||||
@@ -327,7 +337,7 @@ namespace mRemoteNG.App.Update
|
||||
|
||||
if (!string.IsNullOrEmpty(_currentAnnouncementInfo.Name))
|
||||
{
|
||||
mRemoteNG.Settings.Default.LastAnnouncement = _currentAnnouncementInfo.Name;
|
||||
Settings.Default.LastAnnouncement = _currentAnnouncementInfo.Name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +351,7 @@ namespace mRemoteNG.App.Update
|
||||
DownloadUpdateProgressChangedEventEvent(sender, e);
|
||||
}
|
||||
|
||||
private void DownloadUpdateCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
|
||||
private void DownloadUpdateCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
AsyncCompletedEventArgs raiseEventArgs = e;
|
||||
|
||||
@@ -353,7 +363,7 @@ namespace mRemoteNG.App.Update
|
||||
updateAuthenticode.RequireThumbprintMatch = true;
|
||||
updateAuthenticode.ThumbprintToMatch = _currentUpdateInfo.CertificateThumbprint;
|
||||
|
||||
if (!(updateAuthenticode.Verify() == Authenticode.StatusValue.Verified))
|
||||
if (updateAuthenticode.Verify() != Authenticode.StatusValue.Verified)
|
||||
{
|
||||
if (updateAuthenticode.Status == Authenticode.StatusValue.UnhandledException)
|
||||
{
|
||||
@@ -390,11 +400,11 @@ namespace mRemoteNG.App.Update
|
||||
{
|
||||
add
|
||||
{
|
||||
GetUpdateInfoCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Combine(GetUpdateInfoCompletedEventEvent, value);
|
||||
GetUpdateInfoCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(GetUpdateInfoCompletedEventEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
GetUpdateInfoCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Remove(GetUpdateInfoCompletedEventEvent, value);
|
||||
GetUpdateInfoCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(GetUpdateInfoCompletedEventEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,11 +413,11 @@ namespace mRemoteNG.App.Update
|
||||
{
|
||||
add
|
||||
{
|
||||
GetChangeLogCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Combine(GetChangeLogCompletedEventEvent, value);
|
||||
GetChangeLogCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(GetChangeLogCompletedEventEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
GetChangeLogCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Remove(GetChangeLogCompletedEventEvent, value);
|
||||
GetChangeLogCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(GetChangeLogCompletedEventEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,11 +426,11 @@ namespace mRemoteNG.App.Update
|
||||
{
|
||||
add
|
||||
{
|
||||
GetAnnouncementInfoCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Combine(GetAnnouncementInfoCompletedEventEvent, value);
|
||||
GetAnnouncementInfoCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(GetAnnouncementInfoCompletedEventEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
GetAnnouncementInfoCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Remove(GetAnnouncementInfoCompletedEventEvent, value);
|
||||
GetAnnouncementInfoCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(GetAnnouncementInfoCompletedEventEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,11 +439,11 @@ namespace mRemoteNG.App.Update
|
||||
{
|
||||
add
|
||||
{
|
||||
DownloadUpdateProgressChangedEventEvent = (DownloadProgressChangedEventHandler)System.Delegate.Combine(DownloadUpdateProgressChangedEventEvent, value);
|
||||
DownloadUpdateProgressChangedEventEvent = (DownloadProgressChangedEventHandler)Delegate.Combine(DownloadUpdateProgressChangedEventEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
DownloadUpdateProgressChangedEventEvent = (DownloadProgressChangedEventHandler)System.Delegate.Remove(DownloadUpdateProgressChangedEventEvent, value);
|
||||
DownloadUpdateProgressChangedEventEvent = (DownloadProgressChangedEventHandler)Delegate.Remove(DownloadUpdateProgressChangedEventEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,11 +452,11 @@ namespace mRemoteNG.App.Update
|
||||
{
|
||||
add
|
||||
{
|
||||
DownloadUpdateCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Combine(DownloadUpdateCompletedEventEvent, value);
|
||||
DownloadUpdateCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(DownloadUpdateCompletedEventEvent, value);
|
||||
}
|
||||
remove
|
||||
{
|
||||
DownloadUpdateCompletedEventEvent = (AsyncCompletedEventHandler)System.Delegate.Remove(DownloadUpdateCompletedEventEvent, value);
|
||||
DownloadUpdateCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(DownloadUpdateCompletedEventEvent, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol.RDP;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
using System;
|
||||
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;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
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;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
@@ -33,12 +39,12 @@ 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;
|
||||
|
||||
private int _currentNodeIndex = 0;
|
||||
private int _currentNodeIndex;
|
||||
private string _parentConstantId = Convert.ToString(0);
|
||||
#endregion
|
||||
|
||||
@@ -52,7 +58,7 @@ namespace mRemoteNG.Config.Connections
|
||||
public TreeNode RootTreeNode {get; set;}
|
||||
public bool Export {get; set;}
|
||||
public Format SaveFormat {get; set;}
|
||||
public Security.Save SaveSecurity {get; set;}
|
||||
public Save SaveSecurity {get; set;}
|
||||
public ConnectionList ConnectionList {get; set;}
|
||||
public ContainerList ContainerList {get; set;}
|
||||
#endregion
|
||||
@@ -95,8 +101,7 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
bool isVerified = false;
|
||||
SqlDataReader sqlDataReader = null;
|
||||
System.Version databaseVersion = null;
|
||||
try
|
||||
try
|
||||
{
|
||||
SqlCommand sqlCommand = new SqlCommand("SELECT * FROM tblRoot", sqlConnection);
|
||||
sqlDataReader = sqlCommand.ExecuteReader();
|
||||
@@ -106,21 +111,21 @@ 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();
|
||||
|
||||
if (databaseVersion.CompareTo(new System.Version(2, 2)) == 0) // 2.2
|
||||
if (databaseVersion.CompareTo(new Version(2, 2)) == 0) // 2.2
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, string.Format("Upgrading database from version {0} to version {1}.", databaseVersion.ToString(), "2.3"));
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format("Upgrading database from version {0} to version {1}.", databaseVersion, "2.3"));
|
||||
sqlCommand = new SqlCommand("ALTER TABLE tblCons ADD EnableFontSmoothing bit NOT NULL DEFAULT 0, EnableDesktopComposition bit NOT NULL DEFAULT 0, InheritEnableFontSmoothing bit NOT NULL DEFAULT 0, InheritEnableDesktopComposition bit NOT NULL DEFAULT 0;", sqlConnection);
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
databaseVersion = new System.Version(2, 3);
|
||||
databaseVersion = new Version(2, 3);
|
||||
}
|
||||
|
||||
if (databaseVersion.CompareTo(new System.Version(2, 3)) == 0) // 2.3
|
||||
if (databaseVersion.CompareTo(new Version(2, 3)) == 0) // 2.3
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, string.Format("Upgrading database from version {0} to version {1}.", databaseVersion.ToString(), "2.4"));
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format("Upgrading database from version {0} to version {1}.", databaseVersion, "2.4"));
|
||||
sqlCommand = new SqlCommand("ALTER TABLE tblCons ADD UseCredSsp bit NOT NULL DEFAULT 1, InheritUseCredSsp bit NOT NULL DEFAULT 0;", sqlConnection);
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
databaseVersion = new Version(2, 4);
|
||||
@@ -128,7 +133,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (databaseVersion.CompareTo(new Version(2, 4)) == 0) // 2.4
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, string.Format("Upgrading database from version {0} to version {1}.", databaseVersion.ToString(), "2.5"));
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format("Upgrading database from version {0} to version {1}.", databaseVersion, "2.5"));
|
||||
sqlCommand = new SqlCommand("ALTER TABLE tblCons ADD LoadBalanceInfo varchar (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, AutomaticResize bit NOT NULL DEFAULT 1, InheritLoadBalanceInfo bit NOT NULL DEFAULT 0, InheritAutomaticResize bit NOT NULL DEFAULT 0;", sqlConnection);
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
databaseVersion = new Version(2, 5);
|
||||
@@ -141,12 +146,12 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (isVerified == false)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, string.Format(Language.strErrorBadDatabaseVersion, databaseVersion.ToString(), (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName));
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, string.Format(Language.strErrorBadDatabaseVersion, databaseVersion, GeneralAppInfo.ProdName));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, string.Format(Language.strErrorVerifyDatabaseVersionFailed, ex.Message));
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strErrorVerifyDatabaseVersionFailed, ex.Message));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -171,53 +176,52 @@ 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))
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strErrorConnectionListSaveFailed);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strErrorConnectionListSaveFailed);
|
||||
return ;
|
||||
}
|
||||
|
||||
var tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
TreeNode tN = default(TreeNode);
|
||||
tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
string strProtected = "";
|
||||
string strProtected;
|
||||
if (tN.Tag != null)
|
||||
{
|
||||
if ((tN.Tag as RootNodeInfo).Password == true)
|
||||
if (((RootNodeInfo) tN.Tag).Password)
|
||||
{
|
||||
_password = Convert.ToString((tN.Tag as RootNodeInfo).PasswordString);
|
||||
strProtected = Security.Crypt.Encrypt("ThisIsProtected", _password);
|
||||
_password = Convert.ToString(((RootNodeInfo) tN.Tag).PasswordString).ConvertToSecureString();
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsProtected", _password);
|
||||
}
|
||||
else
|
||||
{
|
||||
strProtected = Security.Crypt.Encrypt("ThisIsNotProtected", _password);
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", _password);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strProtected = Security.Crypt.Encrypt("ThisIsNotProtected", _password);
|
||||
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", _password);
|
||||
}
|
||||
|
||||
_sqlQuery = new SqlCommand("DELETE FROM tblRoot", _sqlConnection);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
|
||||
_sqlQuery = new SqlCommand("INSERT INTO tblRoot (Name, Export, Protected, ConfVersion) VALUES(\'" + MiscTools.PrepareValueForDB(tN.Text) + "\', 0, \'" + strProtected + "\'," + App.Info.ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture) + ")", _sqlConnection);
|
||||
_sqlQuery = new SqlCommand("INSERT INTO tblRoot (Name, Export, Protected, ConfVersion) VALUES(\'" + MiscTools.PrepareValueForDB(tN.Text) + "\', 0, \'" + strProtected + "\'," + ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture) + ")", _sqlConnection);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
|
||||
_sqlQuery = new SqlCommand("DELETE FROM tblCons", _sqlConnection);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
|
||||
TreeNodeCollection tNC = default(TreeNodeCollection);
|
||||
tNC = tN.Nodes;
|
||||
|
||||
TreeNodeCollection tNC = tN.Nodes;
|
||||
|
||||
SaveNodesSQL(tNC);
|
||||
|
||||
_sqlQuery = new SqlCommand("DELETE FROM tblUpdate", _sqlConnection);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
_sqlQuery = new SqlCommand("INSERT INTO tblUpdate (LastUpdate) VALUES(\'" + Tools.MiscTools.DBDate(DateTime.Now) + "\')", _sqlConnection);
|
||||
_sqlQuery = new SqlCommand("INSERT INTO tblUpdate (LastUpdate) VALUES(\'" + MiscTools.DBDate(DateTime.Now) + "\')", _sqlConnection);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
|
||||
_sqlConnection.Close();
|
||||
@@ -229,38 +233,38 @@ 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
|
||||
);
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection | Tree.ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
|
||||
{
|
||||
//_xmlTextWriter.WriteStartElement("Node")
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(node.Text) + "\',"; //Name
|
||||
_sqlQuery.CommandText += "\'" + Tree.ConnectionTreeNode.GetNodeType(node).ToString() + "\',"; //Type
|
||||
_sqlQuery.CommandText += "\'" + ConnectionTreeNode.GetNodeType(node) + "\',"; //Type
|
||||
}
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container) //container
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container) //container
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + this.ContainerList[node.Tag].IsExpanded + "\',"; //Expanded
|
||||
curConI = this.ContainerList[node.Tag].ConnectionInfo;
|
||||
_sqlQuery.CommandText += "\'" + ContainerList[node.Tag].IsExpanded + "\',"; //Expanded
|
||||
curConI = ContainerList[node.Tag].ConnectionInfo;
|
||||
SaveConnectionFieldsSQL(curConI);
|
||||
|
||||
_sqlQuery.CommandText = Tools.MiscTools.PrepareForDB(_sqlQuery.CommandText);
|
||||
_sqlQuery.CommandText = MiscTools.PrepareForDB(_sqlQuery.CommandText);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
//_parentConstantId = _currentNodeIndex
|
||||
SaveNodesSQL(node.Nodes);
|
||||
//_xmlTextWriter.WriteEndElement()
|
||||
}
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(false) + "\',";
|
||||
curConI = this.ConnectionList[node.Tag];
|
||||
curConI = ConnectionList[node.Tag];
|
||||
SaveConnectionFieldsSQL(curConI);
|
||||
//_xmlTextWriter.WriteEndElement()
|
||||
_sqlQuery.CommandText = Tools.MiscTools.PrepareForDB(_sqlQuery.CommandText);
|
||||
_sqlQuery.CommandText = MiscTools.PrepareForDB(_sqlQuery.CommandText);
|
||||
_sqlQuery.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
@@ -270,12 +274,13 @@ 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) + "\',";
|
||||
|
||||
if (this.SaveSecurity.Username == true)
|
||||
if (SaveSecurity.Username)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Username) + "\',";
|
||||
}
|
||||
@@ -284,7 +289,7 @@ namespace mRemoteNG.Config.Connections
|
||||
_sqlQuery.CommandText += "\'" + "" + "\',";
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Domain == true)
|
||||
if (SaveSecurity.Domain)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Domain) + "\',";
|
||||
}
|
||||
@@ -293,9 +298,9 @@ namespace mRemoteNG.Config.Connections
|
||||
_sqlQuery.CommandText += "\'" + "" + "\',";
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Password == true)
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(Security.Crypt.Encrypt(with_1.Password, _password)) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(cryptographyProvider.Encrypt(with_1.Password, _password)) + "\',";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -303,16 +308,16 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.Hostname) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.Protocol.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.Protocol + "\',";
|
||||
_sqlQuery.CommandText += "\'" + MiscTools.PrepareValueForDB(with_1.PuttySession) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Port) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.UseConsoleSession) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RenderingEngine.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.ICAEncryption.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDPAuthenticationLevel.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RenderingEngine + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.ICAEncryption + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDPAuthenticationLevel + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.LoadBalanceInfo + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.Colors.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.Resolution.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.Colors + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.Resolution + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.AutomaticResize) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.DisplayWallpaper) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.DisplayThemes) + "\',";
|
||||
@@ -323,7 +328,7 @@ namespace mRemoteNG.Config.Connections
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.RedirectPorts) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.RedirectPrinters) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.RedirectSmartCards) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RedirectSound.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RedirectSound + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.RedirectKeys) + "\',";
|
||||
|
||||
if (curConI.OpenConnections.Count > 0)
|
||||
@@ -341,23 +346,23 @@ namespace mRemoteNG.Config.Connections
|
||||
_sqlQuery.CommandText += "\'" + with_1.UserField + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.ExtApp + "\',";
|
||||
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCCompression.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCEncoding.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCAuthMode.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCProxyType.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCCompression + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCEncoding + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCAuthMode + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCProxyType + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCProxyIP + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.VNCProxyPort) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCProxyUsername + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Security.Crypt.Encrypt(with_1.VNCProxyPassword, _password) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCColors.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.VNCSmartSizeMode.ToString() + "\',";
|
||||
_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) + "\',";
|
||||
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayUsageMethod.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayUsageMethod + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayHostname + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayUseConnectionCredentials.ToString() + "\',";
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayUseConnectionCredentials + "\',";
|
||||
|
||||
if (this.SaveSecurity.Username == true)
|
||||
if (SaveSecurity.Username)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayUsername + "\',";
|
||||
}
|
||||
@@ -366,16 +371,16 @@ namespace mRemoteNG.Config.Connections
|
||||
_sqlQuery.CommandText += "\'" + "" + "\',";
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Password == true)
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + Security.Crypt.Encrypt(with_1.RDGatewayPassword, _password) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + cryptographyProvider.Encrypt(with_1.RDGatewayPassword, _password) + "\',";
|
||||
}
|
||||
else
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + "" + "\',";
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Domain == true)
|
||||
if (SaveSecurity.Domain)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + with_1.RDGatewayDomain + "\',";
|
||||
}
|
||||
@@ -386,7 +391,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.UseCredSsp) + "\',";
|
||||
|
||||
if (this.SaveSecurity.Inheritance == true)
|
||||
if (SaveSecurity.Inheritance)
|
||||
{
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.CacheBitmaps) + "\',";
|
||||
_sqlQuery.CommandText += "\'" + Convert.ToString(with_1.Inheritance.Colors) + "\',";
|
||||
@@ -507,7 +512,7 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
if (with_1.Parent != null)
|
||||
{
|
||||
_parentConstantId = Convert.ToString((with_1.Parent as ContainerInfo).ConnectionInfo.ConstantID);
|
||||
_parentConstantId = Convert.ToString(with_1.Parent.ConnectionInfo.ConstantID);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -516,9 +521,9 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((with_1.Parent as ContainerInfo).Parent != null)
|
||||
if (with_1.Parent.Parent != null)
|
||||
{
|
||||
_parentConstantId = Convert.ToString(((with_1.Parent as ContainerInfo).Parent as ContainerInfo).ConnectionInfo.ConstantID);
|
||||
_parentConstantId = Convert.ToString(with_1.Parent.Parent.ConnectionInfo.ConstantID);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -526,7 +531,7 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
}
|
||||
|
||||
_sqlQuery.CommandText += _currentNodeIndex + ",\'" + _parentConstantId + "\',\'" + with_1.ConstantID + "\',\'" + Tools.MiscTools.DBDate(DateTime.Now) + "\')";
|
||||
_sqlQuery.CommandText += _currentNodeIndex + ",\'" + _parentConstantId + "\',\'" + with_1.ConstantID + "\',\'" + MiscTools.DBDate(DateTime.Now) + "\')";
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -534,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(Security.Crypt.Encrypt(fileContents, _password));
|
||||
streamWriter.Write(cryptographyProvider.Encrypt(fileContents, _password));
|
||||
streamWriter.Close();
|
||||
}
|
||||
}
|
||||
@@ -555,21 +561,21 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
return;
|
||||
}
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
TreeNode treeNode;
|
||||
|
||||
TreeNode treeNode = default(TreeNode);
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(RootTreeNode) == Tree.TreeNodeType.Root)
|
||||
if (ConnectionTreeNode.GetNodeType(RootTreeNode) == TreeNodeType.Root)
|
||||
{
|
||||
treeNode = (TreeNode)RootTreeNode.Clone();
|
||||
}
|
||||
else
|
||||
{
|
||||
treeNode = new TreeNode("mR|Export (" + Tools.MiscTools.DBDate(DateTime.Now) + ")");
|
||||
treeNode = new TreeNode("mR|Export (" + MiscTools.DBDate(DateTime.Now) + ")");
|
||||
treeNode.Nodes.Add(Convert.ToString(RootTreeNode.Clone()));
|
||||
}
|
||||
|
||||
string tempFileName = Path.GetTempFileName();
|
||||
_xmlTextWriter = new XmlTextWriter(tempFileName, System.Text.Encoding.UTF8);
|
||||
_xmlTextWriter = new XmlTextWriter(tempFileName, Encoding.UTF8);
|
||||
|
||||
_xmlTextWriter.Formatting = Formatting.Indented;
|
||||
_xmlTextWriter.Indentation = 4;
|
||||
@@ -582,25 +588,24 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
if (Export)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", Security.Crypt.Encrypt("ThisIsNotProtected", _password));
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsNotProtected", _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((treeNode.Tag as RootNodeInfo).Password == true)
|
||||
if (((RootNodeInfo) treeNode.Tag).Password)
|
||||
{
|
||||
_password = Convert.ToString((treeNode.Tag as RootNodeInfo).PasswordString);
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", Security.Crypt.Encrypt("ThisIsProtected", _password));
|
||||
_password = Convert.ToString(((RootNodeInfo) treeNode.Tag).PasswordString).ConvertToSecureString();
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsProtected", _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", Security.Crypt.Encrypt("ThisIsNotProtected", _password));
|
||||
_xmlTextWriter.WriteAttributeString("Protected", "", cryptographyProvider.Encrypt("ThisIsNotProtected", _password));
|
||||
}
|
||||
}
|
||||
|
||||
_xmlTextWriter.WriteAttributeString("ConfVersion", "", App.Info.ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
TreeNodeCollection treeNodeCollection = default(TreeNodeCollection);
|
||||
treeNodeCollection = treeNode.Nodes;
|
||||
_xmlTextWriter.WriteAttributeString("ConfVersion", "", ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
var treeNodeCollection = treeNode.Nodes;
|
||||
|
||||
SaveNode(treeNodeCollection);
|
||||
|
||||
@@ -624,8 +629,9 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.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)
|
||||
@@ -634,27 +640,27 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
foreach (TreeNode node in tNC)
|
||||
{
|
||||
ConnectionInfo curConI = default(ConnectionInfo);
|
||||
ConnectionInfo curConI;
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Connection | Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Container)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
|
||||
{
|
||||
_xmlTextWriter.WriteStartElement("Node");
|
||||
_xmlTextWriter.WriteAttributeString("Name", "", node.Text);
|
||||
_xmlTextWriter.WriteAttributeString("Type", "", Tree.ConnectionTreeNode.GetNodeType(node).ToString());
|
||||
_xmlTextWriter.WriteAttributeString("Type", "", ConnectionTreeNode.GetNodeType(node).ToString());
|
||||
}
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Container) //container
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container) //container
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Expanded", "", Convert.ToString(this.ContainerList[node.Tag].TreeNode.IsExpanded));
|
||||
curConI = this.ContainerList[node.Tag].ConnectionInfo;
|
||||
_xmlTextWriter.WriteAttributeString("Expanded", "", Convert.ToString(ContainerList[node.Tag].TreeNode.IsExpanded));
|
||||
curConI = ContainerList[node.Tag].ConnectionInfo;
|
||||
SaveConnectionFields(curConI);
|
||||
SaveNode(node.Nodes);
|
||||
_xmlTextWriter.WriteEndElement();
|
||||
}
|
||||
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Connection)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection)
|
||||
{
|
||||
curConI = this.ConnectionList[node.Tag];
|
||||
curConI = ConnectionList[node.Tag];
|
||||
SaveConnectionFields(curConI);
|
||||
_xmlTextWriter.WriteEndElement();
|
||||
}
|
||||
@@ -662,7 +668,7 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SaveNode failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveNode failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -670,13 +676,14 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
try
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Descr", "", curConI.Description);
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
_xmlTextWriter.WriteAttributeString("Descr", "", curConI.Description);
|
||||
|
||||
_xmlTextWriter.WriteAttributeString("Icon", "", curConI.Icon);
|
||||
|
||||
_xmlTextWriter.WriteAttributeString("Panel", "", curConI.Panel);
|
||||
|
||||
if (this.SaveSecurity.Username == true)
|
||||
if (SaveSecurity.Username)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Username", "", curConI.Username);
|
||||
}
|
||||
@@ -685,7 +692,7 @@ namespace mRemoteNG.Config.Connections
|
||||
_xmlTextWriter.WriteAttributeString("Username", "", "");
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Domain == true)
|
||||
if (SaveSecurity.Domain)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Domain", "", curConI.Domain);
|
||||
}
|
||||
@@ -694,9 +701,9 @@ namespace mRemoteNG.Config.Connections
|
||||
_xmlTextWriter.WriteAttributeString("Domain", "", "");
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Password == true)
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("Password", "", Security.Crypt.Encrypt(curConI.Password, _password));
|
||||
_xmlTextWriter.WriteAttributeString("Password", "", cryptographyProvider.Encrypt(curConI.Password, _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -773,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", "", Security.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));
|
||||
@@ -783,7 +790,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayUseConnectionCredentials", "", curConI.RDGatewayUseConnectionCredentials.ToString());
|
||||
|
||||
if (this.SaveSecurity.Username == true)
|
||||
if (SaveSecurity.Username)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayUsername", "", curConI.RDGatewayUsername);
|
||||
}
|
||||
@@ -792,16 +799,16 @@ namespace mRemoteNG.Config.Connections
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayUsername", "", "");
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Password == true)
|
||||
if (SaveSecurity.Password)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", Security.Crypt.Encrypt(curConI.RDGatewayPassword, _password));
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", cryptographyProvider.Encrypt(curConI.RDGatewayPassword, _password));
|
||||
}
|
||||
else
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayPassword", "", "");
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Domain == true)
|
||||
if (SaveSecurity.Domain)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayDomain", "", curConI.RDGatewayDomain);
|
||||
}
|
||||
@@ -810,7 +817,7 @@ namespace mRemoteNG.Config.Connections
|
||||
_xmlTextWriter.WriteAttributeString("RDGatewayDomain", "", "");
|
||||
}
|
||||
|
||||
if (this.SaveSecurity.Inheritance == true)
|
||||
if (SaveSecurity.Inheritance)
|
||||
{
|
||||
_xmlTextWriter.WriteAttributeString("InheritCacheBitmaps", "", Convert.ToString(curConI.Inheritance.CacheBitmaps));
|
||||
_xmlTextWriter.WriteAttributeString("InheritColors", "", Convert.ToString(curConI.Inheritance.Colors));
|
||||
@@ -920,7 +927,7 @@ namespace mRemoteNG.Config.Connections
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SaveConnectionFields failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SaveConnectionFields failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -930,16 +937,14 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
private void SaveTomRCSV()
|
||||
{
|
||||
if (App.Runtime.IsConnectionsFileLoaded == false)
|
||||
if (Runtime.IsConnectionsFileLoaded == false)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -981,13 +986,13 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
foreach (TreeNode node in tNC)
|
||||
{
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Connection)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection)
|
||||
{
|
||||
ConnectionInfo curConI = (ConnectionInfo)node.Tag;
|
||||
|
||||
WritemRCSVLine(curConI);
|
||||
}
|
||||
else if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Container)
|
||||
else if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
|
||||
{
|
||||
SaveNodemRCSV(node.Nodes);
|
||||
}
|
||||
@@ -998,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)
|
||||
{
|
||||
@@ -1030,7 +1035,7 @@ namespace mRemoteNG.Config.Connections
|
||||
csvLn += con.Domain + ";";
|
||||
}
|
||||
|
||||
csvLn += con.Hostname + ";" + con.Protocol.ToString() + ";" + con.PuttySession + ";" + Convert.ToString(con.Port) + ";" + Convert.ToString(con.UseConsoleSession) + ";" + Convert.ToString(con.UseCredSsp) + ";" + con.RenderingEngine.ToString() + ";" + con.ICAEncryption.ToString() + ";" + con.RDPAuthenticationLevel.ToString() + ";" + con.LoadBalanceInfo + ";" + con.Colors.ToString() + ";" + con.Resolution.ToString() + ";" + 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.ToString() + ";" + Convert.ToString(con.RedirectKeys) + ";" + con.PreExtApp + ";" + con.PostExtApp + ";" + con.MacAddress + ";" + con.UserField + ";" + con.ExtApp + ";" + con.VNCCompression.ToString() + ";" + con.VNCEncoding.ToString() + ";" + con.VNCAuthMode.ToString() + ";" + con.VNCProxyType.ToString() + ";" + con.VNCProxyIP + ";" + Convert.ToString(con.VNCProxyPort) + ";" + con.VNCProxyUsername + ";" + con.VNCProxyPassword + ";" + con.VNCColors.ToString() + ";" + con.VNCSmartSizeMode.ToString() + ";" + 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.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) + ";";
|
||||
|
||||
if (SaveSecurity.Inheritance)
|
||||
{
|
||||
@@ -1045,16 +1050,14 @@ namespace mRemoteNG.Config.Connections
|
||||
#region vRD CSV
|
||||
private void SaveTovRDCSV()
|
||||
{
|
||||
if (App.Runtime.IsConnectionsFileLoaded == false)
|
||||
if (Runtime.IsConnectionsFileLoaded == false)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -1067,16 +1070,16 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
foreach (TreeNode node in tNC)
|
||||
{
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Connection)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection)
|
||||
{
|
||||
ConnectionInfo curConI = (ConnectionInfo)node.Tag;
|
||||
|
||||
if (curConI.Protocol == Connection.Protocol.ProtocolType.RDP)
|
||||
if (curConI.Protocol == ProtocolType.RDP)
|
||||
{
|
||||
WritevRDCSVLine(curConI);
|
||||
}
|
||||
}
|
||||
else if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Container)
|
||||
else if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Container)
|
||||
{
|
||||
SaveNodevRDCSV(node.Nodes);
|
||||
}
|
||||
@@ -1087,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)
|
||||
{
|
||||
@@ -1107,18 +1110,16 @@ namespace mRemoteNG.Config.Connections
|
||||
#region vRD VRE
|
||||
private void SaveToVRE()
|
||||
{
|
||||
if (App.Runtime.IsConnectionsFileLoaded == false)
|
||||
if (Runtime.IsConnectionsFileLoaded == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
var tNC = tN.Nodes;
|
||||
|
||||
TreeNode tN = default(TreeNode);
|
||||
tN = (TreeNode)RootTreeNode.Clone();
|
||||
|
||||
TreeNodeCollection tNC = default(TreeNodeCollection);
|
||||
tNC = tN.Nodes;
|
||||
|
||||
_xmlTextWriter = new XmlTextWriter(ConnectionFileName, System.Text.Encoding.UTF8);
|
||||
_xmlTextWriter = new XmlTextWriter(ConnectionFileName, Encoding.UTF8);
|
||||
_xmlTextWriter.Formatting = Formatting.Indented;
|
||||
_xmlTextWriter.Indentation = 4;
|
||||
|
||||
@@ -1140,11 +1141,11 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
foreach (TreeNode node in tNC)
|
||||
{
|
||||
if (Tree.ConnectionTreeNode.GetNodeType(node) == Tree.TreeNodeType.Connection)
|
||||
if (ConnectionTreeNode.GetNodeType(node) == TreeNodeType.Connection)
|
||||
{
|
||||
ConnectionInfo curConI = (ConnectionInfo)node.Tag;
|
||||
|
||||
if (curConI.Protocol == Connection.Protocol.ProtocolType.RDP)
|
||||
if (curConI.Protocol == ProtocolType.RDP)
|
||||
{
|
||||
_xmlTextWriter.WriteStartElement("Connection");
|
||||
_xmlTextWriter.WriteAttributeString("Id", "", "");
|
||||
|
||||
510
mRemoteV1/Config/Connections/SqlConnectionsLoader.cs
Normal 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.ICAEncryption = (ProtocolICA.EncryptionStrength)Tools.MiscTools.StringToEnum(typeof(ProtocolICA.EncryptionStrength), Convert.ToString(_sqlDataReader["ICAEncryptionStrength"]));
|
||||
connectionInfo.Inheritance.ICAEncryption = 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
648
mRemoteV1/Config/Connections/XmlConnectionsLoader.cs
Normal file
@@ -0,0 +1,648 @@
|
||||
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, Convert.ToBoolean(xmlnode.Attributes["Inherit"].Value));
|
||||
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.ICAEncryption = (ProtocolICA.EncryptionStrength)Tools.MiscTools.StringToEnum(typeof(ProtocolICA.EncryptionStrength), xmlnode.Attributes["ICAEncryptionStrength"].Value);
|
||||
connectionInfo.Inheritance.ICAEncryption = 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,8 @@
|
||||
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 System.DirectoryServices;
|
||||
using mRemoteNG.App;
|
||||
using System.Text.RegularExpressions;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Tree;
|
||||
@@ -24,14 +15,14 @@ namespace mRemoteNG.Config.Import
|
||||
{
|
||||
try
|
||||
{
|
||||
TreeNode treeNode = Tree.ConnectionTreeNode.AddNode(TreeNodeType.Container);
|
||||
var treeNode = ConnectionTreeNode.AddNode(TreeNodeType.Container);
|
||||
|
||||
ContainerInfo containerInfo = new ContainerInfo();
|
||||
var containerInfo = new ContainerInfo();
|
||||
containerInfo.TreeNode = treeNode;
|
||||
containerInfo.ConnectionInfo = new ConnectionInfo(containerInfo);
|
||||
|
||||
string name = "";
|
||||
Match match = Regex.Match(ldapPath, "ou=([^,]*)", RegexOptions.IgnoreCase);
|
||||
var name = "";
|
||||
var match = Regex.Match(ldapPath, "ou=([^,]*)", RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
name = match.Groups[1].Captures[0].Value;
|
||||
@@ -64,7 +55,7 @@ namespace mRemoteNG.Config.Import
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage(message: "Config.Import.ActiveDirectory.Import() failed.", ex: ex, logOnly: true);
|
||||
Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.Import() failed.", ex, logOnly: true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,15 +63,11 @@ namespace mRemoteNG.Config.Import
|
||||
{
|
||||
try
|
||||
{
|
||||
string strDisplayName = "";
|
||||
string strDescription = "";
|
||||
string strHostName = "";
|
||||
const string ldapFilter = "(objectClass=computer)";
|
||||
|
||||
const string ldapFilter = "(objectClass=computer)";
|
||||
|
||||
DirectorySearcher ldapSearcher = new DirectorySearcher();
|
||||
SearchResultCollection ldapResults = default(SearchResultCollection);
|
||||
SearchResult ldapResult = default(SearchResult);
|
||||
var ldapSearcher = new DirectorySearcher();
|
||||
var ldapResults = default(SearchResultCollection);
|
||||
var ldapResult = default(SearchResult);
|
||||
|
||||
ldapSearcher.SearchRoot = new DirectoryEntry(ldapPath);
|
||||
ldapSearcher.PropertiesToLoad.AddRange(new[] {"securityEquals", "cn"});
|
||||
@@ -92,26 +79,26 @@ namespace mRemoteNG.Config.Import
|
||||
foreach (SearchResult tempLoopVar_ldapResult in ldapResults)
|
||||
{
|
||||
ldapResult = tempLoopVar_ldapResult;
|
||||
System.DirectoryServices.DirectoryEntry with_2 = ldapResult.GetDirectoryEntry();
|
||||
strDisplayName = Convert.ToString(with_2.Properties["cn"].Value);
|
||||
strDescription = Convert.ToString(with_2.Properties["Description"].Value);
|
||||
strHostName = Convert.ToString(with_2.Properties["dNSHostName"].Value);
|
||||
var with_2 = ldapResult.GetDirectoryEntry();
|
||||
var displayName = Convert.ToString(with_2.Properties["cn"].Value);
|
||||
var description = Convert.ToString(with_2.Properties["Description"].Value);
|
||||
var hostName = Convert.ToString(with_2.Properties["dNSHostName"].Value);
|
||||
|
||||
TreeNode treeNode = Tree.ConnectionTreeNode.AddNode(TreeNodeType.Connection, strDisplayName);
|
||||
var treeNode = ConnectionTreeNode.AddNode(TreeNodeType.Connection, displayName);
|
||||
|
||||
ConnectionInfo connectionInfo = new ConnectionInfo();
|
||||
ConnectionInfoInheritance inheritanceInfo = new ConnectionInfoInheritance(connectionInfo, true);
|
||||
var connectionInfo = new ConnectionInfo();
|
||||
var inheritanceInfo = new ConnectionInfoInheritance(connectionInfo, true);
|
||||
inheritanceInfo.Description = false;
|
||||
if (parentTreeNode.Tag is ContainerInfo)
|
||||
{
|
||||
connectionInfo.Parent = (ContainerInfo)parentTreeNode.Tag;
|
||||
}
|
||||
connectionInfo.Inheritance = inheritanceInfo;
|
||||
connectionInfo.Name = strDisplayName;
|
||||
connectionInfo.Hostname = strHostName;
|
||||
connectionInfo.Description = strDescription;
|
||||
connectionInfo.Name = displayName;
|
||||
connectionInfo.Hostname = hostName;
|
||||
connectionInfo.Description = description;
|
||||
connectionInfo.TreeNode = treeNode;
|
||||
treeNode.Name = strDisplayName;
|
||||
treeNode.Name = displayName;
|
||||
treeNode.Tag = connectionInfo; //set the nodes tag to the conI
|
||||
//add connection to connections
|
||||
Runtime.ConnectionList.Add(connectionInfo);
|
||||
@@ -121,7 +108,7 @@ namespace mRemoteNG.Config.Import
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddExceptionMessage(message: "Config.Import.ActiveDirectory.ImportComputers() failed.", ex: ex, logOnly: true);
|
||||
Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.", ex, logOnly: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,26 @@
|
||||
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.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)
|
||||
{
|
||||
ProtocolType finalProtocol = default(ProtocolType);
|
||||
bool protocolValid = false;
|
||||
var finalProtocol = default(ProtocolType);
|
||||
var protocolValid = false;
|
||||
|
||||
TreeNode treeNode = Tree.ConnectionTreeNode.AddNode(Tree.TreeNodeType.Connection, host.HostNameWithoutDomain);
|
||||
var treeNode = Tree.ConnectionTreeNode.AddNode(Tree.TreeNodeType.Connection, host.HostNameWithoutDomain);
|
||||
|
||||
ConnectionInfo connectionInfo = new ConnectionInfo();
|
||||
var connectionInfo = new ConnectionInfo();
|
||||
connectionInfo.Inheritance = new ConnectionInfoInheritance(connectionInfo);
|
||||
|
||||
connectionInfo.Name = host.HostNameWithoutDomain;
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
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 System.Xml;
|
||||
using System.IO;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Images;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Container;
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
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 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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
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 System.IO;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Images;
|
||||
using mRemoteNG.Config.Connections;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Connection;
|
||||
@@ -23,11 +13,11 @@ namespace mRemoteNG.Config.Import
|
||||
{
|
||||
public static void Import(string fileName, TreeNode parentTreeNode)
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(fileName);
|
||||
TreeNode treeNode = new TreeNode(name);
|
||||
var name = Path.GetFileNameWithoutExtension(fileName);
|
||||
var treeNode = new TreeNode(name);
|
||||
parentTreeNode.Nodes.Add(treeNode);
|
||||
|
||||
ContainerInfo containerInfo = new ContainerInfo
|
||||
var containerInfo = new ContainerInfo
|
||||
{
|
||||
TreeNode = treeNode,
|
||||
Name = name
|
||||
@@ -51,14 +41,16 @@ namespace mRemoteNG.Config.Import
|
||||
treeNode.Tag = containerInfo;
|
||||
treeNode.ImageIndex = (int)TreeImageType.Container;
|
||||
treeNode.SelectedImageIndex = (int)TreeImageType.Container;
|
||||
|
||||
ConnectionsLoader connectionsLoad = new ConnectionsLoader();
|
||||
connectionsLoad.ConnectionFileName = fileName;
|
||||
connectionsLoad.RootTreeNode = treeNode;
|
||||
connectionsLoad.ConnectionList = Runtime.ConnectionList;
|
||||
connectionsLoad.ContainerList = Runtime.ContainerList;
|
||||
|
||||
connectionsLoad.LoadConnections(true);
|
||||
|
||||
var connectionsLoad = new ConnectionsLoader
|
||||
{
|
||||
ConnectionFileName = fileName,
|
||||
RootTreeNode = treeNode,
|
||||
ConnectionList = Runtime.ConnectionList,
|
||||
ContainerList = Runtime.ContainerList
|
||||
};
|
||||
|
||||
connectionsLoad.LoadConnections(true);
|
||||
|
||||
Runtime.ContainerList.Add(containerInfo);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Images;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace mRemoteNG.Config.Settings
|
||||
|
||||
public void LoadExternalAppsFromXML()
|
||||
{
|
||||
string oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName + "\\" + SettingsFileInfo.ExtAppsFilesName;
|
||||
string oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + GeneralAppInfo.ProdName + "\\" + SettingsFileInfo.ExtAppsFilesName;
|
||||
string newPath = SettingsFileInfo.SettingsPath + "\\" + SettingsFileInfo.ExtAppsFilesName;
|
||||
XmlDocument xDom = new XmlDocument();
|
||||
if (File.Exists(newPath))
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace mRemoteNG.Config.Settings
|
||||
|
||||
CreatePanels();
|
||||
#if !PORTABLE
|
||||
string oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName + "\\" + SettingsFileInfo.LayoutFileName;
|
||||
string oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + GeneralAppInfo.ProdName + "\\" + SettingsFileInfo.LayoutFileName;
|
||||
#endif
|
||||
string newPath = SettingsFileInfo.SettingsPath + "\\" + SettingsFileInfo.LayoutFileName;
|
||||
if (File.Exists(newPath))
|
||||
@@ -49,7 +49,7 @@ namespace mRemoteNG.Config.Settings
|
||||
}
|
||||
else
|
||||
{
|
||||
Startup.SetDefaultLayout();
|
||||
Startup.Instance.SetDefaultLayout();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -7,6 +7,7 @@ using mRemoteNG.App;
|
||||
using mRemoteNG.App.Info;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.Security;
|
||||
using mRemoteNG.Security.SymmetricEncryption;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
@@ -62,8 +63,9 @@ namespace mRemoteNG.Config.Settings
|
||||
}
|
||||
mRemoteNG.Settings.Default.QuickyTBVisible = with1.tsQuickConnect.Visible;
|
||||
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
mRemoteNG.Settings.Default.ConDefaultPassword =
|
||||
Crypt.Encrypt(Convert.ToString(mRemoteNG.Settings.Default.ConDefaultPassword), GeneralAppInfo.EncryptionKey);
|
||||
cryptographyProvider.Encrypt(Convert.ToString(mRemoteNG.Settings.Default.ConDefaultPassword), GeneralAppInfo.EncryptionKey);
|
||||
|
||||
mRemoteNG.Settings.Default.Save();
|
||||
|
||||
|
||||