Skip to content

Commit 37d463e

Browse files
committed
fixup! chore: enable tunnel binary verification
1 parent 34793f0 commit 37d463e

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

Installer/Installer.csproj

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<AssemblyName>Coder.Desktop.Installer</AssemblyName>
5-
<RootNamespace>Coder.Desktop.Installer</RootNamespace>
6-
<OutputType>Exe</OutputType>
7-
<TargetFramework>net481</TargetFramework>
8-
<LangVersion>13.0</LangVersion>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<AssemblyName>Coder.Desktop.Installer</AssemblyName>
5+
<RootNamespace>Coder.Desktop.Installer</RootNamespace>
6+
<OutputType>Exe</OutputType>
7+
<TargetFramework>net481</TargetFramework>
8+
<LangVersion>13.0</LangVersion>
9+
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<None Remove="*.msi" />
13-
<None Remove="*.exe" />
14-
<None Remove="*.wxs" />
15-
<None Remove="*.wixpdb" />
16-
<None Remove="*.wixobj" />
17-
</ItemGroup>
11+
<ItemGroup>
12+
<None Remove="*.msi" />
13+
<None Remove="*.exe" />
14+
<None Remove="*.wxs" />
15+
<None Remove="*.wixpdb" />
16+
<None Remove="*.wixobj" />
17+
</ItemGroup>
1818

19-
<ItemGroup>
20-
<PackageReference Include="WixSharp_wix4" Version="2.6.0" />
21-
<PackageReference Include="WixSharp_wix4.bin" Version="2.6.0" />
22-
<PackageReference Include="CommandLineParser" Version="2.9.1" />
23-
</ItemGroup>
19+
<ItemGroup>
20+
<PackageReference Include="WixSharp_wix4" Version="2.6.0" />
21+
<PackageReference Include="WixSharp_wix4.bin" Version="2.6.0" />
22+
<PackageReference Include="CommandLineParser" Version="2.9.1" />
23+
</ItemGroup>
2424
</Project>

Installer/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ private static int BuildMsiPackage(MsiOptions opts)
256256
new RegValue(RegistryHive, RegistryKey, "Manager:TunnelBinaryPath",
257257
$"[INSTALLFOLDER]{opts.VpnDir}\\coder-vpn.exe"),
258258
new RegValue(RegistryHive, RegistryKey, "Manager:LogFileLocation",
259-
@"[INSTALLFOLDER]coder-desktop-service.log"));
259+
@"[INSTALLFOLDER]coder-desktop-service.log"),
260+
new RegValue(RegistryHive, RegistryKey, "Manager:TunnelBinarySignatureSigner", "Coder Technologies Inc."),
261+
new RegValue(RegistryHive, RegistryKey, "Manager:TunnelBinaryAllowVersionMismatch", "false"));
260262

261263
// Note: most of this control panel info will not be visible as this
262264
// package is usually hidden in favor of the bootstrapper showing

Vpn.Service/Downloader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ public AssemblyVersionDownloadValidator(int expectedMajor, int expectedMinor, in
9696
if (_expectedBuild == -1 && _expectedRevision != -1)
9797
throw new ArgumentException("Build must be set if Revision is set", nameof(expectedRevision));
9898

99+
// Unfortunately the Version constructor throws an exception if the
100+
// build or revision is -1. You need to use the specific constructor
101+
// with the correct number of parameters.
102+
//
103+
// This is only for error rendering purposes anyways.
99104
if (_expectedBuild == -1)
100105
_expectedVersion = new Version(_expectedMajor, _expectedMinor);
101106
else if (_expectedRevision == -1)

0 commit comments

Comments
 (0)