|
正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- //===========================================================================
- //
- // File Name: Setup.rul
- //
- // Description: Blank setup main script file
- //
- // Comments: Blank setup is an empty setup project. If you want to
- // create a new project via. step-by step instructions use the
- // Project Assistant.
- //
- //===========================================================================
- // Included header files ----------------------------------------------------
- #include "ifx.h"
- function OnBegin()
- STRING strFramework;
- STRING strVersion;
- INT iVersion;
- begin
- SetTitle(IFX_PRODUCT_NAME + " 安装向导", 0, BACKGROUNDCAPTION);
-
- SdShowMsg("安装程序正在检测系统必备组件。。。",TRUE);
- Delay(2);
- SdShowMsg("",FALSE);
-
- RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
- strFramework = SRCDIR ^ "dotnetfx35"^"wcu"^"dotNetFramework"^"dotNetFx35setup.exe";//放在Disk1上的可执行文件路径
- if(RegDBKeyExist("SOFTWARE\\Microsoft\\.NETFramework\\v3.0") < 0)
- then
-
- VerGetFileVersion(WINDIR^"system32"^"msiexec.exe",strVersion); //取得文件版本号(判断windows installer版本)
- if(strVersion < "3.1")
- then
- if(LaunchAppAndWait(SUPPORTDIR^"WindowsInstaller-KB893803-v2-x86.exe","",LAAW_OPTION_WAIT)<0)
- then
- MessageBox("WindowsInstaller error",INFORMATION);
- abort;
- endif;
- endif;
-
- if( LaunchAppAndWait(strFramework, "/q:a/l" ,LAAW_OPTION_WAIT) < 0)
- then
- SprintfBox(MB_OK,".NET安装",".NET FrameWork安装失败!");
- abort;
- endif;
- endif;
-
- if(RegDBKeyExist("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{1F1C2DFC-2D24-3E06-BCB8-725134ADF989}") < 0)//判断机器是否安装了c++2008运行库
- then
- if(LaunchAppAndWait(SUPPORTDIR^"(C++2008)vcredist2008.exe","/s",WAIT)<0)
- then
- MessageBox("(C++2008)vcredist2008 error",INFORMATION);
- abort;
- endif;
- endif;
-
- if(RegDBKeyExist("SOFTWARE\\MapInfo\\MapInfo") < 0)
- then
- if(LaunchAppAndWait(SUPPORTDIR^"MapX4.5.exe","",WAIT)<0)
- then
- MessageBox("MapX4.5 error",INFORMATION);
- abort;
- endif;
- endif;
- end;
复制代码 又一个实例
- function OnBegin()
- string svCurrentDir;
- begin
- // TO DO: you may change default non-UI setting, for example
- //
- // You may also perform your custom initialization steps, check requirements, etc.
- //GetCurrentDir(svCurrentDir);
- //svCurrentDir = svCurrentDir+"\\dotNetFx40_Full_x86_x64.exe";
-
- svCurrentDir = SUPPORTDIR^"\\dotNetFx40_Full_x86_x64.exe";
- RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); //设置默认的注册表键值根节点
- // 判断是否存在.net
- if (RegDBKeyExist ("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4.0") <0 &&RegDBKeyExist ("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4") < 0) then
- //当上面判断了没有安装.net这个软件时,则启动光盘里
- //dotnetfx.exe安装程序来安装。
- MessageBox ("检测到本机未安装.Net FrameWork 4.0,下一步将会先安装.Net FrameWork 4.0 ", INFORMATION);
- if(LaunchAppAndWait (svCurrentDir ,"", LAAW_OPTION_WAIT)<0) then
- MessageBox ("找不到安装程序或者安装出错,请双击运行dotNetFx40_Full_x86_x64.exe,手动安装", INFORMATION);
- return 0;
- endif;
- endif;
- end;
复制代码
|
|