您是通过命令行还是通过msbuild或某种自动方法构建?如果你是,你可以用下面的方法:
:: Change Product Code for Build
FOR /f "delims=" %%i IN ('"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64\uuidgen.exe"') DO SET productcodeguidcl=%%i
"C:\PATHTOFNR\fnr.exe" --cl --dir "C:\PATHTOYOURISM" --fileMask "YOUR.ism" --useRegEx --alwaysUseEncoding "utf-8" --find "ProductCode.*{.*}" --replace "ProductCode</td><td>{%productcodeguidcl%}"
注意下面的示例假定您有uuidgen.exe(免费),构建服务器上,还需要免费工具fnr.exe(https://findandreplace.codeplex.com/)
我们用它进行基本的微星,微星INSTALLSCRIPT的一段时间和项目INSTALLSCRIPT没有任何问题,直到我们终于接通我们的项目到Installshield的API的。