background preloader

Windows Installer

Facebook Twitter

Boneman's Blog: Custom Action Tutorial Part I %u2013 Custom Acti. This is the first part of a multi-part series on Custom Actions in the MSI world. The articles are designed to be read in order, as each one will build from knowledge gained in the previous ones. To give you a short roadmap, the series will start with some dry and boring theory, and the subsequent articles will start us down a path of writing Custom Actions in unmanaged C++, C#, and script. Custom Actions are used when the power of the Windows Installer engine's Standard Actions are not enough to accomplish a given installation task. For instance, installing or controlling a service is trivial using MSI Standard Actions, but creating a virtual directory in IIS is not. Before beginning, I'd like to make sure you have the proper environment to work under. This part covers some necessary background on the different Custom Action types and Custom Action scheduling.

Setting up your environment Let's get started We are going to use Orca to investigate the Orca.msi file. In the sequence tables. Aaron Stebner's WebLog : Windows Installer custom action tutoria. Steven Bone posted the first of a series of articles about how Windows Installer custom actions work and how to create and debug them. You can click on the link to read Part 1 - Custom Action Types and Sequences. This article describes how to configure the columns of the custom action table in an MSI, when to use immediate and deferred custom action types, how to handle rollback, and when to use the various custom action flags, options and conditions.

When using Windows Installer to create a setup, you can author most necessary actions using the standard MSI tables. However, there are some types of actions that are not supported using native MSI tables (such as the list I posted a while back). Because of this, using custom actions in your MSI will sometimes be necessary. Building a setup package is an integral part of the software development process, and the same level of care should be put into planning and designing the setup and deployment for your software.

Visual Studio Setup - projects and custom actions. Second in a series on Visual Studio setup. This article describes the kinds of custom actions that can be used in your Visual Studio setup project. Introduction It’s often necessary to add your own code to a Visual Studio setup project, which is accomplished using custom actions. Custom actions are in contrast to the standard actions that Windows Installer performs during an installation. Examples of standard actions include copying files and registering COM servers. (You can download the code examples to go with this article using the link to the right of the title.)

Properties and CustomActionData To understand the use of custom actions, it’s important to know how to use Windows Installer properties, and in particular the CustomActionData property. Remember that the properties can be standard Windows Installer properties (TARGETDIR, VersionNT and so on), or properties that you created yourself, perhaps by using Search Target Machine as we saw in the previous article. C++ custom action DLL. Error "ALLUSERS property is not 1..." when selecting "Just Me" o. Using RUNDLL32.exe to call a function within a dll. VB6's File System Objects. Article from Visual Developer Magazin. INFO: Windows Rundll and Rundll32 Interface. Microsoft Windows 95, Windows 98, and Windows Millennium Edition (Me) contains two command-line utility programs named Rundll.exe and Rundll32.exe that allow you to invoke a function exported from a DLL, either 16-bit or 32-bit.

However, Rundll and Rundll32 programs do not allow you to call any exported function from any DLL. For example, you can not use these utility programs to call the Win32 API (Application Programming Interface) calls exported from the system DLLs. The programs only allow you to call functions from a DLL that are explicitly written to be called by them. This article provides more details on the use of Rundll and Rundll32 programs under the Windows operating systems listed above. MIcrosoft Windows NT 4.0, Windows 2000, and Windows XP ship with only Rundll32. There is no support for Rundll (the Win16 utility) on either platform. The Rundll and Rundll32 utility programs were originally designed only for internal use at Microsoft. Rundll vs. Rundll command line. Windows Installer. Microsoft encourages third parties to use Windows Installer as the basis for installation frameworks, so that they synchronize correctly with other installers and keep the internal database of installed products consistent.

Important features such as rollback and versioning depend on a consistent internal database for reliable operation. Furthermore, Windows Installer facilitates the principle of least privilege by performing software installations by proxy for unprivileged users. Logical structure of packages[edit] A package describes the installation of one or more full products (Windows Installer does not handle dependencies between products) and is universally identified by a GUID (the PackageCode property).

Products[edit] A single, installed, working program (or set of programs) is a product. Features[edit] The package author defines the product features. Components[edit] Key paths[edit] Setup phases[edit] User interface[edit] Execute[edit] Execute phase happens in two steps: Rollback[edit] When setup isn't just xcopy : VBScript (and Jscript) MSI CustomA. Today was one of those days where you finally get around to looking at the time and wonder where the heck the hours went.

It wasn't even like I really got a lot done. I think my context switch costs have been really high lately. It feels good to finally be home chilling out to the Perfecto Chills albums. I thought I'd relate a short story to you why VBScript (and Jscript for that matter) should not be used for CustomActions in an MSI. Today, I realized it was 15:39 when a fellow developer, we'll call him Joe, called me at work.

My first thought was, "Jeez, it's almost 4 o'clock and I haven't got anything done! " My second thought was, "I bet Joe is screwed. " "Rob, have you been tracking the email thread about the CustomAction of mine that is failing? " That was it. Interestingly enough, a Windows Installer developer attached one of the many emails that I send to people when they are having problems using VBScript for CustomActions. 1. 2. 3. Joy of Setup - When VBScript and JScript custom actions are even. As everyone knows, script custom actions are inherently evil. A security addition to Windows Installer 4.0 in Windows Vista means that script CAs are even more likely to fail; see Heath’s blog entry on the issue and Aaron’s follow-up.

But did you know that script CAs, evil that they are, nonetheless ship in Orca, MsiVal2, and even the WiX toolset? Shocking but true. The Internal Consistency Evaluators (ICEs) are implemented as custom actions in .cub files that are MSI databases with a vastly different schema you’re used to seeing. Of 98 ICEs in the version of Darice.cub in the Windows Vista SDK, only four are written in VBScript — yet that’s all it takes to fail your build. If you run into the problem, check out the workaround Aaron offers before you take the drastic step of disabling validation.

Heath Stewart's Blog : Windows Installer Errors 2738 and 2739 wi.