Questions tagged [custom-action]

A custom action is custom code provided by a developer to be called during a Windows Installer setup. Windows Installer tools (such as WiX, Visual Studio Setup Projects, InstallShield, Wise, Advanced Installer and so on) provide support for incorporating custom actions into your Windows Installer setup.

A custom action is most often custom code called from a Windows Installer setup (an MSI file). Most tools (such as WiX, Advanced Installer, InstallShield, Visual Studio setup projects) provide support for calling custom actions. There are several types of custom action in Windows Installer setups:

  1. Setting a Property (although called a custom action this type 51 one doesn't run user-provided code).
  2. Setting the location of a Directory.
  3. Running embedded VBScript or JScript code.
  4. Calling an external VBScript or JScript file.
  5. Calling a method from a C++ DLL.
  6. Running an executable.
  7. Sending an error that stops the install (a type 19 custom action that doesn't run any user-provided code).
  8. Managed code custom actions called with Visual Studio's installer class mechanism.
  9. Managed code custom actions called via the DTF mechanism, in most cases from WiX-generated setups.
1032 questions
8
votes
2 answers

How do you execute a custom action in WiX only if an installed feature is being uninstalled?

I have a WiX installer that has per-feature custom actions that need to be executed on uninstall. Right now I'm running into a problem where the actions execute whether or not the feature was actually installed by the user. The custom actions fail…
dskiles
  • 851
  • 1
  • 13
  • 24
8
votes
1 answer

Stop windows service before perform the uninstallation

I have an installer that installs few components including windows service, after it installed it'll start the service that installed onto the system using CustomAction. The problem when I uninstall the application, the installer asks to close the…
Amer Sawan
  • 2,126
  • 1
  • 22
  • 40
8
votes
1 answer

Targets seem to be building in the wrong order when building Wix Custom Action under TeamCity

I'm having problems getting my CI build to work under TeamCity. I've got similar projects that build OK, so I don;t think it is a TeamCity problem per se, but I've looked at this so much I'm starting to go code blind and I fear I may be missing the…
Tim Long
  • 13,508
  • 19
  • 79
  • 147
8
votes
3 answers

How do you add custom menu actions programmatically in SharePoint?

I need to add a custom menu action to a custom content type programmatically in c#. This is because I will not know the URL I need to link to beforehand. The URL to link to will be pulled from configuration when the feature is activated. I have…
Steve
7
votes
5 answers

Run batch file in Windows Installer Commit

I am having no success in modifying a Windows Installer MSI to run a batch file after the primary output has been installed. I have searched for this and found many suggestions, but nothing that works. Add a Custom Action Custom actions can only be…
Dour High Arch
  • 21,513
  • 29
  • 75
  • 90
7
votes
4 answers

Custom Action not working - Visual Studio Setup Project

In the past we have used Advanced Installer to build our .msi installers for a particular project. Our yearly license for Advanced Installer has expired, so to avoid the renewal cost, and because I think the same can be accomplished with Visual…
7
votes
1 answer

how to mock Microsoft.Deployment.WindowsInstaller Session

I am using C#. I have created a Wix installer and a custom action to support the wix installer. Now I am trying to create a unit test the CustomAction only, without LUX. I have tried in many different ways, but I am unable to Mock the…
7
votes
1 answer

Wix CustomAction [C#] session.Message is not show during the installation

This is WIX script fragment NOT INSTALLED
drgrd
  • 73
  • 1
  • 4
7
votes
2 answers

WIX: Using a temporary file during install

I am writing a WIX installer and I have a following requirement: During installation, I need to pass an absolute path to a file (lets call it A) included in my installer to a COM component, which already exists on the hard drive and is a part of…
madbadger
  • 644
  • 2
  • 10
  • 15
7
votes
3 answers

WiX 3.7: How to delete registry key on uninstall based on condition set by user?

I need to allow a user to specify whether the installer should remove or retain a registry key during uninstallation. Here is what I do. I have a RemoveRegistryKey component with a Condition element that looks like this:
Alek Davis
  • 10,628
  • 2
  • 41
  • 53
7
votes
1 answer

Wix - Run an exe ( with arguments ) at end of install, which wasn't installed by current MSI

I have a MSI created in WiX 3.6 that obviously installs various things and creates a shortcut to an exe that isn't actually installed by my MSI ( we know for certain that the exe is located in a specific folder, because it's installed by a seperate…
Tall Tyke
  • 171
  • 1
  • 3
  • 14
6
votes
1 answer

Wix: Can execute a custom action before InstallValidate?

During uninstall progress, the installer displays below message: "The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup." I think it's…
jcha
  • 629
  • 1
  • 8
  • 16
6
votes
1 answer

can't pass properties to WiX custom action

I've read How do I pass msiexec properties to a WiX C# custom action? , but that didn't answer my question, or maybe I just don't see what I am doing wrong. My install package fails to install, and the logs say that my property wasn't found in the…
Bogdan Verbenets
  • 25,686
  • 13
  • 66
  • 119
6
votes
2 answers

Why is it a good idea to limit the use of custom actions in my WiX / MSI setups?

Why is it a good idea to limit the use of custom actions in my WiX / MSI setups? Deployment is a crucial part of most development. Please give this content a chance. It is my firm belief that software quality can be dramatically improved by small…
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
6
votes
1 answer

How do I write custom action DLL for use in an MSI?

This is a question I intend to answer myself, but please feel free to add other ways to accomplish this. I was packaging an application for use on a wide variety of configurations, and I determined that the most reliable way to perform custom logic…
Mick
  • 13,248
  • 9
  • 69
  • 119