在 .msi 中 的 Component table,查看 ComponentId 列,是一个16进制数的字符串,
用 InstallShield IDE 添加一个 component ,ComponentId 会自动生成,点击“Generate GUID” 会重新生成一个新的 ComponentId,
如何用 vbscript 生成 GUID 呢?
Call CreateGUIDFunction CreateGUIDDim TypeLibSet TypeLib = CreateObject("Scriptlet.TypeLib")' (line 1) & VbCrLf & (line 2) is equivalent with \n , to start a new line WScript.Echo "GUID 1: " & Mid(TypeLib.Guid, 2, 36) & VbCrLf & "GUID 2: " & Left(TypeLib.Guid, 38) & VbCrLf & "GUID 3: " & TypeLib.GuidEnd Function
执行结果:
参考:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/adc7c091-8476-4dc9-bd10-c28186982ae3/equivalent-for-a-n-new-line-character-in-visual-basic?forum=vbgeneral