Compare commits

...

367 Commits

Author SHA1 Message Date
Dimitrij
36ddaa3429 update section 2022-01-14 17:39:44 +00:00
Dimitrij
d1165d5a9d update 2022-01-14 17:37:53 +00:00
Dimitrij
9df199ca55 rename and removal 2022-01-14 17:37:21 +00:00
Dimitrij
414306f26d move resources files from main branch 2022-01-14 17:33:52 +00:00
Dimitrij
4b5dc4152a Merge branch 'v1.77.3-dev' of https://github.com/mRemoteNG/mRemoteNG into v1.77.3-dev 2022-01-14 17:20:39 +00:00
Dimitrij
a023409fe9 update change log 2022-01-14 17:20:10 +00:00
Dimitrij
d36c59658d Merge pull request #2123 from jacko873/develop
Thycotic Secret Server -  Added 2FA OTP support
2022-01-14 17:14:37 +00:00
jacko873
4f832ee70b Added 2FA OTP support
Added support for 2FA OTP
token managment and use if refresh token
2022-01-14 17:29:07 +01:00
Dimitrij
7b97097515 Merge pull request #2121 from tecxx/develop-orig
update documentation regarding external connectors feature
2022-01-14 10:47:49 +00:00
tecxx
86b3cb8d5d update documentation regarding external connectors feature 2022-01-14 11:11:15 +01:00
Dimitrij
4c304e11f3 update version number to 1.77.3 2022-01-12 10:53:48 +00:00
Faryan Rezagholi
aee497de03 nuget updates 2022-01-11 23:31:13 +01:00
Dimitrij
823f8614e5 lib update 2022-01-11 21:04:53 +00:00
Dimitrij
b54afb8823 Merge pull request #2115 from Vest/fix_2100
Fix tests that were broken by PR #2100
2022-01-11 20:16:00 +00:00
Dimitrij
22e611c63b Update ConfigWindowGeneralTests.cs
add one more ','
2022-01-11 19:37:22 +00:00
Dimitrij
3deb01a65d Update ConfigWindowGeneralTests.cs
add ','
2022-01-11 19:23:52 +00:00
Dimitrij
6f24b0bb71 Update ConfigWindowGeneralTests.cs
add missing fileds
2022-01-11 19:07:29 +00:00
Dimitrij
9d7921f538 Update ConfigWindowGeneralTests.cs
fixes for username field add
2022-01-11 15:14:28 +00:00
Vest
a4e66b3d11 Fix tests that were broken by PR #2100.
Signed-off-by: Vest <Vest@users.noreply.github.com>
2022-01-11 15:47:18 +01:00
Faryan Rezagholi
3866ff76f9 Merge pull request #2114 from david-sway/fix_toolbar_toggles
Fixed behavior of toolbar visibility toggles in the View menu
2022-01-11 00:02:14 +01:00
david-sway
82f947abdd Fixed behavior of toolbar visibility toggles in the View menu 2022-01-10 13:06:18 -05:00
Dimitrij
47c6f53b43 fix image link 2022-01-07 16:57:13 +00:00
Dimitrij
606657524e update build badges, paypal 2022-01-07 16:33:23 +00:00
Dimitrij
168285944c fix path 2022-01-07 15:46:04 +00:00
Dimitrij
1746af927b lib updates 2022-01-07 09:46:31 +00:00
Dimitrij
2eca8ffba2 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2022-01-04 10:43:12 +00:00
Dimitrij
6ef0c06a19 lib updates 2022-01-04 10:43:00 +00:00
Faryan Rezagholi
af68f1a16e Merge pull request #2104 from tecxx/develop-orig
fix test cases caused by new fields
2021-12-26 13:11:03 +01:00
tecxx
f429839a17 fix test cases caused by new fields 2021-12-25 19:53:31 +01:00
Dimitrij
66770e602a Merge pull request #2103 from tecxx/develop-orig
improve SS api credential handling
2021-12-25 18:52:04 +00:00
tecxx
f760131cf5 remove dead function call 2021-12-25 18:55:59 +01:00
tecxx
cdc1d5064f improve handling of invalid api credentials 2021-12-25 18:52:54 +01:00
Faryan Rezagholi
3b707d29b9 Updated PuTTYNG to v0.76 (fixes #2012) 2021-12-25 16:11:22 +01:00
Dimitrij
df632bb1f0 Merge pull request #2102 from Vest/issue_2057
Extended the field [RenderingEngine] from 10 chars to 16
2021-12-25 13:12:22 +00:00
Vest
74cb453995 Updated changelog.md 2021-12-25 11:33:56 +01:00
Vest
f8eec94b04 Extended the field [RenderingEngine] from 10 chars to 16.
This is not the full fix of issue #2057, because the scripts are not "migration" scripts.
2021-12-25 11:31:05 +01:00
Faryan Rezagholi
697efacc58 Merge pull request #2101 from Vest/fix_mssql_type
Fix typo in mssql_db_setup.sql
2021-12-24 19:12:20 +01:00
Vest
ff9cff8f44 Fix typo in mssql_db_setup.sql
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-24 16:59:31 +01:00
Dimitrij
d78388646d Merge pull request #2100 from tecxx/develop
external connectors update #2
2021-12-23 17:42:49 +00:00
tecxx
05ffcdeef7 fix null object bug in ec2 connector 2021-12-23 16:54:54 +01:00
Dimitrij
3b8e347a9e Merge pull request #2098 from Vest/fix_large
Fix failed BinaryFileTest
2021-12-23 11:18:55 +00:00
Dimitrij
37f160f698 Merge branch 'develop' into fix_large 2021-12-23 11:18:46 +00:00
tecxx
6f1446339c new fields for external connectors
add ec2 instance connector
2021-12-23 09:59:29 +01:00
Dimitrij
fed44dc366 Merge pull request #2097 from Vest/fix_gui
Fix failed tests related to mRemoteNGTests.UI.Window.ConfigWindowTests
2021-12-23 02:36:17 +00:00
Vest
c71ec34998 Updated changelog
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-22 22:40:10 +01:00
Vest
157bda8f51 Fix BinaryFileTest
mRemoteNGTests doesn't define "DEBUG" and "PORTABLE", but defines "DEBUG_PORTABLE" macro.

Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-22 22:36:38 +01:00
Vest
d80e5bc792 Updated changelog.md
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-22 22:33:30 +01:00
Vest
f9669e8158 Fix failed tests related to mRemoteNGTests.UI.Window.ConfigWindowTests.
The menu item OpeningCommand is related to SSH1/SSH2. Previously it was tested for RDP.

Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-22 22:26:53 +01:00
Faryan Rezagholi
04c83c608b removed deprecated/unhandled features 2021-12-20 17:37:19 +01:00
Faryan Rezagholi
9f50037e11 Merge pull request #2096 from Vest/fix_2081
Fixed crypto provider test
2021-12-20 17:09:44 +01:00
Faryan Rezagholi
33fd741ba7 Merge branch 'develop' into fix_2081 2021-12-20 17:06:14 +01:00
Vest
035c3f9319 Updated changelog.md
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-20 16:21:43 +01:00
Vest
3df922340d Fixed the test that was broken with the PR #2081
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-20 16:17:39 +01:00
Dimitrij
72b9190e2f fix for failing tests due missing path to schema 2021-12-20 11:28:01 +00:00
Dimitrij
8fe1bdf39a Merge pull request #2089 from Vest/fix_help_menu
Fixes the exception thrown by menu buttons "Documentation" and "Website"
2021-12-17 10:14:57 +00:00
Vest
f78bf2bc8a Updated CHANGELOG.md
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 21:52:56 +01:00
Vest
a1f0a69874 Menu button "Documentation" and "Website" threw an exception.
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 21:46:10 +01:00
Faryan Rezagholi
8a26b2f433 Merge pull request #2088 from Vest/issue_2087
Launch updates from shell (fixes #2087)
2021-12-16 20:57:56 +01:00
Vest
a18784d2c7 Updated changelog.
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 19:04:49 +01:00
Vest
3c25a987fd Fix the issue #2087
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 19:02:25 +01:00
Dimitrij
7cebc4ef42 Merge pull request #2086 from Vest/refactor_webclient
Use async HttpClient instead of obsolete WebClient
2021-12-16 17:31:06 +00:00
Faryan Rezagholi
a8ab46d5c8 remove app.comfig 2021-12-16 17:09:03 +01:00
Vest
8bac5a8c54 Removed unused imports for UpdateWindow.cs 2021-12-16 17:05:05 +01:00
Faryan Rezagholi
801a41ae10 removed log4net leftover 2021-12-16 17:04:11 +01:00
Vest
47e37afe12 Removed unused imports for AppUpdater.cs
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 17:03:56 +01:00
Faryan Rezagholi
942bf7d8cb moved log4net config into its own file 2021-12-16 17:01:45 +01:00
Vest
0e8d573819 Updated changelog 2021-12-16 17:00:49 +01:00
Vest
2bdfd7401e Corrected warnings related to async event handlers
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 16:41:00 +01:00
Vest
68dd6b1e23 Removed unused code
Added the checksum verification.

Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 15:57:18 +01:00
Vest
2fe85ae0e5 Added the progress handling;
Now API (AppUpdater) is async.
Cancellation token hasn't been tested yet, because UI doesn't allow to cancel the update.

Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 15:37:56 +01:00
Vest
e9fa1c3b5e Added Initial async support for AppUpdater
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-16 12:30:12 +01:00
Faryan Rezagholi
f543b83cfc added missing issue (#870) 2021-12-16 00:41:57 +01:00
Faryan Rezagholi
2d917ca11a set lang version to latest 2021-12-15 22:54:08 +01:00
Faryan Rezagholi
2c830627ef removed orphaned paths, added missing ones 2021-12-15 21:11:22 +01:00
Faryan Rezagholi
46003a3509 removed orphaned path from harvest dir 2021-12-15 20:18:10 +01:00
Faryan Rezagholi
6b0412586e Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-15 19:50:03 +01:00
Faryan Rezagholi
36ca7ffbdb removed credits file from installer 2021-12-15 19:48:23 +01:00
Dimitrij
e5244f1fec Merge pull request #2085 from tecxx/develop
fix issue 2075
2021-12-15 18:41:57 +00:00
Faryan Rezagholi
359a7272e8 build external connectors on 'release portable' 2021-12-15 19:38:33 +01:00
Dimitrij
82cd3a7e56 swap runtime and configSections as per below https://stackoverflow.com/questions/13623896 2021-12-15 16:01:40 +00:00
tecxx
a2e78fd08a fix issue 2075 by standardizing "StartProgram" Property to "RDPStartProgram" and "StartProgramWorkDir" to "RDPStartProgramWorkDir" 2021-12-15 15:11:56 +01:00
Faryan Rezagholi
a48b5e9d65 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-15 02:42:00 +01:00
Faryan Rezagholi
f4c4d9ea8c removed 'en-US' specific translation in favor of default (en) 2021-12-15 02:41:50 +01:00
Dimitrij
02ed45fa61 added file exist check and null check 2021-12-15 01:31:26 +00:00
Dimitrij
ad227ea2ee add check if no removable files to don't throw null error 2021-12-15 01:02:13 +00:00
Dimitrij
d7e2358d3e Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-14 23:50:13 +00:00
Faryan Rezagholi
196e98e4a7 Merge pull request #2084 from tecxx/develop
fixed some tests around "StartProgramWorkDir"
2021-12-14 22:04:09 +01:00
tecxx
00bc45fba1 fix some more inconsistencies with "StartProgramWorkDir" 2021-12-14 21:45:39 +01:00
Dimitrij
62c0d3f07f Merge pull request #2083 from tecxx/develop
fix a test case caused by property named "Prop_StartProgram" instead …
2021-12-14 20:37:16 +00:00
Faryan Rezagholi
d42574a16c updated sql scripts (fixes #1436) 2021-12-14 21:36:14 +01:00
tecxx
a854b04293 fix a test case caused by property named "Prop_StartProgram" instead of "StartProgram" 2021-12-14 21:07:06 +01:00
Faryan Rezagholi
96632da4d7 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-14 20:00:10 +01:00
Faryan Rezagholi
cf18d6b1e9 reordered "added" section 2021-12-14 20:00:02 +01:00
Faryan Rezagholi
262e2e1b85 Merge pull request #1451 from mRemoteNG/push_settings_recursively
Added option to push inheritance settings to children recursively
2021-12-14 19:51:10 +01:00
Faryan Rezagholi
743c46de70 merge from develop 2021-12-14 19:48:10 +01:00
Faryan Rezagholi
9624bc96c9 Merge pull request #2081 from Vest/refactor_rijndael
Fixed compiler warning
2021-12-14 19:36:32 +01:00
Vest
1643bb7d59 Corrected "obsolete" warnings for objects RijndaelManaged and MD5CryptoServiceProvider
Added several "using" statements for all disposable objects.

Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-14 16:55:14 +01:00
Faryan Rezagholi
edad5a838f removed credits file 2021-12-14 13:40:35 +01:00
Faryan Rezagholi
fb35226e20 update nuget packages 2021-12-14 13:37:40 +01:00
Faryan Rezagholi
40605737b1 Merge pull request #2080 from Vest/issue_2079
Copy theme files to target dir
2021-12-14 13:31:13 +01:00
Faryan Rezagholi
01a62e099e updated changelog (#2079) 2021-12-14 13:27:23 +01:00
Faryan Rezagholi
80748bb66b copy theme files to output dir (fixes #2079) 2021-12-14 13:25:40 +01:00
Faryan Rezagholi
c6c77e9bc4 Revert "Solve issue #2079"
This reverts commit 1f462648c4.
2021-12-14 13:23:31 +01:00
Vest
1f462648c4 Solve issue #2079
Signed-off-by: Vest <Vest@users.noreply.github.com>
2021-12-14 13:10:02 +01:00
Faryan Rezagholi
099256e5d4 code cleanup 2021-12-14 01:14:51 +01:00
Dimitrij
8735d24122 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-12 19:37:12 +00:00
Dimitrij
b2fc3967d3 update to move dll and lang to subfolders, not supported fully in net 6.0 2021-12-12 19:36:47 +00:00
Faryan Rezagholi
0ec02cfa56 removed left over project files from #2076 2021-12-09 20:29:45 +01:00
Faryan Rezagholi
ade36d6876 re-add .net framework 2 as supported runtimefor installer 2021-12-09 20:25:48 +01:00
Faryan Rezagholi
73313d7dae fixes/simplified postbuild installer scripts 2021-12-09 20:11:45 +01:00
Faryan Rezagholi
7db9865ffa build installer for .net framework 4.8 only 2021-12-09 18:27:29 +01:00
Faryan Rezagholi
40656cb70b Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-09 18:20:27 +01:00
Faryan Rezagholi
b5a07f3e79 Update README.MD 2021-12-09 18:20:20 +01:00
Faryan Rezagholi
66877ce9b1 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-09 18:16:00 +01:00
Faryan Rezagholi
57b067b4e2 don't convert license file to rich text format on installer build 2021-12-09 18:14:35 +01:00
Faryan Rezagholi
74999e9394 removed obsolete files 2021-12-09 18:14:05 +01:00
Faryan Rezagholi
f4d6f1e5ee Condensed README.MD 2021-12-09 18:09:22 +01:00
Faryan Rezagholi
096f670eb3 hide disc cost button in installer (#1363) 2021-12-09 00:22:00 +01:00
Faryan Rezagholi
bceaca49bf imported templates from wix sources to be able to make modifications. 2021-12-09 00:21:04 +01:00
Faryan Rezagholi
5e94c84516 spelling fix 2021-12-08 23:08:35 +01:00
Faryan Rezagholi
28dc14e739 improved feature tree in installer 2021-12-08 23:06:56 +01:00
Faryan Rezagholi
d5d28e80cb removed any cpu configurations from solution file 2021-12-07 01:22:49 +01:00
Faryan Rezagholi
f1eea76249 added build configs for external conectors project 2021-12-07 01:12:20 +01:00
Faryan Rezagholi
0976404eda merged from develop 2021-12-07 01:10:02 +01:00
Faryan Rezagholi
8074c9a7c6 re 2021-12-07 01:06:31 +01:00
Dimitrij
513af43fca Merge pull request #2076 from tecxx/develop
rework TSS api to use .net6 compatible code
2021-12-06 21:59:58 +00:00
tecxx
afd5d76992 rework TSS api to use .net6 compatible code
rename dll to ExternalConnectors.dll for possible other future implementations
refactor namespaces in dll
2021-12-06 21:54:35 +01:00
Faryan Rezagholi
a31da5f880 update build configuration 2021-12-06 00:57:00 +01:00
Faryan Rezagholi
be470f50ec rounded corners 2021-12-04 15:17:24 +01:00
Faryan Rezagholi
a04494346e rounded corners 2021-12-04 15:15:25 +01:00
Faryan Rezagholi
797533459e Update README.MD
updated .net version requirement
2021-12-04 14:39:19 +01:00
Faryan Rezagholi
22e879ef18 Update README.MD
added server 2022
2021-12-04 14:37:19 +01:00
Faryan Rezagholi
dc6bc5b4d6 fixed appveyor badges 2021-12-04 14:34:07 +01:00
Faryan Rezagholi
a6c7457c59 updated VncSharp nuget 2021-12-02 23:20:20 +01:00
Dimitrij
b609cfba2a Merge pull request #1848 from johnwc/feature/RemoteDesktopServices
Feature/remote desktop services
2021-12-02 09:02:56 +00:00
John Carew
345980f457 Removed duplicate StartProgram property set 2021-12-02 01:27:27 -06:00
John Carew
5a86a0a8cb Merge from develop 2021-12-02 00:32:40 -06:00
John Carew
24c1ce3f4a Correct saving StartProgramWorkDir 2021-12-02 00:17:26 -06:00
Faryan Rezagholi
fc65c2583e hopefully fixed all installer build issues 2021-12-02 01:15:22 +01:00
Faryan Rezagholi
1df3c33f69 removed developer note from license file 2021-12-02 00:11:07 +01:00
Faryan Rezagholi
98a9cc7436 Update README.MD 2021-12-01 23:51:06 +01:00
Faryan Rezagholi
ff88d4649c more adjustments to the build configuration 2021-12-01 23:42:16 +01:00
Faryan Rezagholi
8c61306a8d Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-12-01 23:25:52 +01:00
Faryan Rezagholi
6496e34868 fixed installer paths 2021-12-01 23:25:42 +01:00
Faryan Rezagholi
7d6c9d517c unified different project configurations 2021-12-01 23:25:17 +01:00
Faryan Rezagholi
d918d8ffd1 Update README.MD 2021-12-01 22:53:18 +01:00
Dimitrij
ca61ea09d0 --update test libs 2021-12-01 20:55:15 +00:00
Faryan Rezagholi
faff230d42 applied fix from @reox22 2021-12-01 21:09:57 +01:00
Faryan Rezagholi
c288c3d071 fixed project style of pr 2021-12-01 21:07:18 +01:00
Faryan Rezagholi
500a22b0b6 merged from develop 2021-12-01 21:07:00 +01:00
Faryan Rezagholi
ba1317d245 replaced newly introduced backup icon with one that matches the programs ui 2021-12-01 20:25:00 +01:00
Dimitrij
5cfbfc5071 --correction
test cases
2021-12-01 10:04:38 +00:00
Dimitrij
bf4b9d5355 --lib updates 2021-11-26 09:41:32 +00:00
Dimitrij
904f0bc202 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-11-26 09:20:56 +00:00
Dimitrij
94c546bd0f -- fix for tests 2021-11-26 09:20:45 +00:00
Dimitrij
64f1e10a5e Merge pull request #2024 from mRemoteNG/dotnet
Migrate Project to .NET6
2021-11-26 09:14:55 +00:00
Faryan Rezagholi
8b20da78ff merge from develop 2021-11-25 22:40:32 +01:00
Faryan Rezagholi
1be4ef437d merged from develop 2021-11-25 22:40:20 +01:00
Dimitrij
76da9c3247 -fix
fix serializers for OpeningCommand
2021-11-17 23:30:57 +00:00
Dimitrij
1e4dcc23d7 -fix
more fix regarding adding new option
2021-11-17 11:41:06 +00:00
Dimitrij
9c95e7fd96 -fix after nunit update 2021-11-16 22:29:00 +00:00
Dimitrij
cea5f57c60 --fix
better way to set of defaults
2021-11-16 19:10:09 +00:00
Dimitrij
19e6d37b62 -- fix
Set CustomToolNamespace to avoid overwrite on change
2021-11-16 19:02:29 +00:00
Dimitrij
018979d17f #2064 fix, to avoid failure then null, set by default to be empty 2021-11-16 17:19:06 +00:00
Dimitrij
8bd398cbd6 update to VS 2022 2021-11-16 13:29:14 +00:00
Dimitrij
59872b14cf #1297
little fix of logic
2021-11-16 13:28:45 +00:00
Dimitrij
c5240d72e1 Merge pull request #2065 from merarischroeder/503_ssh-execute-single-command-after-login
Added Null/Empty check for OpeningCommand
2021-11-16 09:08:39 +00:00
Todd Hubers
77b54f9a10 Added Null/Empty check for OpeningCommand 2021-11-15 13:38:56 +11:00
Dimitrij
b5bcb5b3bb libupdate 2021-11-13 16:42:33 +00:00
Dimitrij
87c500138b update .net framework to version 4.8 2021-11-13 16:32:47 +00:00
Dimitrij
f3f384ebcc Merge pull request #2064 from merarischroeder/503_ssh-execute-single-command-after-login
503 SSH Execute a single command after login
2021-11-13 16:16:54 +00:00
Todd Hubers
08de2eacd6 Amended changelog 2021-11-13 03:25:03 +11:00
Todd Hubers
b763d968fe Support for saving OpeningCommand and the InheritedOpeningCommand. Tested for stock saving only. 2021-11-13 03:22:35 +11:00
Todd Hubers
3b05eba2e2 Use SendKeys to Execute the Opening Command on the Putty window after logged in + NEWLINE. Tested and working. 2021-11-13 03:05:02 +11:00
Todd Hubers
b6d2c72a40 Added new SSH Property "Opening Command" 2021-11-13 02:47:16 +11:00
Dimitrij
e6d2c9791d Merge pull request #2063 from tecxx/SecretServerInterface
Thycotic Secret Server Interface
2021-11-05 13:00:45 +00:00
tecxx
91a0eeb29a add changelog entry 2021-11-04 21:30:48 +01:00
tecxx
8c9c4865f2 add secret server handler to RDP and SSH 2021-11-04 21:13:37 +01:00
tecxx
6fbd4a7c88 add secret server interface library 2021-11-04 21:09:23 +01:00
Dimitrij
239adaa129 add 'Languages' folder as alternative for translation assemblies (to move from root all translations into it) 2021-11-02 23:08:09 +00:00
Dimitrij
9f8c82b649 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-11-02 22:53:56 +00:00
Dimitrij
7875bb6ebd lib update 2021-11-02 22:53:14 +00:00
Dimitrij
a33abf3f56 Merge pull request #2061 from horizontti/patch-1
Create Language.fi-FI.resx
2021-11-02 10:05:33 +00:00
horizontti
1fadadcdb5 Create Language.fi-FI.resx 2021-11-01 23:59:46 +02:00
Faryan Rezagholi
a294dec0dc merged from develop 2021-10-30 15:58:32 +02:00
Dimitrij
5de75e6a8a downgrade DockPanelSuite to 3.0.6 due reference error in 3.1.0 2021-10-30 01:04:39 +01:00
Dimitrij
4b44be2e54 libs update 2021-10-28 17:57:48 +01:00
Dimitrij
b5f1d63175 Merge pull request #2058 from LightningSt0rm/develop
Fix a break in the Windows Clipboard Chain
2021-10-28 17:24:33 +01:00
Adrian
1c5695df7e Update changelog 2021-10-20 17:52:50 -05:00
Adrian
1808ad9ad7 Correct issues with the Windows Clipboard Chain, where the chain was broken when messages to WM_CHANGECBCHAIN weren't handled appropriately as well unregister self from the clipboard chain when closing. 2021-10-20 17:10:24 -05:00
Dimitrij
8dc5e81374 Update French translation #2045 2021-09-21 22:46:49 +01:00
Dimitrij
b899056a8e lib update 2021-09-17 23:12:47 +01:00
Dimitrij
f884c47ad8 set Language as resource 2021-09-17 22:58:58 +01:00
Dimitrij
07eae639b6 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-09-14 12:13:58 +01:00
Dimitrij
d2349bd713 merge with new options 2021-09-14 12:03:01 +01:00
Faryan Rezagholi
28ee3c6e8f merged from develop 2021-08-30 00:36:28 +02:00
Faryan Rezagholi
4430f269f7 Merge pull request #2033 from IDDesigns/id/net5
Id/net5
2021-08-29 23:04:55 +02:00
Faryan Rezagholi
a72f7d63f6 Added <LangVersion>preview</LangVersion> to test project 2021-08-29 22:59:38 +02:00
Faryan Rezagholi
859b6f8ac5 set target framework to "net6.0-windows" instead of "net6.0-windows7.0" 2021-08-29 22:55:19 +02:00
Faryan Rezagholi
a7f238aba3 merge from dotnet 2021-08-29 22:51:29 +02:00
Faryan Rezagholi
e0cff27aae addded <LangVersion>preview</LangVersion> to project file 2021-08-29 18:55:21 +02:00
Faryan Rezagholi
d9c4a6ec76 Merge branch 'dotnet' into dotnet6 2021-08-29 18:45:29 +02:00
Faryan Rezagholi
4d95bc4255 merge from develop 2021-08-29 18:45:02 +02:00
Faryan Rezagholi
fdea0144b0 removed test output from script 2021-08-29 18:44:08 +02:00
Faryan Rezagholi
7398a373c2 Squashed commit of the following:
commit 84b28316d01d158891d909e90fe428e48d5566e3
Author: Faryan Rezagholi <faryan.rezagholi@siedle.de>
Date:   Sun Aug 29 13:08:31 2021 +0200

    r

commit 7375b4a5456a615b36c4fbf0eda7a8d56762de85
Author: Faryan Rezagholi <faryan.rezagholi@siedle.de>
Date:   Sun Aug 29 12:54:40 2021 +0200

    ...

commit 96aa9d809131c8277bd62cb90fdfa4fd07f1940e
Author: Faryan Rezagholi <faryan.rezagholi@siedle.de>
Date:   Fri Aug 20 15:12:03 2021 +0200

    j
2021-08-29 18:41:50 +02:00
Faryan Rezagholi
c88e45cde8 fixed app.config for dotnet6 2021-08-29 12:47:31 +02:00
Ian Dunkerly
f77848e3d9 Fixing up unit tests 2021-08-27 21:20:50 +01:00
Ian Dunkerly
5ed78cc3b6 Swapped BouncyCastle for Portable.BouncyCastle which support .net standard 2.0 2021-08-22 17:25:55 +01:00
Ian Dunkerly
1b4593bb62 Removed system.web reference - these are not supported in .Net 5 2021-08-22 15:28:47 +01:00
Ian Dunkerly
c620e26644 Import MSTC as ActiveX control removing need for dependency on Windows Simulator 2021-08-22 14:27:58 +01:00
Faryan Rezagholi
74af24c3db appveyor test 2021-08-20 13:14:16 +02:00
Faryan Rezagholi
ac1f32f773 setting workdir for 7z 2021-08-20 13:03:22 +02:00
Faryan Rezagholi
99c7dbb332 trying -sfp2 option on 7z for appveyor 2021-08-20 12:17:14 +02:00
Faryan Rezagholi
b0632b8910 trying to fix appveyor no 7z-ing portable release 2021-08-20 00:36:09 +02:00
Faryan Rezagholi
d26a9615c0 updated nuget 2021-08-19 23:47:46 +02:00
Faryan Rezagholi
f609d6e0b2 removed cefsharp nuget 2021-08-19 23:47:37 +02:00
Faryan Rezagholi
e5042712b6 nuget update 2021-08-19 23:29:13 +02:00
Faryan Rezagholi
bf93d3af04 fixed ambigous call 2021-08-19 22:36:41 +02:00
Faryan Rezagholi
ea43abe392 updated projects to .net6 2021-08-19 22:36:32 +02:00
Faryan Rezagholi
0e74314ddc fixed port scan and external tools window not showing 2021-08-15 21:53:10 +02:00
Faryan Rezagholi
54eabd6a74 some property display names were not showing, fixes #1990 2021-08-15 20:53:52 +02:00
Faryan Rezagholi
2f52473566 Allow setting Port when using MSSQL, fixes #1884 2021-08-15 20:13:59 +02:00
Faryan Rezagholi
98e7250b3c trying to fix 7z creating archives wrong on appveyor 2021-08-15 19:51:25 +02:00
Faryan Rezagholi
882438f5e0 replaced logo in readme 2021-08-15 19:16:17 +02:00
Faryan Rezagholi
bb93dddd39 copy PUTTYNG.exe to output dir 2021-08-15 17:05:13 +02:00
Faryan Rezagholi
59f6a8a933 fixed wix installer 2021-08-15 16:36:55 +02:00
Faryan Rezagholi
8ce83f3cd0 removed orphaned path from project 2021-08-15 16:32:50 +02:00
Faryan Rezagholi
745e402da9 Removed VNC Smart Size feature. This allows the use of VNCSharp via nuget instead of distributing our own version of it) 2021-08-15 16:32:31 +02:00
Faryan Rezagholi
6cbe1c92d5 fix for Proces.Start() on .net5 2021-08-15 16:28:38 +02:00
Faryan Rezagholi
54fc2fb4c6 updated readme 2021-08-15 16:20:23 +02:00
Faryan Rezagholi
adc2815ab5 fixed some failing tests 2021-08-15 16:20:09 +02:00
Faryan Rezagholi
75f9f647ee migrated projects to .net5 2021-08-15 16:16:30 +02:00
Faryan Rezagholi
f14f7dbb72 removed assembly info classes as they are no longer needed 2021-08-15 16:15:34 +02:00
Faryan Rezagholi
4978618e9a merged from develp 2021-08-15 14:08:40 +02:00
Faryan Rezagholi
59b9f4f15b moved resharper logo 2021-08-15 02:17:40 +02:00
Faryan Rezagholi
7ff0ce5369 tring to fix 7z duplicate file error on appveyor builds 2021-08-15 00:41:59 +02:00
Faryan Rezagholi
93bd278819 removed assembly bindings 2021-08-14 18:30:49 +02:00
Faryan Rezagholi
b97b1f3690 added sigcheck back 2021-08-14 18:24:36 +02:00
Faryan Rezagholi
307f374be1 fixed renaming of installer not working 2021-08-14 18:17:17 +02:00
Faryan Rezagholi
17f701824e encore un test 2021-08-14 17:05:21 +02:00
Faryan Rezagholi
c7b89dcf71 another test 2021-08-14 16:57:42 +02:00
Faryan Rezagholi
fc527a947f appveyor build script fixes 2021-08-14 16:49:23 +02:00
Faryan Rezagholi
d0520690a2 appveyor build script fixes 2021-08-14 16:45:06 +02:00
Faryan Rezagholi
315d020b6f appveyor build script fixes 2021-08-14 13:55:42 +02:00
Faryan Rezagholi
8a4bcdef52 appveyor build script fixes 2021-08-14 13:48:38 +02:00
Faryan Rezagholi
727ef34c6d appveyor build script fixes 2021-08-14 13:46:43 +02:00
Faryan Rezagholi
d8bc06d05d ? 2021-08-14 13:41:09 +02:00
Faryan Rezagholi
def214dde2 maybe this time 2021-08-14 13:39:10 +02:00
Faryan Rezagholi
219f948c4a again... 2021-08-14 13:35:13 +02:00
Faryan Rezagholi
72193eccf0 appveyor fix 2021-08-14 13:30:54 +02:00
Faryan Rezagholi
7eb85c6a3d trying to fix appveyor not zipping 2021-08-14 13:26:35 +02:00
Faryan Rezagholi
954c667173 cleanup 2021-08-14 13:16:09 +02:00
Faryan Rezagholi
33c738df5f unified/simplified/accelerated zip file creation 2021-08-14 13:07:14 +02:00
Faryan Rezagholi
2141fe298f let appveyor use project scripts 2021-08-14 12:15:13 +02:00
Faryan Rezagholi
8e73f512b4 moved puttyng.exe to project root 2021-08-14 01:55:51 +02:00
Faryan Rezagholi
92dddb8fd8 removed unused scripts 2021-08-13 02:20:34 +02:00
Faryan Rezagholi
e9869f4c88 cleaned up resource structure 2021-08-13 02:06:21 +02:00
Faryan Rezagholi
52597d4dcb removed 7zip binarys from project 2021-08-13 01:44:26 +02:00
Faryan Rezagholi
dc7ce27b81 fixed designer error 2021-08-13 01:17:27 +02:00
Faryan Rezagholi
4242595a66 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-08-13 01:12:45 +02:00
Faryan Rezagholi
50b9a11503 change searchbar placement default property 2021-08-13 01:12:20 +02:00
Faryan Rezagholi
621a723602 Merge pull request #2022 from mRemoteNG/webview2
Replace CefSharp with Webview2
2021-08-12 23:46:04 +02:00
Faryan Rezagholi
6260cc3655 fixed tests 2021-08-12 23:35:19 +02:00
Faryan Rezagholi
300e668327 updated wix file fragments 2021-08-12 23:26:18 +02:00
Faryan Rezagholi
3cf274c37a updated changelog 2021-08-12 23:11:55 +02:00
Faryan Rezagholi
2ca356ee5c removed CefSharp from credits 2021-08-12 22:55:40 +02:00
Faryan Rezagholi
ca8751c40c little code cleanup 2021-08-12 22:54:20 +02:00
Faryan Rezagholi
3c7e97d2d9 replaced CefSharp with WebView2 2021-08-12 22:46:07 +02:00
Faryan Rezagholi
dbe2d690da removed majority of cefsharp related code 2021-08-12 21:00:26 +02:00
Faryan Rezagholi
949410e2cc unified release channel names across program 2021-08-11 03:21:16 +02:00
Faryan Rezagholi
100f856b5f cleaned up view menu and made all properties saveable 2021-08-11 03:08:20 +02:00
Faryan Rezagholi
d7bee01454 removed orphaned templates dir 2021-08-10 01:17:15 +02:00
Faryan Rezagholi
5566081986 update nuget packages 2021-08-10 00:59:27 +02:00
Faryan Rezagholi
29f7dd93f3 optimized form closing event 2021-08-10 00:56:14 +02:00
Faryan Rezagholi
3dd8db5728 updated icons in connection tree 2021-08-08 22:30:55 +02:00
Dimitrij
17e70d11f5 Merge pull request #2016 from xjoker/develop
Cannot connect to the database when the password has special characters
2021-08-06 14:59:15 +01:00
wuwenjing
f8afd439b2 When the password contains special characters, it will be unable to connect to the database. Using "SqlConnectionStringBuilder" to construct "ConnectionString" can solve the problem 2021-08-06 16:35:01 +08:00
Faryan Rezagholi
0dc61b1c26 Merge pull request #2014 from mRemoteNG/revised_icons
Revised icons
2021-08-04 02:39:03 +02:00
Faryan Rezagholi
de6c4fcb17 updated readme 2021-08-04 02:18:53 +02:00
Faryan Rezagholi
57f5c854ff moved logo 2021-08-04 02:13:17 +02:00
Faryan Rezagholi
4f4523ab77 removed old form icons 2021-08-04 02:11:29 +02:00
Faryan Rezagholi
e34e632519 removed ICOs from project 2021-08-04 01:49:06 +02:00
Faryan Rezagholi
f810b902a6 added image converter class to get ico from resources (get rid of redundant image resources) 2021-08-04 01:48:08 +02:00
Faryan Rezagholi
fd5bdc1484 replaced remaining icons 2021-08-04 01:11:34 +02:00
Faryan Rezagholi
e3a12ae6c5 you guessed it... ICONS! 2021-08-04 00:51:54 +02:00
Faryan Rezagholi
c9c5664ec6 icons icons icons 2021-08-04 00:39:33 +02:00
Faryan Rezagholi
75cff549ce more icons changed 2021-08-03 23:53:08 +02:00
Faryan Rezagholi
885cb6915d Merge branch 'develop' into revised_icons 2021-08-03 23:13:27 +02:00
Faryan Rezagholi
f9396a4ecf moved photoshop image templates out of project folder 2021-08-03 22:43:57 +02:00
Faryan Rezagholi
f1a03329e5 removed ultravnc icon 2021-08-03 22:38:15 +02:00
Faryan Rezagholi
f65be671a3 moved icons that will stay the same 2021-08-03 22:36:34 +02:00
Faryan Rezagholi
fa9e8f6cba merged develop 2021-08-03 22:27:51 +02:00
Faryan Rezagholi
67a3e76cfe removed icons that are obsolete since #2011 and #2013 2021-08-03 22:16:53 +02:00
Faryan Rezagholi
e4569c0bb8 Merge pull request #2013 from mRemoteNG/remove_components_check
Remove components check
2021-08-03 22:11:10 +02:00
Faryan Rezagholi
6f1a62e917 Merge branch 'develop' into remove_components_check 2021-08-03 21:57:06 +02:00
Faryan Rezagholi
3f6e21f15a Merge pull request #2011 from mRemoteNG/remove_screenshot_manager
removed screenshot manager
2021-08-03 21:54:52 +02:00
Faryan Rezagholi
46c4287c67 updated changelog 2021-08-03 21:51:09 +02:00
Faryan Rezagholi
1ea1826a27 removed leftovers from components check 2021-08-03 21:46:00 +02:00
Faryan Rezagholi
151457daf0 removed components check options page 2021-08-03 21:39:07 +02:00
Faryan Rezagholi
38cc21fa3a first wave of icons changed 2021-08-03 21:36:03 +02:00
Faryan Rezagholi
77f759f258 more icons cleaned up 2021-08-03 18:50:47 +02:00
Faryan Rezagholi
07c04061c2 more unused icons removed 2021-08-03 01:30:06 +02:00
Faryan Rezagholi
d4bf6ed0c8 added icons that were no part of the resource file 2021-08-03 01:21:11 +02:00
Faryan Rezagholi
ebd46efe81 Merge branch 'develop' into remove_screenshot_manager 2021-08-03 01:11:28 +02:00
Faryan Rezagholi
24d193efb0 revised host status icons 2021-08-03 00:59:59 +02:00
Faryan Rezagholi
3b2a63178f removed unused images/duplicate resources 2021-08-03 00:52:28 +02:00
Faryan Rezagholi
78f60afb85 Removed famfamfam folder and obsolete icons from images folder 2021-08-03 00:49:11 +02:00
Faryan Rezagholi
52a7957789 Update README.MD
Embedded new logo
2021-08-02 12:56:04 +02:00
Faryan Rezagholi
6870583b1c new logo 2021-08-02 12:50:00 +02:00
Faryan Rezagholi
9ffe514350 fixed error from previous merge 2021-08-02 00:29:15 +02:00
Faryan Rezagholi
fc6e04497a updated changelog 2021-08-02 00:16:14 +02:00
Faryan Rezagholi
cfb3f9a3ca merged from develop 2021-08-02 00:13:33 +02:00
Faryan Rezagholi
d47fac791e removed unused language strings 2021-08-02 00:05:10 +02:00
Faryan Rezagholi
490b70c2d3 removed cef scheme handler for obsolete in-app documentation 2021-08-02 00:01:48 +02:00
Faryan Rezagholi
3eecdd9ada Merge pull request #2010 from mRemoteNG/redesign_menus
Redesigned Menus
2021-08-01 23:51:22 +02:00
Faryan Rezagholi
7bdbc5417c update changelog 2021-08-01 23:28:32 +02:00
Faryan Rezagholi
2cd07dcb72 Merge branch 'develop' into redesign_menus 2021-08-01 23:01:53 +02:00
Faryan Rezagholi
adb83ade67 Merge pull request #2005 from mRemoteNG/remove_in_app_documentation
Remove in-app documentation
2021-08-01 23:00:21 +02:00
Faryan Rezagholi
a90f5da8b0 updated changelog 2021-08-01 22:45:39 +02:00
Faryan Rezagholi
38937a4f83 more rearrangements 2021-08-01 22:43:59 +02:00
Faryan Rezagholi
31f35a23ee removed some icons from file menu 2021-08-01 22:39:16 +02:00
Faryan Rezagholi
74de010d3c cleaned up icons in view menu 2021-08-01 22:32:27 +02:00
Faryan Rezagholi
a9e4c880df redesigned help menu 2021-08-01 22:29:04 +02:00
Faryan Rezagholi
b7fe265604 rearranged view menu 2021-08-01 21:45:15 +02:00
Faryan Rezagholi
25c4af5a9f cleaned up file menu 2021-08-01 21:40:14 +02:00
Faryan Rezagholi
b3ecf702e1 removed developer notice 2021-07-28 21:31:59 +02:00
Faryan Rezagholi
c34a3cc7e7 Added back sphinx documentation files 2021-07-26 01:22:31 +02:00
Faryan Rezagholi
158783f2d1 removed screenshot manager 2021-07-26 01:11:01 +02:00
Faryan Rezagholi
624192d301 Added featured project 2021-07-26 00:51:21 +02:00
Faryan Rezagholi
e9be139ed0 removed HelpWindows from code 2021-07-24 19:40:52 +02:00
Faryan Rezagholi
2b9195ed9c fixed typo 2021-07-24 19:38:09 +02:00
Faryan Rezagholi
dfdfecba57 open help in external browsr instead of in-app 2021-07-24 19:37:38 +02:00
Faryan Rezagholi
2d6fec13fb added url to documentation 2021-07-24 19:37:22 +02:00
Faryan Rezagholi
216f340468 removed sphinx documentation files 2021-07-24 19:35:00 +02:00
Faryan Rezagholi
a4211a7e55 removed postbuild sphinx script 2021-07-24 19:34:04 +02:00
Faryan Rezagholi
d6a2488fde removed obsolete citrix reference from minimum requirements section 2021-07-22 22:33:58 +02:00
Faryan Rezagholi
d4d60439b6 Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop 2021-07-22 22:12:02 +02:00
Faryan Rezagholi
75edd0d8ef round corners on splash screen 2021-07-22 22:11:05 +02:00
Dimitrij
b4e6e21094 Merge pull request #2001 from radiosti/patch-1
added optional but helpful winscp arguments
2021-07-20 09:54:42 +01:00
radiosti
8c48bc926e Update external_tools_cheat_sheet.rst 2021-07-19 20:56:26 +02:00
Dimitrij
031b6fb30d set AutoGenerateBindingRedirects 2021-07-05 20:17:39 +01:00
Dimitrij
647542e462 update supported os list 2021-07-04 14:51:00 +01:00
Dimitrij
dbf28d83f3 update PuTTY to v.0.75 2021-07-04 14:42:03 +01:00
Dimitrij
142acdd42f cleanup unused files 2021-06-29 12:18:02 +01:00
Dimitrij
ce103d30d3 update lib 2021-06-29 10:11:16 +01:00
Kvarkas
556d65e8b4 upd README.MD 2021-06-24 23:47:14 +01:00
Kvarkas
e0cf070bd0 fx mistypo 2021-06-24 23:45:52 +01:00
Kvarkas
70c5a336c2 upd 2021-06-24 23:43:52 +01:00
Kvarkas
f82d5fbd2d nb 2021-06-24 23:26:34 +01:00
John Carew
67dfd6b036 Update change log 2020-08-29 17:56:18 -05:00
John Carew
162eb0c958 Add missing db updates for Favorite & ICAEncryptionStrength columns.
Misc vs project automated updates.
2020-08-29 17:44:45 -05:00
John Carew
a2dcc42f68 Update to support reading/writing from config
Update db version to 2.9
Change version tracking from double to Version, to support revision changes between minor versions in db
2020-08-29 17:43:11 -05:00
John Carew
6b7f6dcb19 Add Remote Desktop Services group
Add StartProgram & StartProgramWorkDir properties to Remote Desktop Services group
Corrected Redirect Drives & Smart Cards display names
2020-08-29 17:26:46 -05:00
David Sparer
066e783a37 changed the Edit sub-menu to Inheritance in the connection context menu 2019-06-18 09:16:17 -05:00
David Sparer
3e1bf001c7 Merge branch 'develop' into push_settings_recursively
# Conflicts:
#	mRemoteV1/Resources/Language/Language.Designer.cs
#	mRemoteV1/Resources/Language/Language.resx
2019-06-18 09:10:23 -05:00
David Sparer
722e18c07d updated changelog 2019-05-15 10:41:00 -05:00
David Sparer
a66ec00587 put the ''apply to children" menu options in a sub-menu 2019-05-15 10:09:08 -05:00
David Sparer
2b5100c019 Merge branch 'develop' into push_settings_recursively 2019-05-15 09:29:02 -05:00
David Sparer
74da05e6e8 fixed tests 2019-05-10 15:47:11 -05:00
David Sparer
af24e3b284 the inheritance button will now be shown on items whose parent is the root node 2019-05-10 15:41:43 -05:00
David Sparer
fb68d0bff3 added a button to apply default inheritance to the selected node 2019-05-10 13:57:58 -05:00
David Sparer
d3a2ba26ba only allow pushing inheritance from containers 2019-05-10 08:10:37 -05:00
David Sparer
2f70ec5cb6 Merge branch 'develop' into push_settings_recursively 2019-05-10 08:04:15 -05:00
David Sparer
9173e9e56a added a context menu item to push inheritance to child nodes 2019-04-29 08:39:06 -05:00
David Sparer
11ad8a8398 simplified how inheritance is globally disabled/enabled 2019-04-25 10:21:09 -05:00
David Sparer
0d518e44c7 Merge branch 'develop' into push_settings_recursively 2019-04-24 12:26:21 -05:00
David Sparer
7d8a5a2bdf added methods on the container info to push settings to children recursively 2019-04-01 13:26:25 -05:00
1150 changed files with 4 additions and 176262 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

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

BIN
Header_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

63
Jenkinsfile vendored
View File

@@ -1,63 +0,0 @@
#!groovy
node('windows') {
def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
def msBuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe"
def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.7.0\\tools\\nunit3-console.exe"
def openCoverPath = "${jobDir}\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe"
def reportGeneratorPath = "${jobDir}\\packages\\ReportGenerator.3.0.2\\tools\\ReportGenerator.exe"
def testResultFilePrefix = "TestResult"
def testResultFileNormal = "${testResultFilePrefix}_UnitTests_normal.xml"
def testResultFilePortable = "${testResultFilePrefix}_UnitTests_portable.xml"
def testResultFileAcceptance = "${testResultFilePrefix}_AcceptanceTests.xml"
def coverageReport = "code_coverage_report.xml"
def codeCoverageHtml = "CodeCoverageReport.html"
stage ('Checkout Branch') {
checkout scm
bat "del /Q \"${jobDir}\\${testResultFilePrefix}*.xml\""
}
stage ('Restore NuGet Packages') {
def nugetPath = "C:\\nuget.exe"
bat "${nugetPath} restore ${solutionFilePath}"
}
stage ('Build mRemoteNG (Normal)') {
bat "\"${msBuild}\" /nologo /p:Platform=x86 \"${jobDir}\\mRemoteV1.sln\""
}
stage ('Build mRemoteNG (Portable)') {
bat "\"${msBuild}\" /nologo /p:Configuration=\"Debug Portable\";Platform=x86 \"${jobDir}\\mRemoteV1.sln\""
}
stage ('Run Unit Tests (Normal, w/coverage)') {
try {
bat "\"${openCoverPath}\" -register:user -target:\"${nunitConsolePath}\" -targetargs:\"\"${jobDir}\\mRemoteNGTests\\bin\\debug\\mRemoteNGTests.dll\" --result=${testResultFileNormal} --x86\" -output:\"${coverageReport}\""
}
catch (ex) {
nunit testResultsPattern: "${testResultFilePrefix}*.xml"
throw ex
}
}
stage ('Run Unit Tests (Portable)') {
try {
bat "\"${nunitConsolePath}\" \"${jobDir}\\mRemoteNGTests\\bin\\debug portable\\mRemoteNGTests.dll\" --result=${testResultFilePortable} --x86"
}
catch (ex) {
nunit testResultsPattern: "${testResultFilePrefix}*.xml"
throw ex
}
}
stage ('Run Acceptance Tests') {
try {
bat "\"${nunitConsolePath}\" \"${jobDir}\\mRemoteNG.Specs\\bin\\debug\\mRemoteNG.Specs.dll\" --result=${testResultFileAcceptance} --x86"
}
catch (ex) {
nunit testResultsPattern: "${testResultFilePrefix}*.xml"
throw ex
}
}
}

View File

@@ -1,71 +0,0 @@
node('windows') {
def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
def msBuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe"
def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.10.0\\tools\\nunit3-console.exe"
def openCoverPath = "${jobDir}\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe"
def testResultFilePrefix = "TestResult"
def testResultFileNormal = "${testResultFilePrefix}_UnitTests_normal.xml"
def testResultFilePortable = "${testResultFilePrefix}_UnitTests_portable.xml"
def coverageReport = "code_coverage_report.xml"
stage ('Clean output dir') {
bat script: "rmdir /S /Q \"${jobDir}\\Release\" 2>nul", returnStatus: true
}
stage ('Checkout Branch') {
checkout([
$class: 'GitSCM',
branches: [[name: '*/${TargetBranch}']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[
credentialsId: '9c3fbff4-5b90-402f-a298-00e607fcec87',
url: 'https://github.com/mRemoteNG/mRemoteNG.git'
]]
])
}
stage ('Restore NuGet Packages') {
def nugetPath = "C:\\nuget.exe"
bat "${nugetPath} restore ${solutionFilePath}"
}
withCredentials([file(credentialsId: '9b674d57-6792-48e3-984a-4d1bab2abb64', variable: 'CODE_SIGNING_CERT')]) {
withCredentials([usernamePassword(credentialsId: '05b7449b-05c0-490f-8661-236242526e62', passwordVariable: 'MRNG_CERT_PASSWORD', usernameVariable: 'NO_USERNAME')]) {
stage ('Build mRemoteNG (Normal - MSI)') {
bat "\"${msBuild}\" /nologo /t:Clean,Build /p:Configuration=\"Release Installer\" /p:Platform=x86 /p:CertPath=\"${env.CODE_SIGNING_CERT}\" /p:CertPassword=${env.MRNG_CERT_PASSWORD} \"${jobDir}\\mRemoteV1.sln\""
archiveArtifacts artifacts: "Release\\*.msi", caseSensitive: false, onlyIfSuccessful: true, fingerprint: true
}
stage ('Build mRemoteNG (Portable)') {
bat "\"${msBuild}\" /nologo /t:Clean,Build /p:Configuration=\"Release Portable\" /p:Platform=x86 /p:CertPath=\"${env.CODE_SIGNING_CERT}\" /p:CertPassword=${env.MRNG_CERT_PASSWORD} \"${jobDir}\\mRemoteV1.sln\""
archiveArtifacts artifacts: "Release\\*.zip", caseSensitive: false, onlyIfSuccessful: true, fingerprint: true
}
}
}
stage ('Run Unit Tests (Normal - MSI)') {
bat "\"${nunitConsolePath}\" \"${jobDir}\\mRemoteNGTests\\bin\\release\\mRemoteNGTests.dll\" --result=${testResultFileNormal} --x86"
}
stage ('Run Unit Tests (Portable)') {
bat "\"${nunitConsolePath}\" \"${jobDir}\\mRemoteNGTests\\bin\\release portable\\mRemoteNGTests.dll\" --result=${testResultFilePortable} --x86"
}
stage ('Generate UpdateCheck Files') {
bat "powershell -ExecutionPolicy Bypass -File \"${jobDir}\\Tools\\create_upg_chk_files.ps1\" -TagName \"${env.TagName}\" -UpdateChannel \"${env.UpdateChannel}\""
archiveArtifacts artifacts: "Release\\*.txt", caseSensitive: false, onlyIfSuccessful: true
}
stage ('Publish to GitHub') {
withCredentials([string(credentialsId: '5443a369-dbe8-42d3-b4e8-04d0b4e9039a', variable: 'GH_AUTH_TOKEN')]) {
def releaseFolder = "${jobDir}\\Release"
// because batch files suck at handling newline characters, we have to convert to base64 in groovy and back to text in powershell
def base64Description = env.ReleaseDescription.bytes.encodeBase64().toString()
bat "powershell -ExecutionPolicy Bypass -File \"${jobDir}\\Tools\\publish_to_github.ps1\" -Owner \"mRemoteNG\" -Repository \"mRemoteNG\" -ReleaseTitle \"${env.ReleaseTitle}\" -TagName \"${env.TagName}\" -TargetCommitish \"${env.TargetBranch}\" -Description \"${base64Description}\" -IsDraft ${env.IsDraft} -IsPrerelease ${env.IsPreRelease} -ReleaseFolderPath \"${releaseFolder}\" -AuthToken \"${env.GH_AUTH_TOKEN}\" -DescriptionIsBase64Encoded"
}
}
}

177
README.MD
View File

@@ -1,181 +1,12 @@
**NOTICE: This project is currently stalled and we are transitioning to a new maintainer. Please see [this stickied issue](https://github.com/mRemoteNG/mRemoteNG/issues/1949) for more details. Development help would be greatly appreciated.**
<br/><br/>
<br/>
<p align="center">
<img width="500" src="https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/develop/Tools/img/logo.png">
<img width="450" src="https://github.com/mRemoteNG/mRemoteNG/blob/mRemoteNGProjectFiles/Header_dark.png">
</p>
<p align="center">
An open source, multi-protocol, tabbed remote connections manager allowing you to view all of your connections in a simple yet powerful interface
Resources files
</p>
<p align="center">
<img alt="GitHub All Releases" src="https://img.shields.io/github/downloads/mremoteng/mremoteng/total?label=Overall%20Downloads&style=for-the-badge">
</p>
<p align="center">
<a href="https://www.reddit.com/r/mRemoteNG/">
<img alt="Subreddit subscribers" src="https://img.shields.io/reddit/subreddit-subscribers/mremoteng?label=Reddit&logo=Reddit&style=flat-square">
</a>
<a href="https://twitter.com/mremoteng">
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/mremoteng?color=%231DA1F2&label=Twitter&logo=Twitter&style=flat-square">
</a>
<a href="https://gitter.im/mRemoteNG/PublicChat">
<img alt="Gitter" src="https://img.shields.io/gitter/room/mRemoteNG/PublicChat?label=Join%20the%20Chat&logo=Gitter&style=flat-square">
</a>
<a href="https://www.paypal.me/DavidSparer">
<img alt="PayPal" src="https://img.shields.io/badge/%24-PayPal-blue.svg?label=Donate&logo=PayPal&style=flat-square">
</a>
<a href="bitcoin:16fUnHUM3k7W9Fvpc6dug7TAdfeGEcLbSg">
<img alt="Bitcoin" src="https://img.shields.io/badge/%24-Bitcoin.svg?label=Donate&logo=bitcoin&style=flat-square">
</a>
</p>
<p align="center">
<a href="https://github.com/mRemoteNG/mRemoteNG/blob/develop/COPYING.TXT">
<img alt="License" src="https://img.shields.io/github/license/mremoteng/mremoteng?label=License&style=flat">
</a>
<a href="https://bestpractices.coreinfrastructure.org/projects/529">
<img alt="CII Best Practices" src="https://bestpractices.coreinfrastructure.org/projects/529/badge?style=flat">
</a>
<a href='https://mremoteng.readthedocs.io/en/latest/?badge=latest'>
<img src='https://readthedocs.org/projects/mremoteng/badge/?version=latest' alt='Documentation Status' />
</a>
</p>
---
| Update Channel | Build Status | Downloads |
| ---------------|--------------|-----------|
| Stable | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/master?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/master) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.20/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.20) |
| Prerelease | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/develop?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/develop) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.77.1/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.77.1) |
| Nightly build | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/develop?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/develop) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.77.2/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.77.2) |
## Features
The following protocols are supported:
* RDP (Remote Desktop Protocol)
* VNC (Virtual Network Computing)
* SSH (Secure Shell)
* Telnet (TELecommunication NETwork)
* HTTP/HTTPS (Hypertext Transfer Protocol)
* rlogin (Remote Login)
* Raw Socket Connections
* Powershell remoting
For a detailed feature list and general usage support, refer to the [Documentation](https://mremoteng.readthedocs.io/en/latest/).
## Installation
### Supported Operating Systems
- [Windows 10](https://en.wikipedia.org/wiki/Windows_10)
- [Windows 8.1](https://en.wikipedia.org/wiki/Windows_8.1)
- [Windows Server 2019](https://en.wikipedia.org/wiki/Windows_Server_2019)
- [Windows Server 2016](https://en.wikipedia.org/wiki/Windows_Server_2016)
- [Windows Server 2012 R2](https://en.wikipedia.org/wiki/Windows_Server_2012_R2)
### Packaging
Downloads are provided in three different packages.
#### Binary package
The binary package of mRemoteNG is a compiled version of mRemoteNG which comes in an MSI installer.
This is the most common way to install mRemoteNG and get up and running.
#### Portable package
The portable package contains a modified version of the executable which stores and loads all your settings from files in the application's directory.
This package can be used to run mRemoteNG from a USB stick and preserve your configuration wherever you go.
#### Source package
This contains the source code from which mRemoteNG is build.
You will need to compile it yourself using Visual Studio.
### Minimum Requirements
* [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
* [Microsoft .NET Framework 4.0](https://www.microsoft.com/en-us/download/details.aspx?id=17851)
* Microsoft Terminal Service Client 6.0 or later
* Needed if you use RDP. mstscax.dll and/or msrdp.ocx be registered.
* [Citrix ICA Client](https://www.citrix.com/downloads/citrix-receiver.html)
* Needed if you use ICA. wfica.ocx must be registered
### Download
mRemoteNG is available as a redistributable MSI package or as a portable ZIP package and can be downloaded from the following locations:
* [GitHub](https://github.com/mRemoteNG/mRemoteNG/releases)
* [Project Website](https://mremoteng.org/download)
### Command line install
The MSI package of mRemoteNG can be installed using the command line:
`msiexec /i C:\Path\To\mRemoteNG-Installer.exe [INSTALLDIR=value] [IGNOREPREREQUISITES=value]`
| Property | Value | Description |
|-|-|-|
| INSTALLDIR | `folder path` | This allows you to set the installation directory from the command line. For paths that contain spaces, enclose the path in double quotes (""). This overrides any value found in the registry. |
| IGNOREPREREQUISITES | `0` or `1` | When set to `1`, the installer will not be halted if any prerequisite check is not met. You must still run the installer as administrator. |
#### Examples
**Install to a custom folder**
`msiexec /i C:\Path\To\mRemoteNG-Installer.msi INSTALLDIR="D:\Work Apps\mRemoteNG"`
**Ignore prerequisites during a normal install**
`msiexec /i C:\Path\To\mRemoteNG-Installer.msi IGNOREPREREQUISITES=1`
**Ignore prerequisites during a silent install**
`msiexec /i C:\Path\To\mRemoteNG-Installer.msi /qn IGNOREPREREQUISITES=1`
### Troubleshooting installation
Turn on verbose logging by using the `/lv* <log path>` argument at the command line.
`msiexec /i C:\Path\To\mRemoteNG-Installer.msi /l*v C:\mremoteng_install.log`
## Uninstall
### Standard Uninstall
mRemoteNG basic binary package can be uninstalled with Windows Control Panel. If for some reason it does not work please
follow information provided below for Manual Uninstall.
### Manual Uninstall
_If you are using the Portable version, simply deleting the folder that contains mRemoteNG should be sufficient. These uninstall instructions are only necessary for the normal binary .MSI installed version of mRemoteNG_
* Delete the folder where mRemoteNG was installed. By default, this is:
`%PROGRAMFILES%\mRemoteNG`
* Delete the mRemoteNG install entry from one of the following locations. Search for "mRemoteNG" in the DisplayName field:
* x86: ``HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\``
* x64: ``HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\``
* (Optional) If you would also like to delete user data remove `%LOCALAPPDATA%\mRemoteNG`
## Featured Projects
* [PSmRemoteNG](https://github.com/realslacker/PSmRemoteNG) A module to create mRemoteNG connection files from PowerShell.
## Contribute
If you find mRemoteNG useful and would like to contribute, it would be greatly appreciated. When you contribute, you make it possible for the team to cover the costs of producing mRemoteNG.
### Submit Code
Check out the [Wiki page](https://github.com/mRemoteNG/mRemoteNG/wiki) on how to configure your development environment and submit a pull request.
### Translate
Check out the [Wiki page](https://github.com/mRemoteNG/mRemoteNG/wiki) on how to help make mRemoteNG a polyglot.
</br>
<p align="center">
<img alt="Developed with ReSharper" src="https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/develop/Tools/img/icon_ReSharper.png">
<img alt="Developed with ReSharper" src="https://github.com/mRemoteNG/mRemoteNG/blob/mRemoteNGProjectFiles/icon_ReSharper.png">
</p>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,31 +0,0 @@
7-Zip Extra
~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (C) 1999-2019 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/

View File

@@ -1,111 +0,0 @@
7-Zip Extra history
-------------------
This file contains only information about changes related to that package exclusively.
The full history of changes is listed in history.txt in main 7-Zip program.
19.00 2019-02-21
-------------------------
- Encryption strength for 7z archives was increased:
the size of random initialization vector was increased from 64-bit to 128-bit,
and the pseudo-random number generator was improved.
- Some bugs were fixed.
18.06 2018-12-30
-------------------------
- The speed for LZMA/LZMA2 compressing was increased by 3-10%,
and there are minor changes in compression ratio.
- Some bugs were fixed.
18.05 2018-04-30
-------------------------
- The speed for LZMA/LZMA2 compressing was increased
by 8% for fastest/fast compression levels and
by 3% for normal/maximum compression levels.
18.03 beta 2018-03-04
-------------------------
- The speed for single-thread LZMA/LZMA2 decoding
was increased by 30% in x64 version and by 3% in x86 version.
- 7-Zip now can use multi-threading for 7z/LZMA2 decoding,
if there are multiple independent data chunks in LZMA2 stream.
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

View File

@@ -1,124 +0,0 @@
7-Zip Extra 19.00
-----------------
7-Zip Extra is package of extra modules of 7-Zip.
7-Zip Copyright (C) 1999-2019 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

View File

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

View File

@@ -1,15 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
Write-Output "Copying PUTTYNG to correct directory"
Copy-Item -Path (Join-Path -Path $SolutionDir -ChildPath "mRemoteNG\Resources\PuTTYNG.exe") -Destination $TargetDir -Force
Write-Output ""

View File

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

View File

@@ -1,19 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
Write-Output "Copying THEMES folder to output"
$sourceFiles = [io.path]::combine($SolutionDir , 'mRemoteNG\Resources\Themes' )
$DestinationDir = [io.path]::combine($TargetDir , 'Themes')
robocopy $sourceFiles $DestinationDir *.vstheme /s
Write-Output ""

View File

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

View File

@@ -1,109 +0,0 @@
#Requires -Version 4.0
param (
[string]
[Parameter(Mandatory=$true)]
$TagName,
[string]
[Parameter(Mandatory=$true)]
[ValidateSet("Stable","Beta","Development")]
$UpdateChannel
)
function New-MsiUpdateFileContent {
param (
[System.IO.FileInfo]
[Parameter(Mandatory=$true)]
$MsiFile,
[string]
[Parameter(Mandatory=$true)]
$TagName
)
$version = $MsiFile.BaseName -replace "[a-zA-Z-]*"
$certThumbprint = (Get-AuthenticodeSignature -FilePath $MsiFile).SignerCertificate.Thumbprint
$hash = Get-FileHash -Algorithm SHA512 $MsiFile | % { $_.Hash }
$fileContents = `
"Version: $version
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$TagName/$($MsiFile.Name)
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$TagName/CHANGELOG.md
CertificateThumbprint: $certThumbprint
Checksum: $hash"
Write-Output $fileContents
}
function New-ZipUpdateFileContent {
param (
[System.IO.FileInfo]
[Parameter(Mandatory=$true)]
$ZipFile,
[string]
[Parameter(Mandatory=$true)]
$TagName
)
$version = $ZipFile.BaseName -replace "[a-zA-Z-]*"
$hash = Get-FileHash -Algorithm SHA512 $ZipFile | % { $_.Hash }
$fileContents = `
"Version: $version
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$TagName/$($ZipFile.Name)
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$TagName/CHANGELOG.TXT
Checksum: $hash"
Write-Output $fileContents
}
function Resolve-UpdateCheckFileName {
param (
[string]
[Parameter(Mandatory=$true)]
[ValidateSet("Stable","Beta","Development")]
$UpdateChannel,
[string]
[Parameter(Mandatory=$true)]
[ValidateSet("Normal","Portable")]
$Type
)
$fileName = ""
if ($UpdateChannel -eq "Beta") { $fileName += "beta-" }
elseif ($UpdateChannel -eq "Development") { $fileName += "dev-" }
$fileName += "update"
if ($Type -eq "Portable") { $fileName += "-portable" }
$fileName += ".txt"
Write-Output $fileName
}
$releaseFolder = Join-Path -Path $PSScriptRoot -ChildPath "..\Release" -Resolve
# build msi update file
$msiFile = Get-ChildItem -Path "$releaseFolder\*.msi" | sort LastWriteTime | select -last 1
$msiUpdateContents = New-MsiUpdateFileContent -MsiFile $msiFile -TagName $TagName
$msiUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Normal
Write-Output "`n`nMSI Update Check File Contents ($msiUpdateFileName)`n------------------------------"
Tee-Object -InputObject $msiUpdateContents -FilePath "$releaseFolder\$msiUpdateFileName"
# build zip update file
$zipFile = Get-ChildItem -Path "$releaseFolder\*.zip" | sort LastWriteTime | select -last 1
$zipUpdateContents = New-ZipUpdateFileContent -ZipFile $zipFile -TagName $TagName
$zipUpdateFileName = Resolve-UpdateCheckFileName -UpdateChannel $UpdateChannel -Type Portable
Write-Output "`n`nZip Update Check File Contents ($zipUpdateFileName)`n------------------------------"
Tee-Object -InputObject $zipUpdateContents -FilePath "$releaseFolder\$zipUpdateFileName"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,61 +0,0 @@
[CmdletBinding()]
param (
[string]
# Name of the file to find
$FileName
)
function EditBinCertificateIsValid() {
param (
[string]
$Path
)
# Verify file certificate
$valid_microsoft_cert_thumbprints = @(
"3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC",
"98ED99A67886D020C564923B7DF25E9AC019DF26",
"108E2BA23632620C427C570B6D9DB51AC31387FE",
"5EAD300DC7E4D637948ECB0ED829A072BD152E17"
)
$file_signature = Get-AuthenticodeSignature -FilePath $Path
if (($file_signature.Status -ne "Valid") -or ($valid_microsoft_cert_thumbprints -notcontains $file_signature.SignerCertificate.Thumbprint)) {
Write-Warning "Could not validate the signature of $Path"
return $false
} else {
return $true
}
}
function ToolCanBeExecuted {
param (
[string]
$Path
)
$null = & $Path
Write-Output ($LASTEXITCODE -gt 0)
}
$rootSearchPaths = @(
[System.IO.Directory]::EnumerateFileSystemEntries("C:\Program Files", "*Visual Studio*", [System.IO.SearchOption]::TopDirectoryOnly),
[System.IO.Directory]::EnumerateFileSystemEntries("C:\Program Files (x86)", "*Visual Studio*", [System.IO.SearchOption]::TopDirectoryOnly)
)
# Returns the first full path to the $FileName that our search can find
foreach ($searchPath in $rootSearchPaths) {
foreach ($visualStudioFolder in $searchPath) {
Write-Verbose "Searching in folder '$visualStudioFolder'"
$matchingExes = [System.IO.Directory]::EnumerateFileSystemEntries($visualStudioFolder, $FileName, [System.IO.SearchOption]::AllDirectories)
foreach ($matchingExe in $matchingExes) {
if ((EditBinCertificateIsValid -Path $matchingExe) -and (ToolCanBeExecuted -Path $matchingExe)) {
return $matchingExe
}
}
}
}
Write-Error "Could not find any valid file by the name $FileName." -ErrorAction Stop

View File

@@ -1,235 +0,0 @@
$githubUrl = 'https://api.github.com'
# GitHub doesn't support the default powershell protocol (TLS 1.0)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
function Publish-GitHubRelease {
param (
[string]
[Parameter(Mandatory=$true)]
#
$Owner,
[string]
[Parameter(Mandatory=$true)]
#
$Repository,
[string]
[Parameter(Mandatory=$true)]
#
$ReleaseTitle,
[string]
[Parameter(Mandatory=$true)]
#
$TagName,
[string]
[Parameter(Mandatory=$true)]
# Either the SHA of the commit to target or the branch name.
$TargetCommitish,
[string]
[Parameter(Mandatory=$true)]
#
$Description,
[bool]
[Parameter(Mandatory=$true)]
#
$IsDraft,
[bool]
[Parameter(Mandatory=$true)]
#
$IsPrerelease,
[string]
[Parameter(Mandatory=$true)]
# The OAuth2 token to use for authentication.
$AuthToken
)
$body = New-GitHubReleaseRequestBody -TagName $TagName -TargetCommitish $TargetCommitish -ReleaseTitle $ReleaseTitle -Description $Description -IsDraft $IsDraft -IsPrerelease $IsPrerelease
$req_publishRelease = Invoke-WebRequest -Uri "$githubUrl/repos/$Owner/$Repository/releases" -Method Post -Headers @{"Authorization"="token $AuthToken"} -Body $body -ErrorAction Stop
$response_publishRelease = ConvertFrom-Json -InputObject $req_publishRelease.Content
Write-Output $response_publishRelease
}
function Edit-GitHubRelease {
param (
[string]
#[Parameter(Mandatory=$true)]
#
$Owner,
[string]
#[Parameter(Mandatory=$true)]
#
$Repository,
[string]
#[Parameter(Mandatory=$true)]
#
$ReleaseId,
[string]
#
$ReleaseTitle,
[string]
#
$TagName,
[string]
# Either the SHA of the commit to target or the branch name.
$TargetCommitish,
[string]
#
$Description,
[bool]
#
$IsDraft,
[bool]
#
$IsPrerelease,
[string]
#[Parameter(Mandatory=$true)]
# The OAuth2 token to use for authentication.
$AuthToken
)
$body_params = @{
"TagName" = $TagName
"TargetCommitish" = $TargetCommitish
"ReleaseTitle" = $ReleaseTitle
"Description" = $Description
}
if ($PSBoundParameters.ContainsKey("IsDraft")) { $body_params.Add("IsDraft", $IsDraft) }
if ($PSBoundParameters.ContainsKey("IsPrerelease")) { $body_params.Add("IsPrerelease", $IsPrerelease) }
$body = New-GitHubReleaseRequestBody @body_params
$req_editRelease = Invoke-WebRequest -Uri "$githubUrl/repos/$Owner/$Repository/releases/$ReleaseId" -Method Post -Headers @{"Authorization"="token $AuthToken"} -Body $body -ErrorAction Stop
$response_editRelease = ConvertFrom-Json -InputObject $req_editRelease.Content
Write-Output $response_editRelease
}
function Get-GitHubRelease {
param (
[string]
[Parameter(Mandatory=$true)]
#
$Owner,
[string]
[Parameter(Mandatory=$true)]
#
$Repository,
[string]
[Parameter(Mandatory=$true)]
#
$ReleaseId,
[string]
[Parameter(Mandatory=$true)]
# The OAuth2 token to use for authentication.
$AuthToken
)
$req_getRelease = Invoke-WebRequest -Uri "$githubUrl/repos/$Owner/$Repository/releases/$ReleaseId" -Method Get -Headers @{"Authorization"="token $AuthToken"} -ErrorAction Stop
$response_getRelease = ConvertFrom-Json -InputObject $req_getRelease.Content
Write-Output $response_getRelease
}
function Upload-GitHubReleaseAsset {
param (
[string]
[Parameter(Mandatory=$true)]
$UploadUri,
[string]
[Parameter(Mandatory=$true)]
# Path to the file to upload with the release
$FilePath,
[string]
[Parameter(Mandatory=$true)]
# Content type of the file
$ContentType,
[string]
[Parameter(Mandatory=$true)]
# The OAuth2 token to use for authentication.
$AuthToken,
[string]
# A short description label for the asset
$Label = ""
)
$UploadUri = $UploadUri -replace "(\{[\w,\?]*\})$"
$files = Get-Item -Path $FilePath
$labelParam = ""
if ($Label -ne "") {
$labelParam = "&label=$Label"
}
# Get-Item could produce an array of files if a wildcard is provided. (C:\*.txt)
# Upload each matching item individually
foreach ($file in $files) {
Write-Output "Uploading asset to GitHub release: '$($file.FullName)'"
$req_uploadZipAsset = Invoke-WebRequest -Uri "$($UploadUri)?name=$($file.Name)$labelParam" -Method Post -Headers @{"Authorization"="token $AuthToken"} -ContentType $ContentType -InFile $file.FullName -ErrorAction Stop
}
}
function New-GitHubReleaseRequestBody {
param (
[string]
#
$TagName,
[string]
# Either the SHA of the commit to target or the branch name.
$TargetCommitish,
[string]
# Title of the release
$ReleaseTitle,
[string]
# Description of the release
$Description,
[bool]
# Is this a draft?
$IsDraft,
[bool]
# Is this a pre-release?
$IsPrerelease
)
$body_params = [ordered]@{}
if ($TagName -ne "") { $body_params.Add("tag_name", $TagName) }
if ($TargetCommitish -ne "") { $body_params.Add("target_commitish", $TargetCommitish) }
if ($ReleaseTitle -ne "") { $body_params.Add("name", $ReleaseTitle) }
if ($Description -ne "") { $body_params.Add("body", $Description) }
if ($PSBoundParameters.ContainsKey("IsDraft")) { $body_params.Add("draft", $IsDraft) }
if ($PSBoundParameters.ContainsKey("IsPrerelease")) { $body_params.Add("prerelease", $IsPrerelease) }
$json_body = ConvertTo-Json -InputObject $body_params -Compress
Write-Output $json_body
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,44 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$TargetFileName,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName,
[string]
$CertificatePath,
[string]
$CertificatePassword,
[string[]]
$ExcludeFromSigning
)
Write-Output "+=================================================================+"
Write-Output "| Beginning mRemoteNG Installer Post Build |"
Write-Output "+=================================================================+"
Format-Table -AutoSize -Wrap -InputObject @{
"SolutionDir" = $SolutionDir
"TargetDir" = $TargetDir
"TargetFileName" = $TargetFileName
"ConfigurationName" = $ConfigurationName
"CertificatePath" = $CertificatePath
"ExcludeFromSigning" = $ExcludeFromSigning
}
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning -SolutionDir $SolutionDir
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath -SolutionDir $SolutionDir
& "$PSScriptRoot\rename_installer_with_version.ps1" -SolutionDir $SolutionDir
& "$PSScriptRoot\copy_release_installer.ps1" -SourcePath $TargetDir -DestinationDir (Join-Path -Path $SolutionDir -ChildPath "Release")

View File

@@ -1,52 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$TargetFileName,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName,
[string]
$CertificatePath,
[string]
$CertificatePassword,
[string[]]
$ExcludeFromSigning
)
Write-Output "+=================================================================+"
Write-Output "| Beginning mRemoteNG Post Build |"
Write-Output "+=================================================================+"
Format-Table -AutoSize -Wrap -InputObject @{
"SolutionDir" = $SolutionDir
"TargetDir" = $TargetDir
"TargetFileName" = $TargetFileName
"ConfigurationName" = $ConfigurationName
"CertificatePath" = $CertificatePath
"ExcludeFromSigning" = $ExcludeFromSigning
}
& "$PSScriptRoot\copy_puttyng.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\copy_themes.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\copy_tiles.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\sphinx_docs.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir
& "$PSScriptRoot\set_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
& "$PSScriptRoot\verify_LargeAddressAware.ps1" -TargetDir $TargetDir -TargetFileName $TargetFileName
& "$PSScriptRoot\tidy_files_for_release.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName
& "$PSScriptRoot\sign_binaries.ps1" -TargetDir $TargetDir -CertificatePath $CertificatePath -CertificatePassword $CertificatePassword -ConfigurationName $ConfigurationName -Exclude $ExcludeFromSigning -SolutionDir $SolutionDir
& "$PSScriptRoot\verify_binary_signatures.ps1" -TargetDir $TargetDir -ConfigurationName $ConfigurationName -CertificatePath $CertificatePath -SolutionDir $SolutionDir
& "$PSScriptRoot\zip_symbols.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName
& "$PSScriptRoot\zip_portable_files.ps1" -SolutionDir $SolutionDir -TargetDir $TargetDir -ConfigurationName $ConfigurationName

View File

@@ -1,25 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
#
$Owner,
[string]
[Parameter(Mandatory=$true)]
#
$Repository,
[string]
[Parameter(Mandatory=$true)]
#
$ReleaseId,
[string]
[Parameter(Mandatory=$true)]
# The OAuth2 token to use for authentication.
$AuthToken
)
. "$PSScriptRoot\github_functions.ps1"
Edit-GitHubRelease -Owner $Owner -Repository $Repository -ReleaseId $ReleaseId -AuthToken $AuthToken -IsDraft $false

View File

@@ -1,81 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
#
$Owner,
[string]
[Parameter(Mandatory=$true)]
#
$Repository,
[string]
[Parameter(Mandatory=$true)]
#
$ReleaseTitle,
[string]
[Parameter(Mandatory=$true)]
#
$TagName,
[string]
[Parameter(Mandatory=$true)]
# Either the SHA of the commit to target or the branch name.
$TargetCommitish,
[string]
[Parameter(Mandatory=$true)]
#
$Description,
[string]
[Parameter(Mandatory=$true)]
[ValidateSet("true","false")]
# true/false
$IsDraft,
[string]
[Parameter(Mandatory=$true)]
[ValidateSet("true","false")]
# true/false
$IsPrerelease,
[string]
[Parameter(Mandatory=$true)]
# Path to the folder which contains release assets to upload
$ReleaseFolderPath,
[string]
[Parameter(Mandatory=$true)]
# The OAuth2 token to use for authentication.
$AuthToken,
[switch]
# Enable this switch to treat $Description as a Base64 encoded string. It will be decoded before being used elsewhere in the script.
$DescriptionIsBase64Encoded
)
if ($DescriptionIsBase64Encoded) {
$Description = ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Description)))
}
. "$PSScriptRoot\github_functions.ps1"
$releaseFolderItems = Get-ChildItem -Path $ReleaseFolderPath
$mrngPortablePath = ($releaseFolderItems | ?{$_.Name -match "portable-[\d\.]+\.zip"}).FullName
$mrngNormalPath = ($releaseFolderItems | ?{$_.Name -match "installer-[\d\.]+\.msi"}).FullName
$mrngPortableSymbolsPath = ($releaseFolderItems | ?{$_.Name -match "mremoteng-portable-symbols-[\d\.]+\.zip"}).FullName
$mrngNormalSymbolsPath = ($releaseFolderItems | ?{$_.Name -match "mremoteng-symbols-[\d\.]+\.zip"}).FullName
$release = Publish-GitHubRelease -Owner $Owner -Repository $Repository -ReleaseTitle $ReleaseTitle -TagName $TagName -TargetCommitish $TargetCommitish -Description $Description -IsDraft ([bool]::Parse($IsDraft)) -IsPrerelease ([bool]::Parse($IsPrerelease)) -AuthToken $AuthToken
$zipUpload = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngPortablePath -ContentType "application/zip" -AuthToken $AuthToken -Label "Portable Edition (zip)"
$msiUpload = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngNormalPath -ContentType "application/octet-stream" -AuthToken $AuthToken -Label "Normal Edition (msi)"
$portableEditionSymbols = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngPortableSymbolsPath -ContentType "application/zip" -AuthToken $AuthToken -Label "Portable Edition Debug Symbols"
$normalEditionSymbols = Upload-GitHubReleaseAsset -UploadUri $release.upload_url -FilePath $mrngNormalSymbolsPath -ContentType "application/zip" -AuthToken $AuthToken -Label "Normal Edition Debug Symbols"
Write-Output (Get-GitHubRelease -Owner $Owner -Repository $Repository -ReleaseId $release.id -AuthToken $AuthToken)

View File

@@ -1,29 +0,0 @@
param (
[string]
$SolutionDir
)
$renameTarget = $SolutionDir + "InstallerProjects\Installer\bin\Release\en-US\mRemoteNG-Installer.msi"
Write-Host $SolutionDir
Write-Host $renameTarget
$targetVersionedFile = "$SolutionDir\mRemoteNG\bin\Release\mRemoteNG.exe"
$version = &"$SolutionDir\Tools\exes\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
}

View File

@@ -1,22 +0,0 @@
[CmdletBinding()]
param (
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$TargetFileName
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
$path_editBin = Join-Path -Path $PSScriptRoot -ChildPath "exes\editbin.exe"
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
# Set LargeAddressAware
Write-Output "Setting LargeAddressAware on binary file:`n`"$path_outputExe`" `nwith:`n`"$path_editBin`""
& "$path_editBin" /largeaddressaware "$path_outputExe"
Write-Output ""

View File

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

View File

@@ -1,31 +0,0 @@
param(
[string]
[Parameter(Mandatory=$true)]
# Folder path that contains the files you would like to sign. Recursive.
$PathToSignableFiles,
[string]
# The code signing certificate to use when signing the files.
$CertificatePath = "C:\mRemoteNG_code_signing_cert.pfx",
[SecureString]
# Password to unlock the code signing certificate.
$CertificatePassword = (Get-Credential -Message "Enter password for the mRemoteNG code signing certificate" -UserName "USERNAME NOT NEEDED").Password,
[string[]]
# File names to exclude from signing
$Exclude
)
$timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll"
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificatePath, $CertificatePassword)
Write-Output "Getting files from path: $PathToSignableFiles"
$signableFiles = Get-ChildItem -Path $PathToSignableFiles -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -notcontains $_.Name}
Write-Output "Signable files count: $($signableFiles.Count)"
foreach ($file in $signableFiles) {
Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName
}

View File

@@ -1,33 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
Write-Output "Building HTML-Documentation with Sphinx"
$path_HelpFilesDir = Join-Path -Path $TargetDir -ChildPath "Help"
$path_SphinxSourceDir = Join-Path -Path $SolutionDir -ChildPath "mRemoteNG\Documentation"
# Remove stale Help files, if they exist
if (Test-Path -Path $path_HelpFilesDir) {
Remove-Item -Path $path_HelpFilesDir -Recurse -Force
}
# Build docs
sphinx-build $path_SphinxSourceDir $path_HelpFilesDir
# Place dummy html file if build failed
if (-Not (Test-Path $path_HelpFilesDir\index.html -PathType Leaf)) {
New-Item -Path $path_HelpFilesDir -ItemType "directory"
New-Item $path_HelpFilesDir\index.html
Set-Content $path_HelpFilesDir\index.html 'Welcome to mRemoteNG!'
}
Write-Output ""

View File

@@ -1,39 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
# Remove unnecessary files from Release versions
if ($ConfigurationName -match "Release") {
Write-Output "Removing unnecessary files from Release versions"
$test = Join-Path -Path $TargetDir -ChildPath "app.publish"
if (Test-Path $test -PathType Container) {
Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "app.publish") -Recurse -Force
}
$filesToDelete = Get-ChildItem -Path $TargetDir -Recurse -Include @(
"*.publish",
"*.xml",
"*.backup",
"*.log",
"*vshost*",
"*.tmp"
) -Exclude @(
"mRemoteNG.VisualElementsManifest.xml"
)
Remove-Item -Path $filesToDelete.FullName
Write-Output $filesToDelete.FullName
}
else {
Write-Output "We will not remove anything - this is not a release build."
}
Write-Output ""

View File

@@ -1,17 +0,0 @@
# $FullPath Full path to the Microsoft executable to validate
param (
[string]
[Parameter(Mandatory=$true)]
$FullPath
)
$validMSCertThumbprints = @("3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC", "108E2BA23632620C427C570B6D9DB51AC31387FE", "98ED99A67886D020C564923B7DF25E9AC019DF26", "5EAD300DC7E4D637948ECB0ED829A072BD152E17")
$exeSignature = Get-AuthenticodeSignature -FilePath $FullPath
$baseErrorMsg = "Could not validate the certificate of $FullPath. "
if ($exeSignature.Status -ne "Valid") {
Write-Error -Message ($baseErrorMsg+"The signature was invalid.") -ErrorAction Stop
}
elseif ($validMSCertThumbprints -notcontains $exeSignature.SignerCertificate.Thumbprint) {
Write-Error -Message ($baseErrorMsg+"The certificate thumbprint ($($exeSignature.SignerCertificate.Thumbprint)) is not trusted.") -ErrorAction Stop
}

View File

@@ -1,30 +0,0 @@
[CmdletBinding()]
param (
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$TargetFileName
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
$path_dumpBin = Join-Path -Path $PSScriptRoot -ChildPath "exes\dumpbin.exe"
$path_outputExe = Join-Path -Path $TargetDir -ChildPath $TargetFileName
# Dump exe header
$output = & "$path_dumpBin" /NOLOGO /HEADERS "$path_outputExe" | Select-String large
if ($output -eq $null)
{
Write-Warning "Could not validate LargeAddressAware"
}
else
{
Write-Output $output.ToString().TrimStart(" ")
}
Write-Output ""

View File

@@ -1,59 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName,
[string]
[Parameter(Mandatory=$true)]
[AllowEmptyString()]
# The code signing certificate to use when signing the files.
$CertificatePath,
[string]
[Parameter(Mandatory=$true)]
$SolutionDir
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
# validate release versions and if the certificate value was passed
if ($ConfigurationName -match "Release" -And ($CertificatePath)) {
if(-Not ([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) ) {
$CertificatePath = Join-Path -Path $SolutionDir -ChildPath $CertificatePath
}
# make sure the cert is actually available
if ($CertificatePath -eq "" -or !(Test-Path -Path $CertificatePath -PathType Leaf))
{
Write-Output "Certificate is not present - files likely not signed - we won't verify file signatures."
return
}
Write-Output "Verifying signature of binaries"
Write-Output "Getting files from path: $TargetDir"
$signableFiles = Get-ChildItem -Path $TargetDir -Recurse | ?{$_.Extension -match "dll|exe|msi"}
Write-Output "Signable files count: $($signableFiles.Count)"
$badSignatureFound = $false
foreach ($file in $signableFiles) {
$signature = Get-AuthenticodeSignature -FilePath $file.FullName
if ($signature.Status -ne "Valid") {
Write-Warning "File $($file.FullName) does not have a valid signature."
$badSignatureFound = $true
}
}
if ($badSignatureFound) {
Write-Output "One or more files were improperly signed."
} else {
Write-Output "All files have valid signatures."
}
} else {
Write-Output "This is not a release build or CertificatePath wasn't provided - we won't verify file signatures."
Write-Output "Config: $($ConfigurationName)`tCertPath: $($CertificatePath)"
}
Write-Output ""

View File

@@ -1,64 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
if(-not [string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {
Write-Output "Too early to run via Appveyor - artifacts don't get generated properly. Exiting"
Exit
}
Write-Output "Solution Dir: '$($SolutionDir)'"
Write-Output "Target Dir: '$($TargetDir)'"
$ConfigurationName = $ConfigurationName.Trim()
Write-Output "Config Name (tirmmed): '$($ConfigurationName)'"
# Windows Sysinternals Sigcheck from http://technet.microsoft.com/en-us/sysinternals/bb897441
$SIGCHECK="$($SolutionDir)Tools\exes\sigcheck.exe"
$SEVENZIP="$($SolutionDir)Tools\7zip\7za.exe"
# Package Zip
if ($ConfigurationName -eq "Release Portable") {
Write-Output "Packaging Release Portable ZIP"
$version = & $SIGCHECK /accepteula -q -n "$($SolutionDir)mRemoteNG\bin\$($ConfigurationName)\mRemoteNG.exe"
Write-Output "Version is $($version)"
$PortableZip="$($SolutionDir)Release\mRemoteNG-Portable-$($version).zip"
$tempFolderPath = Join-Path -Path $SolutionDir -ChildPath "mRemoteNG\bin\package"
Remove-Item -Recurse $tempFolderPath -ErrorAction SilentlyContinue | Out-Null
New-Item $tempFolderPath -ItemType "directory" | Out-Null
Copy-Item "$($SolutionDir)mRemoteNG\Resources\PuTTYNG.exe" -Destination $tempFolderPath
#Write-Output "$($SolutionDir)mRemoteNG\bin\$ConfigurationName"
#Write-Output "$($SolutionDir)mRemoteNG\bin\package"
Copy-Item "$($SolutionDir)mRemoteNG\bin\$ConfigurationName\*" -Destination $tempFolderPath -Recurse -Force
# Delete any PDB files that accidentally get copied into the temp folder
Get-ChildItem -Path $tempFolderPath -Filter "*.pdb" | Remove-Item
Copy-Item "$($SolutionDir)*.txt" -Destination $tempFolderPath
Write-Output "Creating portable ZIP file $($PortableZip)"
Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip (Join-Path -Path $tempFolderPath -ChildPath "*.*")
#& $SEVENZIP a -bt -mx=9 -tzip -y $PortableZip "$($SolutionDir)*.TXT"
}
else {
Write-Output "We will not zip anything - this isnt a portable release build."
}
Write-Output ""

View File

@@ -1,56 +0,0 @@
param (
[string]
[Parameter(Mandatory=$true)]
$SolutionDir,
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
if(-not [string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {
Write-Output "Too early to run via Appveyor - artifacts don't get generated properly. Exiting"
Exit
}
Write-Output "Solution Dir: '$($SolutionDir)'"
Write-Output "Target Dir: '$($TargetDir)'"
$ConfigurationName = $ConfigurationName.Trim()
Write-Output "Config Name (trimmed): '$($ConfigurationName)'"
# Windows Sysinternals Sigcheck from http://technet.microsoft.com/en-us/sysinternals/bb897441
$SIGCHECK="$($SolutionDir)Tools\exes\sigcheck.exe"
$SEVENZIP="$($SolutionDir)Tools\7zip\7za.exe"
# Package Zip
if ($ConfigurationName -match "Release") {
Write-Output "Packaging debug symbols"
$version = & $SIGCHECK /accepteula -q -n "$($SolutionDir)mRemoteNG\bin\$($ConfigurationName)\mRemoteNG.exe"
Write-Output "Version is $($version)"
if ($ConfigurationName -match "Portable") {
$zipFilePrefix = "mRemoteNG-Portable-symbols"
} else {
$zipFilePrefix = "mRemoteNG-symbols"
}
$outputZipPath="$($SolutionDir)Release\$zipFilePrefix-$($version).zip"
Write-Output "Creating debug symbols ZIP file $($outputZipPath)"
Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue
& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath (Join-Path -Path $TargetDir -ChildPath "*.pdb")
}
else {
Write-Output "We will not package debug symbols - this isnt a release build."
}
Write-Output ""

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -1,132 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.352
MinimumVisualStudioVersion = 14.0.25420.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mRemoteNG", "mRemoteNG\mRemoteNG.csproj", "{4934A491-40BC-4E5B-9166-EA1169A220F6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mRemoteNGTests", "mRemoteNGTests\mRemoteNGTests.csproj", "{1453B37F-8621-499E-B0B2-6091F76DC0BB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "mRemoteNGInstaller", "mRemoteNGInstaller", "{4FE795BE-646E-4F1B-BAD0-A68EA26394DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomActions", "mRemoteNGInstaller\CustomActions\CustomActions.csproj", "{5423D985-CB48-4344-B47F-E8C6D60C8B04}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "mRemoteNGInstaller\Installer\Installer.wixproj", "{F0168B9F-6815-40DF-BA53-46CEE7683B68}"
ProjectSection(ProjectDependencies) = postProject
{5423D985-CB48-4344-B47F-E8C6D60C8B04} = {5423D985-CB48-4344-B47F-E8C6D60C8B04}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mRemoteNGSpecs", "mRemoteNGSpecs\mRemoteNGSpecs.csproj", "{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}"
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 Installer|Any CPU = Release Installer|Any CPU
Release Installer|x86 = Release Installer|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|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug Portable|Any CPU.Build.0 = Debug Portable|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|Any CPU.ActiveCfg = Debug|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Debug|Any CPU.Build.0 = Debug|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 Installer|Any CPU.ActiveCfg = Release|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Installer|Any CPU.Build.0 = Release|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Installer|x86.ActiveCfg = Release|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Installer|x86.Build.0 = Release|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|Any CPU.ActiveCfg = Release Portable|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|Any CPU.Build.0 = Release Portable|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|Any CPU.ActiveCfg = Release|x86
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|Any CPU.Build.0 = Release|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|Any CPU.ActiveCfg = Debug Portable|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug Portable|Any CPU.Build.0 = Debug Portable|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|Any CPU.ActiveCfg = Debug|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Debug|Any CPU.Build.0 = Debug|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 Installer|Any CPU.ActiveCfg = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Installer|Any CPU.Build.0 = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Installer|x86.ActiveCfg = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Installer|x86.Build.0 = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|Any CPU.ActiveCfg = Release Portable|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release Portable|Any CPU.Build.0 = Release Portable|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|Any CPU.ActiveCfg = Release|x86
{1453B37F-8621-499E-B0B2-6091F76DC0BB}.Release|Any CPU.Build.0 = Release|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|Any CPU.ActiveCfg = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|Any CPU.Build.0 = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug Portable|x86.ActiveCfg = Debug|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Debug|Any CPU.ActiveCfg = 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 Installer|Any CPU.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Installer|Any CPU.Build.0 = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Installer|x86.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Installer|x86.Build.0 = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|Any CPU.ActiveCfg = Release|x86
{5423D985-CB48-4344-B47F-E8C6D60C8B04}.Release Portable|x86.ActiveCfg = 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
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|Any CPU.ActiveCfg = Debug Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|Any CPU.Build.0 = Debug Portable|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Debug Portable|x86.ActiveCfg = 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}.Release Installer|Any CPU.ActiveCfg = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Installer|Any CPU.Build.0 = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Installer|x86.ActiveCfg = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release Installer|x86.Build.0 = Release|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|Any CPU.ActiveCfg = Release|x86
{F0168B9F-6815-40DF-BA53-46CEE7683B68}.Release|x86.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug Portable|Any CPU.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug Portable|Any CPU.Build.0 = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug Portable|x86.ActiveCfg = Debug|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug Portable|x86.Build.0 = Debug|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug|Any CPU.ActiveCfg = Debug|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug|x86.ActiveCfg = Debug|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Debug|x86.Build.0 = Debug|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Installer|Any CPU.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Installer|Any CPU.Build.0 = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Installer|x86.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Installer|x86.Build.0 = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Portable|Any CPU.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Portable|Any CPU.Build.0 = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Portable|x86.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release Portable|x86.Build.0 = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release|Any CPU.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release|x86.ActiveCfg = Release|x86
{16AA21E2-D6B7-427D-AB7D-AA8C611B724E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5423D985-CB48-4344-B47F-E8C6D60C8B04} = {4FE795BE-646E-4F1B-BAD0-A68EA26394DD}
{F0168B9F-6815-40DF-BA53-46CEE7683B68} = {4FE795BE-646E-4F1B-BAD0-A68EA26394DD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5D390A0C-2FC4-4908-B86E-7E4DEF5916EC}
EndGlobalSection
EndGlobal

View File

@@ -1,53 +0,0 @@
# top-most EditorConfig file
root = true
[*]
end_of_line = crlf
indent_style = space
[*.xml]
indent_size = 4
[*.cs]
indent_size = 4
trim_trailing_whitespace = true
charset = utf-8-bom
# reStructuredText
[*.rst]
charset = utf-8
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 3
max_line_length = 120
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:none
dotnet_style_qualification_for_property = false:none
dotnet_style_qualification_for_method = false:none
dotnet_style_qualification_for_event = false:none
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Space preferences
csharp_space_after_cast = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false

View File

@@ -1,111 +0,0 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
using Microsoft.Win32;
using mRemoteNG.App.Info;
using mRemoteNG.Messages;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
namespace mRemoteNG.App
{
public static class CompatibilityChecker
{
public static void CheckCompatibility(MessageCollector messageCollector)
{
CheckFipsPolicy(messageCollector);
CheckLenovoAutoScrollUtility(messageCollector);
}
private static void CheckFipsPolicy(MessageCollector messageCollector)
{
if (Settings.Default.OverrideFIPSCheck)
{
messageCollector.AddMessage(MessageClass.InformationMsg, "OverrideFIPSCheck is set. Will skip check", true);
return;
}
messageCollector.AddMessage(MessageClass.InformationMsg, "Checking FIPS policy...", true);
messageCollector.AddMessage(MessageClass.InformationMsg, $"FIPS2003: {FipsPolicyEnabledForServer2003()}", true);
messageCollector.AddMessage(MessageClass.InformationMsg, $"FIPS2008+: {FipsPolicyEnabledForServer2008AndNewer()}", true);
if (!FipsPolicyEnabledForServer2003() && !FipsPolicyEnabledForServer2008AndNewer()) return;
var errorText = string.Format(Language.ErrorFipsPolicyIncompatible, GeneralAppInfo.ProductName);
messageCollector.AddMessage(MessageClass.ErrorMsg, errorText, true);
//About to pop up a message, let's not block it...
FrmSplashScreen.getInstance().Close();
var ShouldIStayOrShouldIGo = CTaskDialog.MessageBox(Application.ProductName,
Language.CompatibilityProblemDetected, errorText, "",
"",
Language.CheckboxDoNotShowThisMessageAgain,
ETaskDialogButtons.OkCancel, ESysIcons.Warning,
ESysIcons.Warning);
if (CTaskDialog.VerificationChecked && ShouldIStayOrShouldIGo == DialogResult.OK)
{
messageCollector.AddMessage(MessageClass.ErrorMsg, "User requests that FIPS check be overridden", true);
Settings.Default.OverrideFIPSCheck = true;
Settings.Default.Save();
return;
}
if (ShouldIStayOrShouldIGo == DialogResult.Cancel)
Environment.Exit(1);
}
private static bool FipsPolicyEnabledForServer2003()
{
var regKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Lsa");
if (!(regKey?.GetValue("FIPSAlgorithmPolicy") is int fipsPolicy))
return false;
return fipsPolicy != 0;
}
private static bool FipsPolicyEnabledForServer2008AndNewer()
{
var regKey = Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy");
if (!(regKey?.GetValue("Enabled") is int fipsPolicy))
return false;
return fipsPolicy != 0;
}
private static void CheckLenovoAutoScrollUtility(MessageCollector messageCollector)
{
messageCollector.AddMessage(MessageClass.InformationMsg, "Checking Lenovo AutoScroll Utility...", true);
if (!Settings.Default.CompatibilityWarnLenovoAutoScrollUtility)
return;
var proccesses = new Process[] { };
try
{
proccesses = Process.GetProcessesByName("virtscrl");
}
catch (InvalidOperationException ex)
{
messageCollector.AddExceptionMessage("Error in CheckLenovoAutoScrollUtility", ex);
}
if (proccesses.Length <= 0)
{
messageCollector.AddMessage(MessageClass.InformationMsg, "Lenovo AutoScroll Utility not found", true);
return;
}
messageCollector.AddMessage(MessageClass.WarningMsg, "Lenovo AutoScroll Utility found", true);
CTaskDialog.MessageBox(Application.ProductName, Language.CompatibilityProblemDetected,
string.Format(Language.CompatibilityLenovoAutoScrollUtilityDetected,
Application.ProductName), "",
"", Language.CheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.Ok,
ESysIcons.Warning,
ESysIcons.Warning);
if (CTaskDialog.VerificationChecked)
Settings.Default.CompatibilityWarnLenovoAutoScrollUtility = false;
}
}
}

View File

@@ -1,117 +0,0 @@
using System;
using System.Linq;
using System.Windows.Forms;
using mRemoteNG.Config.Connections;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.ConnectionSerializers.Csv;
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNG.UI.Forms;
namespace mRemoteNG.App
{
public static class Export
{
public static void ExportToFile(ConnectionInfo selectedNode, ConnectionTreeModel connectionTreeModel)
{
try
{
var saveFilter = new SaveFilter();
using (var exportForm = new FrmExport())
{
if (selectedNode?.GetTreeNodeType() == TreeNodeType.Container)
exportForm.SelectedFolder = selectedNode as ContainerInfo;
else if (selectedNode?.GetTreeNodeType() == TreeNodeType.Connection)
{
if (selectedNode.Parent.GetTreeNodeType() == TreeNodeType.Container)
exportForm.SelectedFolder = selectedNode.Parent;
exportForm.SelectedConnection = selectedNode;
}
if (exportForm.ShowDialog(FrmMain.Default) != DialogResult.OK)
return;
ConnectionInfo exportTarget;
switch (exportForm.Scope)
{
case FrmExport.ExportScope.SelectedFolder:
exportTarget = exportForm.SelectedFolder;
break;
case FrmExport.ExportScope.SelectedConnection:
exportTarget = exportForm.SelectedConnection;
break;
default:
exportTarget = connectionTreeModel.RootNodes.First(node => node is RootNodeInfo);
break;
}
saveFilter.SaveUsername = exportForm.IncludeUsername;
saveFilter.SavePassword = exportForm.IncludePassword;
saveFilter.SaveDomain = exportForm.IncludeDomain;
saveFilter.SaveInheritance = exportForm.IncludeInheritance;
saveFilter.SaveCredentialId = exportForm.IncludeAssignedCredential;
SaveExportFile(exportForm.FileName, exportForm.SaveFormat, saveFilter, exportTarget);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("App.Export.ExportToFile() failed.", ex);
}
}
private static void SaveExportFile(string fileName,
SaveFormat saveFormat,
SaveFilter saveFilter,
ConnectionInfo exportTarget)
{
try
{
ISerializer<ConnectionInfo, string> serializer;
switch (saveFormat)
{
case SaveFormat.mRXML:
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
var rootNode = exportTarget.GetRootParent() as RootNodeInfo;
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
cryptographyProvider,
rootNode?.PasswordString
.ConvertToSecureString() ??
new RootNodeInfo(RootNodeType
.Connection)
.PasswordString
.ConvertToSecureString(),
saveFilter);
serializer = new XmlConnectionsSerializer(cryptographyProvider, connectionNodeSerializer);
break;
case SaveFormat.mRCSV:
serializer =
new CsvConnectionsSerializerMremotengFormat(saveFilter, Runtime.CredentialProviderCatalog);
break;
default:
throw new ArgumentOutOfRangeException(nameof(saveFormat), saveFormat, null);
}
var serializedData = serializer.Serialize(exportTarget);
var fileDataProvider = new FileDataProvider(fileName);
fileDataProvider.Save(serializedData);
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace($"Export.SaveExportFile(\"{fileName}\") failed.", ex);
}
finally
{
Runtime.ConnectionsService.RemoteConnectionsSyncronizer?.Enable();
}
}
}
}

View File

@@ -1,134 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using mRemoteNG.Config.Import;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Container;
using mRemoteNG.Resources.Language;
using mRemoteNG.Tools;
namespace mRemoteNG.App
{
public static class Import
{
public static void ImportFromFile(ContainerInfo importDestinationContainer)
{
try
{
using (var openFileDialog = new OpenFileDialog())
{
openFileDialog.CheckFileExists = true;
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
openFileDialog.Multiselect = true;
var fileTypes = new List<string>();
fileTypes.AddRange(new[] {Language.FilterAllImportable, "*.xml;*.rdp;*.rdg;*.dat;*.csv"});
fileTypes.AddRange(new[] {Language.FiltermRemoteXML, "*.xml"});
fileTypes.AddRange(new[] {Language.FiltermRemoteCSV, "*.csv"});
fileTypes.AddRange(new[] {Language.FilterRDP, "*.rdp"});
fileTypes.AddRange(new[] {Language.FilterRdgFiles, "*.rdg"});
fileTypes.AddRange(new[] {Language.FilterPuttyConnectionManager, "*.dat"});
fileTypes.AddRange(new[] {Language.FilterAll, "*.*"});
openFileDialog.Filter = string.Join("|", fileTypes.ToArray());
if (openFileDialog.ShowDialog() != DialogResult.OK)
return;
HeadlessFileImport(
openFileDialog.FileNames,
importDestinationContainer,
Runtime.ConnectionsService,
fileName => MessageBox.Show(string.Format(Language.ImportFileFailedContent, fileName), Language.AskUpdatesMainInstruction,
MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1));
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("Unable to import file.", ex);
}
}
public static void HeadlessFileImport(
IEnumerable<string> filePaths,
ContainerInfo importDestinationContainer,
ConnectionsService connectionsService,
Action<string> exceptionAction = null)
{
using (connectionsService.BatchedSavingContext())
{
foreach (var fileName in filePaths)
{
try
{
var importer = BuildConnectionImporterFromFileExtension(fileName);
importer.Import(fileName, importDestinationContainer);
}
catch (Exception ex)
{
exceptionAction?.Invoke(fileName);
Runtime.MessageCollector.AddExceptionMessage($"Error occurred while importing file '{fileName}'.", ex);
}
}
}
}
public static void ImportFromActiveDirectory(string ldapPath,
ContainerInfo importDestinationContainer,
bool importSubOu)
{
try
{
using (Runtime.ConnectionsService.BatchedSavingContext())
{
ActiveDirectoryImporter.Import(ldapPath, importDestinationContainer, importSubOu);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("App.Import.ImportFromActiveDirectory() failed.", ex);
}
}
public static void ImportFromPortScan(IEnumerable<ScanHost> hosts,
ProtocolType protocol,
ContainerInfo importDestinationContainer)
{
try
{
using (Runtime.ConnectionsService.BatchedSavingContext())
{
var importer = new PortScanImporter(protocol);
importer.Import(hosts, importDestinationContainer);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("App.Import.ImportFromPortScan() failed.", ex);
}
}
private static IConnectionImporter<string> BuildConnectionImporterFromFileExtension(string fileName)
{
// TODO: Use the file contents to determine the file type instead of trusting the extension
var extension = Path.GetExtension(fileName) ?? "";
switch (extension.ToLowerInvariant())
{
case ".xml":
return new MRemoteNGXmlImporter();
case ".csv":
return new MRemoteNGCsvImporter();
case ".rdp":
return new RemoteDesktopConnectionImporter();
case ".rdg":
return new RemoteDesktopConnectionManagerImporter();
case ".dat":
return new PuttyConnectionManagerImporter();
default:
throw new FileFormatException("Unrecognized file format.");
}
}
}
}

View File

@@ -1,10 +0,0 @@
namespace mRemoteNG.App.Info
{
public static class ConnectionsFileInfo
{
public static readonly string DefaultConnectionsPath = SettingsFileInfo.SettingsPath;
public static readonly string DefaultConnectionsFile = "confCons.xml";
public static readonly string DefaultConnectionsFileNew = "confConsNew.xml";
public static readonly double ConnectionFileVersion = 2.8;
}
}

View File

@@ -1,10 +0,0 @@
namespace mRemoteNG.App.Info
{
public class CredentialsFileInfo
{
public static readonly string CredentialsPath = SettingsFileInfo.SettingsPath;
public static readonly string CredentialsFile = "confCreds.xml";
public static readonly string CredentialsFileNew = "confCredsNew.xml";
public static readonly double CredentialsFileVersion = 1.0;
}
}

View File

@@ -1,61 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
using static System.Environment;
namespace mRemoteNG.App.Info
{
public static class GeneralAppInfo
{
public const string UrlHome = "https://www.mremoteng.org";
public const string UrlDonate = "https://mremoteng.org/contribute";
public const string UrlForum = "https://www.reddit.com/r/mRemoteNG";
public const string UrlBugs = "https://bugs.mremoteng.org";
public static string ApplicationVersion = Application.ProductVersion;
public static readonly string ProductName = 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 string ReportingFilePath = "";
public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
public static string UserAgent
{
get
{
var details = new List<string>
{
"compatible",
OSVersion.Platform == PlatformID.Win32NT
? $"Windows NT {OSVersion.Version.Major}.{OSVersion.Version.Minor}"
: OSVersion.VersionString
};
if (Is64BitProcess)
{
details.Add("WOW64");
}
details.Add(Thread.CurrentThread.CurrentUICulture.Name);
details.Add($".NET CLR {Environment.Version}");
var detailsString = string.Join("; ", details.ToArray());
return $"Mozilla/5.0 ({detailsString}) {ProductName}/{ApplicationVersion}";
}
}
public static Version GetApplicationVersion()
{
System.Version.TryParse(ApplicationVersion, out var v);
return v;
}
}
}

View File

@@ -1,29 +0,0 @@
using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using mRemoteNG.Connection;
namespace mRemoteNG.App.Info
{
public static class SettingsFileInfo
{
private static readonly string ExePath =
Path.GetDirectoryName(Assembly.GetAssembly(typeof(ConnectionInfo))?.Location);
public static string SettingsPath =>
Runtime.IsPortableEdition
? ExePath
: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + Application.ProductName;
public static string LayoutFileName { get; } = "pnlLayout.xml";
public static string ExtAppsFilesName { get; } = "extApps.xml";
public static string ThemesFileName { get; } = "Themes.xml";
public static string ThemeFolder { get; } =
SettingsPath != null ? Path.Combine(SettingsPath, "Themes") : String.Empty;
public static string InstalledThemeFolder { get; } =
ExePath != null ? Path.Combine(ExePath, "Themes") : String.Empty;
}
}

View File

@@ -1,78 +0,0 @@
using System;
using mRemoteNG.Properties;
// ReSharper disable InconsistentNaming
namespace mRemoteNG.App.Info
{
public static class UpdateChannelInfo
{
public const string STABLE = "Stable";
public const string BETA = "Beta";
public const string DEV = "Development";
/* no #if here since they are used for unit tests as well */
public const string STABLE_PORTABLE = "update-portable.txt";
public const string BETA_PORTABLE = "beta-update-portable.txt";
public const string DEV_PORTABLE = "dev-update-portable.txt";
public const string STABLE_MSI = "update.txt";
public const string BETA_MSI = "beta-update.txt";
public const string DEV_MSI = "dev-update.txt";
public static Uri GetUpdateChannelInfo()
{
var channel = IsValidChannel(Settings.Default.UpdateChannel) ? Settings.Default.UpdateChannel : STABLE;
return GetUpdateTxtUri(channel);
}
private static string GetChannelFileName(string channel)
{
return Runtime.IsPortableEdition
? GetChannelFileNamePortableEdition(channel)
: GetChannelFileNameNormalEdition(channel);
}
private static string GetChannelFileNameNormalEdition(string channel)
{
switch (channel)
{
case STABLE:
return STABLE_MSI;
case BETA:
return BETA_MSI;
case DEV:
return DEV_MSI;
default:
return STABLE_MSI;
}
}
private static string GetChannelFileNamePortableEdition(string channel)
{
switch (channel)
{
case STABLE:
return STABLE_PORTABLE;
case BETA:
return BETA_PORTABLE;
case DEV:
return DEV_PORTABLE;
default:
return STABLE_PORTABLE;
}
}
private static Uri GetUpdateTxtUri(string channel)
{
return new Uri(new Uri(Settings.Default.UpdateAddress),
new Uri(GetChannelFileName(channel), UriKind.Relative));
}
private static bool IsValidChannel(string s)
{
return s.Equals(STABLE) || s.Equals(BETA) || s.Equals(DEV);
}
}
}

View File

@@ -1,33 +0,0 @@
using System;
using System.IO;
using mRemoteNG.Connection;
namespace mRemoteNG.App.Initialization
{
public class ConnectionIconLoader
{
private readonly string _path;
public ConnectionIconLoader(string folderPath)
{
if (string.IsNullOrEmpty(folderPath))
throw new ArgumentException($"{nameof(folderPath)} must be a valid folder path.");
_path = folderPath;
}
public void GetConnectionIcons()
{
if (Directory.Exists(_path) == false)
return;
foreach (var f in Directory.GetFiles(_path, "*.ico", SearchOption.AllDirectories))
{
var fInfo = new FileInfo(f);
Array.Resize(ref ConnectionIcon.Icons, ConnectionIcon.Icons.Length + 1);
ConnectionIcon.Icons.SetValue(fInfo.Name.Replace(".ico", ""), ConnectionIcon.Icons.Length - 1);
}
}
}
}

View File

@@ -1,21 +0,0 @@
using System.IO;
using mRemoteNG.Config.Connections;
using mRemoteNG.Properties;
namespace mRemoteNG.App.Initialization
{
public class CredsAndConsSetup
{
public void LoadCredsAndCons()
{
new SaveConnectionsOnEdit(Runtime.ConnectionsService);
if (Settings.Default.FirstStart && !Settings.Default.LoadConsFromCustomLocation &&
!File.Exists(Runtime.ConnectionsService.GetStartupConnectionFileName()))
Runtime.ConnectionsService.NewConnectionsFile(Runtime.ConnectionsService
.GetStartupConnectionFileName());
Runtime.LoadConnections();
}
}
}

View File

@@ -1,75 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using mRemoteNG.Messages;
using mRemoteNG.Messages.MessageFilteringOptions;
using mRemoteNG.Messages.MessageWriters;
using mRemoteNG.Messages.WriterDecorators;
namespace mRemoteNG.App.Initialization
{
public class MessageCollectorSetup
{
public static void SetupMessageCollector(MessageCollector messageCollector,
IList<IMessageWriter> messageWriterList)
{
messageCollector.CollectionChanged += (o, args) =>
{
var messages = args.NewItems.Cast<IMessage>().ToArray();
foreach (var printer in messageWriterList)
foreach (var message in messages)
printer.Write(message);
};
}
public static void BuildMessageWritersFromSettings(IList<IMessageWriter> messageWriterList)
{
#if DEBUG
messageWriterList.Add(BuildDebugConsoleWriter());
#endif
messageWriterList.Add(BuildTextLogMessageWriter());
messageWriterList.Add(BuildNotificationPanelMessageWriter());
messageWriterList.Add(BuildPopupMessageWriter());
}
private static IMessageWriter BuildDebugConsoleWriter()
{
return new DebugConsoleMessageWriter();
}
private static IMessageWriter BuildTextLogMessageWriter()
{
return new MessageTypeFilterDecorator(
new LogMessageTypeFilteringOptions(),
new TextLogMessageWriter(Logger.Instance)
);
}
private static IMessageWriter BuildNotificationPanelMessageWriter()
{
return new OnlyLogMessageFilter(
new MessageTypeFilterDecorator(
new
NotificationPanelMessageFilteringOptions(),
new MessageFocusDecorator(
Windows.ErrorsForm,
new
NotificationPanelSwitchOnMessageFilteringOptions(),
new
NotificationPanelMessageWriter(Windows
.ErrorsForm)
)
)
);
}
private static IMessageWriter BuildPopupMessageWriter()
{
return new OnlyLogMessageFilter(
new MessageTypeFilterDecorator(
new PopupMessageFilteringOptions(),
new PopupMessageWriter()
)
);
}
}
}

View File

@@ -1,124 +0,0 @@
using System;
using System.Management;
using System.Threading;
using System.Windows.Forms;
using mRemoteNG.Messages;
using mRemoteNG.Resources.Language;
namespace mRemoteNG.App.Initialization
{
public class StartupDataLogger
{
private readonly MessageCollector _messageCollector;
public StartupDataLogger(MessageCollector messageCollector)
{
if (messageCollector == null)
throw new ArgumentNullException(nameof(messageCollector));
_messageCollector = messageCollector;
}
public void LogStartupData()
{
LogApplicationData();
LogCmdLineArgs();
LogSystemData();
LogClrData();
LogCultureData();
}
private void LogSystemData()
{
var osData = GetOperatingSystemData();
var architecture = GetArchitectureData();
var nonEmptyData = Array.FindAll(new[] {osData, architecture}, s => !string.IsNullOrEmpty(s));
var data = string.Join(" ", nonEmptyData);
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
}
private string GetOperatingSystemData()
{
var osVersion = string.Empty;
var servicePack = string.Empty;
try
{
foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True")
.Get())
{
var managementObject = (ManagementObject)o;
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
servicePack = GetOSServicePack(servicePack, managementObject);
}
}
catch (Exception ex)
{
_messageCollector.AddExceptionMessage("Error retrieving operating system information from WMI.", ex);
}
var osData = string.Join(" ", osVersion, servicePack);
return osData;
}
private string GetOSServicePack(string servicePack, ManagementObject managementObject)
{
var servicePackNumber = Convert.ToInt32(managementObject.GetPropertyValue("ServicePackMajorVersion"));
if (servicePackNumber != 0)
{
servicePack = $"Service Pack {servicePackNumber}";
}
return servicePack;
}
private string GetArchitectureData()
{
var architecture = string.Empty;
try
{
foreach (var o in new ManagementObjectSearcher("SELECT AddressWidth FROM Win32_Processor WHERE DeviceID=\'CPU0\'")
.Get())
{
var managementObject = (ManagementObject)o;
var addressWidth = Convert.ToInt32(managementObject.GetPropertyValue("AddressWidth"));
architecture = $"{addressWidth}-bit";
}
}
catch (Exception ex)
{
_messageCollector.AddExceptionMessage("Error retrieving operating system address width from WMI.", ex);
}
return architecture;
}
private void LogApplicationData()
{
var data = $"{Application.ProductName} {Application.ProductVersion}";
if (Runtime.IsPortableEdition)
data += $" {Language.PortableEdition}";
data += " starting.";
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
}
private void LogCmdLineArgs()
{
var data = $"Command Line: {string.Join(" ", Environment.GetCommandLineArgs())}";
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
}
private void LogClrData()
{
var data = $"Microsoft .NET CLR {Environment.Version}";
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
}
private void LogCultureData()
{
var data =
$"System Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}";
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
}
}
}

View File

@@ -1,71 +0,0 @@
using System;
using System.IO;
using System.Windows.Forms;
using log4net;
using log4net.Appender;
using log4net.Config;
using mRemoteNG.Properties;
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.App
{
public class Logger
{
public static readonly Logger Instance = new Logger();
public ILog Log { get; private set; }
public static string DefaultLogPath => BuildLogFilePath();
private Logger()
{
Initialize();
}
private void Initialize()
{
XmlConfigurator.Configure(LogManager.CreateRepository("mRemoteNG"));
if (string.IsNullOrEmpty(Settings.Default.LogFilePath))
Settings.Default.LogFilePath = BuildLogFilePath();
SetLogPath(Settings.Default.LogToApplicationDirectory ? DefaultLogPath : Settings.Default.LogFilePath);
}
public void SetLogPath(string path)
{
var repository = LogManager.GetRepository("mRemoteNG");
var appenders = repository.GetAppenders();
foreach (var appender in appenders)
{
var fileAppender = (RollingFileAppender)appender;
if (fileAppender == null || fileAppender.Name != "LogFileAppender") continue;
fileAppender.File = path;
fileAppender.ActivateOptions();
}
Log = LogManager.GetLogger("mRemoteNG", "Logger");
}
private static string BuildLogFilePath()
{
var logFilePath = Runtime.IsPortableEdition ? GetLogPathPortableEdition() : GetLogPathNormalEdition();
var logFileName = Path.ChangeExtension(Application.ProductName, ".log");
if (logFileName == null) return "mRemoteNG.log";
var logFile = Path.Combine(logFilePath, logFileName);
return logFile;
}
private static string GetLogPathNormalEdition()
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
Application.ProductName);
}
private static string GetLogPathPortableEdition()
{
return Application.StartupPath;
}
}
}

View File

@@ -1,547 +0,0 @@
using System;
using System.Drawing;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Text;
#pragma warning disable 649
#pragma warning disable 169
namespace mRemoteNG.App
{
public static class NativeMethods
{
#region Functions
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool AppendMenu(IntPtr hMenu, int uFlags, IntPtr uIDNewItem, string lpNewItem);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr CreatePopupMenu();
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr FindWindowEx(IntPtr parentHandle,
IntPtr childAfter,
string lclassName,
string windowTitle);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool InsertMenu(IntPtr hMenu,
int uPosition,
int uFlags,
IntPtr uIDNewItem,
string lpNewItem);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int IsIconic(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool PostMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, StringBuilder lParam);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
internal static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, string lParam);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
internal static extern IntPtr SendMessage([In] IntPtr hWnd,
[In] uint msg,
[Out] StringBuilder wParam,
[In] IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool SetMenuItemBitmaps(IntPtr hMenu,
int uPosition,
int uFlags,
IntPtr hBitmapUnchecked,
IntPtr hBitmapChecked);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr WindowFromPoint(Point point);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int GetDlgCtrlID(IntPtr hwndCtl);
[DllImport("user32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
internal static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
[DllImport("user32", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
internal static extern bool SetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
[DllImport("kernel32", SetLastError = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal static extern bool CloseHandle(IntPtr handle);
#endregion
#region Structures
[StructLayout(LayoutKind.Sequential)]
internal struct WINDOWPOS
{
public IntPtr hwnd;
public IntPtr hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public int flags;
}
internal struct WINDOWPLACEMENT
{
public uint length;
public uint flags;
public uint showCmd;
public POINT ptMinPosition;
public POINT ptMaxPosition;
public RECT rcNormalPosition;
}
internal struct POINT
{
public long x;
public long y;
}
internal 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)
{
return wLow | wHigh << 16;
}
public static int MAKELPARAM(ref int wLow, ref int wHigh)
{
return MAKELONG(wLow, wHigh);
}
public static int LOWORD(int value)
{
return value & 0xFFFF;
}
public static int LOWORD(IntPtr value)
{
return LOWORD(value.ToInt32());
}
public static int HIWORD(int value)
{
return value >> 16;
}
public static int HIWORD(IntPtr value)
{
return HIWORD(value.ToInt32());
}
#endregion
#region Constants
public const int TRUE = 1;
#region GetWindowLong
public const int GWL_STYLE = (-16);
#endregion
#region AppendMenu / ModifyMenu / DeleteMenu / RemoveMenu
public const int MF_BYCOMMAND = 0x0;
public const int MF_BYPOSITION = 0x400;
public const int MF_STRING = 0x0;
public const int MF_POPUP = 0x10;
public const int MF_SEPARATOR = 0x800;
#endregion
#region WM_LBUTTONDOWN / WM_LBUTTONUP
public const int MK_LBUTTON = 0x1;
#endregion
#region ShowWindow
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
/// <summary>
/// Retains the current size (ignores the cx and cy parameters).
/// </summary>
public const int SWP_NOSIZE = 0x1;
/// <summary>
/// Retains the current position (ignores the x and y parameters).
/// </summary>
public const int SWP_NOMOVE = 0x2;
/// <summary>
/// Retains the current Z order (ignores the hWndInsertAfter parameter).
/// </summary>
public const int SWP_NOZORDER = 0x4;
/// <summary>
/// Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
/// </summary>
public const int SWP_NOREDRAW = 0x8;
/// <summary>
/// Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
/// </summary>
public const int SWP_NOACTIVATE = 0x10;
/// <summary>
/// Draws a frame (defined in the window's class description) around the window.
/// </summary>
public const int SWP_DRAWFRAME = 0x20;
/// <summary>
/// Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
/// </summary>
public const int SWP_FRAMECHANGED = 0x20;
/// <summary>
/// Displays the window.
/// </summary>
public const int SWP_SHOWWINDOW = 0x40;
/// <summary>
/// Hides the window.
/// </summary>
public const int SWP_HIDEWINDOW = 0x80;
/// <summary>
/// Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
/// </summary>
public const int SWP_NOCOPYBITS = 0x100;
/// <summary>
/// Does not change the owner window's position in the Z order.
/// </summary>
public const int SWP_NOOWNERZORDER = 0x200;
/// <summary>
/// Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
/// </summary>
public const int SWP_NOSENDCHANGING = 0x400;
/// <summary>
///
/// </summary>
public const int SWP_NOCLIENTSIZE = 0x800;
/// <summary>
///
/// </summary>
public const int SWP_NOCLIENTMOVE = 0x1000;
/// <summary>
/// Prevents generation of the WM_SYNCPAINT message.
/// </summary>
public const int SWP_DEFERERASE = 0x2000;
/// <summary>
/// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
/// </summary>
public const int SWP_ASYNCWINDOWPOS = 0x4000;
/// <summary>
///
/// </summary>
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>
///
/// </summary>
public const int WA_INACTIVE = 0x0;
/// <summary>
///
/// </summary>
public const int WA_ACTIVE = 0x1;
/// <summary>
/// Sent to both the window being activated and the window being deactivated.
/// If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the
/// top-level window being deactivated, then to the window procedure of the top-level window being activated. If the
/// windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
/// </summary>
public const int WA_CLICKACTIVE = 0x2;
#endregion
#region Window Messages
/// <summary>
/// Sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
/// </summary>
public const int WM_CREATE = 0x1;
/// <summary>
/// Sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen. This message is sent first to the window being destroyed and then to the child windows(if any) as they are destroyed.During the processing of the message, it can be assumed that all child windows still exist.
/// </summary>
public const int WM_DESTROY = 0x2;
/// <summary>
/// Sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
/// </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>
public const int WM_GETTEXT = 0xD;
/// <summary>
/// Sent as a signal that a window or an application should terminate.
/// </summary>
public const int WM_CLOSE = 0x10;
/// <summary>
/// Sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.
/// </summary>
public const int WM_ACTIVATEAPP = 0x1C;
/// <summary>
/// Sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
/// </summary>
public const int WM_SETCURSOR = 0x20;
/// <summary>
/// Sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.
/// </summary>
public const int WM_MOUSEACTIVATE = 0x21;
/// <summary>
/// Sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.
/// </summary>
public const int WM_GETMINMAXINFO = 0x24;
/// <summary>
/// Sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.
/// </summary>
public const int WM_WINDOWPOSCHANGING = 0x46;
/// <summary>
/// Sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.
/// </summary>
public const int WM_WINDOWPOSCHANGED = 0x47;
/// <summary>
/// Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
/// </summary>
public const int WM_KEYDOWN = 0x100;
/// <summary>
/// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
/// </summary>
public const int WM_KEYUP = 0x101;
/// <summary>
/// Posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.
/// </summary>
public const int WM_CHAR = 0x102;
/// <summary>
/// Sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
/// </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>
public const int WM_SYSCOMMAND = 0x112;
/// <summary>
/// Posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_MOUSEMOVE = 0x200;
/// <summary>
/// Posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_LBUTTONDOWN = 0x201;
/// <summary>
/// Posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_LBUTTONUP = 0x202;
/// <summary>
/// Posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_RBUTTONDOWN = 0x204;
/// <summary>
/// Posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_RBUTTONUP = 0x205;
/// <summary>
/// Posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_MBUTTONDOWN = 0x207;
/// <summary>
/// Posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_MBUTTONUP = 0x208;
/// <summary>
/// Posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_XBUTTONDOWN = 0x20B;
/// <summary>
/// Posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
/// </summary>
public const int WM_XBUTTONUP = 0x20C;
/// <summary>
/// Sent to a window when a significant action occurs on a descendant window. This message is now extended to include the WM_POINTERDOWN event. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.
/// </summary>
public const int WM_PARENTNOTIFY = 0x210;
/// <summary>
/// Sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
/// </summary>
public const int WM_ENTERSIZEMOVE = 0x231;
/// <summary>
/// Sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
/// </summary>
public const int WM_EXITSIZEMOVE = 0x232;
/// <summary>
/// Sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
/// </summary>
public const int WM_DRAWCLIPBOARD = 0x308;
/// <summary>
/// Sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
/// </summary>
public const int WM_CHANGECBCHAIN = 0x30D;
#endregion
#region Window Styles
public const int WS_MAXIMIZE = 0x1000000;
public const int WS_VISIBLE = 0x10000000;
public const int WS_CHILD = 0x40000000;
public const int WS_EX_MDICHILD = 0x40;
#endregion
#region Virtual Key Codes
public const int VK_CONTROL = 0x11;
public const int VK_C = 0x67;
#endregion
#region EM
public const uint ECM_FIRST = 0x1500;
public const uint EM_SETCUEBANNER = ECM_FIRST + 1;
public const uint EM_GETCUEBANNER = ECM_FIRST + 2;
#endregion
#region LB
public const int LB_ERR = -1;
public const int LB_SELECTSTRING = 0x18C;
#endregion
#region TCM
internal const int TCM_ADJUSTRECT = 0x1328;
#endregion
#endregion
}
}

View File

@@ -1,107 +0,0 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using mRemoteNG.Properties;
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)
{
if (Settings.Default.SingleInstance)
StartApplicationAsSingleInstance();
else
StartApplication();
}
private static void StartApplication()
{
CatchAllUnhandledExceptions();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var frmSplashScreen = FrmSplashScreen.getInstance();
frmSplashScreen.Show();
Application.Run(FrmMain.Default);
}
public static void CloseSingletonInstanceMutex()
{
_mutex?.Close();
}
private static void StartApplicationAsSingleInstance()
{
const string mutexID = "mRemoteNG_SingleInstanceMutex";
_mutex = new Mutex(false, mutexID, out var newInstanceCreated);
if (!newInstanceCreated)
{
SwitchToCurrentInstance();
return;
}
StartApplication();
GC.KeepAlive(_mutex);
}
private static void SwitchToCurrentInstance()
{
var singletonInstanceWindowHandle = GetRunningSingletonInstanceWindowHandle();
if (singletonInstanceWindowHandle == IntPtr.Zero) return;
if (NativeMethods.IsIconic(singletonInstanceWindowHandle) != 0)
NativeMethods.ShowWindow(singletonInstanceWindowHandle, (int)NativeMethods.SW_RESTORE);
NativeMethods.SetForegroundWindow(singletonInstanceWindowHandle);
}
private static IntPtr GetRunningSingletonInstanceWindowHandle()
{
var windowHandle = IntPtr.Zero;
var currentProcess = Process.GetCurrentProcess();
foreach (var 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;
}
private static void CatchAllUnhandledExceptions()
{
Application.ThreadException += ApplicationOnThreadException;
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
}
private static void ApplicationOnThreadException(object sender, ThreadExceptionEventArgs e)
{
if (!FrmSplashScreen.getInstance().IsDisposed)
FrmSplashScreen.getInstance().Close();
if (FrmMain.Default.IsDisposed) return;
var window = new FrmUnhandledException(e.Exception, false);
window.ShowDialog(FrmMain.Default);
}
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
if (!FrmSplashScreen.getInstance().IsDisposed)
FrmSplashScreen.getInstance().Close();
var window = new FrmUnhandledException(e.ExceptionObject as Exception, e.IsTerminating);
window.ShowDialog(FrmMain.Default);
}
}
}

View File

@@ -1,225 +0,0 @@
using mRemoteNG.App.Info;
using mRemoteNG.Config.Putty;
using mRemoteNG.Connection;
using mRemoteNG.Credential;
using mRemoteNG.Credential.Repositories;
using mRemoteNG.Messages;
using mRemoteNG.Security;
using mRemoteNG.Tools;
using mRemoteNG.Tree.Root;
using mRemoteNG.UI;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
using System;
using System.IO;
using System.Security;
using System.Threading;
using System.Windows.Forms;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
namespace mRemoteNG.App
{
public static class Runtime
{
public static bool IsPortableEdition
{
get
{
#if PORTABLE
return true;
#else
return false;
#endif
}
}
/// <summary>
/// Feature flag to enable the credential manager feature
/// </summary>
public static bool UseCredentialManager => false;
public static WindowList WindowList { get; set; }
public static MessageCollector MessageCollector { get; } = new MessageCollector();
public static NotificationAreaIcon NotificationAreaIcon { get; set; }
public static ExternalToolsService ExternalToolsService { get; } = new ExternalToolsService();
public static SecureString EncryptionKey { get; set; } =
new RootNodeInfo(RootNodeType.Connection).PasswordString.ConvertToSecureString();
public static ICredentialRepositoryList CredentialProviderCatalog { get; } = new CredentialRepositoryList();
public static ConnectionsService ConnectionsService { get; } =
new ConnectionsService(PuttySessionsManager.Instance);
#region Connections Loading/Saving
public static void LoadConnectionsAsync()
{
var t = new Thread(LoadConnectionsBGd);
t.SetApartmentState(ApartmentState.STA);
t.Start();
}
private static void LoadConnectionsBGd()
{
LoadConnections();
}
/// <summary>
///
/// </summary>
/// <param name="withDialog">
/// Should we show the file selection dialog to allow the user to select
/// a connection file
/// </param>
public static void LoadConnections(bool withDialog = false)
{
var connectionFileName = "";
try
{
// disable sql update checking while we are loading updates
ConnectionsService.RemoteConnectionsSyncronizer?.Disable();
if (withDialog)
{
var loadDialog = DialogFactory.BuildLoadConnectionsDialog();
if (loadDialog.ShowDialog() != DialogResult.OK)
return;
connectionFileName = loadDialog.FileName;
Settings.Default.UseSQLServer = false;
Settings.Default.Save();
}
else if (!Settings.Default.UseSQLServer)
{
connectionFileName = ConnectionsService.GetStartupConnectionFileName();
}
ConnectionsService.LoadConnections(Settings.Default.UseSQLServer, false, connectionFileName);
if (Settings.Default.UseSQLServer)
{
ConnectionsService.LastSqlUpdate = DateTime.Now;
}
// re-enable sql update checking after updates are loaded
ConnectionsService.RemoteConnectionsSyncronizer?.Enable();
}
catch (Exception ex)
{
FrmSplashScreen.getInstance().Close();
if (Settings.Default.UseSQLServer)
{
MessageCollector.AddExceptionMessage(Language.LoadFromSqlFailed, ex);
var commandButtons = string.Join("|", Language._TryAgain,
Language.CommandOpenConnectionFile,
string.Format(Language.CommandExitProgram,
Application.ProductName));
CTaskDialog.ShowCommandBox(Application.ProductName, Language.LoadFromSqlFailed,
Language.LoadFromSqlFailedContent,
MiscTools.GetExceptionMessageRecursive(ex), "", "",
commandButtons, false, ESysIcons.Error, ESysIcons.Error);
switch (CTaskDialog.CommandButtonResult)
{
case 0:
LoadConnections(withDialog);
return;
case 1:
Settings.Default.UseSQLServer = false;
LoadConnections(true);
return;
default:
Application.Exit();
return;
}
}
if (ex is FileNotFoundException && !withDialog)
{
MessageCollector.AddExceptionMessage(
string.Format(Language.ConnectionsFileCouldNotBeLoadedNew,
connectionFileName), ex,
MessageClass.InformationMsg);
string[] commandButtons =
{
Language.ConfigurationCreateNew,
Language.ConfigurationCustomPath,
Language.ConfigurationImportFile,
Language.Exit
};
var answered = false;
while (!answered)
{
try
{
CTaskDialog.ShowTaskDialogBox(
GeneralAppInfo.ProductName,
Language.ConnectionFileNotFound,
"", "", "", "", "",
string.Join(" | ", commandButtons),
ETaskDialogButtons.None,
ESysIcons.Question,
ESysIcons.Question);
switch (CTaskDialog.CommandButtonResult)
{
case 0:
ConnectionsService.NewConnectionsFile(connectionFileName);
answered = true;
break;
case 1:
LoadConnections(true);
answered = true;
break;
case 2:
ConnectionsService.NewConnectionsFile(connectionFileName);
Import.ImportFromFile(ConnectionsService.ConnectionTreeModel.RootNodes[0]);
answered = true;
break;
case 3:
Application.Exit();
answered = true;
break;
}
}
catch (Exception exc)
{
MessageCollector.AddExceptionMessage(
string
.Format(Language.ConnectionsFileCouldNotBeLoadedNew,
connectionFileName), exc,
MessageClass.InformationMsg);
}
}
return;
}
MessageCollector.AddExceptionStackTrace(
string.Format(Language.ConnectionsFileCouldNotBeLoaded,
connectionFileName), ex);
if (connectionFileName != ConnectionsService.GetStartupConnectionFileName())
{
LoadConnections(withDialog);
}
else
{
MessageBox.Show(FrmMain.Default,
string.Format(Language.ErrorStartupConnectionFileLoad, Environment.NewLine,
Application.ProductName,
ConnectionsService.GetStartupConnectionFileName(),
MiscTools.GetExceptionMessageRecursive(ex)),
@"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
}
}
#endregion
}
}

View File

@@ -1,36 +0,0 @@
using System.Windows.Forms;
using mRemoteNG.UI.Forms;
using WeifenLuo.WinFormsUI.Docking;
namespace mRemoteNG.App
{
public static class Screens
{
public static void SendFormToScreen(Screen screen)
{
var frmMain = FrmMain.Default;
var wasMax = false;
if (frmMain.WindowState == FormWindowState.Maximized)
{
wasMax = true;
frmMain.WindowState = FormWindowState.Normal;
}
frmMain.Location = screen.Bounds.Location;
if (wasMax)
{
frmMain.WindowState = FormWindowState.Maximized;
}
}
public static void SendPanelToScreen(DockContent panel, Screen screen)
{
panel.DockState = DockState.Float;
if (panel.ParentForm == null) return;
panel.ParentForm.Left = screen.Bounds.Location.X;
panel.ParentForm.Top = screen.Bounds.Location.Y;
}
}
}

View File

@@ -1,99 +0,0 @@
using mRemoteNG.Tools;
using System;
using System.Diagnostics;
using System.Windows.Forms;
using mRemoteNG.Config.Putty;
using mRemoteNG.Properties;
using mRemoteNG.Resources.Language;
using mRemoteNG.UI.Controls;
using mRemoteNG.UI.Forms;
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.App
{
public static class Shutdown
{
private static string _updateFilePath;
private static bool UpdatePending
{
get { return !string.IsNullOrEmpty(_updateFilePath); }
}
public static void Quit(string updateFilePath = null)
{
_updateFilePath = updateFilePath;
FrmMain.Default.Close();
ProgramRoot.CloseSingletonInstanceMutex();
}
public static void Cleanup(Control quickConnectToolStrip,
ExternalToolsToolStrip externalToolsToolStrip,
MultiSshToolStrip multiSshToolStrip,
FrmMain frmMain)
{
try
{
StopPuttySessionWatcher();
DisposeNotificationAreaIcon();
SaveConnections();
SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip, frmMain);
UnregisterBrowsers();
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace(Language.SettingsCouldNotBeSavedOrTrayDispose, ex);
}
}
private static void StopPuttySessionWatcher()
{
PuttySessionsManager.Instance.StopWatcher();
}
private static void DisposeNotificationAreaIcon()
{
if (Runtime.NotificationAreaIcon != null && Runtime.NotificationAreaIcon.Disposed == false)
Runtime.NotificationAreaIcon.Dispose();
}
private static void SaveConnections()
{
if (Settings.Default.SaveConsOnExit)
Runtime.ConnectionsService.SaveConnections();
}
private static void SaveSettings(Control quickConnectToolStrip,
ExternalToolsToolStrip externalToolsToolStrip,
MultiSshToolStrip multiSshToolStrip,
FrmMain frmMain)
{
Config.Settings.SettingsSaver.SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip,
frmMain);
}
private static void UnregisterBrowsers()
{
IeBrowserEmulation.Unregister();
}
public static void StartUpdate()
{
try
{
RunUpdateFile();
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace("The update could not be started.", ex);
}
}
private static void RunUpdateFile()
{
if (UpdatePending)
Process.Start(_updateFilePath);
}
}
}

View File

@@ -1,127 +0,0 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using mRemoteNG.App.Info;
using mRemoteNG.App.Initialization;
using mRemoteNG.App.Update;
using mRemoteNG.Config.Connections.Multiuser;
using mRemoteNG.Connection;
using mRemoteNG.Messages;
using mRemoteNG.Properties;
using mRemoteNG.Tools;
using mRemoteNG.Tools.Cmdline;
using mRemoteNG.UI;
using mRemoteNG.UI.Forms;
namespace mRemoteNG.App
{
public class Startup
{
private AppUpdater _appUpdate;
private readonly ConnectionIconLoader _connectionIconLoader;
private readonly FrmMain _frmMain = FrmMain.Default;
public static Startup Instance { get; } = new Startup();
private Startup()
{
_appUpdate = new AppUpdater();
_connectionIconLoader = new ConnectionIconLoader(GeneralAppInfo.HomePath + "\\Icons\\");
}
static Startup()
{
}
public void InitializeProgram(MessageCollector messageCollector)
{
Debug.Print("---------------------------" + Environment.NewLine + "[START] - " +
Convert.ToString(DateTime.Now, CultureInfo.InvariantCulture));
var startupLogger = new StartupDataLogger(messageCollector);
startupLogger.LogStartupData();
CompatibilityChecker.CheckCompatibility(messageCollector);
ParseCommandLineArgs(messageCollector);
IeBrowserEmulation.Register();
_connectionIconLoader.GetConnectionIcons();
DefaultConnectionInfo.Instance.LoadFrom(Settings.Default, a => "ConDefault" + a);
DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, a => "InhDefault" + a);
}
private static void ParseCommandLineArgs(MessageCollector messageCollector)
{
var interpreter = new StartupArgumentsInterpreter(messageCollector);
interpreter.ParseArguments(Environment.GetCommandLineArgs());
}
public void CreateConnectionsProvider(MessageCollector messageCollector)
{
messageCollector.AddMessage(MessageClass.DebugMsg, "Determining if we need a database syncronizer");
if (!Settings.Default.UseSQLServer) return;
messageCollector.AddMessage(MessageClass.DebugMsg, "Creating database syncronizer");
Runtime.ConnectionsService.RemoteConnectionsSyncronizer =
new RemoteConnectionsSyncronizer(new SqlConnectionsUpdateChecker());
Runtime.ConnectionsService.RemoteConnectionsSyncronizer.Enable();
}
public void CheckForUpdate()
{
if (_appUpdate == null)
{
_appUpdate = new AppUpdater();
}
else if (_appUpdate.IsGetUpdateInfoRunning)
{
return;
}
var nextUpdateCheck =
Convert.ToDateTime(Settings.Default.CheckForUpdatesLastCheck.Add(
TimeSpan
.FromDays(Convert.ToDouble(Settings
.Default
.CheckForUpdatesFrequencyDays))));
if (!Settings.Default.UpdatePending && DateTime.UtcNow < nextUpdateCheck)
{
return;
}
_appUpdate.GetUpdateInfoCompletedEvent += GetUpdateInfoCompleted;
_appUpdate.GetUpdateInfoAsync();
}
private void GetUpdateInfoCompleted(object sender, AsyncCompletedEventArgs e)
{
if (_frmMain.InvokeRequired)
{
_frmMain.Invoke(new AsyncCompletedEventHandler(GetUpdateInfoCompleted), sender, e);
return;
}
try
{
_appUpdate.GetUpdateInfoCompletedEvent -= GetUpdateInfoCompleted;
if (e.Cancelled)
{
return;
}
if (e.Error != null)
{
throw e.Error;
}
if (_appUpdate.IsUpdateAvailable())
{
Windows.Show(WindowType.Update);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("GetUpdateInfoCompleted() failed.", ex);
}
}
}
}

View File

@@ -1,94 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization;
using mRemoteNG.Properties;
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.App
{
[Serializable]
public sealed class SupportedCultures : Dictionary<string, string>
{
private static SupportedCultures _Instance;
private static SupportedCultures SingletonInstance
{
get { return _Instance ?? (_Instance = new SupportedCultures()); }
}
private SupportedCultures()
{
foreach (var CultureName in Settings.Default.SupportedUICultures.Split(','))
{
try
{
var CultureInfo = new CultureInfo(CultureName.Trim());
Add(CultureInfo.Name, CultureInfo.TextInfo.ToTitleCase(CultureInfo.NativeName));
}
catch (Exception ex)
{
Debug.Print(
$"An exception occurred while adding the culture {CultureName} to the list of supported cultures. {ex.StackTrace}");
}
}
}
// fix CA2229 - https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2229-implement-serialization-constructors?view=vs-2017
private SupportedCultures(SerializationInfo info, StreamingContext context)
{
throw new NotImplementedException();
}
public static bool IsNameSupported(string CultureName)
{
return SingletonInstance.ContainsKey(CultureName);
}
public static bool IsNativeNameSupported(string CultureNativeName)
{
return SingletonInstance.ContainsValue(CultureNativeName);
}
public static string get_CultureName(string CultureNativeName)
{
var Names = new string[SingletonInstance.Count + 1];
var NativeNames = new string[SingletonInstance.Count + 1];
SingletonInstance.Keys.CopyTo(Names, 0);
SingletonInstance.Values.CopyTo(NativeNames, 0);
for (var Index = 0; Index <= SingletonInstance.Count; Index++)
{
if (NativeNames[Index] == CultureNativeName)
{
return Names[Index];
}
}
throw (new KeyNotFoundException());
}
public static string get_CultureNativeName(string CultureName)
{
return SingletonInstance[CultureName];
}
public static List<string> CultureNativeNames
{
get
{
var ValueList = new List<string>();
foreach (var Value in SingletonInstance.Values)
{
ValueList.Add(Value);
}
return ValueList;
}
}
}
}

View File

@@ -1,410 +0,0 @@
using System;
using System.IO;
using System.Net;
using System.ComponentModel;
using System.Threading;
using System.Reflection;
using mRemoteNG.App.Info;
using mRemoteNG.Security.SymmetricEncryption;
using System.Security.Cryptography;
using mRemoteNG.Properties;
#if !PORTABLE
using mRemoteNG.Tools;
#else
using System.Windows.Forms;
#endif
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.App.Update
{
public class AppUpdater
{
private WebProxy _webProxy;
private Thread _getUpdateInfoThread;
private Thread _getChangeLogThread;
#region Public Properties
public UpdateInfo CurrentUpdateInfo { get; private set; }
public string ChangeLog { get; private set; }
public bool IsGetUpdateInfoRunning
{
get { return _getUpdateInfoThread != null && _getUpdateInfoThread.IsAlive; }
}
private bool IsGetChangeLogRunning
{
get { return _getChangeLogThread != null && _getChangeLogThread.IsAlive; }
}
public bool IsDownloadUpdateRunning
{
get { return _downloadUpdateWebClient != null; }
}
#endregion
#region Public Methods
public AppUpdater()
{
SetProxySettings();
}
private void SetProxySettings()
{
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, Runtime.EncryptionKey);
SetProxySettings(shouldWeUseProxy, proxyAddress, port, useAuthentication, username, password);
}
public void SetProxySettings(bool useProxy,
string address,
int port,
bool useAuthentication,
string username,
string password)
{
if (useProxy && !string.IsNullOrEmpty(address))
{
_webProxy = port != 0 ? new WebProxy(address, port) : new WebProxy(address);
_webProxy.Credentials = useAuthentication ? new NetworkCredential(username, password) : null;
}
else
{
_webProxy = null;
}
}
public bool IsUpdateAvailable()
{
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
{
return false;
}
return CurrentUpdateInfo.Version > GeneralAppInfo.GetApplicationVersion();
}
public void GetUpdateInfoAsync()
{
if (IsGetUpdateInfoRunning)
{
_getUpdateInfoThread.Abort();
}
_getUpdateInfoThread = new Thread(GetUpdateInfo);
_getUpdateInfoThread.SetApartmentState(ApartmentState.STA);
_getUpdateInfoThread.IsBackground = true;
_getUpdateInfoThread.Start();
}
public void GetChangeLogAsync()
{
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
{
throw new InvalidOperationException(
"CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling GetChangeLogAsync().");
}
if (IsGetChangeLogRunning)
{
_getChangeLogThread.Abort();
}
_getChangeLogThread = new Thread(GetChangeLog);
_getChangeLogThread.SetApartmentState(ApartmentState.STA);
_getChangeLogThread.IsBackground = true;
_getChangeLogThread.Start();
}
public void DownloadUpdateAsync()
{
if (_downloadUpdateWebClient != null)
{
throw new InvalidOperationException("A previous call to DownloadUpdateAsync() is still in progress.");
}
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
{
throw new InvalidOperationException(
"CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling DownloadUpdateAsync().");
}
#if !PORTABLE
CurrentUpdateInfo.UpdateFilePath =
Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), "msi"));
#else
var sfd = new SaveFileDialog
{
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
FileName = CurrentUpdateInfo.FileName,
RestoreDirectory = true
};
if (sfd.ShowDialog() == DialogResult.OK)
{
CurrentUpdateInfo.UpdateFilePath = sfd.FileName;
}
else
{
return;
}
#endif
DownloadUpdateWebClient.DownloadFileAsync(CurrentUpdateInfo.DownloadAddress,
CurrentUpdateInfo.UpdateFilePath);
}
#endregion
#region Private Properties
private WebClient _downloadUpdateWebClient;
private WebClient DownloadUpdateWebClient
{
get
{
if (_downloadUpdateWebClient != null)
{
return _downloadUpdateWebClient;
}
_downloadUpdateWebClient = CreateWebClient();
_downloadUpdateWebClient.DownloadProgressChanged += DownloadUpdateProgressChanged;
_downloadUpdateWebClient.DownloadFileCompleted += DownloadUpdateCompleted;
return _downloadUpdateWebClient;
}
}
#endregion
#region Private Methods
private WebClient CreateWebClient()
{
var webClient = new WebClient();
webClient.Headers.Add("user-agent", GeneralAppInfo.UserAgent);
webClient.Proxy = _webProxy;
return webClient;
}
private static DownloadStringCompletedEventArgs NewDownloadStringCompletedEventArgs(string result,
Exception exception,
bool cancelled,
object userToken)
{
var type = typeof(DownloadStringCompletedEventArgs);
const BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Instance;
Type[] argumentTypes = {typeof(string), typeof(Exception), typeof(bool), typeof(object)};
var constructor = type.GetConstructor(bindingFlags, null, argumentTypes, null);
object[] arguments = {result, exception, cancelled, userToken};
if (constructor == null)
return null;
return (DownloadStringCompletedEventArgs)constructor.Invoke(arguments);
}
private DownloadStringCompletedEventArgs DownloadString(Uri address)
{
var webClient = CreateWebClient();
var result = string.Empty;
Exception exception = null;
var cancelled = false;
try
{
result = webClient.DownloadString(address);
}
catch (ThreadAbortException)
{
cancelled = true;
}
catch (Exception ex)
{
exception = ex;
}
return NewDownloadStringCompletedEventArgs(result, exception, cancelled, null);
}
private void GetUpdateInfo()
{
var e = DownloadString(UpdateChannelInfo.GetUpdateChannelInfo());
if (!e.Cancelled && e.Error == null)
{
try
{
CurrentUpdateInfo = UpdateInfo.FromString(e.Result);
Settings.Default.CheckForUpdatesLastCheck = DateTime.UtcNow;
if (!Settings.Default.UpdatePending)
{
Settings.Default.UpdatePending = IsUpdateAvailable();
}
}
catch (Exception ex)
{
e = NewDownloadStringCompletedEventArgs(e.Result, ex, e.Cancelled, null);
}
}
GetUpdateInfoCompletedEventEvent?.Invoke(this, e);
}
private void GetChangeLog()
{
var e = DownloadString(CurrentUpdateInfo.ChangeLogAddress);
if (!e.Cancelled && e.Error == null)
{
ChangeLog = e.Result;
}
GetChangeLogCompletedEventEvent?.Invoke(this, e);
}
private void DownloadUpdateProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
DownloadUpdateProgressChangedEventEvent?.Invoke(sender, e);
}
private void DownloadUpdateCompleted(object sender, AsyncCompletedEventArgs e)
{
var raiseEventArgs = e;
if (!e.Cancelled && e.Error == null)
{
try
{
#if !PORTABLE
var updateAuthenticode = new Authenticode(CurrentUpdateInfo.UpdateFilePath)
{
RequireThumbprintMatch = true,
ThumbprintToMatch = CurrentUpdateInfo.CertificateThumbprint
};
if (updateAuthenticode.Verify() != Authenticode.StatusValue.Verified)
{
if (updateAuthenticode.Status == Authenticode.StatusValue.UnhandledException)
{
throw updateAuthenticode.Exception;
}
throw new Exception(updateAuthenticode.GetStatusMessage());
}
#endif
using (var cksum = SHA512.Create())
{
using (var stream = File.OpenRead(CurrentUpdateInfo.UpdateFilePath))
{
var hash = cksum.ComputeHash(stream);
var hashString = BitConverter.ToString(hash).Replace("-", "").ToUpperInvariant();
if (!hashString.Equals(CurrentUpdateInfo.Checksum))
throw new Exception("SHA512 Hashes didn't match!");
}
}
}
catch (Exception ex)
{
raiseEventArgs = new AsyncCompletedEventArgs(ex, false, null);
}
}
if (raiseEventArgs.Cancelled || raiseEventArgs.Error != null)
{
File.Delete(CurrentUpdateInfo.UpdateFilePath);
}
DownloadUpdateCompletedEventEvent?.Invoke(this, raiseEventArgs);
_downloadUpdateWebClient.Dispose();
_downloadUpdateWebClient = null;
}
#endregion
#region Events
private AsyncCompletedEventHandler GetUpdateInfoCompletedEventEvent;
public event AsyncCompletedEventHandler GetUpdateInfoCompletedEvent
{
add
{
GetUpdateInfoCompletedEventEvent =
(AsyncCompletedEventHandler)Delegate.Combine(GetUpdateInfoCompletedEventEvent, value);
}
remove
{
GetUpdateInfoCompletedEventEvent =
(AsyncCompletedEventHandler)Delegate.Remove(GetUpdateInfoCompletedEventEvent, value);
}
}
private AsyncCompletedEventHandler GetChangeLogCompletedEventEvent;
public event AsyncCompletedEventHandler GetChangeLogCompletedEvent
{
add
{
GetChangeLogCompletedEventEvent =
(AsyncCompletedEventHandler)Delegate.Combine(GetChangeLogCompletedEventEvent, value);
}
remove
{
GetChangeLogCompletedEventEvent =
(AsyncCompletedEventHandler)Delegate.Remove(GetChangeLogCompletedEventEvent, value);
}
}
private DownloadProgressChangedEventHandler DownloadUpdateProgressChangedEventEvent;
public event DownloadProgressChangedEventHandler DownloadUpdateProgressChangedEvent
{
add
{
DownloadUpdateProgressChangedEventEvent =
(DownloadProgressChangedEventHandler)Delegate.Combine(DownloadUpdateProgressChangedEventEvent,
value);
}
remove
{
DownloadUpdateProgressChangedEventEvent =
(DownloadProgressChangedEventHandler)Delegate.Remove(DownloadUpdateProgressChangedEventEvent,
value);
}
}
private AsyncCompletedEventHandler DownloadUpdateCompletedEventEvent;
public event AsyncCompletedEventHandler DownloadUpdateCompletedEvent
{
add
{
DownloadUpdateCompletedEventEvent =
(AsyncCompletedEventHandler)Delegate.Combine(DownloadUpdateCompletedEventEvent, value);
}
remove
{
DownloadUpdateCompletedEventEvent =
(AsyncCompletedEventHandler)Delegate.Remove(DownloadUpdateCompletedEventEvent, value);
}
}
#endregion
}
}

View File

@@ -1,100 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace mRemoteNG.App.Update
{
public class UpdateFile
{
#region Public Properties
// ReSharper disable MemberCanBePrivate.Local
// ReSharper disable once MemberCanBePrivate.Global
public Dictionary<string, string> Items { get; } =
new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
#endregion
#region Public Methods
public UpdateFile(string content)
{
FromString(content);
}
// ReSharper disable MemberCanBePrivate.Local
// ReSharper disable once MemberCanBePrivate.Global
public void FromString(string content)
{
if (string.IsNullOrEmpty(content)) return;
char[] keyValueSeparators = {':', '='};
char[] commentCharacters = {'#', ';', '\''};
// no separators means no valid update data...
if (content.Trim().IndexOfAny(keyValueSeparators) == -1) return;
using (var sr = new StringReader(content))
{
string line;
while ((line = sr.ReadLine()) != null)
{
var trimmedLine = line.Trim();
if (trimmedLine.Length == 0)
continue;
if (trimmedLine.Substring(0, 1).IndexOfAny(commentCharacters) != -1)
continue;
var parts = trimmedLine.Split(keyValueSeparators, 2);
if (parts.Length != 2)
continue;
// make sure we have valid data in both parts before adding to the collection. If either part is empty, then it's not valid data.
if (string.IsNullOrEmpty(parts[0].Trim()) || string.IsNullOrEmpty(parts[1].Trim()))
continue;
Items.Add(parts[0].Trim(), parts[1].Trim());
}
}
}
// ReSharper disable MemberCanBePrivate.Local
private string GetString(string key)
{
// ReSharper restore MemberCanBePrivate.Local
return !Items.ContainsKey(key) ? string.Empty : Items[key];
}
public Version GetVersion(string key = "Version")
{
var value = GetString(key);
return string.IsNullOrEmpty(value) ? null : new Version(value);
}
public Uri GetUri(string key)
{
var value = GetString(key);
return string.IsNullOrEmpty(value) ? null : new Uri(value);
}
public string GetThumbprint(string key = "CertificateThumbprint")
{
return GetString(key).Replace(" ", "").ToUpperInvariant();
}
public string GetFileName()
{
var value = GetString("dURL");
var sv = value.Split('/');
return sv[sv.Length - 1];
}
public string GetChecksum(string key = "Checksum")
{
return GetString(key).Replace(" ", "").ToUpperInvariant();
}
#endregion
}
}

View File

@@ -1,78 +0,0 @@
using System;
// ReSharper disable UnusedAutoPropertyAccessor.Local
namespace mRemoteNG.App.Update
{
public class UpdateInfo
{
public bool IsValid { get; private set; }
public Version Version { get; private set; }
public Uri DownloadAddress { get; private set; }
public string UpdateFilePath { get; set; }
public Uri ChangeLogAddress { get; private set; }
public Uri ImageAddress { get; private set; }
public Uri ImageLinkAddress { get; private set; }
#if !PORTABLE
public string CertificateThumbprint { get; private set; }
#endif
// ReSharper disable once MemberCanBePrivate.Global
public string FileName { get; set; }
public string Checksum { get; private set; }
public static UpdateInfo FromString(string input)
{
var newInfo = new UpdateInfo();
if (string.IsNullOrEmpty(input))
{
newInfo.IsValid = false;
}
else
{
var updateFile = new UpdateFile(input);
newInfo.Version = updateFile.GetVersion();
newInfo.DownloadAddress = updateFile.GetUri("dURL");
newInfo.ChangeLogAddress = updateFile.GetUri("clURL");
#if false
newInfo.ImageAddress = updateFile.GetUri("imgURL");
newInfo.ImageLinkAddress = updateFile.GetUri("imgURLLink");
#endif
#if !PORTABLE
newInfo.CertificateThumbprint = updateFile.GetThumbprint();
#endif
newInfo.FileName = updateFile.GetFileName();
newInfo.Checksum = updateFile.GetChecksum();
newInfo.IsValid = newInfo.CheckIfValid();
}
return newInfo;
}
public bool CheckIfValid()
{
if (string.IsNullOrEmpty(Version.ToString()))
return false;
if (string.IsNullOrEmpty(DownloadAddress.AbsoluteUri))
return false;
if (string.IsNullOrEmpty(ChangeLogAddress.AbsoluteUri))
return false;
#if false
if (string.IsNullOrEmpty(ImageAddress.AbsoluteUri))
return false;
if (string.IsNullOrEmpty(ImageLinkAddress.AbsoluteUri))
return false;
#endif
#if !PORTABLE
if (string.IsNullOrEmpty(CertificateThumbprint))
return false;
#endif
if (string.IsNullOrEmpty(FileName))
return false;
// ReSharper disable once ConvertIfStatementToReturnStatement
if (string.IsNullOrEmpty(Checksum))
return false;
return true;
}
}
}

View File

@@ -1,92 +0,0 @@
using System;
using mRemoteNG.UI;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.Window;
namespace mRemoteNG.App
{
public static class Windows
{
private static ActiveDirectoryImportWindow _adimportForm;
private static HelpWindow _helpForm;
private static ExternalToolsWindow _externalappsForm;
private static PortScanWindow _portscanForm;
private static ScreenshotManagerWindow _screenshotmanagerForm;
private static UltraVNCWindow _ultravncscForm;
private static ConnectionTreeWindow _treeForm;
internal static ConnectionTreeWindow TreeForm
{
get => _treeForm ?? (_treeForm = new ConnectionTreeWindow());
set => _treeForm = value;
}
internal static ConfigWindow ConfigForm { get; set; } = new ConfigWindow();
internal static ErrorAndInfoWindow ErrorsForm { get; set; } = new ErrorAndInfoWindow();
internal static ScreenshotManagerWindow ScreenshotForm { get; set; } = new ScreenshotManagerWindow();
private static UpdateWindow UpdateForm { get; set; } = new UpdateWindow();
internal static SSHTransferWindow SshtransferForm { get; private set; } = new SSHTransferWindow();
public static void Show(WindowType windowType)
{
try
{
var dockPanel = FrmMain.Default.pnlDock;
// ReSharper disable once SwitchStatementMissingSomeCases
switch (windowType)
{
case WindowType.ActiveDirectoryImport:
if (_adimportForm == null || _adimportForm.IsDisposed)
_adimportForm = new ActiveDirectoryImportWindow();
_adimportForm.Show(dockPanel);
break;
case WindowType.Options:
using (var optionsForm = new FrmOptions())
{
optionsForm.ShowDialog(dockPanel);
}
break;
case WindowType.SSHTransfer:
if (SshtransferForm == null || SshtransferForm.IsDisposed)
SshtransferForm = new SSHTransferWindow();
SshtransferForm.Show(dockPanel);
break;
case WindowType.Update:
if (UpdateForm == null || UpdateForm.IsDisposed)
UpdateForm = new UpdateWindow();
UpdateForm.Show(dockPanel);
break;
case WindowType.Help:
if (_helpForm == null || _helpForm.IsDisposed)
_helpForm = new HelpWindow();
_helpForm.Show(dockPanel);
break;
case WindowType.ExternalApps:
if (_externalappsForm == null || _externalappsForm.IsDisposed)
_externalappsForm = new ExternalToolsWindow();
_externalappsForm.Show(dockPanel);
break;
case WindowType.PortScan:
_portscanForm = new PortScanWindow();
_portscanForm.Show(dockPanel);
break;
case WindowType.ScreenshotManager:
_screenshotmanagerForm = new ScreenshotManagerWindow();
_screenshotmanagerForm.Show(dockPanel);
break;
case WindowType.UltraVNCSC:
if (_ultravncscForm == null || _ultravncscForm.IsDisposed)
_ultravncscForm = new UltraVNCWindow();
_ultravncscForm.Show(dockPanel);
break;
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace("App.Runtime.Windows.Show() failed.", ex);
}
}
}
}

View File

@@ -1,11 +0,0 @@
namespace mRemoteNG.Config
{
public enum ConfirmCloseEnum
{
Unspecified = 0,
Never = 1,
Exit = 2,
Multiple = 3,
All = 4
}
}

View File

@@ -1,59 +0,0 @@
using System;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
namespace mRemoteNG.Config.Connections
{
public class ConnectionsLoadedEventArgs : EventArgs
{
/// <summary>
/// The previous <see cref="ConnectionTreeModel"/> that is being
/// unloaded.
/// </summary>
public Optional<ConnectionTreeModel> PreviousConnectionTreeModel { get; }
/// <summary>
/// True if the previous <see cref="ConnectionTreeModel"/> was loaded from
/// a database.
/// </summary>
public bool PreviousSourceWasDatabase { get; }
/// <summary>
/// The new <see cref="ConnectionTreeModel"/> that is being loaded.
/// </summary>
public ConnectionTreeModel NewConnectionTreeModel { get; }
/// <summary>
/// True if the new <see cref="ConnectionTreeModel"/> was loaded from
/// a database.
/// </summary>
public bool NewSourceIsDatabase { get; }
/// <summary>
/// The path to the new connections source.
/// If <see cref="NewSourceIsDatabase"/> is True, this will be the server and database name.
/// If False, it will be a file path to the connection file.
/// </summary>
public string NewSourcePath { get; }
public ConnectionsLoadedEventArgs(Optional<ConnectionTreeModel> previousTreeModelModel,
ConnectionTreeModel newTreeModelModel,
bool previousSourceWasDatabase,
bool newSourceIsDatabase,
string newSourcePath)
{
if (previousTreeModelModel == null)
throw new ArgumentNullException(nameof(previousTreeModelModel));
if (newTreeModelModel == null)
throw new ArgumentNullException(nameof(newTreeModelModel));
if (newSourcePath == null)
throw new ArgumentNullException(nameof(newSourcePath));
PreviousConnectionTreeModel = previousTreeModelModel;
PreviousSourceWasDatabase = previousSourceWasDatabase;
NewConnectionTreeModel = newTreeModelModel;
NewSourceIsDatabase = newSourceIsDatabase;
NewSourcePath = newSourcePath;
}
}
}

View File

@@ -1,27 +0,0 @@
using System;
using mRemoteNG.Tree;
namespace mRemoteNG.Config.Connections
{
public class ConnectionsSavedEventArgs
{
public ConnectionTreeModel ModelThatWasSaved { get; }
public bool PreviouslyUsingDatabase { get; }
public bool UsingDatabase { get; }
public string ConnectionFileName { get; }
public ConnectionsSavedEventArgs(ConnectionTreeModel modelThatWasSaved,
bool previouslyUsingDatabase,
bool usingDatabase,
string connectionFileName)
{
if (modelThatWasSaved == null)
throw new ArgumentNullException(nameof(modelThatWasSaved));
ModelThatWasSaved = modelThatWasSaved;
PreviouslyUsingDatabase = previouslyUsingDatabase;
UsingDatabase = usingDatabase;
ConnectionFileName = connectionFileName;
}
}
}

View File

@@ -1,35 +0,0 @@
using System;
using mRemoteNG.App;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers.ConnectionSerializers.Csv;
using mRemoteNG.Security;
using mRemoteNG.Tree;
namespace mRemoteNG.Config.Connections
{
public class CsvConnectionsSaver : ISaver<ConnectionTreeModel>
{
private readonly string _connectionFileName;
private readonly SaveFilter _saveFilter;
public CsvConnectionsSaver(string connectionFileName, SaveFilter saveFilter)
{
if (string.IsNullOrEmpty(connectionFileName))
throw new ArgumentException($"Argument '{nameof(connectionFileName)}' cannot be null or empty");
if (saveFilter == null)
throw new ArgumentNullException(nameof(saveFilter));
_connectionFileName = connectionFileName;
_saveFilter = saveFilter;
}
public void Save(ConnectionTreeModel connectionTreeModel, string propertyNameTrigger = "")
{
var csvConnectionsSerializer =
new CsvConnectionsSerializerMremotengFormat(_saveFilter, Runtime.CredentialProviderCatalog);
var dataProvider = new FileDataProvider(_connectionFileName);
var csvContent = csvConnectionsSerializer.Serialize(connectionTreeModel);
dataProvider.Save(csvContent);
}
}
}

View File

@@ -1,9 +0,0 @@
using mRemoteNG.Tree;
namespace mRemoteNG.Config.Connections
{
public interface IConnectionsLoader
{
ConnectionTreeModel Load();
}
}

View File

@@ -1,23 +0,0 @@
using System;
using mRemoteNG.Config.DatabaseConnectors;
namespace mRemoteNG.Config.Connections.Multiuser
{
public delegate void
ConnectionsUpdateAvailableEventHandler(object sender, ConnectionsUpdateAvailableEventArgs args);
public class ConnectionsUpdateAvailableEventArgs : EventArgs
{
public IDatabaseConnector DatabaseConnector { get; private set; }
public DateTime UpdateTime { get; private set; }
public bool Handled { get; set; }
public ConnectionsUpdateAvailableEventArgs(IDatabaseConnector databaseConnector, DateTime updateTime)
{
if (databaseConnector == null)
throw new ArgumentNullException(nameof(databaseConnector));
DatabaseConnector = databaseConnector;
UpdateTime = updateTime;
}
}
}

View File

@@ -1,11 +0,0 @@
using System;
namespace mRemoteNG.Config.Connections.Multiuser
{
public delegate void UpdateCheckFinishedEventHandler(object sender, ConnectionsUpdateCheckFinishedEventArgs args);
public class ConnectionsUpdateCheckFinishedEventArgs : EventArgs
{
public bool UpdateAvailable { get; set; }
}
}

View File

@@ -1,15 +0,0 @@
using System;
namespace mRemoteNG.Config.Connections.Multiuser
{
public interface IConnectionsUpdateChecker : IDisposable
{
bool IsUpdateAvailable();
void IsUpdateAvailableAsync();
event EventHandler UpdateCheckStarted;
event UpdateCheckFinishedEventHandler UpdateCheckFinished;
event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
}
}

View File

@@ -1,93 +0,0 @@
using mRemoteNG.App;
using System;
using System.Timers;
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.Config.Connections.Multiuser
{
public class RemoteConnectionsSyncronizer : IConnectionsUpdateChecker
{
private readonly Timer _updateTimer;
private readonly IConnectionsUpdateChecker _updateChecker;
public double TimerIntervalInMilliseconds
{
get { return _updateTimer.Interval; }
}
public RemoteConnectionsSyncronizer(IConnectionsUpdateChecker updateChecker)
{
_updateChecker = updateChecker;
_updateTimer = new Timer(3000);
SetEventListeners();
}
private void SetEventListeners()
{
_updateChecker.UpdateCheckStarted += OnUpdateCheckStarted;
_updateChecker.UpdateCheckFinished += OnUpdateCheckFinished;
_updateChecker.ConnectionsUpdateAvailable +=
(sender, args) => ConnectionsUpdateAvailable?.Invoke(sender, args);
_updateTimer.Elapsed += (sender, args) => _updateChecker.IsUpdateAvailableAsync();
ConnectionsUpdateAvailable += Load;
}
private void Load(object sender, ConnectionsUpdateAvailableEventArgs args)
{
Runtime.ConnectionsService.LoadConnections(true, false, "");
args.Handled = true;
}
public void Enable()
{
_updateTimer.Start();
}
public void Disable()
{
_updateTimer.Stop();
}
public bool IsUpdateAvailable()
{
return _updateChecker.IsUpdateAvailable();
}
public void IsUpdateAvailableAsync()
{
_updateChecker.IsUpdateAvailableAsync();
}
private void OnUpdateCheckStarted(object sender, EventArgs eventArgs)
{
_updateTimer.Stop();
UpdateCheckStarted?.Invoke(sender, eventArgs);
}
private void OnUpdateCheckFinished(object sender, ConnectionsUpdateCheckFinishedEventArgs eventArgs)
{
_updateTimer.Start();
UpdateCheckFinished?.Invoke(sender, eventArgs);
}
public event EventHandler UpdateCheckStarted;
public event UpdateCheckFinishedEventHandler UpdateCheckFinished;
public event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool itIsSafeToAlsoFreeManagedObjects)
{
if (!itIsSafeToAlsoFreeManagedObjects) return;
_updateTimer.Dispose();
_updateChecker.Dispose();
}
}
}

View File

@@ -1,133 +0,0 @@
using System;
using System.Data;
using System.Data.Common;
using System.Threading;
using mRemoteNG.App;
using mRemoteNG.Config.DatabaseConnectors;
using mRemoteNG.Messages;
namespace mRemoteNG.Config.Connections.Multiuser
{
public class SqlConnectionsUpdateChecker : IConnectionsUpdateChecker
{
private readonly IDatabaseConnector _dbConnector;
private readonly DbCommand _dbQuery;
private DateTime LastUpdateTime => Runtime.ConnectionsService.LastSqlUpdate;
private DateTime _lastDatabaseUpdateTime;
public SqlConnectionsUpdateChecker()
{
_dbConnector = DatabaseConnectorFactory.DatabaseConnectorFromSettings();
_dbQuery = _dbConnector.DbCommand("SELECT * FROM tblUpdate");
_lastDatabaseUpdateTime = default(DateTime);
}
public bool IsUpdateAvailable()
{
RaiseUpdateCheckStartedEvent();
ConnectToSqlDb();
var updateIsAvailable = DatabaseIsMoreUpToDateThanUs();
if (updateIsAvailable)
RaiseConnectionsUpdateAvailableEvent();
RaiseUpdateCheckFinishedEvent(updateIsAvailable);
return updateIsAvailable;
}
public void IsUpdateAvailableAsync()
{
var thread = new Thread(() => IsUpdateAvailable());
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
}
private void ConnectToSqlDb()
{
try
{
_dbConnector.Connect();
}
catch (Exception e)
{
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
"Unable to connect to Sql DB to check for updates." +
Environment.NewLine + e.Message, true);
}
}
private bool DatabaseIsMoreUpToDateThanUs()
{
var lastUpdateInDb = GetLastUpdateTimeFromDbResponse();
var amTheLastoneUpdated = CheckIfIAmTheLastOneUpdated(lastUpdateInDb);
return (lastUpdateInDb > LastUpdateTime && !amTheLastoneUpdated);
}
private bool CheckIfIAmTheLastOneUpdated(DateTime lastUpdateInDb)
{
DateTime lastSqlUpdateWithoutMilliseconds =
new DateTime(LastUpdateTime.Ticks - (LastUpdateTime.Ticks % TimeSpan.TicksPerSecond),
LastUpdateTime.Kind);
return lastUpdateInDb == lastSqlUpdateWithoutMilliseconds;
}
private DateTime GetLastUpdateTimeFromDbResponse()
{
var lastUpdateInDb = default(DateTime);
try
{
var sqlReader = _dbQuery.ExecuteReader(CommandBehavior.CloseConnection);
sqlReader.Read();
if (sqlReader.HasRows)
lastUpdateInDb = Convert.ToDateTime(sqlReader["LastUpdate"]);
sqlReader.Close();
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
"Error executing Sql query to get updates from the DB." +
Environment.NewLine + ex.Message, true);
}
_lastDatabaseUpdateTime = lastUpdateInDb;
return lastUpdateInDb;
}
public event EventHandler UpdateCheckStarted;
private void RaiseUpdateCheckStartedEvent()
{
UpdateCheckStarted?.Invoke(this, EventArgs.Empty);
}
public event UpdateCheckFinishedEventHandler UpdateCheckFinished;
private void RaiseUpdateCheckFinishedEvent(bool updateAvailable)
{
var args = new ConnectionsUpdateCheckFinishedEventArgs {UpdateAvailable = updateAvailable};
UpdateCheckFinished?.Invoke(this, args);
}
public event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
private void RaiseConnectionsUpdateAvailableEvent()
{
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Remote connection update is available");
var args = new ConnectionsUpdateAvailableEventArgs(_dbConnector, _lastDatabaseUpdateTime);
ConnectionsUpdateAvailable?.Invoke(this, args);
}
public void Dispose()
{
Dispose(true);
}
private void Dispose(bool itIsSafeToDisposeManagedObjects)
{
if (!itIsSafeToDisposeManagedObjects) return;
_dbConnector.Disconnect();
_dbConnector.Dispose();
_dbQuery.Dispose();
}
}
}

View File

@@ -1,59 +0,0 @@
using System;
using System.Collections.Specialized;
using System.ComponentModel;
using mRemoteNG.Connection;
using mRemoteNG.UI.Forms;
namespace mRemoteNG.Config.Connections
{
public class SaveConnectionsOnEdit
{
private readonly ConnectionsService _connectionsService;
public SaveConnectionsOnEdit(ConnectionsService connectionsService)
{
if (connectionsService == null)
throw new ArgumentNullException(nameof(connectionsService));
_connectionsService = connectionsService;
connectionsService.ConnectionsLoaded += ConnectionsServiceOnConnectionsLoaded;
}
private void ConnectionsServiceOnConnectionsLoaded(object sender,
ConnectionsLoadedEventArgs connectionsLoadedEventArgs)
{
connectionsLoadedEventArgs.NewConnectionTreeModel.CollectionChanged +=
ConnectionTreeModelOnCollectionChanged;
connectionsLoadedEventArgs.NewConnectionTreeModel.PropertyChanged += ConnectionTreeModelOnPropertyChanged;
foreach (var oldTree in connectionsLoadedEventArgs.PreviousConnectionTreeModel)
{
oldTree.CollectionChanged -= ConnectionTreeModelOnCollectionChanged;
oldTree.PropertyChanged -= ConnectionTreeModelOnPropertyChanged;
}
}
private void ConnectionTreeModelOnPropertyChanged(object sender,
PropertyChangedEventArgs propertyChangedEventArgs)
{
SaveConnectionOnEdit(propertyChangedEventArgs.PropertyName);
}
private void ConnectionTreeModelOnCollectionChanged(object sender,
NotifyCollectionChangedEventArgs
notifyCollectionChangedEventArgs)
{
SaveConnectionOnEdit();
}
private void SaveConnectionOnEdit(string propertyName = "")
{
if (!Properties.Settings.Default.SaveConnectionsAfterEveryEdit)
return;
if (FrmMain.Default.IsClosing)
return;
_connectionsService.SaveConnectionsAsync(propertyName);
}
}
}

View File

@@ -1,10 +0,0 @@
namespace mRemoteNG.Config.Connections
{
public enum SaveFormat
{
None,
mRXML,
mRCSV,
SQL
}
}

View File

@@ -1,102 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using mRemoteNG.Config.DatabaseConnectors;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql;
using mRemoteNG.Config.Serializers.Versioning;
using mRemoteNG.Container;
using mRemoteNG.Security;
using mRemoteNG.Security.Authentication;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
namespace mRemoteNG.Config.Connections
{
public class SqlConnectionsLoader : IConnectionsLoader
{
private readonly IDeserializer<string, IEnumerable<LocalConnectionPropertiesModel>>
_localConnectionPropertiesDeserializer;
private readonly IDataProvider<string> _dataProvider;
public Func<Optional<SecureString>> AuthenticationRequestor { get; set; } =
() => MiscTools.PasswordDialog("", false);
public SqlConnectionsLoader(
IDeserializer<string, IEnumerable<LocalConnectionPropertiesModel>> localConnectionPropertiesDeserializer,
IDataProvider<string> dataProvider)
{
_localConnectionPropertiesDeserializer =
localConnectionPropertiesDeserializer.ThrowIfNull(nameof(localConnectionPropertiesDeserializer));
_dataProvider = dataProvider.ThrowIfNull(nameof(dataProvider));
}
public ConnectionTreeModel Load()
{
var connector = DatabaseConnectorFactory.DatabaseConnectorFromSettings();
var dataProvider = new SqlDataProvider(connector);
var metaDataRetriever = new SqlDatabaseMetaDataRetriever();
var databaseVersionVerifier = new SqlDatabaseVersionVerifier(connector);
var cryptoProvider = new LegacyRijndaelCryptographyProvider();
var metaData = metaDataRetriever.GetDatabaseMetaData(connector) ??
HandleFirstRun(metaDataRetriever, connector);
var decryptionKey = GetDecryptionKey(metaData);
if (!decryptionKey.Any())
throw new Exception("Could not load SQL connections");
databaseVersionVerifier.VerifyDatabaseVersion(metaData.ConfVersion);
var dataTable = dataProvider.Load();
var deserializer = new DataTableDeserializer(cryptoProvider, decryptionKey.First());
var connectionTree = deserializer.Deserialize(dataTable);
ApplyLocalConnectionProperties(connectionTree.RootNodes.First(i => i is RootNodeInfo));
return connectionTree;
}
private Optional<SecureString> GetDecryptionKey(SqlConnectionListMetaData metaData)
{
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
var cipherText = metaData.Protected;
var authenticator = new PasswordAuthenticator(cryptographyProvider, cipherText, AuthenticationRequestor);
var authenticated =
authenticator.Authenticate(new RootNodeInfo(RootNodeType.Connection).DefaultPassword
.ConvertToSecureString());
if (authenticated)
return authenticator.LastAuthenticatedPassword;
return Optional<SecureString>.Empty;
}
private void ApplyLocalConnectionProperties(ContainerInfo rootNode)
{
var localPropertiesXml = _dataProvider.Load();
var localConnectionProperties = _localConnectionPropertiesDeserializer.Deserialize(localPropertiesXml);
rootNode
.GetRecursiveChildList()
.Join(localConnectionProperties,
con => con.ConstantID,
locals => locals.ConnectionId,
(con, locals) => new {Connection = con, LocalProperties = locals})
.ForEach(x =>
{
x.Connection.PleaseConnect = x.LocalProperties.Connected;
x.Connection.Favorite = x.LocalProperties.Favorite;
if (x.Connection is ContainerInfo container)
container.IsExpanded = x.LocalProperties.Expanded;
});
}
private SqlConnectionListMetaData HandleFirstRun(SqlDatabaseMetaDataRetriever metaDataRetriever, IDatabaseConnector connector)
{
metaDataRetriever.WriteDatabaseMetaData(new RootNodeInfo(RootNodeType.Connection), connector);
return metaDataRetriever.GetDatabaseMetaData(connector);
}
}
}

View File

@@ -1,184 +0,0 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using mRemoteNG.App;
using mRemoteNG.App.Info;
using mRemoteNG.Config.DatabaseConnectors;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql;
using mRemoteNG.Config.Serializers.Versioning;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Messages;
using mRemoteNG.Resources.Language;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
namespace mRemoteNG.Config.Connections
{
public class SqlConnectionsSaver : ISaver<ConnectionTreeModel>
{
private readonly SaveFilter _saveFilter;
private readonly ISerializer<IEnumerable<LocalConnectionPropertiesModel>, string> _localPropertiesSerializer;
private readonly IDataProvider<string> _dataProvider;
public SqlConnectionsSaver(SaveFilter saveFilter,
ISerializer<IEnumerable<LocalConnectionPropertiesModel>, string>
localPropertieSerializer,
IDataProvider<string> localPropertiesDataProvider)
{
if (saveFilter == null)
throw new ArgumentNullException(nameof(saveFilter));
_saveFilter = saveFilter;
_localPropertiesSerializer = localPropertieSerializer.ThrowIfNull(nameof(localPropertieSerializer));
_dataProvider = localPropertiesDataProvider.ThrowIfNull(nameof(localPropertiesDataProvider));
}
public void Save(ConnectionTreeModel connectionTreeModel, string propertyNameTrigger = "")
{
var rootTreeNode = connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First();
UpdateLocalConnectionProperties(rootTreeNode);
if (PropertyIsLocalOnly(propertyNameTrigger))
{
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
$"Property {propertyNameTrigger} is local only. Not saving to database.");
return;
}
if (SqlUserIsReadOnly())
{
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
"Trying to save connection tree but the SQL read only checkbox is checked, aborting!");
return;
}
using (var dbConnector = DatabaseConnectorFactory.DatabaseConnectorFromSettings())
{
dbConnector.Connect();
var databaseVersionVerifier = new SqlDatabaseVersionVerifier(dbConnector);
var metaDataRetriever = new SqlDatabaseMetaDataRetriever();
var metaData = metaDataRetriever.GetDatabaseMetaData(dbConnector);
if (!databaseVersionVerifier.VerifyDatabaseVersion(metaData.ConfVersion))
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
Language.ErrorConnectionListSaveFailed);
return;
}
metaDataRetriever.WriteDatabaseMetaData(rootTreeNode, dbConnector);
UpdateConnectionsTable(rootTreeNode, dbConnector);
UpdateUpdatesTable(dbConnector);
}
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Saved connections to database");
}
/// <summary>
/// Determines if a given property name should be only saved
/// locally.
/// </summary>
/// <param name="property">
/// The name of the property that triggered the save event
/// </param>
/// <returns></returns>
private bool PropertyIsLocalOnly(string property)
{
return property == nameof(ConnectionInfo.OpenConnections) ||
property == nameof(ContainerInfo.IsExpanded) ||
property == nameof(ContainerInfo.Favorite);
}
private void UpdateLocalConnectionProperties(ContainerInfo rootNode)
{
var a = rootNode.GetRecursiveChildList().Select(info => new LocalConnectionPropertiesModel
{
ConnectionId = info.ConstantID,
Connected = info.OpenConnections.Count > 0,
Expanded = info is ContainerInfo c && c.IsExpanded,
Favorite = info.Favorite,
});
var serializedProperties = _localPropertiesSerializer.Serialize(a);
_dataProvider.Save(serializedProperties);
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Saved local connection properties");
}
private void UpdateRootNodeTable(RootNodeInfo rootTreeNode, IDatabaseConnector databaseConnector)
{
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
string strProtected;
if (rootTreeNode != null)
{
if (rootTreeNode.Password)
{
var password = rootTreeNode.PasswordString.ConvertToSecureString();
strProtected = cryptographyProvider.Encrypt("ThisIsProtected", password);
}
else
{
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", Runtime.EncryptionKey);
}
}
else
{
strProtected = cryptographyProvider.Encrypt("ThisIsNotProtected", Runtime.EncryptionKey);
}
var dbQuery = databaseConnector.DbCommand("DELETE FROM tblRoot");
dbQuery.ExecuteNonQuery();
if (rootTreeNode != null)
{
dbQuery =
databaseConnector.DbCommand(
"INSERT INTO tblRoot (Name, Export, Protected, ConfVersion) VALUES(\'" +
MiscTools.PrepareValueForDB(rootTreeNode.Name) + "\', 0, \'" + strProtected + "\'," +
ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture) + ")");
dbQuery.ExecuteNonQuery();
}
else
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
$"UpdateRootNodeTable: rootTreeNode was null. Could not insert!");
}
}
private void UpdateConnectionsTable(RootNodeInfo rootTreeNode, IDatabaseConnector databaseConnector)
{
var dataProvider = new SqlDataProvider(databaseConnector);
var currentDataTable = dataProvider.Load();
var cryptoProvider = new LegacyRijndaelCryptographyProvider();
var serializer = new DataTableSerializer(_saveFilter, cryptoProvider,
rootTreeNode.PasswordString.ConvertToSecureString());
serializer.SetSourceDataTable(currentDataTable);
var dataTable = serializer.Serialize(rootTreeNode);
//var dbQuery = databaseConnector.DbCommand("DELETE FROM tblCons");
//dbQuery.ExecuteNonQuery();
dataProvider.Save(dataTable);
}
private void UpdateUpdatesTable(IDatabaseConnector databaseConnector)
{
var dbQuery = databaseConnector.DbCommand("DELETE FROM tblUpdate");
dbQuery.ExecuteNonQuery();
dbQuery = databaseConnector.DbCommand("INSERT INTO tblUpdate (LastUpdate) VALUES(\'" + MiscTools.DBDate(DateTime.Now) + "\')");
dbQuery.ExecuteNonQuery();
}
private bool SqlUserIsReadOnly()
{
return Properties.Settings.Default.SQLReadOnly;
}
}
}

View File

@@ -1,40 +0,0 @@
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using System;
using System.IO;
using System.Security;
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
namespace mRemoteNG.Config.Connections
{
public class XmlConnectionsLoader : IConnectionsLoader
{
private readonly string _connectionFilePath;
public XmlConnectionsLoader(string connectionFilePath)
{
if (string.IsNullOrEmpty(connectionFilePath))
throw new ArgumentException($"{nameof(connectionFilePath)} cannot be null or empty");
if (!File.Exists(connectionFilePath))
throw new FileNotFoundException($"{connectionFilePath} does not exist");
_connectionFilePath = connectionFilePath;
}
public ConnectionTreeModel Load()
{
var dataProvider = new FileDataProvider(_connectionFilePath);
var xmlString = dataProvider.Load();
var deserializer = new XmlConnectionsDeserializer(PromptForPassword);
return deserializer.Deserialize(xmlString);
}
private Optional<SecureString> PromptForPassword()
{
var password = MiscTools.PasswordDialog(Path.GetFileName(_connectionFilePath), false);
return password;
}
}
}

View File

@@ -1,54 +0,0 @@
using System;
using System.Linq;
using mRemoteNG.App;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
namespace mRemoteNG.Config.Connections
{
public class XmlConnectionsSaver : ISaver<ConnectionTreeModel>
{
private readonly string _connectionFileName;
private readonly SaveFilter _saveFilter;
public XmlConnectionsSaver(string connectionFileName, SaveFilter saveFilter)
{
if (string.IsNullOrEmpty(connectionFileName))
throw new ArgumentException($"Argument '{nameof(connectionFileName)}' cannot be null or empty");
if (saveFilter == null)
throw new ArgumentNullException(nameof(saveFilter));
_connectionFileName = connectionFileName;
_saveFilter = saveFilter;
}
public void Save(ConnectionTreeModel connectionTreeModel, string propertyNameTrigger = "")
{
try
{
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
var serializerFactory = new XmlConnectionSerializerFactory();
var xmlConnectionsSerializer = serializerFactory.Build(
cryptographyProvider,
connectionTreeModel,
_saveFilter,
Properties.Settings.Default.EncryptCompleteConnectionsFile);
var rootNode = connectionTreeModel.RootNodes.OfType<RootNodeInfo>().First();
var xml = xmlConnectionsSerializer.Serialize(rootNode);
var fileDataProvider = new FileDataProviderWithRollingBackup(_connectionFileName);
fileDataProvider.Save(xml);
}
catch (Exception ex)
{
Runtime.MessageCollector?.AddExceptionStackTrace("SaveToXml failed", ex);
}
}
}
}

View File

@@ -1,75 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Xml.Linq;
using mRemoteNG.Credential;
using mRemoteNG.Security;
using mRemoteNG.Security.Factories;
namespace mRemoteNG.Config
{
public class CredentialHarvester
{
private readonly IEqualityComparer<ICredentialRecord> _credentialComparer = new CredentialDomainUserComparer();
// maps a connectioninfo (by its id) to the credential object that was harvested
public Dictionary<Guid, ICredentialRecord> ConnectionToCredentialMap { get; } =
new Dictionary<Guid, ICredentialRecord>();
public IEnumerable<ICredentialRecord> Harvest(XDocument xDocument, SecureString decryptionKey)
{
if (xDocument == null)
throw new ArgumentNullException(nameof(xDocument));
var cryptoProvider = new CryptoProviderFactoryFromXml(xDocument.Root).Build();
foreach (var element in xDocument.Descendants("Node"))
{
if (!EntryHasSomeCredentialData(element)) continue;
var newCredential = BuildCredential(element, cryptoProvider, decryptionKey);
Guid connectionId;
Guid.TryParse(element.Attribute("Id")?.Value, out connectionId);
if (connectionId == Guid.Empty)
{
//error
}
if (ConnectionToCredentialMap.Values.Contains(newCredential, _credentialComparer))
{
var existingCredential =
ConnectionToCredentialMap.Values.First(record =>
_credentialComparer.Equals(newCredential, record));
ConnectionToCredentialMap.Add(connectionId, existingCredential);
}
else
ConnectionToCredentialMap.Add(connectionId, newCredential);
}
return ConnectionToCredentialMap.Values.Distinct(_credentialComparer);
}
private ICredentialRecord BuildCredential(XElement element,
ICryptographyProvider cryptographyProvider,
SecureString decryptionKey)
{
var credential = new CredentialRecord
{
Title = $"{element.Attribute("Username")?.Value}\\{element.Attribute("Domain")?.Value}",
Username = element.Attribute("Username")?.Value,
Domain = element.Attribute("Domain")?.Value,
Password = cryptographyProvider.Decrypt(element.Attribute("Password")?.Value, decryptionKey)
.ConvertToSecureString()
};
return credential;
}
private static bool EntryHasSomeCredentialData(XElement e)
{
return e.Attribute("Username")?.Value != "" ||
e.Attribute("Domain")?.Value != "" ||
e.Attribute("Password")?.Value != "";
}
}
}

View File

@@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Security;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Credential;
namespace mRemoteNG.Config
{
public class CredentialRecordLoader
{
private readonly IDataProvider<string> _dataProvider;
private readonly ISecureDeserializer<string, IEnumerable<ICredentialRecord>> _deserializer;
public CredentialRecordLoader(IDataProvider<string> dataProvider,
ISecureDeserializer<string, IEnumerable<ICredentialRecord>> deserializer)
{
if (dataProvider == null)
throw new ArgumentNullException(nameof(dataProvider));
if (deserializer == null)
throw new ArgumentNullException(nameof(deserializer));
_dataProvider = dataProvider;
_deserializer = deserializer;
}
public IEnumerable<ICredentialRecord> Load(SecureString key)
{
var serializedCredentials = _dataProvider.Load();
return _deserializer.Deserialize(serializedCredentials, key);
}
}
}

View File

@@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Security;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Credential;
namespace mRemoteNG.Config
{
public class CredentialRecordSaver
{
private readonly IDataProvider<string> _dataProvider;
private readonly ISecureSerializer<IEnumerable<ICredentialRecord>, string> _serializer;
public CredentialRecordSaver(IDataProvider<string> dataProvider,
ISecureSerializer<IEnumerable<ICredentialRecord>, string> serializer)
{
if (dataProvider == null)
throw new ArgumentNullException(nameof(dataProvider));
if (serializer == null)
throw new ArgumentNullException(nameof(serializer));
_dataProvider = dataProvider;
_serializer = serializer;
}
public void Save(IEnumerable<ICredentialRecord> credentialRecords, SecureString key)
{
var serializedCredentials = _serializer.Serialize(credentialRecords, key);
_dataProvider.Save(serializedCredentials);
}
}
}

View File

@@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers.CredentialProviderSerializer;
using mRemoteNG.Credential;
namespace mRemoteNG.Config
{
public class CredentialRepositoryListLoader : ILoader<IEnumerable<ICredentialRepository>>
{
private readonly IDataProvider<string> _dataProvider;
private readonly CredentialRepositoryListDeserializer _deserializer;
public CredentialRepositoryListLoader(IDataProvider<string> dataProvider,
CredentialRepositoryListDeserializer deserializer)
{
if (dataProvider == null)
throw new ArgumentNullException(nameof(dataProvider));
if (deserializer == null)
throw new ArgumentNullException(nameof(deserializer));
_dataProvider = dataProvider;
_deserializer = deserializer;
}
public IEnumerable<ICredentialRepository> Load()
{
var data = _dataProvider.Load();
return _deserializer.Deserialize(data);
}
}
}

View File

@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers.CredentialProviderSerializer;
using mRemoteNG.Credential;
namespace mRemoteNG.Config
{
public class CredentialRepositoryListSaver : ISaver<IEnumerable<ICredentialRepository>>
{
private readonly IDataProvider<string> _dataProvider;
public CredentialRepositoryListSaver(IDataProvider<string> dataProvider)
{
if (dataProvider == null)
throw new ArgumentNullException(nameof(dataProvider));
_dataProvider = dataProvider;
}
public void Save(IEnumerable<ICredentialRepository> repositories, string propertyNameTrigger = "")
{
var serializer = new CredentialRepositoryListSerializer();
var data = serializer.Serialize(repositories);
_dataProvider.Save(data);
}
}
}

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