Windows Installer Custom Action

Windows Installer Custom Action Rating: 7,9/10 6741 votes

Custom Actions.; 2 minutes to read; In this article. The Windows Installer provides many built-in actions for performing the installation process. For a list of these actions, see the Standard Actions Reference. Standard actions are sufficient to execute an installation in most cases.

Windows

Windows Installer Vbscript Custom Action


Pre-req
Powershell Script which does the task you want to achieve
machine should have powershell installed on it. Hence these type of custom actions will fail on windows XP

Now Installshield doesnt offer adding a new powershell custom action atleast in the MSI / MST. though this feature is present in the ISM and the same is true for KillProcess custom which comes shipped with Installshield 2013(still working on the turnaround for this custom action and will be covered up in the next blog).

Windows Installer Custom Action 8

Darwin Transform and Its Application in Windows Installer Custom Actions. In some cases, using Windows Installer API functions does not provide information about certain specific elements of a Windows Installer package. Let us consider the following scenario. During the initial installation, the setup disables some features (setting their. Step 4: Add custom Actions, click on custom action icon Custom actions are for adding code that is needed to be executed during installation. Note: One important fact is that we can not run any code before installation starts, any code will run only after the installer. It’s worth noting that Windows Installer doesn’t know whether a custom action is an install or an uninstall, which is how custom actions appear in the Visual Studio IDE. Visual Studio adds a condition to the custom actions that is true on an install or an uninstall, but you can’t see it in the IDE. The Windows Installer Custom Actions. In the User Interface Sequence only immediate custom actions can be used. It contains a list of Standard Actions starting with Begin and ending with ExecuteAction. ExecuteAction is the one that triggers the execute sequence. At the end of the installation process, the installer returns from the execute sequence in the UI Sequence. I have written custom installation form (code in C#), which is invoked through the Custom action (of windows installer.msi). I have a cancel button in the form. Now i need to rollback the installation process (Remove all files added / copied, and also the registry entries made), when i click. If you want to undo (rollback) what the custom.

So as one of my friend on this forum suggested , if we wish to execute powershell based custom action we'll have to go via using an EXE based custom action. Hence implementing the same , following are the steps to be followed to add a powershell custom action in your package, then be it MSI/MST

Arduino programming software.
1. Create a directory structure which mimics the location of powershell.exe present on our system which is C:WindowsSystem32WindowsPowerShellv1.0. (creating directory structure shouldnt be much of a pain for you all)
2. Next Add the PS1 file in your package in a suitable location, preferrably INSTALLDIR (I find it adding in that location more convinient than any other location due to ease of accessing it but the choice of location solely depends on the user.)
3. Next Add custom action of the type 3106 which is EXE stored in a directory table. so the custom action table will now look as follows

Windows Installer Custom Action Table


Action:StopService(Name of my custom action)

Windows Installer Custom Action C++

Type:3106

Visual Studio Custom Installer

Source:v10(The directory structure i created to mimic the location of pwoershell.exe present on my location)

Target:powershell.exe -file '[INSTALLDIR]ServiceTest.ps1'

Custom

Now next step is faily simple which is scheduling the custom action and defining its in script execution .
Cheers you're done. Test the application.

Hope this little tutorial helps you'll. Let me know in case of any issues