Files
velopack/samples/CSharpWpf/readme.md
Caelan 3128d34b14 Rework solution structure to allow more types of library projects (#196)
* Rename avalonia & wpf samples

* Rename rest of samples

* fix sample readme

* Fix compat util tests

* rename / move all src projects

* remove package lock files and move libC# again

* Add rust lib and cargo workspace

* Replace locksmith lib with new filelocksmith-rs library

* Deprecated type

* fix setup compile

* Use thiserror for error handling

* Rename some enums and formatting

* Add missing SHA256

* wip c++ library

* cpp wip

* alphabetize readme

* Try to get build working again

* Fix some conditionally compiled bits

* cross config should be in workspace root

* Fix PathHelper for new rust target dir

* Missed one old path to velopack.csproj

* remove obsolete coverage code

* testawareapp.exe no longer exists
2024-08-06 22:56:40 +01:00

1.3 KiB

VeloWpfSample

Prerequisites: vpk command line tool installed

This app demonstrates how to use WPF to provide a desktop UI, installer, and updates for Windows only.

You can run this sample by executing the build script with a version number: build.bat 1.0.0. Once built, you can install the app - build more updates, and then test updates and so forth. The sample app will check the local release dir for new update packages.

In your production apps, you should deploy your updates to some kind of update server instead.

WPF Implementation Notes

WPF generates a Program.Main(argv[]) method automatically for you, so it requires a couple of extra steps to get Velopack working with WPF.

  1. You need to create your own Program.cs class, and add a static Main() method.
  2. In order for dotnet to execute this new Main() method instead of the default WPF one, you need to add the following to your .csproj:
    <PropertyGroup>
      <StartupObject>YourNamespace.Program</StartupObject>
    </PropertyGroup>
    
  3. You should run the VelopackApp builder before starting WPF as usual.
    [STAThread]
    public static void Main(string[] args)
    {
        VelopackApp.Build().Run();
        var application = new App();
        application.InitializeComponent();
        application.Run();
    }