DEV Community

YASH MAISURIYA
YASH MAISURIYA

Posted on

2

🚀 Building a Custom Windows Installer with Inno Setup for WPF Applications 💻✨

After completing my WPF application, it was time to wrap it up in a clean, user-friendly installer. Like many developers, I initially turned to Visual Studio’s Setup Wizard (Setup Project). While it gets the job done for basic packaging, I quickly ran into its limitations — especially when it came to customization.

Here’s a quick overview of why I made the switch, what I needed, and how Inno Setup gave me the flexibility I was looking for.

🤔 Why I Left the Setup Wizard Behind
Initially, I used the built-in Setup Wizard provided by Visual Studio. It’s a drag-and-drop experience that’s great for simple installers, but here's what I couldn’t do with it:

  • ❌ No option to create a desktop shortcut
  • ❌ No way to auto-launch the application after installation
  • ❌ No custom branding or installation logic
  • ❌ Limited control over registry entries and version checks

I needed more — something that would allow me to create a polished, professional installer. That’s when I discovered Inno Setup.

✅ What I Achieved with Inno Setup:

  • ✅ Created desktop & Start Menu shortcuts
  • ✅ Launched app after installation
  • ✅ Added registry keys for license/trial handling
  • ✅ Branded the installer with a custom icon and app name
  • ✅ Controlled version checks and clean uninstall support

🔧 Brief Explanation of the Installer Script
This Inno Setup script creates a custom Windows installer for testApplication. Here's a breakdown of its key components:

  • [Setup]: Defines the application name, version, output file, privileges, and installer behavior (like compression and icon).
  • [Languages]: Adds support for English language messages.
  • [Files]: Includes:
    • The main .exe, .dll, and .config files.
    • SQLite-specific files like SQLite.Interop.dll.
    • Additional resources like images and default songs.
    • Temporary files like EULA and Terms text.
  • [Icons]: Adds Start Menu and Desktop shortcuts (controlled by user selection).
  • [Run]: Optionally runs the application after installation.
  • [Code]:
    • Adds custom wizard pages for Terms & Conditions, License Agreement, and Install Options.
    • Provides checkboxes for:
      • Accepting license terms.
      • Creating desktop shortcuts.
      • Running the app post-install.
    • Validates if the license checkbox is checked before proceeding.

📁 Full Script on GitHub Gist:
https://github.com/YashMaisuirya13/InnoScriptWpf.git

💡Pro Tips
🛠️ Use Inno Script Studio or ISTool for a more visual experience when editing scripts.
📁 {app} is a helpful macro that points to the installation directory.
🧠 Use the [Code] section for advanced logic like checking existing versions or validating registry keys.
🧪 Always test your installer in a clean VM or sandbox environment.

With Inno Setup, I was finally able to deliver an installer that matched the polish and professionalism of the application itself.

Let me know if you’d like help building your own installer!

Image description

Image of Datadog

Diagram Like A Pro

Bring your cloud architecture to life with expert tips from AWS and Datadog. In this ebook, AWS Solutions Architects Jason Mimick and James Wenzel reveal pro strategies for building clear, compelling diagrams that make an impact.

Get the Guide

Top comments (0)

Image of Datadog

Get the real story behind DevSecOps

Explore data from thousands of apps to uncover how container image size, deployment frequency, and runtime context affect real-world security. Discover seven key insights that can help you build and ship more secure software.

Read the Report

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay