1.InnoSetup中怎样在安装前执行一个DOS的批处理文件?
2.Twebbrowser到底怎样识别"无法找到该页"或"该页无法访问"出错事件??网上找了半天没有靠谱的

解决方案 »

  1.   

    第一个问题,可以在InnoSetup中加脚本实现
    第二个问题,可以截获返回值,404(不一定对,又肯能是400)表示无法找到该页,或者你直接判断返回是否是200(表示正常)就可以了。
      

  2.   


    IDHTTP是不是同样这么判断的?
      

  3.   

    1.我当然知道是用脚本,但怎么写?
    2..Navigate根本没有返回值
      

  4.   

    Pascal Scripting: Scripted Constants
    The Pascal script can contain several functions which are called when Setup wants to know the value of a scripted {code:...} constant. The called function must have 1 String parameter named Param, and must return a String value.The syntax of a {code:...} constant is: {code:FunctionName|Param}FunctionName specifies the name of the Pascal script function. 
    Param specifies the string parameter to pass to the function. If you omit Param, an empty string will be passed. 
    If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25". 
    Param may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere. 
    Example:
    DefaultDirName={code:MyConst}\My ProgramHere is an example of a [Code] section containing the MyConst function used above.[Code]
    function MyConst(Param: String): String;
    begin
      Result := ExpandConstant('{pf}');
    end;
    If the function specified by the {code:...} constant is not included in the [Code] section, it must be a support function. Here is an example.[INI]
    FileName: "{app}\MyIni.ini"; Section: "MySettings"; Key: "ShortApp"; String: "{code:GetShortName|{app}}"See also
    Constants 
      

  5.   

    Inno的脚本,它的帮助里就有。
      

  6.   


    老实说这方法比较笨,我不信twebbrowser根本没提供失败时的返回??