Skip to content

Instantly share code, notes, and snippets.

@ctaggart
Last active December 25, 2020 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctaggart/21ff8e23b82e3408ee8dc6108beb1de7 to your computer and use it in GitHub Desktop.
Save ctaggart/21ff8e23b82e3408ee8dc6108beb1de7 to your computer and use it in GitHub Desktop.
ClickOnce for Rust Apps
msbuild $PSScriptRoot /t:Restore,Publish /v:m
<Project>
<PropertyGroup>
<InstallUrl>https://ctaggart.github.io/minesweeper-rs/</InstallUrl>
<ManifestCertificateThumbprint>1A92BF20220B301077205787F406B1BCEE6DA97E</ManifestCertificateThumbprint>
</PropertyGroup>
</Project>
<Project>
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.1.0.*</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut>
<GenerateManifests>True</GenerateManifests>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<IsRevisionIncremented>True</IsRevisionIncremented>
<IsWebBootstrapper>True</IsWebBootstrapper>
<MapFileExtensions>true</MapFileExtensions>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\</PublishDir>
<PublishUrl>bin\publish\</PublishUrl>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishSingleFile>False</PublishSingleFile>
<SelfContained>False</SelfContained>
<SignatureAlgorithm>sha256RSA</SignatureAlgorithm>
<SignManifests>True</SignManifests>
<TargetFramework>net5.0-windows</TargetFramework>
<UpdateEnabled>True</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
</PropertyGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.5.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 5.0.1 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<Configuration>Release</Configuration>
<PublishProfile>ClickOnceProfile</PublishProfile>
<ApplicationIcon>Square44x44Logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Content Include="..\target\release\minesweeper-rs.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
static class Program
{
static void Main()
{
try
{
Process.Start(new ProcessStartInfo { CreateNoWindow = true, FileName = "minesweeper-rs.exe" });
}
catch (Exception x)
{
MessageBox.Show(x.Message, "Error Starting Minesweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment