1.安装语言判断:
    if SELECTED_LANGUAGE = ISLANG_ENGLISH then
     szLicenseFile =  SRCDIR ^ "licenseAgreementEn.txt";//如果是英语,选择英文的许可协议
    else
     szLicenseFile =  SRCDIR ^ "licenseAgreementCn.txt";//否则,选择中文的许可协议
    endif;

2.验证是否有Framework
prototype NUMBER CheckFramework();

function NUMBER CheckFramework()
NUMBER IsExist;

begin 
 IsExist = 0;
 if(RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE)<0)  then   
      IsExist = -1;   
 endif;
  if(RegDBKeyExist("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5")<0 && RegDBKeyExist("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727")<0)   then     //如果有framework3.5或者framework2.0
         IsExist = -1;   
  endif;
    return  IsExist;
end;

3.安装framework3.5
nResult= LaunchAppAndWait(SRCDIR ^ "DotnetFx"^"dotnetfx35.exe", "", WAIT);//framework安装文件放在scrdir下的名为DotNetFx的文件夹下

4.验证是否有SQLServer2005
prototype NUMBER FindSQL2K5();

function NUMBER FindSQL2K5()
NUMBER IsExist;

begin 
 IsExist = 0;
 if(RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE)<0)  then  
        IsExist = -1;   
 endif;
 if(RegDBKeyExist("Software\\Microsoft\\Microsoft SQL Server\\90\\Tools\\ClientSetup")<0)   then    
        IsExist = -1;   
 endif; 
 return  IsExist;
end;

 用Installshield制作软件包常用的InstallScript -----2

posted on 2009-08-26 21:12  lanbo  阅读(1145)  评论(0编辑  收藏  举报