if(svSerial!="12345678") then
       MessageBox ( "请您输入正确的注册码,否则将无法完成后续安装!" , WARNING );
        goto  Dlg_SdRegisterUserEx;
    endif;  

解决方案 »

  1.   

      if(svSerial!="12345678") then
           MessageBox ( "请您输入正确的注册码,否则将无法完成后续安装!" , WARNING );
            goto  Dlg_SdRegisterUserEx;
        endif;  
      

  2.   

    如果你想要验证输入的注册码,最好写一个动态连接库来验证,这样可以充分利用一些库函数,因为Installshield Script提供的库内容是在太少。
      

  3.   

    写一个动态连接库,用UseDll来调就可以了,
    对了,我什么我用Installshield,做的安装程序不能建快捷方式呢?
      

  4.   

    在InstallShield Professional 6.0版本中有验证序列号的例子
      

  5.   

    to needle():在InstallShield Professional 6.0版本中那里有验证序列号的例子,请告诉路径
      

  6.   

    to maggie_ma(): 
      if(svSerial!="12345678") then
              MessageBox ( "请您输入正确的注册码,否则将无法完成后续安装!" , WARNING );
            goto  Dlg_SdRegisterUserEx;
        endif;   应该写在那里?我这样写却错了,请帮忙看一下
    ////////////////////////////////////////////////////////////////////////////////
    //                                                                            
    //  File Name: Setup.rul                                                   
    //                                                                            
    //  Description: InstallShield script                                        
    //                                                                            
    //  Comments: This script was generated based on the selections you made in
    //            the Project Wizard.  Refer to the help topic entitled "Modify      
    //            the script that the Project Wizard generates" for information
    // on possible next steps.
    //
    ////////////////////////////////////////////////////////////////////////////////
    // Include header files
        
    #include "ifx.h"
        
    ////////////////////// string defines //////////////////////////////////////////////// installation declarations ///////////////////// ----- DLL function prototypes -----
        // your DLL function prototypes
    // ---- script function prototypes -----
        // your script function prototypes    // your global variables//////////////////////////////////////////////////////////////////////////////
    //                                                                           
    //  FUNCTION:   OnFirstUIBefore                                            
    //                                                                           
    //  EVENT:      FirstUIBefore event is sent when installation is run for the first
    //              time on given machine. In the handler installation usually displays
    //              UI allowing end user to specify installation parameters. After this
    //              function returns, ComponentTransferData is called to perform file
    //              transfer.
    //                                                                           
    ///////////////////////////////////////////////////////////////////////////////
    function OnFirstUIBefore()
        number  nResult,nSetupType;
        string  szTitle, szMsg;
        string  szLicenseFile, szQuestion;
        string  szName, szCompany, szSerial;
        string  szTargetPath;
        string  szDir;
        string  szComponents, szTargetdir;
        number  nLevel;
        LIST    listStartCopy;
        number  nvSize;
    begin
        // TO DO: if you want to enable background, window title, and caption bar title                                                                     
        // SetTitle( @TITLE_MAIN, 24, WHITE );                                        
        // SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION );                     
        // Enable( FULLWINDOWMODE );    
        // Enable( BACKGROUND );   
        // SetColor(BACKGROUND,RGB (0, 128, 128));    
         if(svSerial!="12345678") then
              MessageBox ( "请您输入正确的注册码,否则将无法完成后续安装!" , WARNING );
            goto  Dlg_SdRegisterUserEx;
        endif;
        nSetupType = TYPICAL;
        TARGETDIR = PROGRAMFILES ^@COMPANY_NAME ^@PRODUCT_NAME;
        szDir = TARGETDIR;
        szName    = "";
        szCompany = "";
        szSerial = "";Dlg_Start:
        // beginning of dialogs labelDlg_SdWelcome:
        szTitle = "";
        szMsg   = "";
        nResult = SdWelcome( szTitle, szMsg );
        if (nResult = BACK) goto Dlg_Start;Dlg_SdLicense:
        szLicenseFile = SUPPORTDIR ^ "license.txt";
        szTitle    = "";
        szMsg      = "";
        szQuestion = "";
        nResult    = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
        if (nResult = BACK) goto Dlg_SdWelcome;Dlg_SdRegisterUserEx:
        szMsg   = "";
        szTitle = "";
        nResult = SdRegisterUserEx( szTitle, szMsg, szName, szCompany, szSerial );
        if (nResult = BACK) goto Dlg_SdLicense;Dlg_SdAskDestPath:
        szTitle = "";
        szMsg   = "";
        nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
        TARGETDIR = szDir;
        if (nResult = BACK) goto Dlg_SdRegisterUserEx;Dlg_SetupType:   
        szTitle    = "";
        szMsg      = "";
        nResult = SetupType ( szTitle , szMsg , "" , nSetupType , 0 );
        if (nResult = BACK) then
            goto Dlg_SdAskDestPath;
        else
            nSetupType = nResult;
            if (nSetupType != CUSTOM) then
           szTargetPath = TARGETDIR;
           nvSize = 0;
           ComponentCompareSizeRequired(MEDIA,szTargetPath,nvSize);
           if (nvSize != 0) then      
                    MessageBox( szSdStr_NotEnoughSpace, WARNING );
               goto Dlg_SetupType;
                endif;
            endif;   
        endif;Dlg_SdComponentTree: 
        if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
        szTitle    = "";
        szMsg      = "";
        szTargetdir = TARGETDIR;
        szComponents = "";
        nLevel = 2;
        if (nSetupType = CUSTOM) then
        nResult = SdComponentTree(szTitle, szMsg, szTargetdir, szComponents, nLevel);
        if (nResult = BACK) goto Dlg_SetupType;  
        endif;Dlg_ObjDialogs:
        nResult = ShowObjWizardPages(nResult);
        if (nResult = BACK) goto Dlg_SdComponentTree;
        
    Dlg_SdStartCopy:
        szTitle = "";
        szMsg   = "";
        listStartCopy = ListCreate( STRINGLIST );
        //The following is an example of how to add a string(szName) to a list(listStartCopy).
        //eg. ListAddString(listStartCopy,szName,AFTER);
        nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
        ListDestroy(listStartCopy);
        if (nResult = BACK) goto Dlg_ObjDialogs;    // setup default status
        SetStatusWindow(0, "");
        Enable(STATUSEX);
        StatusUpdate(ON, 100);    return 0;
    end;///////////////////////////////////////////////////////////////////////////////
    //
    //  FUNCTION:   OnMoving
    //
    //  EVENT:      Moving event is sent when file transfer is started as a result of
    //              ComponentTransferData call, before any file transfer operations 
    //              are performed.
    //
    ///////////////////////////////////////////////////////////////////////////////
    function OnMoving()
        string szAppPath;
    begin
        // Set LOGO Compliance Application Path 
        // TO DO : if your application .exe is in a subfolder of TARGETDIR then add subfolder 
        szAppPath = TARGETDIR;
        RegDBSetItem(REGDB_APPPATH, szAppPath);
        RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
    end;// --- include script file section ---
      

  7.   

    to: carlogjj
    sorry, 我用的是6.2,我不知道6.0有没有。
      

  8.   

    to needle():
        小弟用的是InstallShield 6.22,不是6.0,needle()若你有6.2的密码例子请贴一个出来,或者告诉小弟在6.2的什么地方有例子,小弟将万分感谢.(maggie_ma()给我的代码我都不知道该插在script的什么地方)
      

  9.   

        Dlg_SdRegisterUserEx:
         szMsg   = "";
        szTitle = "";
        nResult = SdRegisterUserEx( szTitle, szMsg, svName, svCompany, svSerial );
        if (nResult = BACK) goto Dlg_Start;放在这里:if(svSerial!="12345678") then
           MessageBox ( "请您输入正确的注册码,否则将无法完成后续安装!" , WARNING );
            goto  Dlg_SdRegisterUserEx;
        endif;  
     Dlg_SdAskDestPath:
                 。。
    不知你看懂了吗?一定好用的,不好用再问。    
      

  10.   

    TO maggie_ma():非常感谢大虾及时出手救助小弟,但小弟问题多多,将在近期请教(InstallShield的问题)