Delivering a Windows desktop application—whether built with WPF, Windows Forms, or .NET Console—requires packaging your compiled binaries, dependencies, and runtime into a reliable installation experience. Users expect a clean setup wizard, desktop and Start Menu shortcuts, proper registry integration, and a straightforward uninstallation path.
This guide covers the two primary approaches for building production-ready Windows installers: modern MSIX packaging via the Windows Application Packaging Project and traditional setup.exe wizard creation using Inno Setup.
Choosing Your Packaging Strategy
Before building your installer, select the format that aligns with your target deployment environment:
Feature | Windows Application Packaging Project (MSIX) | Inno Setup (setup.exe) |
Output Format | .msix / .msixbundle
| Single executable (setup.exe) |
Installation UI | Modern Windows App Installer UI | Classic step-by-step wizard (Next > Install) |
Certificate Requirement | Mandatory (Code Signing or Trusted Self-Signed) | Optional (recommended to avoid SmartScreen prompts) |
Uninstallation | Native, guaranteed zero-residue cleanup | Standard Windows Apps & Features uninstaller |
Best Use Case | Enterprise intranet deployment, Microsoft Store, modern Windows 10/11 environments | Public web downloads, legacy OS support, custom installation scripts |
Method 1: Windows Application Packaging Project (MSIX)
The Windows Application Packaging Project (.wapproj) is Visual Studio's built-in solution for packaging desktop applications into the modern MSIX format. MSIX packages run in a lightweight container that prevents registry bloat and ensures clean updates and uninstalls.
Step 1: Add the Packaging Project to Your Solution
Open your desktop application solution in Visual Studio.
In Solution Explorer, right-click your solution and select Add > New Project.
Search for Windows Application Packaging Project, select it, and click Next.
Name your packaging project (e.g., MyApp.Package), select your target and minimum Windows versions, and click Create.
Step 2: Reference Your Desktop Application
Expand the newly created packaging project in Solution Explorer.
Right-click the Applications node and select Add Reference.
Check the box next to your WPF, WinForms, or Console project and click OK.
Expand Applications, right-click your referenced project, and select Set as Entry Point. This tells the MSIX package which executable to launch when the user opens the app.
Step 3: Configure Package Identity and Visual Assets
Double-click Package.appxmanifest inside the packaging project to open the manifest designer.
Navigate to the Application tab and set your Display name, Description, and Supported rotations.
Navigate to the Visual Assets tab. Upload a high-resolution source logo (400x400 PNG recommended) and click Generate to automatically populate all required Start Menu, taskbar, and installer tile icons.
Navigate to the Packaging tab to verify the Package name, Publisher display name, and Version (Major.Minor.Build.Revision).
Step 4: Build and Sign the MSIX Package
MSIX packages require a digital signature before Windows allows installation.
Right-click the Packaging Project in Solution Explorer and select Publish > Create App Packages.
Select Sideloading (for direct distribution outside the Microsoft Store) and click Next.
On the signing method screen:
Select your target architecture (typically x64 in Release mode) and click Create.
Once complete, Visual Studio provides a link to the output folder containing your .msixbundle and a PowerShell installation script (Install.ps1). Double-clicking the .msixbundle launches the Windows App Installer wizard.
Method 2: Classic Setup Wizard with Inno Setup (setup.exe)
If you want a traditional installation wizard where users can choose their installation directory, accept a license agreement, and toggle desktop shortcuts—without requiring client machines to pre-install a self-signed root certificate—combine .NET Self-Contained Publishing with Inno Setup.
Step 1: Publish a Self-Contained Release Build
Bundling the .NET runtime with your application ensures it runs on any Windows machine without forcing users to download the .NET Desktop Runtime separately.
Open a terminal in your application's project directory and run:
Bash
dotnet publish -c Release -r win-x64 --self-contained true -o ./publish
This compiles your application and copies all required DLLs and runtime dependencies into the ./publish directory.
Step 2: Author the Inno Setup Script
Download and install Inno Setup (free and open-source). Create a new script file named setup.iss in your project root and add the following configuration:
Ini, TOML
#define MyAppName "Enterprise Desktop Client"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "Your Organization"
#define MyAppExeName "MyApplication.exe"
[Setup]
AppId={{D4F8A9C2-7E3B-4B1A-9C5D-2E8F1A4B6C90}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir=InstallerOutput
OutputBaseFilename=EnterpriseClient_Setup_v1.0.0
Compression=lzma2
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=admin
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Files]
Source: "publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Step 3: Compile the Setup Executable
Open setup.iss in the Inno Setup Compiler.
Press Ctrl + F9 (or select Build > Compile).
Inno Setup compresses your ./publish folder using LZMA2 compression and outputs EnterpriseClient_Setup_v1.0.0.exe inside the InstallerOutput folder.
Production Deployment Best Practices
Generate a Unique AppId: In Inno Setup, always generate a unique GUID (Tools > Generate GUID inside the Inno Setup IDE) for AppId. Windows uses this identifier to recognize upgrades and overwrite previous versions cleanly rather than creating duplicate entries in Apps & Features.
Code Sign Your Final Installer: Whether distributing an .msixbundle or a setup.exe, sign the final artifact using signtool.exe with an EV or standard Code Signing Certificate. Unsigned executables trigger Windows Defender SmartScreen warnings on end-user machines.
Automate Version Bumping: Keep your .csproj <Version>, Package.appxmanifest version, and Inno Setup #define MyAppVersion synchronized through your CI/CD build variables so automated upgrades execute smoothly.
Join the conversation! Your thoughts help the community grow.