Wix Installer Msi Not Installing the Winform App Created With Visual Studio 2017

Wix Minimal UI doesnt show up


System Reboot: In this case a simple reboot solved the problem - which is great news.

Speculation: One could speculate as to why, and maybe it had to do with PendingFileRenames (file and folder names waiting to be
changed) or some lock in Windows Updates that affected the System
Restore point creation? Doesn't sound too likely. Just speculation.

A Deployment Mnemonic: To think about this - if you see the problem - a deployment mnemonic: What is locking (in use),
what is blocking (permissions), what is corrupt (disk, malware, configs, encryption), what are unexpected system states
(disk space, time & date settings, language, licensing, windows patch
state, path too long, PendingFileRenames, etc...), what are incompatible products
(things that can't co-exist), what is unreachable or misconfigured (what points to erroneous locations and resources: network server names,
disk paths, URLs, databases, services, UAT environments, PROD environments, etc...) and last but not least: what is missing (runtime, resource image, settings file, etc...)? Launch debugging.


And the older answer. Leaving in to perhaps spark ideas:

  • Prevalence: Do other MSI files work without issues?
  • Timeout: How long do you wait for the MSI to initialize?

    • Initialization & System Restore: The Windows Installer engine may create a system restore point before the GUI is shown. This can be quite slow, and your setup could appear to hang.
  • Source: Maybe post your whole source.
  • Logging: Always make a log file for your installation session to debug.

Sounds like you don't need it, but here is a: Sample, minimal MSI compile with WiX Votive.

Gut feel is that there might be an AppSearch in this dialog set that I am unaware of. Maybe try to have a look at the sources yourself first (WixUI_Minimal.wxs et al). Any other issues with your machine? Virtual? Up to date with hotfixes? Malware checked? Disk space? Event logs?

How to create msi installer with wix?

Quick "Tutorials": A few pointers to samples of WiX in use:

  • WiX Quick-start link collection
  • WiX demo with Visual Studio
  • https://www.firegiant.com/wix/tutorial/ (Firegiant is WiX's commercial branch)
  • A couple of samples here: https://github.com/glytzhkof/all - maybe try "VBScriptWriteToLog"

Some observations: Don't include all build files:

  • Don't include the .pdb files or other files that are meant for debugging (Skeet).
  • Don't distribute a debug build, build in release mode and use those files (unless you want to test a debug build internally).
  • XML files should generally be installed with XmlFile and XmlConfig elements.

How to avoid having two versions of a product installed with Windows Installer / MSI?

Upgrade Code: As long as you have set an upgrade code (which identifies a bunch of related products) you can use a major upgrade element to indicate products that are to be uninstalled as part of a new MSI's installation.

MajorUpgrade Element: Just inject a MajorUpgrade element for default treatment of major upgrades into your existing WiX source. It is a sort of "magic element" doing a lot for you making a number of (usually good) assumptions. There are older and more flexible ways to do it - if you need more detailed control (for legacy purposes usually - auto-magic does not cover all bases):

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

The above is the standard use for all WiX files created in Visual Studio.

Note: I will try to tune up this answer shortly with more links, but give that a go first?

First link: Using Visual Studio to make WiX files. The Hello WiX and Visual Studio-type of scenario.


Major Upgrade Suggested Reading: A few things to know about major upgrades. All WiX markup essentially revolves around the compiled MSI's Upgrade table. It is there that major upgrade logic is configured. Custom actions could also affect things, and a few other things such as launch conditions perhaps.

  • WiX Documentation: How To: Implement a Major Upgrade In Your Installer
  • Major Upgrade - Common Problems: WIX does not uninstall older version
  • Major Upgrade - Manual Configuration: Adding entries to MSI UpgradeTable to remove related products (using old-style Upgrade elements)

Further:

  • Major Upgrades - How-To & Concept: Doing Major Upgrade in Wix creates 2 entries in Add/Remove Programs

WiX Toolset: Creating a simple WiX project breaks in VS2017: The CreateProjectReferenceDefineConstants task was not found


.NET Framework 3.5: After some debugging the solution was to install the .NET Framework 3.5.

  • WiX 3.x has a build-dependency requiring this version.
  • WiX 4.x requires .NET Core and Framework 4+.

Procedure:

  1. Hold Windows Key and Tap R. Type: appwiz.cpl and press Enter.
  2. Left pane, click "Turn Windows Features On / Off".
  3. Tick / enable: ".NET Framework 3.5".
  4. Run Windows Update (!) . If you can. To check for security updates.
    • On Windows 10:
      • Hold Windows Key and Tap R.
      • Type: ms-settings:windowsupdate and press Enter.
      • Click "Check for updates".

Now you should be able to build your WiX projects.

Or talk to tech support if you are in a managed environment. They should have a ready-made package for this .NET runtime, unless the runtime itself is prohibited from use.


Links:

  • Cannot build WIX project on windows 10
  • Hello WiX - minimal step-by-step example for writing a WiX installer in Visual Studio.
  • Chris Painter's samples: https://github.com/iswix-llc/iswix-tutorials
  • WiX Quick Start. Further links to more samples.

Questions on Install+upgrade and prevent overwriting


Quick Links:

  • WiX quick start tips - a collection of links and hints to help generating WiX MSIs.
  • MSI tools - Just a list of MSI tools that you can use.

  1. Upgrades: Update is a built-in feature of MSI. There are major upgrades (the most common and reliable), minor upgrades and small upgrades (not recommended). If the same setup is run again after original installation it is run in "maintenance mode".

    • A major upgrade is essentially an uninstall of an old version and a reinstall of a newer one - with various options for what order this happens in (sequence).
    • A minor upgrade is an in-place upgrade of the current MSI - with a number of restrictions.

    • The WiX visual studio template has the required element to implement a normal major upgrade:

      <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    • How To: Implement a Major Upgrade In Your Installer

    • Here is a step-by-step description of creating an MSI with WiX Votive (Visual Studio)

  2. Downgrade: The file versioning rules of Windows Installer are designed to actively prevent downgrading of files. Installshield has an article on the topic. This is to prevent dll-hell. Many people find this annoying as they want to down-grade their installed binaries (which is not a good thing to do - just uninstall the latest version and install the previous MSI for the previous version is better). Setting the REINSTALLMODE property is a modifier for file overwrite behavior.



Related Topics



Leave a reply



Submit