Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX 3.0 throws error 217, while being executed by continuous integration

This is the error that is thrown by our automated build suite on Windows 2008, while running ICEs (after migrating from WiX 2.0 to WiX 3.0):

LGHT0217: Error executing ICE action 'ICE01'. The most common cause of this kind of ICE failure is an incorrectly registered scripting engine. See http://wix.sourceforge.net/faq.html#Error217 for details and how to solve this problem. The following string format was not expected by the external UI message logger: "The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.". in light.exe(0, 0)

Additionally, these are the errors that show up in the event log:

MSIInstaller: Failed to connect to server. Error: 0x80070005 Product: [ProductName] -- Error 1719. The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.

Intuitively:

  • VBScript and JScript were registered under admin.
  • Integration service has permissions for the desktop interaction and all the files
  • Builds succeed, when executed manually on the same machine by another user or even user logged in as integration account (via RDP)

I'm out of ideas so far.

How do I solve this problem while keeping ICE validation?

like image 219
Rinat Abdullin Avatar asked Jun 30 '09 16:06

Rinat Abdullin


3 Answers

End of the story:

After fiddling with the permissions of the integration account, DCOM, service activation, etc. without any luck, I finally simply disabled ICE validation in the continuous integration build, while still keeping it in the local build.

To disable ICE validation you can set SuppressValidation to true in the .wixproj file:

    <PropertyGroup>
        <SuppressValidation>true</SuppressValidation>
    </PropertyGroup>

Or pass the -sval command line option to light.exe.

like image 78
Rinat Abdullin Avatar answered Sep 20 '22 13:09

Rinat Abdullin


Adding the TFS build controller account to local admin group and restarting the windows service did the job for me.

like image 20
Casper Leon Nielsen Avatar answered Sep 18 '22 13:09

Casper Leon Nielsen


I found the root cause. I tried everything I found, including custom validator extension similar to one posted in Re: [WiX-users] light.exe failed randomly when running ICEs..

It's not a concurrency issue as suggested in various threads. It's caused by a too large Process Environment Block (PEB).

It turns out Windows Installer can’t handle a process environment block larger than 32 kB. In my environment, due to number of variables set by the build system and their size (for example, PATH variable containing multiple duplicated values), PEB was about 34 kB.

Interestingly, per Environment Variables, Windows XP and 2003 had a hard limit of PEB set to 32 kilobytes. That would probably cause an easy-to-catch build break in an earlier phase of the build. Newer Windows' doesn’t have such limit, but I guess that Windows Installer developers limited their internal environment buffers to 32 kB and fail gracefully when the value is exceeded.

The problem can be easily reproduced:

  • Create a .bat file which sets environment variables which size exceeds 32 kB. For example, it can be 32 lines of set Variable<number>=<text longer than 1024 characters>
  • Launch cmd.exe
  • Execute the batch file you created
  • From the same cmd.exe window:
    • Try building the MSI package using WiX with ICE validation on OR
    • Run smoke.exe to validate your package OR
    • Simply run msiexec /i Package.msi
  • All the above commands will end up reporting Error 1719 - Windows Installer could not be accessed.

So, the solution is - review your build scripts and reduce number and size of environment variables so they all fit into 32 kB. You can easily verify the results by running:

set > environment.txt

The goal is to get file environment.txt smaller than ~30 kB.

like image 30
imagi Avatar answered Sep 20 '22 13:09

imagi