Skip to content

feat: installer and uninstaller #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@
<LangVersion>preview</LangVersion>
<!-- We have our own implementation of main with exception handling -->
<DefineConstants>DISABLE_XAML_GENERATED_MAIN</DefineConstants>

<AssemblyName>Coder Desktop</AssemblyName>
<ApplicationIcon>coder.ico</ApplicationIcon>
</PropertyGroup>

<PropertyGroup Condition="$(Configuration) == 'Release'">
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>CopyUsed</TrimMode>
<PublishTrimmed>false</PublishTrimmed>
<!-- <TrimMode>CopyUsed</TrimMode> -->
<PublishReadyToRun>true</PublishReadyToRun>
<SelfContained>true</SelfContained>
<SelfContained>false</SelfContained>
</PropertyGroup>

<ItemGroup>
<Content Include="coder.ico" />
</ItemGroup>

<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Expand Down
12 changes: 4 additions & 8 deletions App/Services/CredentialManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,9 @@ private struct CREDENTIAL
public int Flags;
public int Type;

[MarshalAs(UnmanagedType.LPWStr)]
public string TargetName;
[MarshalAs(UnmanagedType.LPWStr)] public string TargetName;

[MarshalAs(UnmanagedType.LPWStr)]
public string Comment;
[MarshalAs(UnmanagedType.LPWStr)] public string Comment;

public long LastWritten;
public int CredentialBlobSize;
Expand All @@ -252,11 +250,9 @@ private struct CREDENTIAL
public int AttributeCount;
public IntPtr Attributes;

[MarshalAs(UnmanagedType.LPWStr)]
public string TargetAlias;
[MarshalAs(UnmanagedType.LPWStr)] public string TargetAlias;

[MarshalAs(UnmanagedType.LPWStr)]
public string UserName;
[MarshalAs(UnmanagedType.LPWStr)] public string UserName;
}
}
}
6 changes: 2 additions & 4 deletions App/ViewModels/SignInViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ public partial class SignInViewModel : ObservableObject
[NotifyPropertyChangedFor(nameof(ApiTokenError))]
public partial bool ApiTokenTouched { get; set; } = false;

[ObservableProperty]
public partial string? SignInError { get; set; } = null;
[ObservableProperty] public partial string? SignInError { get; set; } = null;

[ObservableProperty]
public partial bool SignInLoading { get; set; } = false;
[ObservableProperty] public partial bool SignInLoading { get; set; } = false;

public string? CoderUrlError => CoderUrlTouched ? _coderUrlError : null;

Expand Down
3 changes: 1 addition & 2 deletions App/ViewModels/TrayWindowDisconnectedViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ public partial class TrayWindowDisconnectedViewModel : ObservableObject
{
private readonly IRpcController _rpcController;

[ObservableProperty]
public partial bool ReconnectButtonEnabled { get; set; } = true;
[ObservableProperty] public partial bool ReconnectButtonEnabled { get; set; } = true;

public TrayWindowDisconnectedViewModel(IRpcController rpcController)
{
Expand Down
12 changes: 4 additions & 8 deletions App/ViewModels/TrayWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ public partial class TrayWindowViewModel : ObservableObject

private DispatcherQueue? _dispatcherQueue;

[ObservableProperty]
public partial VpnLifecycle VpnLifecycle { get; set; } = VpnLifecycle.Unknown;
[ObservableProperty] public partial VpnLifecycle VpnLifecycle { get; set; } = VpnLifecycle.Unknown;

// This is a separate property because we need the switch to be 2-way.
[ObservableProperty]
public partial bool VpnSwitchActive { get; set; } = false;
[ObservableProperty] public partial bool VpnSwitchActive { get; set; } = false;

[ObservableProperty]
public partial string? VpnFailedMessage { get; set; } = null;
[ObservableProperty] public partial string? VpnFailedMessage { get; set; } = null;

[ObservableProperty]
[NotifyPropertyChangedFor(nameof(NoAgents))]
Expand All @@ -49,8 +46,7 @@ public partial class TrayWindowViewModel : ObservableObject

public IEnumerable<AgentViewModel> VisibleAgents => ShowAllAgents ? Agents : Agents.Take(MaxAgents);

[ObservableProperty]
public partial string DashboardUrl { get; set; } = "https://coder.com";
[ObservableProperty] public partial string DashboardUrl { get; set; } = "https://coder.com";

public TrayWindowViewModel(IRpcController rpcController, ICredentialManager credentialManager)
{
Expand Down
Binary file added App/coder.ico
Binary file not shown.
10 changes: 5 additions & 5 deletions App/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@
"System.Collections.Immutable": "9.0.0"
}
},
"codersdk": {
"Coder.Desktop.CoderSdk": {
"type": "Project"
},
"vpn": {
"Coder.Desktop.Vpn": {
"type": "Project",
"dependencies": {
"System.IO.Pipelines": "[9.0.1, )",
"Vpn.Proto": "[1.0.0, )"
"Coder.Desktop.Vpn.Proto": "[1.0.0, )",
"System.IO.Pipelines": "[9.0.1, )"
}
},
"vpn.proto": {
"Coder.Desktop.Vpn.Proto": {
"type": "Project",
"dependencies": {
"Google.Protobuf": "[3.29.3, )"
Expand Down
18 changes: 18 additions & 0 deletions Coder.Desktop.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "App\App.csproj", "{8
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vpn.DebugClient", "Vpn.DebugClient\Vpn.DebugClient.csproj", "{1BBFDF88-B25F-4C07-99C2-30DA384DB730}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Installer", "Installer\Installer.csproj", "{39F5B55A-09D8-477D-A3FA-ADAC29C52605}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -185,6 +187,22 @@ Global
{1BBFDF88-B25F-4C07-99C2-30DA384DB730}.Release|x64.Build.0 = Release|Any CPU
{1BBFDF88-B25F-4C07-99C2-30DA384DB730}.Release|x86.ActiveCfg = Release|Any CPU
{1BBFDF88-B25F-4C07-99C2-30DA384DB730}.Release|x86.Build.0 = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|ARM64.Build.0 = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|x64.ActiveCfg = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|x64.Build.0 = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|x86.ActiveCfg = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Debug|x86.Build.0 = Debug|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|Any CPU.Build.0 = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|ARM64.ActiveCfg = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|ARM64.Build.0 = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|x64.ActiveCfg = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|x64.Build.0 = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|x86.ActiveCfg = Release|Any CPU
{39F5B55A-09D8-477D-A3FA-ADAC29C52605}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions CoderSdk/CoderSdk.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Coder.Desktop.CoderSdk</AssemblyName>
<RootNamespace>Coder.Desktop.CoderSdk</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
24 changes: 24 additions & 0 deletions Installer/Installer.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Coder.Desktop.Installer</AssemblyName>
<RootNamespace>Coder.Desktop.Installer</RootNamespace>
<OutputType>Exe</OutputType>
<TargetFramework>net481</TargetFramework>
<LangVersion>13.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<None Remove="*.msi" />
<None Remove="*.exe" />
<None Remove="*.wxs" />
<None Remove="*.wixpdb" />
<None Remove="*.wixobj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="WixSharp_wix4" Version="2.6.0" />
<PackageReference Include="WixSharp_wix4.bin" Version="2.6.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
Loading
Loading