Skip to content

Commit f6150a5

Browse files
mamoreau-devolutionsawakecoding
authored andcommitted
add vmconnectex application launcher
1 parent 54e8a3a commit f6150a5

11 files changed

Lines changed: 54 additions & 1 deletion

File tree

.github/workflows/build-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
cmake -G "Visual Studio 17 2022" -A $MsvcArch -DWITH_DOTNET=OFF -B $BuildDir
156156
cmake --build $BuildDir --config Release
157157
New-Item -ItemType Directory -Path "dependencies/MsRdpEx/$Arch" | Out-Null
158-
@('MsRdpEx.dll','MsRdpEx.pdb','mstscex.exe','msrdcex.exe') | % {
158+
@('MsRdpEx.dll','MsRdpEx.pdb','mstscex.exe','msrdcex.exe', 'vmconnectex.exe') | % {
159159
Copy-Item "$BuildDir/Release/$_" "dependencies/MsRdpEx/$Arch"
160160
}
161161
Compress-Archive "dependencies\MsRdpEx\$Arch\*.pdb" ".\symbols\MsRdpEx-$PackageVersion-$Arch.symbols.zip" -CompressionLevel Optimal

dll/Paths.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ static char g_DEFAULT_RDP_PATH[MSRDPEX_MAX_PATH] = { 0 };
2525

2626
static char g_XMF_DLL_PATH[MSRDPEX_MAX_PATH] = { 0 };
2727

28+
static char g_VMCONNECT_EXE_PATH[MSRDPEX_MAX_PATH] = { 0 };
29+
2830
bool MsRdpEx_PathCchRenameExtension(char* pszPath, size_t cchPath, const char* pszExt)
2931
{
3032
size_t length = strlen(pszPath);
@@ -273,6 +275,10 @@ bool MsRdpEx_InitPaths(uint32_t pathIds)
273275
}
274276
}
275277

278+
if (pathIds & MSRDPEX_VMCONNECT_EXE_PATH) {
279+
MsRdpEx_ExpandEnvironmentStrings("%SystemRoot%\\System32\\vmconnect.exe", g_VMCONNECT_EXE_PATH, MSRDPEX_MAX_PATH);
280+
}
281+
276282
return true;
277283
}
278284

@@ -333,6 +339,10 @@ const char* MsRdpEx_GetPath(uint32_t pathId)
333339
case MSRDPEX_XMF_DLL_PATH:
334340
path = (const char*) g_XMF_DLL_PATH;
335341
break;
342+
343+
case MSRDPEX_VMCONNECT_EXE_PATH:
344+
path = (const char*) g_VMCONNECT_EXE_PATH;
345+
break;
336346
}
337347

338348
return path;

dll/RdpProcess.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ class CMsRdpExProcess : public IMsRdpExProcess
327327
else if (MsRdpEx_StringIEquals(appName, "msrdc") || MsRdpEx_StringIEquals(appName, "msrdc.exe")) {
328328
appPathId = MSRDPEX_MSRDC_EXE_PATH;
329329
}
330+
else if (MsRdpEx_StringIEquals(appName, "vmconnect") || MsRdpEx_StringIEquals(appName, "vmconnect.exe")) {
331+
appPathId = MSRDPEX_VMCONNECT_EXE_PATH;
332+
}
330333
}
331334

332335
const char* lpApplicationName = appName;

exe/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

22
add_subdirectory(mstscex)
33
add_subdirectory(msrdcex)
4+
add_subdirectory(vmconnectex)

exe/vmconnectex/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# vmconnectex launcher executable
2+
3+
windows_rc_generate_version_info(
4+
NAME "vmconnectex" TYPE "EXE"
5+
VERSION "${MSRDPEX_VERSION}"
6+
FILENAME "vmconnectex.exe"
7+
VENDOR "${MSRDPEX_VENDOR}"
8+
COPYRIGHT "${MSRDPEX_COPYRIGHT}"
9+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
10+
11+
source_group("Resources" FILES vmconnectex.rc)
12+
13+
add_executable(vmconnectex WIN32
14+
vmconnectex.cpp
15+
vmconnectex.rc)
16+
17+
target_link_libraries(vmconnectex MsRdpEx_Dll)

exe/vmconnectex/vmconnectex.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
#include "../dll/AxHost/RdpWinMain.h"
3+
4+
int WINAPI wWinMain(
5+
_In_ HINSTANCE hInstance,
6+
_In_opt_ HINSTANCE hPrevInstance,
7+
_In_ LPWSTR lpCmdLine,
8+
_In_ int nShowCmd)
9+
{
10+
return MsRdpEx_WinMain(hInstance, hPrevInstance, lpCmdLine, nShowCmd, "vmconnect");
11+
}

exe/vmconnectex/vmconnectex.ico

61 KB
Binary file not shown.

exe/vmconnectex/vmconnectex.rc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
IDI_APP_ICON ICON "vmconnectex.ico"
3+
4+
#include "version.rc"

include/MsRdpEx/MsRdpEx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ HMODULE MsRdpEx_LoadLibrary(const char* filename);
7070
#define MSRDPEX_MODULE_DIR_PATH 0x00002000
7171
#define MSRDPEX_LIBRARY_DIR_PATH 0x00004000
7272
#define MSRDPEX_XMF_DLL_PATH 0x00008000
73+
#define MSRDPEX_VMCONNECT_EXE_PATH 0x00010000
7374
#define MSRDPEX_ALL_PATHS 0xFFFFFFFF
7475

7576
bool MsRdpEx_InitPaths(uint32_t pathIds);

installer/MsRdpEx.wxs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
</Extension>
2626
</ProgId>
2727
</Component>
28+
<Component Guid="beb220dc-b822-49bf-90c7-62153f6980f2">
29+
<File Id="vmconnectex.exe" Source="$(var.BinDir)\vmconnectex.exe" KeyPath="yes">
30+
<Shortcut Name="vmconnectex" Directory="ProgramMenuFolder" WorkingDirectory="INSTALLDIR" Icon="vmconnectex.ico" Advertise="yes" />
31+
</File>
32+
</Component>
2833
<Component Guid="17d5f23d-df19-42e2-bd40-7db9306fac2b">
2934
<File Source="$(var.BinDir)\MsRdpEx.dll"></File>
3035
</Component>

0 commit comments

Comments
 (0)