Skip to content

4. Package Your Application

Vishal Rao edited this page Nov 16, 2021 · 5 revisions

Packaging WPF application

Here are some steps you need to follow to package your WPF application:-

  1. Add a new Windows Application Packaging Project project to your solution.
  1. Give a name to this project.
  1. Set the target and minimum platform version for your application.
  1. Once you click on OK, you will see an overview page, just close it.
  1. Now, you need to add a project reference to this project. Right-click on Dependencies under this project directory and choose Add Project Reference. And add the WPF project.
  1. Next you need to set the project context. Open Configuration Manager.
  1. When you open it for the first time, you may see the below screen.
  1. You need to select the architecture of the machine that your application is going to be used on. I have chosen, "Release" as configuration and "x86" as a platform. You may want to choose something different as per your requirement. You have to choose the same platform for all of the projects. If it is not there then add a new one.
  1. Adding a new platform. Make sure your setting matches the below image. Do the same for all the projects.
  1. Finally, your configuration manager window should look like this. You can add as many platforms as you want.
  1. Now open the "Package.appxmanifest" file. In Application tab, enter the "Display name" and "Description". Select "Badge and Tile Text" option for "Lock screen notification".
  1. In Visual Assets tab, enter filepath for the logo. Tick the "Badge Logo" option from "Assets". Click on "Generate", it will generate all the visuals required.
  1. Enter the "Short name" and tick all the options available for "Show name".
  1. In the **Capabilities" tab, you probably do not need to make any changes, just make sure that "Internet (Client)" is selected.
  1. In Declarations tab, again, you do not need to make any changes.
  1. In Content URIs tab, again, you do not need to make any changes.
  1. In Packaging tab, enter the "Packaging display name" and "Publisher Display name". Now choose the certificate by clicking on "Choose Certificate".
  1. If you have a certificate then you can add it, otherwise, you can create a new one. Click on "Create" to create a new one.
  1. Now, enter "Publisher Common Name" and password. Then click on "OK".
  1. Right-click on packaging project (not solution), in Publish, click Create App Packages.
  1. Select Sideloading. Also, tick Enable automatic updates if you want automatic updates.
  1. Select Yes, use the current certificate. Here you may see an option to trust this certificate, this is required for installation.
  1. This is an important page. Here select all the architecture and solution configuration, which you have added in step-8. Also, make sure that you tick the box saying "Include public symbol files...", it is very helpful to debug your application, if something went wrong. Your screen will be similar to this.
  1. Here you need to say that when your application should look for new updates available. You can decide based on your requirements.
  1. Click on Copy and Close.

You're done. Now you should see all the files required at the installer location.

You can share the certificate and the .appxbundle file with anyone.

Packaging Console Application

Packaging console application is a lot easier than packaging WPF applications. We'll package the Server, a console application.

Here are the steps you need to follow-

  1. Go inside the Server folder and run dotnet publish --configuration Release. And you're done.

All the required files can be found inside meet.me/Server/bin/Release/net5.0-windows/publish directory. One need to have all of these files to run this console application.

To install these packaged applications, go here.

Clone this wiki locally