1

I'd like users to be able to reconfigure their installation (turn components on/off) by clicking a button on the UI. This would launch the installer using the msiexec /i command (or equivalent), and would have the same effect as clicking 'Change' in the Programs & Features Windows dialog.

I have one potential way of doing this: Install a copy of the MSI and use that to trigger the installation wizard.

However, I'm wondering if I can locate and trigger the MSI installer wizard using the registry or some other method, rather than making a copy of the installer. Is this possible?

Community
  • 1
  • 1
fredley
  • 32,953
  • 42
  • 145
  • 236

2 Answers2

2

Uninstall information is stored in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<your app>, where <your app> is a name or a GUID (depending on your installation). Under your app's key, the ModifyPath value should hold the modification command - msiexec.exe /I ... or so.

Eran
  • 21,632
  • 6
  • 56
  • 89
2

You can call msiexec /i <ProductCode> and it will figure out the rest. You would need to store your product code somewhere - you could easily add an entry into the Registry table of your MSI which uses [ProductCode] as the value.

JohnL
  • 3,922
  • 3
  • 22
  • 22
  • Got it, this is actually listed in the registry according to @eran's answer, I found it just as your answer appeared! – fredley Jun 28 '12 at 11:50
  • You still have to know you product code, because under \Uninstall MSI will use that as the subkey. Once you know your product code, either mine or eran's solution will work and will 99.9% result in the exact same command. – JohnL Jun 28 '12 at 12:08
  • I do know my product GUID, as it's in WiX source used to build the MSI in the first place :-) – fredley Jun 28 '12 at 12:19
  • Right - in my installs I always use generate the GUID at build time - that simplifies certain things around some upgrade scenarios if I know the GUID will always change. However it does mean I don't know what the GUID will be so I'd have to record it somewhere. – JohnL Jun 28 '12 at 12:32