.INF files: how to concatenate values in [Strings] section?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 14:32:40

问题


I have this in my .inf:

[Strings]
Driver_Name = "Our driver, build version 1112"

For some reason (better SVN hook compatibility - want to assing build number at each time I commit .sys), want this to be:

[Strings]
DrvVer = "1111";
Driver_Name = "Our driver, build version %DrvVer"

Unfortunately, this doesn't get processed, so %DrvVer% remains in place; the other idea is to use "%Driver_Name% %DrvVer%" construct outside of [Strings], but don't sure how to join this parts, too.


回答1:


im not familiar with SVN hooks but maybe some info about INF files will help you.

as far as i know %strings% are not interpreted within the String section.

If you want to concat them "%Driver_Name% %DrvVer%" is already the correct syntax, but it doesnt work within the strings section

i wonder why you are putting the version in the strings section. microsoft already implemented a special Version section for INF files. please take a look at this links:

INF Version Section

INF DriverVer

you could lay out your INF like this:

[Strings]
DrvVer = 1111
BuildDate = 01/11/2011

[Version]
DriverVer=%BuildDate%,%DrvVer%
DriverPackageDisplayName="our driver, build version %DrvVer%"

it should work and looks more standard



来源:https://stackoverflow.com/questions/8150520/inf-files-how-to-concatenate-values-in-strings-section

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!