Inno Setup在安装完成页面中加入选择打开网站/网页的功能

加入下面代码就行乐:
[Run]
Filename: "{app}/MyProg.exe"; Description: "{cm:LaunchProgram,我的程序}"; Flags: nowait postinstall skipifsilent
Filename: "http://vod.wanshitong.net.cn/"; Description: "进入万视通免费电影观看中心"; Flags: postinstall shellexec skipifsilent

运行可执行文件

var

  FileName, Params: String;

  ResultCode: Integer;

begin

    FileName := ExpandConstant('{app}/application.exe');

    Params := ExpandConstant('-x " ');

    Exec(FileName, FileName + ' ' + Params, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);

end;

 

 

or like this:

 

var

  ErrorCode: Integer;

begin

  ShellExec('open', 'http://www.163.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);

end;

 

 

Inno Setup中进行MD5的校验

var
ComMD5: Integer;
FileExit: Boolean;

begin
if CurPageID = wpSelectDir then
begin
  FileExit := FileExists(ExpandConstant('{app}/abcde.exe'));//判断文件 abcde.exe 是否存在于安装目录下
 
  if FileExit = false then begin//如果未找到
    MsgBox('未在该文件夹中搜索到 abcde V0.0.1'#13#13'请选择正确的目录!', mbInformation, MB_OK);
    Result := False;
  end else if FileExit = True then begin
    ComMD5 := CompareStr(GetMD5OfFile(ExpandConstant('{app}/ abcde.exe')), '56faga4457fa87fda4654f5645afdafddafdaf');//计算文件 MD5 值,并把结果返回给 ComMD5,0 代表相等
    if ComMD5 <> 0 then begin//如果文件不相同
    MsgBox('文件版本不对或文件已被应用过补丁!'#13#13'请安装正确的版本或退出当前安装程序!', mbInformation, MB_OK);
    Result := False;
    end else
    Result := True;
  end;
end
else
  Result := True;
end;
 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值