How can I find the upgrade code for an installed application in C#?

I have discovered the upgrade codes are stored in the following registry location. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes The registry key name is the upgrade code and the registry key value name is the product code. I can easily extract these values however the codes are stored in a different format. The red circle shows the formatted upgrade code, … Read more

Prerequisites button disabled – MSI installer

Prerequisities in Visual Studio Projects In Configuration at the top of the dialog, did you try to select either Release or Debug? That should enable the Prerequisites… button. Unecessary, outdated prerequisites? One pet-peeve of mine: is it really necessary to include the .NET runtime as a prerequisite when most users have it installed by their … Read more

Wix custom uninstallation action – how to run before msi removing files

The problem is that my custom uninstallation action runs after the removal of standard install files That’s because you have scheduled it before InstallFiles, which comes after RemoveFiles in a standard InstallExecuteSequence. You can also open your MSI file in an editor like Orca or InstEd and have a look at the InstallExecuteSequence table. Sort … Read more

How do I add/update a property inside an MSI from the command-line?

Example VBScript that you could use to update (or add) a property post-build… Option Explicit Const MSI_FILE = “myfile.msi” Dim installer, database, view Set installer = CreateObject(“WindowsInstaller.Installer”) Set database = installer.OpenDatabase (MSI_FILE, 1) ‘ Update Set view = database.OpenView (“UPDATE Property SET Value=”” & myproperty & “” WHERE Property = ‘MYPROPERTY'”) ‘ .. or Add … Read more

Simplest solution to replace a tiny file inside an MSI?

Okay, revisiting this question with my own answer providing nice little VB script that will do all heavy lifting. As mentioned in the original question, the aim was provide a simple solution for sysadmin users to make the updates/changes themselves. Below is a simplified version of the code I’m currently providing to customers Option Explicit … Read more