WiX 3.0 throws error 217, while being executed by continuous integration
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
.
Adding the TFS build controller account to local admin group and restarting the windows service did the job for me.
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.
The correct description (without a solution, except if adding the CruiseControl account into local administrators group can pass as a solution) of the problem:
Quote from Wix 3.5 & Cruise Control gives errorLGHT0217:
ICE validation needs an interactive account or administrator privileges to be happy. See for example WiX Projects vs. TFS 2010 Team Build (2009-11-14) or Re: [WiX-users] Help with building patch (2009-11-20).
imagi is totally right! I could not believe this is the true answer. Supressing validation and making TFS user Administrator are not good solutions. Plus I could not find NT\Authority to add it to Administrators group and was totally stuck in this.
I got the same error on Windows Server 2012 Datacenter as Build Agent. To solve the problem :
- List item
- Go to Environment Variables on the build agent machine
- Create two System Variables
-
"PF86"
which is equal to"C:\Program Files (x86)"
-
"PF"
which is equal to"C:\Program Files"
- They are so short because I want to save characters.I made them without the final backslash because TEMP, TMP and others were made so and I decided to stick to MS standard for these variables.
- Edit PATH variable by substituting every
"C:\Program Files (x86)"
with%PF86%
and every"C:\Program Files"
with%PF%
- Close and build and enjoy!
- It worked for me. :)
UPDATE I found a better solution : Rapid Environment Editor will do all this and even more for you. Automatically.