0
我创建一个安装程序,我有操纵字符串中的自定义操作:自定义操作错误 - 类型不匹配:[字符串:“C:”]
<CustomAction Id="CheckDataPath2" Script="vbscript" Execute="immediate" Return="ignore">
<![CDATA[
Dim p
p=Session.Property("DATALOCATION")
Dim s
s=Right(1,p)
If (s="/") OR (s="\") Then
Session.Property("PROCEED")="1"
Else
Session.Property("PROCEED")="2"
End If
]]>
</CustomAction>
<InstallExecuteSequence>
<Custom Action="CheckOrigPath2" Before="InstallInitialize">CONTINUE</Custom>
</InstallExecuteSequence>
在日志文件中,我可以看到这个自定义操作正在抛出一个错误。它说:
Microsoft VBScript runtime error 5: Type mismatch: '[string: "C:\"]'
“C:\”是DATALOCATION属性的值。我试过p = CStr(Session.Property("DATALOCATION"))
,这也不起作用。
任何人都知道这里发生了什么?
任何建议将不胜感激。
非常感谢!我永远不会想到这一点。 – user2437443