zoukankan      html  css  js  c++  java
  • 打包.Cab时“x.inf contains DirIDs, which are not supported”

      Mobile打包成cab时,出现如下错误:

         File c:\docume~1\ghqian\locals~1\temp\wiz196.inf contains DirIDs, which are not supported

       以下文章来自:http://blogs.msdn.com/b/raffael/archive/2008/03/18/x-inf-contains-dirids-which-are-not-supported.aspx

    Since looking around over the web I didn't find any reference to this particular case, I think it's worth writing it here. I tracked down this issue recently together with a developer that wanted to package "many" files within a single .CAB (1000+). He was using a quite old version of CabWiz.exe, launched through an application he wrote. So, as the initial troubleshooting step, I tried to reproduce the issue with the CabWiz.exe shipped with Visual Studio 2008: same problem.

    Above all, this error can arise from CabWiz (which is internally invoked by VS2008 when creating Smart Device CAB Projects) also if you're using '%' in registry keys, as my friend Chris reported in his How to avoid hardcoding file paths within CAB file registry settings, in order to add registry values that refer to the location of files installed as part of the application.

    So I thought: ok, he's hitting the known limit of 998 files that could be packaged in a CAB... Wrong: the problem happened also when using much less files, say 300... I'm still talking about C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\CabWiz.exe, version 4.0.4332.0.

    After running some tests, I reached a magic number: 262. With 262 files VS2008 could create a Smart Device CAB successfully, with 263 files it gave error "x.inf contains DirIDs, which are not supported". At this point I noticed that in the .INF file that VS2008 creates and gives to CabWiz.exe, it wrote an entry under [DestinationDirs] for each added file, even if the target folder on the device is the same, as it was in my case. By manually editing the INF (using some applications that automated lines-creation...), I could successfully create a CAB for 263+ files, specifying only one entry under [DestinationDirs]. So, another limit I wasn't aware of is: VS2008's CabWiz can parse up to 262 different entries under [DestinationDirs].

    Now: Windows Mobile 6 SDKs ship with a newer version of CabWiz.exe, v4.5.5102.0 and, very interestingly, it overcame not only the limitation about 998 files, but also the one about 262 entries under [DestinationDirs]. So the "simple" solution in this case was to download one of the 2 Windows Mobile 6 SDKs and use that CabWiz.exe (C:\Program Files\Windows Mobile 6 SDK\Tools\CabWiz).

    Playing with files under C:\Program Files\Microsoft Visual Studio 9.0 is not recommended (and probably "not supported"), however for testing purposes I replaced C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\CabWiz.exe and CabWiz.ddf with the ones under C:\Program Files\Windows Mobile 6 SDK\Tools\CabWiz, and now my VS2008 can continue creating one entry under [DestinationDirs] for each file, independently if the target folder will the be same, but now it successfully creates the CAB. I imagine there are still some limits, but this may be a topic of another post... Smile


    =======================================================================
    野文(Jasson Qian)
    ------------------------------------------------------
    博客园:http://qguohog.cnblogs.com
    CSDN:http://blog.csdn.net/sallay
  • 相关阅读:
    【原】作一个有自控力的人,开始你的时间规划吧!
    【原】关于Python中setuptools安装的问题
    【原】2014年3月学习进度报告
    【原】2014年1月、2月学习进度报告
    【原】我的2014年学习提升计划
    【原】得心应手小工具开发——IE代理快速切换工具
    【原】从头学习设计模式(七)——适配器模式
    【原】从头学习设计模式(六)——观察者模式
    【原】从头学习设计模式(五)——装饰者模式
    【原】从头学习设计模式(四)——抽象工厂模式
  • 原文地址:https://www.cnblogs.com/qguohog/p/2918734.html
Copyright © 2011-2022 走看看