Skip to content

Commit

Permalink
add initial MSI installer
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Nov 22, 2023
1 parent b1db118 commit fa81a0d
Show file tree
Hide file tree
Showing 19 changed files with 154 additions and 32 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ jobs:
New-Item -ItemType Directory -Path "dependencies/MsRdpEx/$Arch" | Out-Null
Copy-Item "$BuildDir/Release/MsRdpEx.dll" "dependencies/MsRdpEx/$Arch"
Copy-Item "$BuildDir/Release/MsRdpEx.pdb" "dependencies/MsRdpEx/$Arch"
Copy-Item "$BuildDir/Release/mstsc.exe" "dependencies/MsRdpEx/$Arch"
Copy-Item "$BuildDir/Release/msrdc.exe" "dependencies/MsRdpEx/$Arch"
Copy-Item "$BuildDir/Release/mstscex.exe" "dependencies/MsRdpEx/$Arch"
Copy-Item "$BuildDir/Release/msrdcex.exe" "dependencies/MsRdpEx/$Arch"
Compress-Archive "dependencies\MsRdpEx\$Arch\*" ".\package\MsRdpEx-$PackageVersion-$Arch.zip" -CompressionLevel Optimal
- name: Upload MsRdpEx (${{matrix.arch}})
Expand Down Expand Up @@ -180,6 +180,22 @@ jobs:
Expand-Archive $_ "dependencies\$Name\$Arch\" -Force
}
- name: Build MsRdpEx MSI installers
shell: pwsh
run: |
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
foreach ($Arch in @('x86','x64','arm64')) {
$MsvcArch = @{"x86"="Win32";"x64"="x64";"arm64"="ARM64"}[$Arch]
dotnet build /p:Configuration=Release /p:Platform=$MsvcArch installer/MsRdpEx.sln
Move-Item "installer\bin\x64\Release\en-US\MsRdpEx.msi" "package\MsRdpEx-$PackageVersion-$Arch.msi"
}
- name: Upload MsRdpEx nuget package
uses: actions/upload-artifact@v3
with:
name: MsRdpEx-msi
path: package/*.msi

- name: Build MsRdpEx nuget package
shell: pwsh
run: |
Expand Down
4 changes: 2 additions & 2 deletions exe/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

add_subdirectory(mstsc)
add_subdirectory(msrdc)
add_subdirectory(mstscex)
add_subdirectory(msrdcex)
2 changes: 1 addition & 1 deletion exe/MsRdpEx.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int WINAPI wWinMain(

if (GetModuleFileNameA(NULL, moduleFilePath, MSRDPEX_MAX_PATH))
{
if (strstr(moduleFilePath, "msrdc.exe")) {
if (strstr(moduleFilePath, "msrdcex.exe")) {
axName = "msrdc";
}
}
Expand Down
17 changes: 0 additions & 17 deletions exe/msrdc/CMakeLists.txt

This file was deleted.

4 changes: 0 additions & 4 deletions exe/msrdc/msrdc.rc

This file was deleted.

17 changes: 17 additions & 0 deletions exe/msrdcex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# msrdcex launcher executable

windows_rc_generate_version_info(
NAME "msrdcex" TYPE "EXE"
VERSION "${MSRDPEX_VERSION}"
FILENAME "msrdcex.exe"
VENDOR "${MSRDPEX_VENDOR}"
COPYRIGHT "${MSRDPEX_COPYRIGHT}"
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.rc)

source_group("Resources" FILES msrdcex.rc)

add_executable(msrdcex WIN32
../MsRdpEx.c
msrdcex.rc)

target_link_libraries(msrdcex MsRdpEx_Dll)
File renamed without changes.
4 changes: 4 additions & 0 deletions exe/msrdcex/msrdcex.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

IDI_APP_ICON ICON "msrdcex.ico"

#include "version.rc"
12 changes: 6 additions & 6 deletions exe/mstsc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# mstsc launcher executable
# mstscex launcher executable

windows_rc_generate_version_info(
NAME "mstsc" TYPE "EXE"
NAME "mstscex" TYPE "EXE"
VERSION "${MSRDPEX_VERSION}"
FILENAME "mstsc.exe"
FILENAME "mstscex.exe"
VENDOR "${MSRDPEX_VENDOR}"
COPYRIGHT "${MSRDPEX_COPYRIGHT}"
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.rc)

source_group("Resources" FILES mstsc.rc)
source_group("Resources" FILES mstscex.rc)

add_executable(mstsc WIN32
../MsRdpEx.c
mstsc.rc)
mstscex.rc)

target_link_libraries(mstsc MsRdpEx_Dll)
target_link_libraries(mstscex MsRdpEx_Dll)
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions installer/Folders.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?include $(sys.CURRENTDIR)Variables.wxi ?>
<Fragment>
<StandardDirectory Id="$(var.ProgramFilesId)">
<Directory Id="VENDORDIR" Name="Devolutions">
<Directory Id="INSTALLDIR" Name="!(bind.Property.ProductName)" ></Directory>
</Directory>
</StandardDirectory>
</Fragment>
</Wix>
Binary file added installer/MsRdpEx.ico
Binary file not shown.
37 changes: 37 additions & 0 deletions installer/MsRdpEx.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "MsRdpEx", "MsRdpEx.wixproj", "{A8FFAEDD-525B-46F0-BC38-A984E659DD23}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|Win32 = Debug|Win32
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Debug|ARM64.ActiveCfg = Debug|ARM64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Debug|ARM64.Build.0 = Debug|ARM64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Debug|x64.ActiveCfg = Debug|x64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Debug|x64.Build.0 = Debug|x64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Debug|Win32.ActiveCfg = Debug|Win32
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Debug|Win32.Build.0 = Debug|Win32
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Release|ARM64.ActiveCfg = Release|ARM64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Release|ARM64.Build.0 = Release|ARM64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Release|x64.ActiveCfg = Release|x64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Release|x64.Build.0 = Release|x64
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Release|Win32.ActiveCfg = Release|Win32
{A8FFAEDD-525B-46F0-BC38-A984E659DD23}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E5B39C52-A0A1-4A89-9739-4B0326F040A0}
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions installer/MsRdpEx.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project Sdk="WixToolset.Sdk/4.0.2">
</Project>
12 changes: 12 additions & 0 deletions installer/MsRdpEx.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?include $(sys.CURRENTDIR)Variables.wxi ?>
<Fragment>
<ComponentGroup Id="MsRdpEx" Directory="INSTALLDIR">
<Component Guid="4d9715ac-8976-11ee-b9d1-0242ac120002">
<File Source="$(var.BinDir)\mstscex.exe"></File>
<File Source="$(var.BinDir)\msrdcex.exe"></File>
<File Source="$(var.BinDir)\MsRdpEx.dll"></File>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
3 changes: 3 additions & 0 deletions installer/Package.en-us.wxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
<String Id="DowngradeError" Value="A newer version of [ProductName] is already installed." />
</WixLocalization>
16 changes: 16 additions & 0 deletions installer/Package.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?include $(sys.CURRENTDIR)Variables.wxi ?>
<Package
Name="$(var.VendorName) $(var.ProductName)" Manufacturer="$(var.VendorFullName)"
Version="$(var.ProductVersion)" UpgradeCode="$(var.UpgradeCode)"
Scope="perMachine" Language="1033">
<MajorUpgrade AllowSameVersionUpgrades="no" DowngradeErrorMessage="!(loc.DowngradeError)" />
<Icon Id="MsRdpEx.ico" SourceFile="MsRdpEx.ico" />
<Property Id="ARPPRODUCTICON" Value="MsRdpEx.ico" />
<Property Id="ARPHELPLINK" Value="$(var.InfoURL)" />
<MediaTemplate EmbedCab="yes" />
<Feature Id="Main">
<ComponentGroupRef Id="MsRdpEx" />
</Feature>
</Package>
</Wix>
26 changes: 26 additions & 0 deletions installer/Variables.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>
<?define VendorName = "Devolutions" ?>
<?define VendorFullName = "Devolutions Inc." ?>

<?define ProductName = "MsRdpEx" ?>
<?define ProductVersion = "1.0.0.0" ?>

<!-- Upgrade code HAS to be the same for all updates. Once you've chosen it don't change it. -->
<?define UpgradeCode="76169e12-8976-11ee-b9d1-0242ac120002" ?>

<!-- The URL for add/remove programs -->
<?define InfoURL="https://github.com/Devolutions/MsRdpEx" ?>

<!-- Source Windows Terminal directory to copy files from -->
<?if $(var.Platform) = x64 ?>
<?define BinDir="..\dependencies\MsRdpEx\x64" ?>
<?define ProgramFilesId="ProgramFiles64Folder" ?>
<?elseif $(var.Platform) = Win32 ?>
<?define BinDir="..\dependencies\MsRdpEx\x86" ?>
<?define ProgramFilesId="ProgramFilesFolder" ?>
<?else ?>
<?define BinDir="..\dependencies\MsRdpEx\arm64" ?>
<?define ProgramFilesId="ProgramFiles64Folder" ?>
<?endif ?>
</Include>

0 comments on commit fa81a0d

Please sign in to comment.