InstallShield安装脚本

最近在用installshield做一键安装,终于搞定,记录一下!

复制代码
//===========================================================================
//
//  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;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值