Inno Setup 打包工具 调用MSI格式


[Code]
 procedure InstallDb;
 var
Path:string;
Path1:string;
Path2:string;
Path3:string;
Path4:string;
ResultCode: Integer;
RegPath:string;
CrystalReportsPath:string;
CrystalReportsChsPath:string;
ReportViewerPath:string;
ReportViewerLPPath:string;

DownUrl:string;
CrystalReportsFile:string;
CrystalReportsFileChs:string;
ReportViewerFile:string;
ReportViewerFileLP:string;
PackFile:string;
begin
RegPath:='SOFTWARE/Microsoft/.NETFramework/policy/v2.0';
CrystalReportsPath:='SOFTWARE/Classes/Installer/Products/8C4D878457793734882EBDA4FB3D2AD4/SourceList/Net';
CrystalReportsChsPath:='SOFTWARE/Classes/Installer/Products/8C4D878457793734882EBDA4FB3D2AD4';
ReportViewerPath:='SOFTWARE/Classes/Installer/Products/8C4D878457793734882EBDA4FB3D2AD4/SourceList/Media';
ReportViewerLPPath:='SOFTWARE/Classes/Installer/Products/8C4D878457793734882EBDA4FB3D2AD4/SourceList';

PackFile:='{app}/dotnetfx2.exe';
CrystalReportsFile:='{app}/CRRedist2005_x86.msi';
CrystalReportsFileChs:='{app}/CRRedist2005_x86_chs.msi';
ReportViewerFile:='{app}/ReportViewer.exe';
ReportViewerFileLP:='{app}/ReportViewerLP.exe';


//.Net Framework2.0
if RegKeyExists(HKLM, RegPath) then
begin
  //MsgBox('系统己安装2.0!',mbInformation,MB_OK);
end
else
//begin if
//  MsgBox('系统检测到您没有安装.Net Framework2.0运行环境,是否立即安装?',
//  mbConfirmation, MB_YESNO) = idYes then
begin
  Path := ExpandConstant(PackFile);
  if(FileOrDirExists(Path)) then  //检测文件是否存在
  Exec(Path, '/q', '',
  SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
//end
end


//CrystalReportsPath
if RegKeyExists(HKLM, CrystalReportsPath) then
begin
  //MsgBox('系统己安装CrystalReportsPath!',mbInformation,MB_OK);
end
else
//begin if
//  MsgBox('系统检测到您没有安装.CrystalReportsPath运行环境,是否立即安装?',
 // mbConfirmation, MB_YESNO) = idYes then
begin
  Path := ExpandConstant(CrystalReportsFile);
  if(FileOrDirExists(Path)) then  //检测文件是否存在
  ShellExec('', Path, '', '', SW_SHOW, ewNoWait, ResultCode)
//end
end


//.CrystalReportsChsPath
if RegKeyExists(HKLM, CrystalReportsChsPath) then
begin
  //MsgBox('系统己安装2.0!',mbInformation,MB_OK);
end
else
//begin if
//  MsgBox('系统检测到您没有安装.CrystalReportsChsPath运行环境,是否立即安装?',
//  mbConfirmation, MB_YESNO) = idYes then
begin
  Path := ExpandConstant(CrystalReportsFileChs);
  if(FileOrDirExists(Path)) then  //检测文件是否存在
  ShellExec('', Path, '', '', SW_SHOW, ewNoWait, ResultCode)
//end
end


//.ReportViewerPath
if RegKeyExists(HKLM, ReportViewerPath) then
begin
  //MsgBox('系统己安装2.0!',mbInformation,MB_OK);
end
else
//begin if
//  MsgBox('系统检测到您没有安装ReportViewerPath运行环境,是否立即安装?',
//  mbConfirmation, MB_YESNO) = idYes then
begin
  Path := ExpandConstant(ReportViewerFile);
  if(FileOrDirExists(Path)) then  //检测文件是否存在
  Exec(Path, '/q', '',
  SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
//end
end


//.ReportViewerLPPath
if RegKeyExists(HKLM, ReportViewerLPPath) then
begin
  //MsgBox('系统己安装2.0!',mbInformation,MB_OK);
end
else
//begin if
//  MsgBox('系统检测到您没有安装.ReportViewerLPPath运行环境,是否立即安装?',
//  mbConfirmation, MB_YESNO) = idYes then
begin
  Path := ExpandConstant(ReportViewerFileLP);
  if(FileOrDirExists(Path)) then  //检测文件是否存在
  Exec(Path, '/q', '',
  SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
//end
end
end;

function NextButtonClick(CurPageID:Integer ):Boolean;
var
    ResultCode: Integer;
    ErrorCode : Integer;
    CrystalReportsFile:string;
    Path1:string;

begin
if (CurPageID = wpFinished) then begin
    InstallDb;
    Result := true;
end
else
begin
  Result := true;
end
end;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值