关于使用 inno setup 的一点问题(100分)

  • 主题发起人 主题发起人 LIUZHOU
  • 开始时间 开始时间
L

LIUZHOU

Unregistered / Unconfirmed
GUEST, unregistred user!
我想询问一下,如果我想把一些自编译好的dll拷到指定的目录下,
比如把test.dll拷到Microsoft Sql Server/MsSql/Data/ 目录下
为确定sqlserver的位置,我必须先运行
一条sql语句“select top 1 filename from sysfiles”得到的filename还要进行拆分
才能得到想要的目录,并且我还要先判断系统是否安装了SQLServer,
如果没有就要跳出;我要求的系统必须win2000server以上,请问怎么办呢?
急!!!
 
用 My Inno Setup Extensions 3.06
http://www.wintax.nl/isx/
有源代码
 
同意楼上,找源代码然后自已改吧
 
function CheckMSSQLServerISSetup: Boolean;
Var //判断当前计算机是否安装MSSQQLServer
SQLPath,SQLDataRoot,SourcePath:String;
begin
Result:=False;
//得到SQL安装目录
IF RegValueExists(HKLM,'Software/Microsoft/MSSQLServer/Setup','SQLPath') then
RegQueryStringValue(HKLM,'Software/Microsoft/MSSQLServer/Setup','SQLPath',SQLPath)
else
Exit;
Result:=True;
//得到SQL数据存放路径
IF RegValueExists(HKLM,'Software/Microsoft/MSSQLServer/Setup','SQLDataRoot') then
RegQueryStringValue(HKLM,'Software/Microsoft/MSSQLServer/Setup','SQLDataRoot',SQLDataRoot);
//得到SQL安装程序所在目录
IF RegValueExists(HKLM,'Software/Microsoft/MSSQLServer/Setup','SourcePath') then
RegQueryStringValue(HKLM,'Software/Microsoft/MSSQLServer/Setup','SourcePath',SourcePath);
end;
 
const
MB_ICONINFORMATION = $40;
TitleCaption='提示......';
SERVICE_STOPPED=1;
// Stopped == SQL //==
SERVICE_START_PENDING=2;
// Starting == //==
SERVICE_STOP_PENDING=3;
// Stopping == Check //==
SERVICE_RUNNING=4;
// Running == //==
SERVICE_CONTINUE_PENDING=5;
// Restarting after being paused == ISRun //==
SERVICE_PAUSE_PENDING=6;
// Pausing == -ning //==
SERVICE_PAUSED=7;
//Paused == //==
function SQLSCMGetLocalServiceStateA(lpszSvc: PChar;dwErr:LongWord): Integer;
//==
external 'SQLSCMGetLocalServiceStateA@files:w95scm.dll cdecl';
//==
function MessageBox(hWnd: Integer;
lpText, lpCaption: String;
uType: Cardinal): Integer;
external 'MessageBoxA@user32.dll stdcall';
procedure CheckMSSQLServer;
var //判断SQLServer 当前运行状态
r,e: LongWORD;
hWnd: Integer;
begin
hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
r := SQLSCMGetLocalServiceStateA('MSSQLServer',e);
case r of
SERVICE_STOPPED:
MessageBox(hWnd,'Stoped,没有启动或已停止MSSQLServer服务。',TitleCaption, MB_OK or MB_ICONINFORMATION);
SERVICE_START_PENDING:
MessageBox(hWnd,'Starting,正在启动MSSQLServer服务。',TitleCaption, MB_OK or MB_ICONINFORMATION);
SERVICE_STOP_PENDING:
MessageBox(hWnd,'Stopping,正在关闭MSSQLServer服务。',TitleCaption, MB_OK or MB_ICONINFORMATION);
SERVICE_RUNNING:
MessageBox(hWnd,'Running,MSSQLServer服务已运行。',TitleCaption, MB_OK or MB_ICONINFORMATION);
SERVICE_CONTINUE_PENDING:
MessageBox(hWnd,'Restarting,正在重新启动MSSQLServer服务。',TitleCaption, MB_OK or MB_ICONINFORMATION);
SERVICE_PAUSE_PENDING:
MessageBox(hWnd,'Pausing,正在暂停MSSQLServer服务。',TitleCaption, MB_OK or MB_ICONINFORMATION);
SERVICE_PAUSED:
MessageBox(hWnd,'Paused,MSSQLServer服务已暂停。',TitleCaption, MB_OK or MB_ICONINFORMATION);
end;
end;
 
我也插一脚,请问如何用Inno Setup 制作带选择的安装文件,比如想Office 一样的,我可以选择
Word,Excel 或者其它的文件,不知道我说清楚没有
 
天堂鸟6420
定义类型
组件类型
[Types]
Name: full;
Description: Full installation
Name: compact;
Description: Compact installation
Name: custom;
Description: Custom installation;
Flags: iscustom
[Components]
Name: main;
Description: My Inno Setup Extensions application files;
Types: full compact custom;
Flags: fixed
Name:do
cs;
Description: My Inno Setup Extensionsdo
cumentation;
Types: full compact
Name: sample;
Description: My Inno Setup Extensions sample scripts;
Types: full compact
 
接受答案了.
 
后退
顶部