|
用Delphi编写安装程序(3)
俞文群 2001-04-09 13:15:34
RegFile.Free;
end
Step 6:安装数据库驱动(与SETP 4对应)
//安装数据库驱动程序
var
cmdlinepchar:array[0..120] of char;
startupinfo:tstartupinfo;
processinfo:tprocessinformation;
begin
screen.cursor:=crhourglass;
strpcopy(cmdlinepchar,trim(FrmPathSelect.EdtDir.Text)+‘mdac_typ.exe /q‘);
fillchar(startupinfo,sizeof(startupinfo),#0); //置0
with startupinfo do
begin
cb:=sizeof(startupinfo);
dwflags:=startf_useshowwindow or startf_usestdhandles;
wshowwindow:=sw_hide; //隐藏被调用程序窗口
end;
if createprocess(nil,cmdlinepchar,nil,nil,true,0,nil,nil,startupinfo,processinfo) then
//创建进程
begin
waitforsingleobject(processinfo.HProcess,infinite); //等待进程结束
end
else
begin
exit;
end;
screen.cursor:=crDEFAULT;
DeleteFile(PChar(trim(FrmPathSelect.EdtDir.Text)+‘mdac_typ.exe‘));
end;
Step 7:创建程序组
变量:
var
smacro:string;
szmacro:array[0..254] of char;
sgroupdesc,sgroupname:string;
sprogdesc:string;
sprogicon:string;
//创建主程序组
//打开对话通路
if ddeclientconv1.OpenLink then
begin
//建立组群
sgroupdesc:=‘宁波大学课件管理系统 ‘;
sgroupname:=‘宁波大学课件管理系统 v1.0‘;
//组成宏指令
smacro:=‘[creategroup(‘+sgroupdesc+‘,‘+sgroupname+‘)]‘;
strpcopy(szmacro,smacro); //转成null-term 字串
ddeclientconv1.ExecuteMacro(szmacro,false); //执行宏指令
//建立ICON图像
sprogicon:=trim(FrmPathSelect.EdtDir.Text)+‘Tnbdemo.exe‘;;
|首 页||上一页||下一页||尾 页|
|