Skip to content

Commit

Permalink
Update hostname replacement in Publish.ps1.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Feb 17, 2021
1 parent 4148d8e commit 80cf2ac
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Desktop.Core/Services/WebRtcSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void Dispose()
VideoSource,
PeerSession
});
GC.SuppressFinalize(this);
}

public async Task Init(IceServerModel[] iceServers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
<PublishTrimmed>True</PublishTrimmed>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Shared/Models/DesktopAppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Remotely.Shared.Models
{
public class DesktopAppConfig
{
private string _host;
private string _host = "";

public string Host
{
Expand Down
8 changes: 4 additions & 4 deletions Utilities/Publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ if ($Hostname) {
return
}

Replace-LineInFile -FilePath "$Root\Shared\Models\DesktopAppConfig.cs" -MatchPattern "public string Host " -ReplaceLineWith "public string Host { get; set; } = `"$($Hostname)`";" -MaxCount 1
Replace-LineInFile -FilePath "$Root\Agent.Installer.Win\ViewModels\MainWindowViewModel.cs" -MatchPattern "private string serverUrl" -ReplaceLineWith "private string serverUrl = `"$($Hostname)`";" -MaxCount 1
Replace-LineInFile -FilePath "$Root\Desktop.Win\Properties\PublishProfiles\ClickOnce-x64.pubxml" -MatchPattern "<InstallUrl>" -ReplaceLineWith " <InstallUrl>$Hostname/Downloads/ClientDownloads/Win-x64/ClickOnce/</InstallUrl>"
Replace-LineInFile -FilePath "$Root\Desktop.Win\Properties\PublishProfiles\ClickOnce-x86.pubxml" -MatchPattern "<InstallUrl>" -ReplaceLineWith " <InstallUrl>$Hostname/Downloads/ClientDownloads/Win-x86/ClickOnce/</InstallUrl>"
Replace-LineInFile -FilePath "$Root\Shared\Models\DesktopAppConfig.cs" -MatchPattern "private string _host" -ReplaceLineWith "private string _host = `"$($Hostname)`";" -MaxCount 1
Replace-LineInFile -FilePath "$Root\Agent.Installer.Win\ViewModels\MainWindowViewModel.cs" -MatchPattern "private string _serverUrl" -ReplaceLineWith "private string _serverUrl = `"$($Hostname)`";" -MaxCount 1
Replace-LineInFile -FilePath "$Root\Desktop.Win\Properties\PublishProfiles\ClickOnce-x64.pubxml" -MatchPattern "<InstallUrl>" -ReplaceLineWith " <InstallUrl>$Hostname/Downloads/Win-x64/ClickOnce/</InstallUrl>"
Replace-LineInFile -FilePath "$Root\Desktop.Win\Properties\PublishProfiles\ClickOnce-x86.pubxml" -MatchPattern "<InstallUrl>" -ReplaceLineWith " <InstallUrl>$Hostname/Downloads/Win-x86/ClickOnce/</InstallUrl>"
}
else {
Write-Warning "`nNo hostname parameter was specified. The server name will need to be entered manually in the desktop client.`n"
Expand Down

0 comments on commit 80cf2ac

Please sign in to comment.