用Inno Setup做安装程序,如何还原SQL Server数据库文件? 用Inno Setup做安装程序,如何还原SQL Server数据库文件?这个贴子不知道应该发在哪个版本,自己觉得这里人气比较旺,还是发在这里了,版主见谅. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if Pos('database', WizardSelectedComponents(False)) > 0 then begin ErrorOccured := False; ScriptDlgPageOpen(); { Set some captions } ScriptDlgPageSetCaption('正在安装数据库'); ScriptDlgPageSetSubCaption1('系统正在安装和配置系统的数据库'); OutputMsg('这个过程可能需要几分钟的时间,请耐心等待……', False); filename := ExpandConstant('{app}\DB_file\webvision.sql'); LoadStringFromFile(filename, tmpFileContent); DBDataDir := ExpandConstant('{app}\DB_file'); StringChange(tmpFileContent, '数据库目录', DBDataDir); StringChange(tmpFileContent, 'local_host_add', LocalIP); SaveStringToFile(filename, tmpFileContent, False); if not RegQueryStringValue(HKLM, 'Software\Microsoft\Microsoft SQL Server\80\Tools\ClientSetup', 'SQLPath', ToolDir) then MsgBox('安装程序找不到SQL SERVER的工具osql.exe,无法安装数据库', mbError, MB_OK) else begin ToolDir := TrimRight(ToolDir); if not FileExists(ToolDir + '\binn\osql.exe') then MsgBox('just test...', mbError, MB_OK) else begin if not InstExec(ToolDir + '\binn\osql.exe', '-U "' + DBUserValues[0] + '" -P "' + DBUserValues[1]+ '" -i "' + filename + '" -o "' + DBDataDir + '\result.log" -b', '', True, True, SW_HIDE, RetValue) then// if RetValue <> 0 then begin MsgBox(SysErrorMessage(RetValue) + #13#13 '详细信息请查看日志文件:' + DBDataDir + '\result.log', mbError, MB_OK) ErrorOccured := True; end else ErrorOccured := False; end; end; ScriptDlgPageClose(True); 为什么我把这些代码放到[Code]段的时候编译通不过呢? 关于window录音机录音控制设定问题? SQL存取 .png格式的图片 请问各位大虾 delphi如何打包开发的工程 TreeView怎样可以通过选择当前节点来活得该节点的顶层节点名称?如何可以屏蔽对节点的Text进行修改?如何可以让Label的背景为透明? 如何定义各个Form都能调用的全局函数? 动态生成变量的问题,望各位帮忙! delphi如何动态生成网络拓扑图,并显示路径度的描述? 显示了多个表,如何删除里面的数据,给个思路? 100分———帮帮忙 一组bmp文件转换成avi 上海耀华称重仪表相关开发 fastreport使用 ole的问题
begin
ErrorOccured := False;
ScriptDlgPageOpen();
{ Set some captions }
ScriptDlgPageSetCaption('正在安装数据库');
ScriptDlgPageSetSubCaption1('系统正在安装和配置系统的数据库');
OutputMsg('这个过程可能需要几分钟的时间,请耐心等待……', False); filename := ExpandConstant('{app}\DB_file\webvision.sql');
LoadStringFromFile(filename, tmpFileContent);
DBDataDir := ExpandConstant('{app}\DB_file');
StringChange(tmpFileContent, '数据库目录', DBDataDir);
StringChange(tmpFileContent, 'local_host_add', LocalIP);
SaveStringToFile(filename, tmpFileContent, False);
if not RegQueryStringValue(HKLM, 'Software\Microsoft\Microsoft SQL Server\80\Tools\ClientSetup', 'SQLPath', ToolDir) then
MsgBox('安装程序找不到SQL SERVER的工具osql.exe,无法安装数据库', mbError, MB_OK)
else
begin
ToolDir := TrimRight(ToolDir);
if not FileExists(ToolDir + '\binn\osql.exe') then
MsgBox('just test...', mbError, MB_OK)
else
begin
if not InstExec(ToolDir + '\binn\osql.exe', '-U "' + DBUserValues[0] + '" -P "' + DBUserValues[1]+ '" -i "' + filename + '" -o "' + DBDataDir + '\result.log" -b', '', True, True, SW_HIDE, RetValue) then
// if RetValue <> 0 then
begin
MsgBox(SysErrorMessage(RetValue) + #13#13 '详细信息请查看日志文件:' + DBDataDir + '\result.log', mbError, MB_OK)
ErrorOccured := True;
end
else
ErrorOccured := False;
end;
end;
ScriptDlgPageClose(True);