服务器 Server installshield脚本

来源:互联网 发布:淘宝卖家电话在哪里 编辑:程序博客网 时间:2024/06/05 17:50

Setup.rul

//===========================================================================
//
//  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.
//
//===========================================================================


#define Alarm_LogicUnit      '"'+TARGETDIR^"ams\\alarm_logic_unit\\alarm_logic_unit.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_InputAlarmHost  '"'+TARGETDIR^"ams\\input_alarm_host_dev\\input_alarm_host_dev.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_InputDhSdk      '"'+TARGETDIR^"ams\\input_dh_sdk_dev\\input_dh_sdk_dev.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_InputEhome      '"'+TARGETDIR^"ams\\input_ehome_dev\\input_ehome_dev.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_InputHikSdk      '"'+TARGETDIR^"ams\\input_hik_sdk_dev\\input_hik_sdk_dev.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_TriggerDb      '"'+TARGETDIR^"ams\\trigger_db\\trigger_db.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_TriggerDevice     '"'+TARGETDIR^"ams\\trigger_device\\trigger_device.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_TriggerEmail      '"'+TARGETDIR^"ams\\trigger_email\\trigger_email.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_TriggerPlatform   '"'+TARGETDIR^"ams\\trigger_platform\\trigger_platform.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_TriggerSmsg       '"'+TARGETDIR^"ams\\trigger_smsg\\trigger_smsg.exe"+'" '+'"'+"-service"+ '"'
#define Alarm_InputDoorControl  '"'+TARGETDIR^"ams\\input_door_control_dev\\input_door_control_dev.exe"+'" '+'"'+"-service"+ '"'
#define NMS               '"'+TARGETDIR^"nms\\nms.exe"+'" '+'"'+"-service"+ '"'
#define SNTPClient           '"'+TARGETDIR^"sntp_client\\sntp_client.exe"+'" '+'"'+"-service"+ '"'
#define bayonet           '"'+TARGETDIR^"bms\\bayonet_logic_unit\\bayonet_logic_unit.exe"+'" '+'"'+"-service"+ '"'
#define gdw_terminal            '"'+TARGETDIR^"bms\\gdw_terminal\\gdw_terminal.exe"+'" '+'"'+"-service"+ '"'
#define hik_cap_ipc             '"'+TARGETDIR^"bms\\hik_cap_ipc\\hik_cap_ipc.exe"+'" '+'"'+"-service"+ '"'
#define bayonet_cascade         '"'+TARGETDIR^"bms\\bayonet_cascade\\bayonet_cascade.exe"+'" '+'"'+"-service"+ '"'
#define DC                   '"'+TARGETDIR^"dc\\dc.exe"+'" '+'"'+"-service"+ '"'
#define DMS                TARGETDIR^"dms\\DecodeServer.exe"
#define KMS                  TARGETDIR^"kms\\KBProxy.exe --service KMS"
#define NCG                  '"'+TARGETDIR^"ncg\\cascade\\cascade.exe"+'" '+'"'+"-service"+ '"'
#define NCGVTDU                 '"'+TARGETDIR^"ncg\\media\\media.exe"+'" '+'"'+"-service"+ '"'
#define PCNVR               '"'+TARGETDIR^"pcnvr\\pcnvr.exe"+'" '+'"'+"-service"+ '"'
#define NVRVOD               '"'+TARGETDIR^"nvrvod\\nvrvod.exe"+'" '+'"'+"-service"+ '"'
#define PMS                  '"'+TARGETDIR^"pms\\pms.exe"+'" '+'"'+"-service"+ '"'
#define TVMS               '"'+TARGETDIR^"tvms\\tvms.exe"+'" '+'"'+"-service"+ '"'
#define VAG               '"'+TARGETDIR^"vag\\pag\\vag_pag.exe"+'" '+'"'+"-service"+ '"' 
#define VAGSTREAM             '"'+TARGETDIR^"vag\\stream\\vag_stream.exe"+'" '+'"'+"-service"+ '"'
#define VRM               '"'+TARGETDIR^"vrm\\vrm.exe"+'" '+'"'+"-service"+ '"'
#define VOD               '"'+TARGETDIR^"vod\\vod.exe"+'" '+'"'+"-service"+ '"'
#define VRB                  '"'+TARGETDIR^"vrb\\vrb.exe"+'" '+'"'+"-service"+ '"'
#define VTM                  '"'+TARGETDIR^"vtm\\vtm.exe"+'" '+'"'+"-service"+ '"'
#define vtdu                    '"'+TARGETDIR^"vtdu\\vtdu.exe"+'" '+'"'+"-service"+ '"'
#define KPS                  '"'+TARGETDIR^"kps\\kps.exe"+'" '+'"'+"-service"+ '"'


// Included header files ----------------------------------------------------
#include "ifx.h"

BOOL bRequire;              //标记必备组件安装情况
BOOL bAlarm_LogicUnit;   //标记报警逻辑处理单元安装情况
BOOL bAlarm_InputAlarmHost;  //标记报警主机接收单元安装情况
BOOL bAlarm_InputDhSdk;      //标记大华Sdk接收单元安装情况
BOOL bAlarm_InputEhome;      //标记E家设备接收单元安装情况
BOOL bAlarm_InputHikSdk;     //标记海康Sdk接收单元安装情况
BOOL bAlarm_TriggerDb;       //标记数据库联动单元安装情况
BOOL bAlarm_TriggerDevice;   //标记设备联动单元安装情况
BOOL bAlarm_TriggerEmail;    //标记邮件联动单元安装情况
BOOL bAlarm_TriggerPlatform; //标记平台联动单元安装情况
BOOL bAlarm_TriggerSmsg;     //标记短信联动单元安装情况
BOOL bAlarm_InputDoorControl; //标记门禁报警接受单元安装情况
BOOL bNMS;                   //标记网管服务器的安装情况
BOOL bbayonet;               //标记卡口逻辑单元安装情况
BOOL bgdw_terminal;          //标记卡口高德威单元安装情况
BOOL bhik_cap_ipc;           //标记卡口直连抓拍机单元安装情况
BOOL bbayonet_cascade;        //标记卡口级联单元安装情况
BOOL bDC;                     //标记网管采集服务器安装情况
BOOL bDMS;                    //标记解码管理服务器安装情况
BOOL bKMS;                //标记键盘代理服务器安装情况
BOOL bNCG;                    //标记联网网管服务器安装情况
BOOL bNCGVTDU;                //标记NCG流转发服务器安装情况
BOOL bPCNVR;                  //标记网络存储服务器安装情况
BOOL bNVRVOD;                  //标记NVR点播服务器安装情况
BOOL bPMS;                      //标记图片管理服务器安装情况
BOOL bTVMS;                     //标记电视墙管理服务器安装情况
BOOL bVAGServer;                //标记VAG信令服务器安装情况
BOOL bVAGVTDU;                 //标记VAG流转发服务器安装情况
BOOL bVRM;                 //标记存储管理服务器安装情况
BOOL bVOD;                     //标记点播服务器安装情况
BOOL bVRB;                      //标记备份管理服务器安装情况
BOOL bvtdu;                    //标记流媒体服务器安装情况
BOOL bVTM;                    //标记流媒体管理服务器安装情况
BOOL bKPS;                    //标记KPS服务器安装情况     
 
 
prototype CheckProgramRun(STRING);  
prototype CopyUninstallFiles(); //声明  
prototype CreateUninstallShortcut();   
BOOL    bvInstall,bvCancel;

//检查程序是否正在运行,如果正在运行将其关闭。
function   CheckProgramRun(szProgramName)//返回0,没有运行,1正在运行,
INT   nRet;  
HWND   nHwnd;  
begin  
 if(szProgramName   =   "")   then  
  nRet   =   0;  
  return   nRet;  
 endif;  
 //得到句柄  
 nHwnd   =   FindWindow("",szProgramName);  
 if(nHwnd   !=   NULL)   then        
  nRet   =   1;  
  //发消息关闭程序  
  //SendMessage(nHwnd,   WM_SYSCOMMAND,   SC_CLOSE,   0);  
 else  
  nRet   =   0;  
 endif;  
 return   nRet;  
end;   
 
//---------------------------------------------------------------------------                                                                       
// OnFirstUIBefore
//
// First Install UI Sequence - Before Move Data
//
// The OnFirstUIBefore event is called by OnShowUI when the setup is
// running in first install mode. By default this event displays UI allowing
// the end user to specify installation parameters.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------
function OnFirstUIBefore()
    number  nResult, nLevel, nSize, nSetupType;
    string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile,svTemp;
    string  szName, szCompany, szTargetPath, szDir, szFeatures;
    BOOL    bLicenseAccepted;
    STRING  szFeatureNamepcnvr;
begin 

    bRequire               = FALSE;
    bAlarm_LogicUnit       = FALSE;
    bAlarm_InputAlarmHost  = FALSE;
    bAlarm_InputDhSdk      = FALSE;
    bAlarm_InputEhome      = FALSE;
    bAlarm_InputHikSdk     = FALSE;
    bAlarm_TriggerDb       = FALSE;
    bAlarm_TriggerDevice   = FALSE;   
    bAlarm_TriggerEmail    = FALSE;
    bAlarm_TriggerPlatform = FALSE;
    bAlarm_TriggerSmsg     = FALSE;
    bAlarm_InputDoorControl= FALSE;
    bNMS                   = FALSE;
    bvCancel               = FALSE;
    bvInstall              = FALSE;
    bbayonet               = FALSE;
    bgdw_terminal          = FALSE;
    bhik_cap_ipc           = FALSE;
    bbayonet_cascade       = FALSE;
    bDC                    = FALSE;
    bDMS                   = FALSE;
    bKMS                   = FALSE;
    bNCG                   = FALSE;
    bNCGVTDU               = FALSE;
    bPCNVR                 = FALSE;
    bNVRVOD                = FALSE;
    szFeatureNamepcnvr ="DefaultFeature\\pcnvr";
    bPMS                   = FALSE;
    bTVMS                  = FALSE;
    bVAGServer             = FALSE;
    bVAGVTDU               = FALSE;
    bVRM                = FALSE;
    bVRB                   = FALSE;
    bvtdu                  = FALSE;
    bVTM                   = FALSE;
    bVOD                   = FALSE;
    bKPS                   = FALSE;

       
    
    // Added in InstallShield 15 - Show an appropriate error message if
    // -removeonly is specified and the product is not installed.
    if( REMOVEONLY ) then
        Disable( DIALOGCACHE );
  szMsg = SdLoadString( IDS_IFX_ERROR_PRODUCT_NOT_INSTALLED_UNINST );
     SdSubstituteProductInfo( szMsg );
  MessageBox( szMsg, SEVERE );
  abort;
    endif;
  
    nSetupType = COMPLETE; 
    szDir = TARGETDIR;
    szName = "";
    szCompany = "";
    bLicenseAccepted = FALSE;

// Beginning of UI Sequence
Dlg_Start:
    nResult = 0;

Dlg_SdWelcome:
    szTitle = "";
    szMsg = "";
    //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
    nResult = SdWelcome( szTitle, szMsg );
    //}}IS_SCRIPT_TAG(Dlg_SdWelcome)
    if (nResult = BACK) goto Dlg_Start;
   
   //if (nResult = CANCEL) then
   //  bvCancel = TRUE;
   //  OnCanceling();
   // endif;

Dlg_SdLicense2:
    szTitle = "";
    szOpt1 = "";
    szOpt2 = "";
    //{{IS_SCRIPT_TAG(License_File_Path)
    szLicenseFile = SUPPORTDIR ^ "License.rtf";
    //}}IS_SCRIPT_TAG(License_File_Path)
    //{{IS_SCRIPT_TAG(Dlg_SdLicense2)
    nResult = SdLicense2Ex( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted, TRUE );
    //}}IS_SCRIPT_TAG(Dlg_SdLicense2)
   
    if (nResult = CANCEL) then
     bvCancel = TRUE;
     OnCanceling();
    endif;
   
    if (nResult = BACK) then
        goto Dlg_SdWelcome;
    else
        bLicenseAccepted = TRUE;
    endif;

Dlg_SdRegisterUser:
    szMsg = "";
    szTitle = "";
    //{{IS_SCRIPT_TAG(Dlg_SdRegisterUser) 
    nResult = SdRegisterUser( szTitle, szMsg, szName, szCompany );
    //}}IS_SCRIPT_TAG(Dlg_SdRegisterUser)
    if (nResult = BACK) goto Dlg_SdLicense2;

Dlg_SetupType2:  
    szTitle = "";
    szMsg = "";
    nResult = CUSTOM;
    //{{IS_SCRIPT_TAG(Dlg_SetupType2) 
    nResult = SetupType2( szTitle, szMsg, "", nSetupType, 0 );
   
  // if (nResult = CANCEL) then
  //   bvCancel = TRUE;
   //  OnCanceling();
  //  endif;   
       
   
    //}}IS_SCRIPT_TAG(Dlg_SetupType2)
    if (nResult = BACK) then
        goto Dlg_SdRegisterUser;
    else
        nSetupType = nResult;
        if (nSetupType != CUSTOM) then
            szTargetPath = TARGETDIR;
            nSize = 0;
            FeatureCompareSizeRequired( MEDIA, szTargetPath, nSize );
            if (nSize != 0) then     
                MessageBox( szSdStr_NotEnoughSpace, WARNING );
                goto Dlg_SetupType2;
            endif;
        endif;  
    endif;

Dlg_SdAskDestPath2:
    if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
 szTitle = "";
    szMsg = "";
    svTemp = TARGETDIR;
    if (nSetupType = CUSTOM) then
                //{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2) 
  nResult = SdAskDestPath2( szTitle, szMsg, szDir );
                //}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
               
       /* if(svTemp!=szDir) then
            if(StrFind(szDir,"\Servers") < 0) then
                 szDir = szDir^"Servers"; 
            endif;
        endif;  */               
               
        TARGETDIR = szDir;
    endif;
    if (nResult = BACK) goto Dlg_SetupType2;
   
  //  if (nResult = CANCEL) then
 //    bvCancel = TRUE;
  //   OnCanceling();
 //   endif;

Dlg_SdFeatureTree:
    if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdAskDestPath2;
    szTitle = "";
    szMsg = "";
    szFeatures = "";
    nLevel = 2;
    if (nSetupType = CUSTOM) then
        //{{IS_SCRIPT_TAG(Dlg_SdFeatureTree) 
        nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, szFeatures, nLevel );
        //}}IS_SCRIPT_TAG(Dlg_SdFeatureTree)
        if (nResult = BACK) goto Dlg_SdAskDestPath2; 
       
    //     if (nResult = CANCEL) then
    //       bvCancel = TRUE;
    //      OnCanceling();
    //    endif;       
       
    endif;
   
        if(FeatureIsItemSelected(MEDIA,szFeatureNamepcnvr) == TRUE && (SYSINFO.bIsWow64)==FALSE) then
   if(AskYesNo("PCNVR只能装到64位操作系统,是否继续安装", YES) = YES) then
   
         else
         FeatureSelectItem(MEDIA,szFeatureNamepcnvr,FALSE);
          
         endif;
    endif;


Dlg_SQLServer:
    nResult = OnSQLServerInitialize( nResult );
    if( nResult = BACK ) goto Dlg_SdFeatureTree;

Dlg_ObjDialogs:
    nResult = ShowObjWizardPages( nResult );
    if (nResult = BACK) goto Dlg_SQLServer;
 
Dlg_SdStartCopy2:
    szTitle = "";
    szMsg = "";
    bvInstall = TRUE;
    //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2) 
    nResult = SdStartCopy2( szTitle, szMsg ); 
    //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2)
    if (nResult = BACK) goto Dlg_ObjDialogs;

    // Added in 11.0 - Set appropriate StatusEx static text.
    SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) );
   
    //if (nResult = CANCEL) then
    // bvCancel = TRUE;
    // OnCanceling();
   // endif;   
    return 0;
end;

 

//---------------------------------------------------------------------------
// CreateUninstallShortcut
//
// This function create the shortcut for uninstalling.
//
// The CreateUninstallShortcut event is called directly by the user to create
// the uninstall shortcut and use before move data.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------
function CreateUninstallShortcut()
 string  szCmdLine,szTitle;
 LIST  lstPath;
 number  nReturn;
 string szResult,szTitleName;
begin      
 // For an InstallScript installation:
  szCmdLine = DISK1TARGET ^ "Setup.exe"; 
  LongPathToQuote(szCmdLine,TRUE); 
  // For an InstallScript MSI installation:
  //szCmdLine = UNINSTALL_STRING;   
 
  // The path has to be handled differently if you are running  

 // an InstallScript MSI installation on Windows 9X. 
  if ( SYSINFO.WIN9X.bWin9X ) then  
   lstPath = ListCreate( STRINGLIST ); 
  StrGetTokens( lstPath, UNINSTALL_STRING, "/" );   
  
  ListGetFirstString( lstPath, szCmdLine ); 
  LongPathToQuote( szCmdLine, TRUE );   
  
  szCmdLine = szCmdLine + " /M" + PRODUCT_GUID;
 endif; 


 GetSystemInfo(LANGUAGE,nReturn,szResult);
    StrRemoveLastSlash(TARGETDIR);
 ParsePath(szTitleName,TARGETDIR,FILENAME);
 if(nReturn = 2052) then 
  szTitle = "卸载Watchdog";
   AddFolderIcon(FOLDER_PROGRAMS^"集中管理平台\\服务端", szTitle,szCmdLine, "","",0, "", REPLACE ); 
 endif;
 if(nReturn = 1033) then                           
  szTitle = "Uninstall Watchdog";
  AddFolderIcon(FOLDER_PROGRAMS^"SurveillanceSystem\\Servers",szTitle,szCmdLine, "","",0, "", REPLACE ); 
 endif;
end;

//---------------------------------------------------------------------------
// OnMoved
//
// The OnMoved event is called as a result of the setup calling
// FeatureTransferData or FeatureMoveData. The event is called when
// all file transfer operations are completed except for batch
// self-registration which is performed immediately after this event returns.
// During uninstallation this event sent after uninstallation is completed,
// therefore you should not modify system state in this event.
//---------------------------------------------------------------------------
function OnMoved()
begin
    //增加删除菜单  
 if(bvCancel = FALSE) then
  if(bvInstall = TRUE) then 
   CreateUninstallShortcut();
  else
   //RemoveUnistallShortcut();
  endif;
 endif;
end;


//---------------------------------------------------------------------------
// OnMoving
//
// The OnMoving event is called as a result of the setup calling
// FeatureTransferData or FeatureMoveData. The event is called before any
// file transfer operations occur.
//---------------------------------------------------------------------------
function OnMoving()
    string szAppPath;
begin
// Un-comment the following script routine to set Logo Compliance Application Path
// TO DO: If your application's main executable file is in a subfolder of TARGETDIR then append this subfolder to szAppPath
//szAppPath = TARGETDIR;
//RegDBSetItem( REGDB_APPPATH, szAppPath );
//RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ IFX_PRODUCT_KEY );
 if (CheckProgramRun("Watchdog") = 1) then
  LaunchAppAndWait("", "taskkill /f /im ServiceWatchdog.exe", LAAW_OPTION_HIDDEN|WAIT );     
  Delay(2);
  LaunchAppAndWait(TARGETDIR ^"uninstall_all.bat", "/qu",   LAAW_OPTION_HIDDEN|WAIT);
  //MessageBox ("在执行操作之前,请先停止服务管理程序ServiceWatchdog.", SEVERE); 
  //abort;
 endif;
 
 if (CheckProgramRun("AlarmServer") = 1) then
  LaunchAppAndWait("", "taskkill /F /IM AlarmServerWatchdog.exe", LAAW_OPTION_HIDDEN|WAIT );
  LaunchAppAndWait(TARGETDIR ^"ams\\uninstall_all.bat", "/qu",   LAAW_OPTION_HIDDEN|WAIT);
 endif; 
end;

 

 

#include "FeatureEvents.rul"

//---------------------------------------------------------------------------
// OnMaintUIAfter
//
// The OnMaintUIAfter event called by OnShowUI after the file transfer
// of the setup when the setup is running in maintenance mode. By default
// this event displays UI that informs the end user that the maintenance setup
// has been completed successfully.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------
function OnMaintUIAfter()
    STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
    NUMBER bvOpt1, bvOpt2;
begin

    ShowObjWizardPages(NEXT);
   
    // Added - Version 9.5 - Use appropriate strings for complete
    // uninstall.
    if( REMOVEALLMODE ) then
        szTitle = SdLoadString(IFX_SDFINISH_REMOVE_TITLE);
        szMsg1 = SdLoadString(IFX_SDFINISH_REMOVE_MSG1);
       
        //删除ServiceWatchdog记录日志      
        DeleteDir( TARGETDIR^"log",ROOT);
       
        // delete windows2008 program folder empty dir 
        DeleteDir(TARGETDIR ,ROOT);           
        DeleteDir(FOLDER_APPLICATIONS^IFX_COMPANY_NAME,ONLYDIR);
        //DeleteDir(FOLDER_PROGRAMS^"集中管理平台\\服务端" ,ALLCONTENTS); 
        DeleteDir(FOLDER_PROGRAMS^"集中管理平台\\服务端" ,ROOT); 
        DeleteDir(FOLDER_PROGRAMS^"集中管理平台" ,ONLYDIR); 
    else
        szTitle = SdLoadString(IFX_SDFINISH_MAINT_TITLE);   
        szMsg1  = SdLoadString(IFX_SDFINISH_MAINT_MSG1);
    endif;

 szMsg2 = "";   
    szOpt1 = "";
    szOpt2 = "";
 bvOpt1   = FALSE;
    bvOpt2   = FALSE;   

    //if ( BATCH_INSTALL ) then
     //SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
    //else   
        SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bvOpt1 , bvOpt2 );
    //endif;
end;


//---------------------------------------------------------------------------
// OnMaintUIBefore
//
// Maintenance UI Sequence - Before Move Data
//
// The OnMaintUIBefore event is called by OnShowUI when the setup is
// running in maintenance mode. By default this event displays UI that
// allows the end user to add or remove features, repair currently
// installed features or uninstall the application.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------
function OnMaintUIBefore()
    number nResult, nType;
    string szTitle, szMsg;
begin
 
 // nType defaults to MODIFY.
 nType = MODIFY;

    //Initialize SQL
    OnSQLServerInitializeMaint();

// Beginning of UI Sequence
Dlg_Start:

    // Added in Version 9.5 - Support for REMOVEONLY option.
    if( !REMOVEONLY ) then
     // In standard mode show maintenance dialog
     Disable( BACKBUTTON );
     nType = SdWelcomeMaint( szTitle, szMsg, nType );
     Enable( BACKBUTTON );
        nResult = NEXT;
    else
        // Hide the initial progress dialog as otherwise the user can
        // click on it, and hide the MessageBox.
        Disable( DIALOGCACHE );

        // In RemoveOnly mode, set to remove.
        nType = REMOVEALL;
    endif;

 // Show Uninstall Confirmation Dialog
    if ( nType = REMOVEALL ) then
  nResult = MessageBox( SdLoadString( IFX_MAINTUI_MSG ), MB_YESNO );
  if (nResult != IDYES ) then
           
            if( REMOVEONLY ) then
                // In REMOVEONLY mode, abort the setup.
                abort;
            else
                // In non-REMOVEONLY mode, redisplay the previous dialog.
       goto Dlg_Start;
            endif;

  endif;
 endif;

Dlg_SdFeatureTree:
 if ( nType = MODIFY ) then
  szTitle = "";
  szMsg = SdLoadString( SD_STR_COMPONENT_MAINT_MSG );
  nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, "", -1 );
  if ( nResult = BACK ) goto Dlg_Start;
    endif;

Dlg_ObjDialogs:
    nResult = ShowObjWizardPages( nResult );
    if ( ( nResult = BACK ) && ( nType != MODIFY ) ) goto Dlg_Start;
    if ( ( nResult = BACK ) && ( nType = MODIFY ) ) goto Dlg_SdFeatureTree;

 switch(nType)

        case REMOVEALL:
      
   // Ensure that all previously installed features are removed.
   FeatureRemoveAllInMediaAndLog();

            // Added in 11.0 - Set appropriate StatusEx static text.
            SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) );

        case REPAIR:
    
   // Changed for DevStudio 9, Disk1 files are now always updated when installed
   // so when running from ADDREMOVE we need to prevent these files from being
   // updated since this will result in files being updated that are locked by the setup.
   // Updating these files when running from ADDREMOVE should not be needed since updates
   // are not run directly from Add/Remove.
            if( ADDREMOVE ) then
                // Reinstall all previously installed features, except
                // disk1 features.
                FeatureUpdate( "" );
            else
                // Reinstall all previously installed features.
                FeatureReinstall();
            endif;

            // Added in 11.0 - Set appropriate StatusEx static text.
            SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REPAIR ) );

        case MODIFY:
           
            // Added in 11.0 - Set appropriate StatusEx static text.
            SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_MODIFY ) );

    endswitch;
 
end;

 

**************************************************************************************************************************************************************

                                                                                                       以下为FeatureEvents.rul脚本

**************************************************************************************************************************************************************

export prototype Feature_Installed();
function Feature_Installed()
begin
 if(!bRequire)  then
 //SetStatusExStaticText(@ID_STRING_INSTALL_NESS);
  if(!SYSINFO.bIsWow64) then
      LaunchAppAndWait(TARGETDIR^"vcredist_x86.exe", "/q",   WAIT);
  else
      LaunchAppAndWait(TARGETDIR^"vcredist_x86.exe", "/q",   WAIT);
    LaunchAppAndWait(TARGETDIR^"vcredist_x64.exe", "/q",   WAIT);
  endif;  
     
 ServiceAddService("SNTPClient","iVMS SNTPClient Service","SNTPClient",SNTPClient,TRUE,"");
 bRequire = TRUE;
 endif;
end;

export prototype Feature_UnInstalling();
function Feature_UnInstalling()
begin
 if(!bRequire)  then
    if(!SYSINFO.bIsWow64) then
     LaunchAppAndWait(TARGETDIR^"vcredist_x86.exe", "/qu",   WAIT);
 else
     LaunchAppAndWait(TARGETDIR^"vcredist_x86.exe", "/qu",   WAIT);  
  LaunchAppAndWait(TARGETDIR^"vcredist_x64.exe", "/qu",   WAIT);
    endif;  
 
 ServiceStopService("SNTPClient");
 ServiceRemoveService("SNTPClient");
 bRequire = TRUE;
 endif;
end; 

export prototype Feature_UnInstalled();
function Feature_UnInstalled()
begin
    //删除记录日志 
 DeleteDir( TARGETDIR^"sntp_client", ALLCONTENTS); 
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\alarm_logic_unit is installed.
//---------------------------------------------------------------------------
export prototype alarm_logic_unit_Installing();
function alarm_logic_unit_Installing()
begin
  SetStatusExStaticText("正在注册报警逻辑处理单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\alarm_logic_unit
// is installed.
//---------------------------------------------------------------------------
export prototype alarm_logic_unit_Installed();
function alarm_logic_unit_Installed()
begin
if(!bAlarm_LogicUnit) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册报警逻辑处理单元服务...");
 ServiceAddService("Alarm_LogicUnit","Alarm_LogicUnit","报警逻辑处理单元",Alarm_LogicUnit,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_LogicUnit = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\alarm_logic_unit is uninstalled.
//---------------------------------------------------------------------------
export prototype alarm_logic_unit_UnInstalling();
function alarm_logic_unit_UnInstalling()
begin
 if(!bAlarm_LogicUnit) then
 SetStatusExStaticText("正在卸载报警逻辑处理单元服务...");   
 ServiceStopService("Alarm_LogicUnit");
 ServiceRemoveService("Alarm_LogicUnit");
 bAlarm_LogicUnit = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\alarm_logic_unit
// is uninstalled.
//---------------------------------------------------------------------------
export prototype alarm_logic_unit_UnInstalled();
function alarm_logic_unit_UnInstalled()
begin
    //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\alarm_logic_unit",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS); 
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\input_alarm_host_dev is installed.
//---------------------------------------------------------------------------
export prototype input_alarm_host_dev_Installing();
function input_alarm_host_dev_Installing()
begin
SetStatusExStaticText("正在注册报警主机接收单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\input_alarm_host_dev
// is installed.
//---------------------------------------------------------------------------
export prototype input_alarm_host_dev_Installed();
function input_alarm_host_dev_Installed()
begin
if(!bAlarm_InputAlarmHost) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册报警主机接收单元服务...");
 ServiceAddService("Alarm_InputAlarmHost","Alarm_InputAlarmHost","报警主机接收单元",Alarm_InputAlarmHost,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_InputAlarmHost = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\input_alarm_host_dev is uninstalled.
//---------------------------------------------------------------------------
export prototype input_alarm_host_dev_UnInstalling();
function input_alarm_host_dev_UnInstalling()
begin
 if(!bAlarm_InputAlarmHost) then
 SetStatusExStaticText("正在卸载报警主机接收单元服务...");   
 ServiceStopService("Alarm_InputAlarmHost");
 ServiceRemoveService("Alarm_InputAlarmHost");
 bAlarm_InputAlarmHost = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\input_alarm_host_dev
// is uninstalled.
//---------------------------------------------------------------------------
export prototype input_alarm_host_dev_UnInstalled();
function input_alarm_host_dev_UnInstalled()
begin
   //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\input_alarm_host_dev",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS); 
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\input_dh_sdk_dev is installed.
//---------------------------------------------------------------------------
export prototype input_dh_sdk_dev_Installing();
function input_dh_sdk_dev_Installing()
begin
SetStatusExStaticText("正在注册大华Sdk接收单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\input_dh_sdk_dev
// is installed.
//---------------------------------------------------------------------------
export prototype input_dh_sdk_dev_Installed();
function input_dh_sdk_dev_Installed()
begin
if(!bAlarm_InputDhSdk) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册大华Sdk接收单元服务...");
 ServiceAddService("Alarm_InputDhSdk","Alarm_InputDhSdk","大华Sdk接收单元",Alarm_InputDhSdk,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_InputDhSdk = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\input_dh_sdk_dev is uninstalled.
//---------------------------------------------------------------------------
export prototype input_dh_sdk_dev_UnInstalling();
function input_dh_sdk_dev_UnInstalling()
begin
 if(!bAlarm_InputDhSdk) then
 SetStatusExStaticText("正在卸载大华Sdk接收单元服务...");   
 ServiceStopService("Alarm_InputDhSdk");
 ServiceRemoveService("Alarm_InputDhSdk");
 bAlarm_InputDhSdk = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\input_dh_sdk_dev
// is uninstalled.
//---------------------------------------------------------------------------
export prototype input_dh_sdk_dev_UnInstalled();
function input_dh_sdk_dev_UnInstalled()
begin
 //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\input_dh_sdk_dev",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS); 
end;

 


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\input_ehome_dev is installed.
//---------------------------------------------------------------------------
export prototype input_ehome_dev_Installing();
function input_ehome_dev_Installing()
begin
SetStatusExStaticText("正在注册E家设备接收单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\input_ehome_dev
// is installed.
//---------------------------------------------------------------------------
export prototype input_ehome_dev_Installed();
function input_ehome_dev_Installed()
begin
if(!bAlarm_InputEhome) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册E家设备接收单元服务...");
 ServiceAddService("Alarm_InputEhome","Alarm_InputEhome","E家设备接收单元",Alarm_InputEhome,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_InputEhome = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\input_ehome_dev is uninstalled.
//---------------------------------------------------------------------------
export prototype input_ehome_dev_UnInstalling();
function input_ehome_dev_UnInstalling()
begin
 if(!bAlarm_InputEhome) then
 SetStatusExStaticText("正在卸载E家设备接收单元服务...");   
 ServiceStopService("Alarm_InputEhome");
 ServiceRemoveService("Alarm_InputEhome");
 bAlarm_InputEhome = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\input_ehome_dev
// is uninstalled.
//---------------------------------------------------------------------------
export prototype input_ehome_dev_UnInstalled();
function input_ehome_dev_UnInstalled()
begin
 //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\input_ehome_dev",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\input_hik_sdk_dev is installed.
//---------------------------------------------------------------------------
export prototype input_hik_sdk_dev_Installing();
function input_hik_sdk_dev_Installing()
begin
SetStatusExStaticText("正在注册海康Sdk接收单元服务...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\input_hik_sdk_dev
// is installed.
//---------------------------------------------------------------------------
export prototype input_hik_sdk_dev_Installed();
function input_hik_sdk_dev_Installed()
begin
if(!bAlarm_InputHikSdk) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册海康Sdk接收单元服务...");
 ServiceAddService("Alarm_InputHikSdk","Alarm_InputHikSdk","海康Sdk接收单元",Alarm_InputHikSdk,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_InputHikSdk = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\input_hik_sdk_dev is uninstalled.
//---------------------------------------------------------------------------
export prototype input_hik_sdk_dev_UnInstalling();
function input_hik_sdk_dev_UnInstalling()
begin
 if(!bAlarm_InputHikSdk) then
 SetStatusExStaticText("正在卸载海康Sdk接收单元服务...");   
 ServiceStopService("Alarm_InputHikSdk");
 ServiceRemoveService("Alarm_InputHikSdk");
 bAlarm_InputHikSdk = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\input_hik_sdk_dev
// is uninstalled.
//---------------------------------------------------------------------------
export prototype input_hik_sdk_dev_UnInstalled();
function input_hik_sdk_dev_UnInstalled()
begin
    //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\input_hik_sdk_dev",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\trigger_db is installed.
//---------------------------------------------------------------------------
export prototype trigger_db_Installing();
function trigger_db_Installing()
begin
SetStatusExStaticText("正在注册数据库联动单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\trigger_db
// is installed.
//---------------------------------------------------------------------------
export prototype trigger_db_Installed();
function trigger_db_Installed()
begin
if(!bAlarm_TriggerDb) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册数据库联动单元服务...");
 ServiceAddService("Alarm_TriggerDb","Alarm_TriggerDb","数据库联动单元",Alarm_TriggerDb,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_TriggerDb = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\trigger_db is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_db_UnInstalling();
function trigger_db_UnInstalling()
begin
 if(!bAlarm_TriggerDb) then
 SetStatusExStaticText("正在卸载数据库联动单元服务...");   
 ServiceStopService("Alarm_TriggerDb");
 ServiceRemoveService("Alarm_TriggerDb");
 bAlarm_TriggerDb = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\trigger_db
// is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_db_UnInstalled();
function trigger_db_UnInstalled()
begin
    //删除记录日志
     DeleteDir(TARGETDIR^"ams\\trigger_db",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\trigger_device is installed.
//---------------------------------------------------------------------------
export prototype trigger_device_Installing();
function trigger_device_Installing()
begin
SetStatusExStaticText("正在注册设备联动单元服务...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\trigger_device
// is installed.
//---------------------------------------------------------------------------
export prototype trigger_device_Installed();
function trigger_device_Installed()
begin
if(!bAlarm_TriggerDevice) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册设备联动单元服务...");
 ServiceAddService("Alarm_TriggerDevice","Alarm_TriggerDevice","设备联动单元",Alarm_TriggerDevice,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_TriggerDevice = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\trigger_device is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_device_UnInstalling();
function trigger_device_UnInstalling()
begin
 if(!bAlarm_TriggerDevice) then
 SetStatusExStaticText("正在卸载设备联动单元服务...");   
 ServiceStopService("Alarm_TriggerDevice");
 ServiceRemoveService("Alarm_TriggerDevice");
 bAlarm_TriggerDevice = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\trigger_device
// is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_device_UnInstalled();
function trigger_device_UnInstalled()
begin
    //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\trigger_device",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\trigger_email is installed.
//---------------------------------------------------------------------------
export prototype trigger_email_Installing();
function trigger_email_Installing()
begin
SetStatusExStaticText("正在注册邮件联动单元服务...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\trigger_email
// is installed.
//---------------------------------------------------------------------------
export prototype trigger_email_Installed();
function trigger_email_Installed()
begin
if(!bAlarm_TriggerEmail) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册邮件联动单元服务...");
 ServiceAddService("Alarm_TriggerEmail","Alarm_TriggerEmail","邮件联动单元",Alarm_TriggerEmail,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_TriggerEmail = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\trigger_email is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_email_UnInstalling();
function trigger_email_UnInstalling()
begin
 if(!bAlarm_TriggerEmail) then
 SetStatusExStaticText("正在卸载邮件联动单元服务...");   
 ServiceStopService("Alarm_TriggerEmail");
 ServiceRemoveService("Alarm_TriggerEmail");
 bAlarm_TriggerEmail = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\trigger_email
// is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_email_UnInstalled();
function trigger_email_UnInstalled()
begin
  //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\trigger_email",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\trigger_platform is installed.
//---------------------------------------------------------------------------
export prototype trigger_platform_Installing();
function trigger_platform_Installing()
begin
SetStatusExStaticText("正在注册平台联动单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\trigger_platform
// is installed.
//---------------------------------------------------------------------------
export prototype trigger_platform_Installed();
function trigger_platform_Installed()
begin
if(!bAlarm_TriggerPlatform) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册平台联动单元服务...");
 ServiceAddService("Alarm_TriggerPlatform","Alarm_TriggerPlatform","平台联动单元",Alarm_TriggerPlatform,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_TriggerPlatform = TRUE;   
 endif;
end;


//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\trigger_platform is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_platform_UnInstalling();
function trigger_platform_UnInstalling()
begin
 if(!bAlarm_TriggerPlatform) then
 SetStatusExStaticText("正在卸载平台联动单元服务...");   
 ServiceStopService("Alarm_TriggerPlatform");
 ServiceRemoveService("Alarm_TriggerPlatform");
 bAlarm_TriggerPlatform = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\trigger_platform
// is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_platform_UnInstalled();
function trigger_platform_UnInstalled()
begin
//删除记录日志 
    DeleteDir(TARGETDIR^"ams\\trigger_platform",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\trigger_smsg is installed.
//---------------------------------------------------------------------------
export prototype trigger_smsg_Installing();
function trigger_smsg_Installing()
begin
SetStatusExStaticText("正在注册短信联动单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\trigger_smsg
// is installed.
//---------------------------------------------------------------------------
export prototype trigger_smsg_Installed();
function trigger_smsg_Installed()
begin
if(!bAlarm_TriggerSmsg) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册短信联动单元服务...");
 ServiceAddService("Alarm_TriggerSmsg","Alarm_TriggerSmsg","短信联动单元",Alarm_TriggerSmsg,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_TriggerSmsg = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\trigger_smsg is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_smsg_UnInstalling();
function trigger_smsg_UnInstalling()
begin
 if(!bAlarm_TriggerSmsg) then
 SetStatusExStaticText("正在卸载短信联动单元服务...");   
 ServiceStopService("Alarm_TriggerSmsg");
 ServiceRemoveService("Alarm_TriggerSmsg");
 bAlarm_TriggerSmsg = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\trigger_smsg
// is uninstalled.
//---------------------------------------------------------------------------
export prototype trigger_smsg_UnInstalled();
function trigger_smsg_UnInstalled()
begin
//删除记录日志 
    DeleteDir(TARGETDIR^"ams\\trigger_smsg",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\nms is installed.
//---------------------------------------------------------------------------
export prototype nms_Installing();
function nms_Installing()
begin
SetStatusExStaticText("正在注册网管服务器...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\nms
// is installed.
//---------------------------------------------------------------------------
export prototype nms_Installed();
function nms_Installed()
begin
if(!bNMS) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册网管服务器...");
 ServiceAddService("NMS","iVMS NMS Service","网管服务器",NMS,TRUE,"");
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bNMS = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\nms is uninstalled.
//---------------------------------------------------------------------------
export prototype nms_UnInstalling();
function nms_UnInstalling()
begin
 if(!bNMS) then
 SetStatusExStaticText("正在卸载网管服务器...");   
 ServiceStopService("NMS");
 ServiceRemoveService("NMS");
 bNMS = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\nms
// is uninstalled.
//---------------------------------------------------------------------------
export prototype nms_UnInstalled();
function nms_UnInstalled()
begin
//删除记录日志 
 DeleteDir( TARGETDIR^"nms", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\bms\bayonet_logic_unit is installed.
//---------------------------------------------------------------------------
export prototype bayonet_logic_unit_Installing();
function bayonet_logic_unit_Installing()
begin
SetStatusExStaticText("正在注册卡口逻辑单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\bms\bayonet_logic_unit
// is installed.
//---------------------------------------------------------------------------
export prototype bayonet_logic_unit_Installed();
function bayonet_logic_unit_Installed()
begin
if(!bbayonet) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册卡口逻辑单元服务...");
 ServiceAddService("bayonet","iVMS BayonetLogicUnit Service","卡口逻辑单元",bayonet,TRUE,"");
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bbayonet = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\bms\bayonet_logic_unit is uninstalled.
//---------------------------------------------------------------------------
export prototype bayonet_logic_unit_UnInstalling();
function bayonet_logic_unit_UnInstalling()
begin
if(!bbayonet) then
 SetStatusExStaticText("正在卸载卡口逻辑单元服务...");   
 ServiceStopService("bayonet");
 ServiceRemoveService("bayonet");
 bbayonet = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\bms\bayonet_logic_unit
// is uninstalled.
//---------------------------------------------------------------------------
export prototype bayonet_logic_unit_UnInstalled();
function bayonet_logic_unit_UnInstalled()
begin
//删除记录日志 
 DeleteDir( TARGETDIR^"bms", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\bms\gdw_terminal is installed.
//---------------------------------------------------------------------------
export prototype gdw_terminal_Installing();
function gdw_terminal_Installing()
begin
SetStatusExStaticText("正在注册卡口高德威单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\bms\gdw_terminal
// is installed.
//---------------------------------------------------------------------------
export prototype gdw_terminal_Installed();
function gdw_terminal_Installed()
begin
if(!bgdw_terminal) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册卡口高德威单元服务...");
 ServiceAddService("gdw_terminal","iVMS BayonetGDWUnit Service","卡口高德威单元",gdw_terminal,TRUE,"");
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bgdw_terminal = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\bms\gdw_terminal is uninstalled.
//---------------------------------------------------------------------------
export prototype gdw_terminal_UnInstalling();
function gdw_terminal_UnInstalling()
begin
if(!bgdw_terminal) then
 SetStatusExStaticText("正在卸载卡口高德威单元服务...");   
 ServiceStopService("gdw_terminal");
 ServiceRemoveService("gdw_terminal");
 bgdw_terminal = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\bms\gdw_terminal
// is uninstalled.
//---------------------------------------------------------------------------
export prototype gdw_terminal_UnInstalled();
function gdw_terminal_UnInstalled()
begin
//删除记录日志 
 DeleteDir( TARGETDIR^"bms", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\bms\hik_cap_ipc is installed.
//---------------------------------------------------------------------------
export prototype hik_cap_ipc_Installing();
function hik_cap_ipc_Installing()
begin
SetStatusExStaticText("正在注册卡口直连抓拍机单元服务...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\bms\hik_cap_ipc
// is installed.
//---------------------------------------------------------------------------
export prototype hik_cap_ipc_Installed();
function hik_cap_ipc_Installed()
begin
if(!bhik_cap_ipc) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册卡口直连抓拍机单元服务...");
 ServiceAddService("hik_cap_ipc","iVMS BayonetIPCUnit Service","卡口直连抓拍机单元",hik_cap_ipc,TRUE,"");
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bhik_cap_ipc = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\bms\hik_cap_ipc is uninstalled.
//---------------------------------------------------------------------------
export prototype hik_cap_ipc_UnInstalling();
function hik_cap_ipc_UnInstalling()
begin
if(!bhik_cap_ipc) then
 SetStatusExStaticText("正在卸载卡口直连抓拍机单元服务...");   
 ServiceStopService("hik_cap_ipc");
 ServiceRemoveService("hik_cap_ipc");
 bhik_cap_ipc = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\bms\hik_cap_ipc
// is uninstalled.
//---------------------------------------------------------------------------
export prototype hik_cap_ipc_UnInstalled();
function hik_cap_ipc_UnInstalled()
begin
//删除记录日志 
 DeleteDir( TARGETDIR^"bms", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\bms\bayonet_cascade is installed.
//---------------------------------------------------------------------------
export prototype bayonet_cascade_Installing();
function bayonet_cascade_Installing()
begin
SetStatusExStaticText("正在注册卡口级联单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\bms\bayonet_cascade
// is installed.
//---------------------------------------------------------------------------
export prototype bayonet_cascade_Installed();
function bayonet_cascade_Installed()
begin
if(!bbayonet_cascade) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册卡口级联单元服务...");
 ServiceAddService("bayonet_cascade","iVMS BayonetCASUnit Service","卡口级联单元",bayonet_cascade,TRUE,"");
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bbayonet_cascade = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\bms\bayonet_cascade is uninstalled.
//---------------------------------------------------------------------------
export prototype bayonet_cascade_UnInstalling();
function bayonet_cascade_UnInstalling()
begin
if(!bbayonet_cascade) then
 SetStatusExStaticText("正在卸载卡口级联单元服务...");   
 ServiceStopService("bayonet_cascade");
 ServiceRemoveService("bayonet_cascade");
 bbayonet_cascade = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\bms\bayonet_cascade
// is uninstalled.
//---------------------------------------------------------------------------
export prototype bayonet_cascade_UnInstalled();
function bayonet_cascade_UnInstalled()
begin
//删除记录日志 
 DeleteDir( TARGETDIR^"bms", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\dc is installed.
//---------------------------------------------------------------------------
export prototype dc_Installing();
function dc_Installing()
begin
SetStatusExStaticText("正在注册网管采集服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\dc
// is installed.
//---------------------------------------------------------------------------
export prototype dc_Installed();
function dc_Installed()
begin
  if(!bDC) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册网管采集服务器...");
  ServiceAddService("DC","iVMS DC Service","网管采集服务器",DC,TRUE,"");  
  bDC = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\dc is uninstalled.
//---------------------------------------------------------------------------
export prototype dc_UnInstalling();
function dc_UnInstalling()
begin
 if(!bDC) then
  SetStatusExStaticText("正在卸载网管采集服务器...");
  ServiceStopService("DC");
  ServiceRemoveService("DC");
  bDC = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\dc
// is uninstalled.
//---------------------------------------------------------------------------
export prototype dc_UnInstalled();
function dc_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"dc", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\dms is installed.
//---------------------------------------------------------------------------
export prototype dms_Installing();
function dms_Installing()
begin
SetStatusExStaticText("正在注册解码管理服务器...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\dms
// is installed.
//---------------------------------------------------------------------------
export prototype dms_Installed();
function dms_Installed()
begin
   if(!bDMS) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册解码管理服务器...");
  ServiceAddService("DMS","iVMS DMS Service","解码管理服务器",DMS,TRUE,"");  
  bDMS = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\dms is uninstalled.
//---------------------------------------------------------------------------
export prototype dms_UnInstalling();
function dms_UnInstalling()
begin
 if(!bDMS) then
  SetStatusExStaticText("正在卸载解码管理服务器...");   
  ServiceStopService("DMS");
  ServiceRemoveService("DMS");
  bDMS = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\dms
// is uninstalled.
//---------------------------------------------------------------------------
export prototype dms_UnInstalled();
function dms_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"dms", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\kms is installed.
//---------------------------------------------------------------------------
export prototype kms_Installing();
function kms_Installing()
begin
SetStatusExStaticText("正在注册键盘代理服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\kms
// is installed.
//---------------------------------------------------------------------------
export prototype kms_Installed();
function kms_Installed()
begin
    if(!bKMS) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册键盘代理服务器...");
  ServiceAddService("kms","iVMS KBS Service","键盘代理服务器",KMS,TRUE,"");  
  bKMS = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\kms is uninstalled.
//---------------------------------------------------------------------------
export prototype kms_UnInstalling();
function kms_UnInstalling()
begin
   if(!bKMS) then
  SetStatusExStaticText("正在卸载键盘代理服务器...");   
  ServiceStopService("kms");
  ServiceRemoveService("kms");
  bKMS = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\kms
// is uninstalled.
//---------------------------------------------------------------------------
export prototype kms_UnInstalled();
function kms_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"kms", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ncg\cascade is installed.
//---------------------------------------------------------------------------
export prototype cascade_Installing();
function cascade_Installing()
begin
SetStatusExStaticText("正在注册联网网关服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ncg\cascade
// is installed.
//---------------------------------------------------------------------------
export prototype cascade_Installed();
function cascade_Installed()
begin
    if(!bNCG) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册联网网关服务器...");
  ServiceAddService("cascade","iVMS NCG Service","联网网关服务器",NCG,TRUE,"");  
  bNCG = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ncg\cascade is uninstalled.
//---------------------------------------------------------------------------
export prototype cascade_UnInstalling();
function cascade_UnInstalling()
begin
    if(!bNCG) then
  SetStatusExStaticText("正在卸载联网网关服务器...");   
  ServiceStopService("cascade");
  ServiceRemoveService("cascade");
  bNCG = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ncg\cascade
// is uninstalled.
//---------------------------------------------------------------------------
export prototype cascade_UnInstalled();
function cascade_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"ncg", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ncg\media is installed.
//---------------------------------------------------------------------------
export prototype media_Installing();
function media_Installing()
begin
 SetStatusExStaticText("正在注册NCG流转发服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ncg\media
// is installed.
//---------------------------------------------------------------------------
export prototype media_Installed();
function media_Installed()
begin
    if(!bNCGVTDU) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册NCG流转发服务器...");
  ServiceAddService("media","iVMS NCGVTDU Service","NCG流转发服务器",NCGVTDU,TRUE,"");  
  bNCGVTDU = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ncg\media is uninstalled.
//---------------------------------------------------------------------------
export prototype media_UnInstalling();
function media_UnInstalling()
begin
   if(!bNCGVTDU) then
  SetStatusExStaticText("正在卸载NCG流转发服务器...");   
  ServiceStopService("media");
  ServiceRemoveService("media");
  bNCGVTDU = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ncg\media
// is uninstalled.
//---------------------------------------------------------------------------
export prototype media_UnInstalled();
function media_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"ncg", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\pcnvr is installed.
//---------------------------------------------------------------------------
export prototype pcnvr_Installing();
function pcnvr_Installing()
begin
SetStatusExStaticText("正在注册网络存储服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\pcnvr
// is installed.
//---------------------------------------------------------------------------
export prototype pcnvr_Installed();
function pcnvr_Installed()
begin
   if(!bPCNVR) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册网络存储服务器...");
  ServiceAddService("pcnvr","iVMS PCNVR Service","网络存储服务器",PCNVR,TRUE,"");  
  bPCNVR = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\pcnvr is uninstalled.
//---------------------------------------------------------------------------
export prototype pcnvr_UnInstalling();
function pcnvr_UnInstalling()
begin
    if(!bPCNVR) then
  SetStatusExStaticText("正在卸载网络存储服务器...");   
  ServiceStopService("pcnvr");
  ServiceRemoveService("pcnvr");
  bPCNVR = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\pcnvr
// is uninstalled.
//---------------------------------------------------------------------------
export prototype pcnvr_UnInstalled();
function pcnvr_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"pcnvr", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\nvrvod is installed.
//---------------------------------------------------------------------------
export prototype nvrvod_Installing();
function nvrvod_Installing()
begin
SetStatusExStaticText("正在注册NVR点播服务器...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\nvrvod
// is installed.
//---------------------------------------------------------------------------
export prototype nvrvod_Installed();
function nvrvod_Installed()
begin
  if(!bNVRVOD) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册NVR点播服务器...");
  ServiceAddService("nvrvod","iVMS NVRVOD Service","NVR点播服务器",NVRVOD,TRUE,"");  
  bNVRVOD = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\nvrvod is uninstalled.
//---------------------------------------------------------------------------
export prototype nvrvod_UnInstalling();
function nvrvod_UnInstalling()
begin
   if(!bNVRVOD) then
  SetStatusExStaticText("正在卸载NVR点播服务器...");   
  ServiceStopService("nvrvod");
  ServiceRemoveService("nvrvod");
  bNVRVOD = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\nvrvod
// is uninstalled.
//---------------------------------------------------------------------------
export prototype nvrvod_UnInstalled();
function nvrvod_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"nvrvod", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\pms is installed.
//---------------------------------------------------------------------------
export prototype pms_Installing();
function pms_Installing()
begin
SetStatusExStaticText("正在注册图片管理服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\pms
// is installed.
//---------------------------------------------------------------------------
export prototype pms_Installed();
function pms_Installed()
begin
   if(!bPMS) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册图片管理服务器...");
  ServiceAddService("PMS","iVMS PMS Service","图片管理服务器",PMS,TRUE,"");  
  bPMS = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\pms is uninstalled.
//---------------------------------------------------------------------------
export prototype pms_UnInstalling();
function pms_UnInstalling()
begin
   if(!bPMS) then
  SetStatusExStaticText("正在卸载图片管理服务器...");   
  ServiceStopService("PMS");
  ServiceRemoveService("PMS");
  bPMS = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\pms
// is uninstalled.
//---------------------------------------------------------------------------
export prototype pms_UnInstalled();
function pms_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"pms", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\tvms is installed.
//---------------------------------------------------------------------------
export prototype tvms_Installing();
function tvms_Installing()
begin
SetStatusExStaticText("正在注册电视墙管理服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\tvms
// is installed.
//---------------------------------------------------------------------------
export prototype tvms_Installed();
function tvms_Installed()
begin
   if(!bTVMS) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册电视墙管理服务器...");
  ServiceAddService("tvms","iVMS TVMS Service","电视墙管理服务器",TVMS,TRUE,"");  
  bTVMS = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\tvms is uninstalled.
//---------------------------------------------------------------------------
export prototype tvms_UnInstalling();
function tvms_UnInstalling()
begin
   if(!bTVMS) then
  SetStatusExStaticText("正在卸载电视墙管理服务器...");   
  ServiceStopService("tvms");
  ServiceRemoveService("tvms");
  bTVMS = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\tvms
// is uninstalled.
//---------------------------------------------------------------------------
export prototype tvms_UnInstalled();
function tvms_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"tvms", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vag\vagserver is installed.
//---------------------------------------------------------------------------
export prototype vagserver_Installing();
function vagserver_Installing()
begin
SetStatusExStaticText("正在注册VAG信令服务器...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vag\vagserver
// is installed.
//---------------------------------------------------------------------------
export prototype vagserver_Installed();
function vagserver_Installed()
begin
    if(!bVAGServer) then  
  if(!bRequire)  then
   Feature_Installed();
  endif; 
  SetStatusExStaticText("正在注册VAG信令服务器...");  
  
  ServiceAddService("vag_pag","iVMS VAG_PAG Service","VAG信令服务器",VAG,TRUE,"");    
    
  bVAGServer = TRUE;
  
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vag\vagserver is uninstalled.
//---------------------------------------------------------------------------
export prototype vagserver_UnInstalling();
function vagserver_UnInstalling()
begin
    if(!bVAGServer) then
  SetStatusExStaticText("正在卸载VAG信令服务器......");  
  
  ServiceStopService("vag_pag");  
  ServiceRemoveService("vag_pag");
 
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vag\vagserver
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vagserver_UnInstalled();
function vagserver_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"vag", ALLCONTENTS); 
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vag\vagvtdu is installed.
//---------------------------------------------------------------------------
export prototype vagvtdu_Installing();
function vagvtdu_Installing()
begin
SetStatusExStaticText("正在注册VAG流转发服务器...");  
end;


//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vag\vagvtdu
// is installed.
//---------------------------------------------------------------------------
export prototype vagvtdu_Installed();
function vagvtdu_Installed()
begin
    if(!bVAGVTDU) then  
  if(!bRequire)  then
   Feature_Installed();
  endif; 
  SetStatusExStaticText("正在注册VAG流转发服务器...");  
  ServiceAddService("vag_stream","iVMS VAG_STREAM Service","VAG流转发服务器",VAGSTREAM,TRUE,"");
  
  bVAGVTDU = TRUE;
  
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vag\vagvtdu is uninstalled.
//---------------------------------------------------------------------------
export prototype vagvtdu_UnInstalling();
function vagvtdu_UnInstalling()
begin
    if(!bVAGVTDU) then
  SetStatusExStaticText("正在卸载VAG流转发服务器...");  
  
  ServiceStopService("vag_stream");
  ServiceRemoveService("vag_stream"); 
  
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vag\vagvtdu
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vagvtdu_UnInstalled();
function vagvtdu_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"vag", ALLCONTENTS);
end;


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vrb is installed.
//---------------------------------------------------------------------------
export prototype vrb_Installing();
function vrb_Installing()
begin
SetStatusExStaticText("正在注册备份管理服务器...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vrb
// is installed.
//---------------------------------------------------------------------------
export prototype vrb_Installed();
function vrb_Installed()
begin
 if(!bVRB) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册备份管理服务器...");
  ServiceAddService("VRB","iVMS VRB Service","备份管理服务器",VRB,TRUE,"");  
  bVRB = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vrb is uninstalled.
//---------------------------------------------------------------------------
export prototype vrb_UnInstalling();
function vrb_UnInstalling()
begin
if(!bVRB) then
  SetStatusExStaticText("正在卸载备份管理服务器...");   
  ServiceStopService("VRB");
  ServiceRemoveService("VRB");
  bVRB = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vrb
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vrb_UnInstalled();
function vrb_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"vrb", ALLCONTENTS);
end;
//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vtdu is installed.
//---------------------------------------------------------------------------
export prototype vtdu1_Installing();
function vtdu1_Installing()
begin
SetStatusExStaticText("正在注册流媒体服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vtdu
// is installed.
//---------------------------------------------------------------------------
export prototype vtdu_Installed();
function vtdu_Installed()
begin
 if(!bvtdu) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册流媒体服务器...");
  ServiceAddService("vtdu","iVMS VTDU Service","流媒体服务器",vtdu,TRUE,"");  
  bvtdu = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vtdu is uninstalled.
//---------------------------------------------------------------------------
export prototype vtdu_UnInstalling();
function vtdu_UnInstalling()
begin
    if(!bvtdu) then
  SetStatusExStaticText("正在卸载流媒体服务器...");  
  ServiceStopService("vtdu");
  ServiceRemoveService("vtdu");
  bvtdu = TRUE;
 endif; 
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vtdu
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vtdu_UnInstalled();
function vtdu_UnInstalled()
begin
    //删除记录日志
 DeleteDir( TARGETDIR^"vtdu", ALLCONTENTS); 
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vtm is installed.
//---------------------------------------------------------------------------
export prototype vtm_Installing();
function vtm_Installing()
begin
SetStatusExStaticText("正在注册流媒体管理服务器...");
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vtm
// is installed.
//---------------------------------------------------------------------------
export prototype vtm_Installed();
function vtm_Installed()
begin
 if(!bVTM) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册流媒体管理服务器...");
  ServiceAddService("VTM","iVMS VTM Service","流媒体管理服务器",VTM,TRUE,"");  
  bVTM = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vtm is uninstalled.
//---------------------------------------------------------------------------
export prototype vtm_UnInstalling();
function vtm_UnInstalling()
begin
   if(!bVTM) then
  SetStatusExStaticText("正在卸载流媒体管理服务器...");
  ServiceStopService("VTM");
  ServiceRemoveService("VTM");
  bVTM = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vtm
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vtm_UnInstalled();
function vtm_UnInstalled()
begin
    //删除记录日志
 DeleteDir(TARGETDIR^"vtm", ALLCONTENTS);
end;

 


//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ncg is installed.
//---------------------------------------------------------------------------
export prototype ncg_Installing();
function ncg_Installing()
begin
SetStatusExStaticText("正在注册联网网关服务器...");
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vag is installed.
//---------------------------------------------------------------------------
export prototype vag_Installing();
function vag_Installing()
begin
SetStatusExStaticText("正在注册VAG信令服务器...");  
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vod is installed.
//---------------------------------------------------------------------------
export prototype vod1_Installing();
function vod1_Installing()
begin
 SetStatusExStaticText("正在注册点播服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vod
// is installed.
//---------------------------------------------------------------------------
export prototype vod2_Installed();
function vod2_Installed()
begin
    if(!bVOD) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
    
     SetStatusExStaticText("正在注册点播服务器...");
  ServiceAddService("vod","iVMS VOD Service","点播服务器",VOD,TRUE,"");   
  bVOD = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vod is uninstalled.
//---------------------------------------------------------------------------
export prototype vod2_UnInstalling();
function vod2_UnInstalling()
begin
if(!bVOD) then 
 SetStatusExStaticText("正在卸载点播服务器...");
 
 ServiceStopService("vod");
 ServiceRemoveService("vod");
 bVOD = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vod
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vod2_UnInstalled();
function vod2_UnInstalled()
begin
 //删除记录日志 
 DeleteDir( TARGETDIR^"vod", ALLCONTENTS);
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\vrm is installed.
//---------------------------------------------------------------------------
export prototype vrm1_Installing();
function vrm1_Installing()
begin
SetStatusExStaticText("正在注册存储管理服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\vrm
// is installed.
//---------------------------------------------------------------------------
export prototype vrm_Installed();
function vrm_Installed()
begin
    if(!bVRM) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册存储管理服务器...");
  ServiceAddService("vrm","iVMS VRM Server","存储管理服务器",VRM,TRUE,"");  
     bVRM = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\vrm is uninstalled.
//---------------------------------------------------------------------------
export prototype vrm_UnInstalling();
function vrm_UnInstalling()
begin
 if(!bVRM) then 
 SetStatusExStaticText("正在卸载存储管理服务器...");
 ServiceStopService("vrm");
 ServiceRemoveService("vrm"); 
 
 bVRM = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\vrm
// is uninstalled.
//---------------------------------------------------------------------------
export prototype vrm_UnInstalled();
function vrm_UnInstalled()
begin
 //删除记录日志 
 DeleteDir( TARGETDIR^"vrm", ALLCONTENTS); 
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\ams\input_door_control_dev is installed.
//---------------------------------------------------------------------------
export prototype input_door_control_dev_Installing();
function input_door_control_dev_Installing()
begin
SetStatusExStaticText("正在注册门禁报警接收单元服务...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\ams\input_door_control_dev
// is installed.
//---------------------------------------------------------------------------
export prototype input_door_control_dev_Installed();
function input_door_control_dev_Installed()
begin
if(!bAlarm_InputDoorControl) then  
  if(!bRequire)  then
  Feature_Installed();
  endif;
 SetStatusExStaticText("正在注册门禁报警接收单元服务...");
 ServiceAddService("Alarm_InputDoorControl","Alarm_InputDoorControl","门禁报警接收单元",Alarm_InputDoorControl,TRUE,"");   
 //LaunchAppAndWait(TARGETDIR^"PSS\\install.bat", "", WAIT|LAAW_OPTION_HIDDEN);   
 bAlarm_InputDoorControl = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\ams\input_door_control_dev is uninstalled.
//---------------------------------------------------------------------------
export prototype input_door_control_dev_UnInstalling();
function input_door_control_dev_UnInstalling()
begin
 if(!bAlarm_InputDoorControl) then
 SetStatusExStaticText("正在卸载门禁报警接收单元服务...");   
 ServiceStopService("Alarm_InputDoorControl");
 ServiceRemoveService("Alarm_InputDoorControl");
 bAlarm_InputDoorControl = TRUE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\ams\input_door_control_dev
// is uninstalled.
//---------------------------------------------------------------------------
export prototype input_door_control_dev_UnInstalled();
function input_door_control_dev_UnInstalled()
begin
 //删除记录日志 
    DeleteDir(TARGETDIR^"ams\\input_door_control_dev",ALLCONTENTS);
 DeleteDir( TARGETDIR^"ams", ALLCONTENTS); 
end;

//---------------------------------------------------------------------------
// The Installing event is sent just before the feature
// DefaultFeature\kps is installed.
//---------------------------------------------------------------------------
export prototype kps_Installing();
function kps_Installing()
begin
SetStatusExStaticText("正在注册键盘模拟服务器...");
end;

//---------------------------------------------------------------------------
// The Installed event is sent after the feature DefaultFeature\kps
// is installed.
//---------------------------------------------------------------------------
export prototype kps_Installed();
function kps_Installed()
begin
if(!bKPS) then  
  if(!bRequire)  then
   Feature_Installed();
  endif;
  SetStatusExStaticText("正在注册键盘模拟服务器...");
  ServiceAddService("kps","iVMS Kps Service","键盘模拟服务器",KPS,TRUE,"");  
  bKMS = TRUE;   
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalling event is sent just before the feature
// DefaultFeature\kps is uninstalled.
//---------------------------------------------------------------------------
export prototype kps_UnInstalling();
function kps_UnInstalling()
begin
if(!bKMS) then
  SetStatusExStaticText("正在卸载键盘模拟服务器...");   
  ServiceStopService("kps");
  ServiceRemoveService("kps");
  bKMS = FALSE;
 endif;
end;

//---------------------------------------------------------------------------
// The UnInstalled event is sent after the feature DefaultFeature\kps
// is uninstalled.
//---------------------------------------------------------------------------
export prototype kps_UnInstalled();
function kps_UnInstalled()
begin
//删除记录日志
 DeleteDir( TARGETDIR^"kps", ALLCONTENTS);
end;

 

0 0
原创粉丝点击