Script Example Analysis: First take a look at the [Setup] section of a basic script created with the Inno Setup Script Wizard:
[Setup]
appname=premiere 6.5 Chinese patch-----------------(program name) appvername=premiere 6.5 Chinese patch------------(program name + version) apppublisher= Studio----------------------------(development unit or author) apppublisherurl=http://www.haozi.com------( Development unit or author Web site) appsupporturl=http://www.haozi.com-------(Technical Service website) appupdatesurl=http://www.haozi.com-------(update upgrade URL) defaultdirname={pf}/adobe/premiere 6.5-----(the default installation path, {PF} is the Program Files folder) defaultgroupname= Premiere 6.5 Chinese Patch----(the project name added by default in the Start menu) Allownoicons=yes--------------------------------------(create shortcut icon) licensefile=d://license file. txt------------------(show license Agreement) infobeforefile=d://Chinese description. txt-------------(show software description) outputdir= finished-----------------------------------------(installation program storage location) outputbasefilename=premiere 6.5 Chinese Patch--( Installer name) setupiconfile= ico----------------------------------(installer icon) compression= Lzma-------------------------------------(compressor: Lzma) Solidcompression=yes--------------------------------( Compression mode: One-time compression) parentheses in the content isI added the comments that I think we should be able to understand. However, as a Chinese patch, generally do not need to create a Start menu items, do not need to create a shortcut icon, do not need to uninstall the function, and require the automatic search for the original installation location of the function, so that the patch installation more convenient and efficient, so made the following modifications: (1) Remove the following items: Defaultgroupname=premiere 6.5 chinese patch----(the name of the item added by default in the Start menu) Allownoicons=yes--------------------------------( Create Shortcut icon) (2) Add the following items: Disabledirpage=yes-------------------------------(no installation path specified) disableprogramgrouppage= Yes---------------(do not add a Start menu item) Direxistswarning=no-----------------------------(does not prompt for a folder already exists) uninstallable= No-----------------------------------(do not uninstall the program) (3) Modify the following items: Original: Defaultdirname={pf}/adobe/premiere 6.5----(default installation path, { PF} is the "Program Files" folder) the key problem is that this path is dead, once you have changed the installation path when you installed premiere 6.5, For example, some people like to install the large program to D, so that the original path is invalid, and you have to manually specify the correct path. This installation program is too "stupid". So how do you get patches to get the actual installation path of the original program automatically? The answer is: Use the registration form. Most applications will write installation and uninstallation information to a specific location in the registry, so the auto-locate feature can be achieved by having the installer extract the information and go to its own installation path. Inno Setup has already supported this feature, so let's just tell it the registry information for premiere 6.5, see the revised: defaultdirname={reg:hklm/software/microsoft/windows/ Currentversion/uninstall/adobe Premiere 6.5,installlocation}-------------(read from the registry PremieThe actual installation path of RE 6.5) then take a look at the [Files] section of the basic script, which is used to define the files to be packaged into the installer, so be aware of these nouns: source: Where-------------file is stored (source) DestDir: Where to install the-------------file (target) Flags:----------------Additional processing parameters for the file (labeled) below to see the specific content: [Files] source: "d:/-Chinese/ Preminfo.dll "; DestDir: "{app}"; Flags:ignoreversion source: "d://Main program/*"; DestDir: "{app}"; Flags:ignoreversion recursesubdirs createallsubdirs source: "d:/Chinese/plugin/*"; DestDir: "{app}"; Flags:ignoreversion recursesubdirs createallsubdirs Words Note: {app}----------------this is a constant that represents the program installation path as long as you are in [Setup] The Defaultdirname item in the paragraph is set and can be substituted elsewhere. One might ask, what is a constant? In layman's terms, they represent some fixed directories in the operating system with simple symbols, making the script concise and straightforward. See the instructions in Inno Setup's help text for details. Ignoreversion--------disregard for file version issues. Recursesubdirs-------Package The home folder and subfolders together (Yiguoduan). Createallsubdirs Create the appropriate subfolder-----installation. Changes to the [Files] section: Many of the Chinese patches are used to replace the original files directly with the Chinese files, very few in the original program directory to create new folders, so you can remove the Flags in the flag createallsubdirs. Execute an executable file when installing ... [files]source: "File name you want to execute";D Estdir: "{app}"; Flags:ignoreversion deleteafterinstall ... [run]filename: "{app}/you want to executeThe file name "; Description: "Setup"; Flags:skipifsilent shellexec : The installation script for inno Setup contains the main paragraph: [setup] segment: Global settings for the installation and uninstallation program, such as author information, installation directory, compression method, Whether to uninstall and so on. [Types] Segment: Defines the type of installation component, such as "Full Installation", "Minimum Installation", "Select Installation". [Component] Segment: Define all components that you can choose to install [Tasks] segment: Define all user-specific tasks during installation. [Dirs] Segment: Defines the directory that the user wants to create additional. [Files] Segment: Defines the files to be packaged into the installer. [Icons] Segment: Defines shortcuts and icons to be created in locations such as the Start menu, the desktop, or the taskbar. [INI] segment: Defined to the user system. INI file is added to the new entry. [Installdelete] Segment: Defines the files or folders to be deleted before installation. [Languages] Segment: Defines the languages available in the installer (for multi-language editions). [Registry] Segment: Defines the registry key to be read, created, or deleted during installation. [Run] Segment: Defines the program to run at the end of the installation. [Uninstalldelete] Segment: Defines additional files or folders to be deleted when uninstalling. [Uninstallrun] Segment: Defines the program to run before starting the uninstallation
Basic script created by the Inno Setup Script Wizard