InstallShield Study Notes

Source: Internet
Author: User

See values for predefined constants: Sprintfbox (Information, "", "%d", variable value);   Custom constants: #define MAXCOUNT, #define COMPAN_NAME "Example_ Company ";   all functions declared with prototype must be defined in the function block,    after the preprocessing statement without"; "For example: #define, #include等等 Keywords Program,endprogram and end and begin   get C disk space Size Script # define disk_drive "c:\\" STRING szdrive,svstring; Number nspace,nresult; szdrive = Disk_drive;nspace = Getdiskspace (szdrive);  nresult = NumberToStr (svString, Nspace); if (Nresult < 0) Then   messagebox ("Numtostr failed.", SERVE);   abort; Endif; sprintfbox (Information, "info", "Disk space:%s", svstring);   operator Description: Join the path operator (^ This operator is used to add a path to the path description or file name description. You can use the join path (^) operator when you want to connect two paths or a file name. When a file name or a subdirectory is added to the path, the operator automatically checks for a sufficient number of backslash symbols: Szstringvar = "c:\\mypath\\" ^ ";   find string (%): using the string operator (%) You can determine whether a string is another string. String operators are case-insensitive. Szstringvara = "This is a sample string."; if (Szstringvara% "sample"//sample size is OK) then   messagebox ("Operation Complete", ""); and endif;  function: AskyeSNo ("Installation complete.would you like to view the ReadMe file now?", yes);//The default choice is yes Oh   when the installation script encounters an abort statement, The installer will be terminated. The uninstallation process then runs automatically in the background to roll back the unfinished installation and remove files that are already installed and level in the installation script. When the user presses the ESC key, the F3 key, or the Cancle button in the Anji dialog box during installation, the installer invokes the default handling handle for the exit event, and the Abort statement is used here.   for loop  for ICount = 1 to 10MessageBox ("You 1 See this times", information);endfor;  descending for loop for j = 2 0 Downto Step 5//20,15,10messagebox ("You'll seee this three times", information);endfor;  steps: For iCount = ten to 10 0 Step 10MessageBox ("You 1 See this times", information); Endfor; goto: The keyword Goto is used to jump a program directly to the Sub-branch of the specified label. In the following code snippet, the GOTO statement allows the program to jump directly to the line specified by the label name. Name: asktext ("Company Name:", "" "," szsrc "), if (szsrc =") thenmessagebox (' place enter ' the company name. ", SERVE); goto NAME;ENDIF; The label declared in the main program can only goto the goto label in the main program, and the Goto statement declared in the function only goes to the goto statement in the function    the restart code is completed: after Move Data---> OnEnd functions inside function OnEnd () beginsdfinishreboot ("title", "haha", 0, "Oooo", 0);//The second argument must be a number 0 and now it is not allowed to have other values. Oh end;   regdbsetdefaultroOT (heky_local_machine); the difference between the registry root node   abort and exit:  is to exit the installation process, except that abort has a rollback process, and exit simply ends the installation process. No rollback action is made for the previous operation.    Change the caption of the dialog InstallShield Ward's method: Settitle (ifx_product_name, 0, backgroundcaption); This is added in the Onbegin method. Order of execution of the    function: Before move data   onbeginbefore move data   onfirstuibeforebefore move data &nbsp      ; Onmaintuibefore   move data    onmoved   after Move data   OnFi The execution order of the Rstuiafterafter Move Data    onmaintuiafter    functions InstallShied2008 The following sequence of functions: Onbegin--- > Onshowuionshowui: Onfirstuibefore----> Onmovedata------> Onfirstuiafteronfirstuibefore (Include): Welcome screen , select the installation path, the type of installation (this interface has been dropped). Onmovedata (Include): Copy of File Onfirstuiafter (include): FileAttribute, Modify Registration, create shortcut, register filter/com, Excute custom EXE; the second time you run Setup: (Maintenance, usually we see the repair, Modify, delete three options) Onmainuibefore---> Onmovedata----> onmainuiafter   How to change the picture of the title bar of the internal dialog box: First you need to add BMP format (size 499*58 pixels) file to the support Files/language Independent directory   Then add the following code in the event response function Onbegin: Dialogsetinfo (dlg_info_altimage, Supportdir ^ "Bear_banner.bmp", TRUE);   ******* Fill in the Registration Code branch ********************************************* DLG_ASKREGISTERCODE://Registration Code fill dialog       setdialogtitle (DLG_ASK_ TEXT, "Registration code verification: Please enter the correct verification Code");     nresult = Asktext ("Registration code:", Szregistercode, Szregistercode);     if (nresult = back) then               goto dlg_sdlicense2;    endif;         if (Szregistercode = "") Then        messagebox ("Registration code cannot be empty", SEVERE);        goto dlg_askregistercode;    endif;     if (STrlengthchars (szregistercode)! =) Then       messagebox ("Please enter the correct registration code", SEVERE) ;        szregistercode = "";        goto Dlg _askregistercode;    endif;            if (Strlengthchars (szregistercode) = +) then       sdshowmsg ("Verifying ..... ", TRUE);        delay (3);        sdshowmsg ("Verifying in .....", FALSE);        messagebox ("Network authentication failed! The program will verify later .... ", information);        bregistercodechecked = true;         //Save the registration code to a file in the installation directory         //file name is:        openfilemode (file_mode_append);         if (Existsdir (szdir) = notexists) Then           createdir (SzDir);         endif;        if (CreateFile ( Nvfilehandle, Szdir, "") < 0) Then          messagebox (" Registration code file creation failed! ", SEVERE);       else          if (WriteLine (Nvfilehandle, Szregistercode) < 0) then          MessageBox ("Failed to save registration code", SEVERE);         endif;        endif;       closefile (NvFileHandle);        goto dlg_askplatformserverip;    endif;  ********** Fill in the Registration Code branch ************************************************ Study BoGuest: http://www.cnblogs.com/beyondtechnology/category/265153.html  ************************************ Do not display the uninstall icon in the Control Panel after the installation is complete **********************************function OnEnd ()  string Subkey;beginsubkey = "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + product_guid;    regdbsetdefaultroot (HKEY_LOCAL_MACHINE); if (Regdbkeyexist (subkey) =1) ThenRegDBDeleteKey (SubKey );   //is not displayed in the Add-Remove Program in Control Panel. endif  if (! Existsdir (Disk1target)) Thendeletedir (disk1target,allcontents);//Remove the Unload function. endif;end;   or:  installation designer->media->releases: Select the release item to set,  in the right argument list Hide Add/remove Panel Entry (last item), set to yes  *************************************************************** Do not display the uninstall icon in the Control Panel after the installation is complete **********************************        ******** How to hide the initialization interface **********************************************In the InstallShield-made installation package, you can start the initial interface with the parameter hide_progress hidden, but the project is different and the application method is different:  InstallScript Engineering: Setup method: In Setup.exe tab, installation designer-> Media, releases, Release *, Setup Command L Add "/hide_progress" to the Ine property entry  *************************************************************** The method of hiding the initialization interface ****** 2013/3/18  problem: 1/Create icon for shortcut key 2/Create uninstall icon 3/Customize Welcome to front window settings 4/ Set the right-most icon of a form's title line 5/Set the form's title bar below the right side of the background image   dlg_setuptype2

InstallShield Learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.