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

前端 未结 12 1513
醉酒成梦
醉酒成梦 2020-12-07 14:23

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:

相关标签:
12条回答
  • 2020-12-07 15:04

    I faced the same problem and did not like to suppress ICE validation. My setup: I used my own computer as a build agent on Visual Studio Online (VSO). My solution was to change the account used to run the service on my machine. Instead of using Network Service or Local Service I simply made the service log on with my own account which had all the necessary rights.

    0 讨论(0)
  • 2020-12-07 15:09

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

    0 讨论(0)
  • 2020-12-07 15:12

    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.

    0 讨论(0)
  • 2020-12-07 15:12

    I was getting same ICE error, but the problem turned to be corrupted Windows Installer Service. This solution worked for me: http://support.microsoft.com/kb/315353

    1. Log on to your computer as an administrator.
    2. Click Start, and then click Run.
    3. In the Open box, type cmd, and then click OK.
    4. At the command prompt, type msiexec.exe /unregister, and then press ENTER.
    5. Type msiexec /regserver, and then press ENTER.
    6. Restart Windows

    Also, verify that the SYSTEM account has full control access permissions to the HKEY_CLASSES_ROOT hive in the Windows registry. In some cases, you may also have to add Administrator accounts.

    0 讨论(0)
  • 2020-12-07 15:14

    From http://wix.sourceforge.net/faq.html#Error217:

    In WiX v3, Light automatically runs validation-- Windows Installer Internal Consistency Evaluators (ICEs) --after every successful build. Validation is a great way to catch common authoring errors that can lead to service problems, which is why it’s now run by default. Unfortunately, there’s a common issue that occurs on Windows Vista and Windows Server 2008 that can cause ICEs to fail. For details on the cause and how to fix it, see Heath Stewart's Blog and Aaron Stebner's WebLog.

    0 讨论(0)
  • 2020-12-07 15:14

    I have some suggestions.

    • Try updating the Microsoft Installer version on the build server
    • Make sure you use the newest release of WiX 3.0, since it's 3.0 release stable now.
    • If all else fails, try running the build service under a specific build user who you can fiddle with permissions for...
    0 讨论(0)
提交回复
热议问题