33 [parameter (Mandatory = $true )]
44 [string ] $Exe ,
55 [parameter (Mandatory = $true )]
6+ [string ] $UpdaterExe ,
7+ [parameter (Mandatory = $true )]
68 [string ] $PedmDll ,
79 [parameter (Mandatory = $true )]
810 [string ] $PedmMsix ,
@@ -31,7 +33,7 @@ function Set-FileNameAndCopy {
3133 [string ]$Path ,
3234 [string ]$NewName
3335 )
34-
36+
3537 if (-Not (Test-Path $Path )) {
3638 throw " File not found: $Path "
3739 }
@@ -84,6 +86,9 @@ function New-AgentMsi() {
8486 # The path to the devolutions-agent.exe file.
8587 [string ] $Exe ,
8688 [parameter (Mandatory = $true )]
89+ # The path to the devolutions-agent-updater.exe file.
90+ [string ] $UpdaterExe ,
91+ [parameter (Mandatory = $true )]
8792 # The path to the devolutions_pedm_shell_ext.dll file.
8893 [string ] $PedmDll ,
8994 [parameter (Mandatory = $true )]
@@ -111,6 +116,7 @@ function New-AgentMsi() {
111116
112117 # Convert slashes. This does not affect function. It's just for display.
113118 $Exe = Convert-Path - Path $Exe
119+ $UpdaterExe = Convert-Path - Path $UpdaterExe
114120 $PedmDll = Convert-Path - Path $PedmDll
115121 $PedmMsix = Convert-Path - Path $PedmMsix
116122 $SessionExe = Convert-Path - Path $SessionExe
@@ -127,20 +133,23 @@ function New-AgentMsi() {
127133 # These file names don't matter for building, but we will clean them up anyways for consistency. The names can be seen if inspecting the MSI.
128134 # The Agent exe will get copied to `C:\Program Files\Devolutions\Agent\DevolutionsAgent.exe` after install.
129135 $myExe = Set-FileNameAndCopy - Path $Exe - NewName ' DevolutionsAgent.exe'
136+ # The updater shim is a detached helper for installing MSI updates.
137+ $myUpdaterExe = Set-FileNameAndCopy - Path $UpdaterExe - NewName ' DevolutionsAgentUpdater.exe'
130138 # The session is a service that gets launched on demand.
131139 $mySessionExe = Set-FileNameAndCopy - Path $SessionExe - NewName ' DevolutionsSession.exe'
132140
133141 Write-Output " $repoDir \dotnet\DesktopAgent\bin\Release\net48\DevolutionsDesktopAgent.exe"
134142
135143 Set-EnvVarPath ' DAGENT_EXECUTABLE' $myExe
144+ Set-EnvVarPath ' DAGENT_UPDATER_EXECUTABLE' $myUpdaterExe
136145 Set-EnvVarPath ' DAGENT_PEDM_SHELL_EXT_DLL' $myPedmDll
137146 Set-EnvVarPath ' DAGENT_PEDM_SHELL_EXT_MSIX' $myPedmMsix
138147 Set-EnvVarPath ' DAGENT_SESSION_EXECUTABLE' $mySessionExe
139148
140149 # The actual DevolutionsDesktopAgent.exe will be `\dotnet\DesktopAgent\bin\Release\net48\DevolutionsDesktopAgent.exe`.
141- # After install, the contsnts of `net48` will be copied to `C:\Program Files\Devolutions\Agent\desktop\`.
150+ # After install, the contents of `net48` will be copied to `C:\Program Files\Devolutions\Agent\desktop\`.
142151 Set-EnvVarPath ' DAGENT_DESKTOP_AGENT_PATH' " $repoDir \dotnet\DesktopAgent\bin\Release\net48"
143-
152+
144153 $version = Get-Version
145154
146155 Push-Location
@@ -152,7 +161,7 @@ function New-AgentMsi() {
152161 if ($Generate ) {
153162 # This is used by `package/WindowsManaged/Program.cs`.
154163 $Env: DAGENT_MSI_SOURCE_ONLY_BUILD = ' 1'
155-
164+
156165 foreach ($lang in Get-PackageLanguages ) {
157166 $Env: DAGENT_MSI_LANG_ID = $lang.Name
158167 & ' MSBuild.exe' ' DevolutionsAgent.sln' ' /t:restore,build' ' /p:Configuration=Release' | Out-Host
@@ -175,4 +184,4 @@ function New-AgentMsi() {
175184 Pop-Location
176185}
177186
178- New-AgentMsi - Generate:($Generate.IsPresent ) - Exe $Exe - PedmDll $PedmDll - PedmMsix $PedmMsix - SessionExe $SessionExe - Architecture $Architecture - Outfile $Outfile
187+ New-AgentMsi - Generate:($Generate.IsPresent ) - Exe $Exe - UpdaterExe $UpdaterExe - PedmDll $PedmDll - PedmMsix $PedmMsix - SessionExe $SessionExe - Architecture $Architecture - Outfile $Outfile
0 commit comments