Inno Setup copy folder

Source: Internet
Author: User

Script sample analysis: Let's take a look at the [setup] section of the BASIC script created using the Inno Setup script Wizard: [setup]

Appname = premiere 6.5 localized patch ----------------- (program name) appvername = premiere 6.5 localized patch ------------ (program name + version) apppublisher = Haizi studio ---------------------------- (developer or author) apppublisherurl = http://www.haozi.com ------ (developer or author URL) appsupporturl = http://www.haozi.com ------- (Technical Service URL) appupdatesurl = http://www.haozi.com ------- (update upgrade URL) defaultdirname = {pf}/Adobe/premiere 6.5 ----- (default installation path, where {pf} is the "Program Files" folder) defagroupgroupname = premi Ere 6.5 Chinese patching ---- (project name added in the Start Menu by default) allownoicons = Yes ← (create shortcut icon) licensefile = D:/Chinese/license file .txt ------------------ (display License Agreement) infobeforefile = D:/ .txt ------------- (show Software Description) outputdir = finished terminal (installation program storage location) outputbasefilename = premiere 6.5 Chinese patch -- (installer name) setupiconfile = Han. ICO ---------------------------------- (installer icon) compression = lzma ------------- ------------------------ (ZIP: lzma) solidcompression = Yes ---------------------------------- (compression method: one-time compression) the content in the brackets is the notes added by the author. I think you should be able to understand this. However, as a Chinese Patch, you generally do not need to create a Start Menu project, do not need to create a shortcut icon, and do not need to uninstall the function. Instead, you must have the function of automatically finding the installation location of the original program, this makes patch installation more convenient and convenient. Therefore, the following modifications are made: (1) Remove the following items: defaultgroupname = premiere 6.5 Chinese-based patch ---- (by default, the project name added in the Start menu) allownoicons = Yes catalog (create shortcut icon) (2) Add the following project: disabledirpage = Yes catalog (you do not need to specify the installation path) disableprogramgrouppage = Yes ------------- (do not add a Start Menu Project) direxistswarning = No ----------------------------- (do not prompt that the folder already exists) uninsta Llable = 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 issue is that this path is dead. Once you change the installation path when installing premiere 6.5, for example, some people prefer to install a large program on the d disk. In this case, the original path is invalid and you have to manually specify the correct path. This setup seems too stupid. So, how can we make the patch automatically obtain the actual installation path of the original program? The answer is: use the registry. After most applications are installed, the installation and uninstallation information is written to a specific location in the registry. Therefore, you only need to enable the installation program to extract the information and switch to your own installation path to implement automatic locating. Inno Setup has long supported this function. Now, we can just tell the registry information of premiere 6.5. Please refer to the modified: defaultdirname = {REG: HKLM/software/Microsoft/Windows/CurrentVersion/uninstall/Adobe Premiere 6.5, installlocation} ----------- (read the actual installation path of premiere 6.5 from the Registry) next let's take a look at the [files] section of the BASIC script. As mentioned earlier, this section is used to define the files to be packaged into the installer. Therefore, we need to clarify the terms: Source: ------------- file storage location (source) destdir: ------------- where the file is to be installed (target) flags: ---------------- additional processing parameters (Marker) for the file to see the specific content: [files] Source: "D:/Chinese/preminfo. DLL "; destdir:" {app} "; flags: ignoreversionsource:" D://main program/* "; destdir:" {app} "; flags: ignoreversion implements createallsubdirs Source: "D:/Chinese/ INS/*"; destdir: "{app}"; flags: ignoreversion recursesubdirs createallsubdirs new word note: {app} -------------- this is a constant, indicates the installation path of the program. As long as you have set the defaultdirname in the [setup] section, you can use it elsewhere. Someone may ask, what is a constant? In general, they are fixed words. They use simple symbols to represent some fixed directories in the operating system, so that the script is concise and clear. For details, see the instructions in the help text of Inno Setup. Ignoreversion -------- ignore the file version issue. Recursesubdirs ------- package the main folder and subfolders (one pot ). Createallsubdirs ----- create a subfolder during installation. Modification to the [files] section: many Chinese-based patches directly replace the original files with Chinese-based files, and rarely create new folders in the original program directory, therefore, the createallsubdirs item in the flags label can be removed. Execute an executable file during installation... [files] Source: "The file name you want to execute"; destdir: "{app}"; flags: ignoreversion deleteafterinstall ..... [run] filename: "{app}/Name of the file you want to execute"; Description: "setup"; flags: skipifsilent shellexec attachment: main sections in the installation script of Inno Setup: [setup] section: global settings for installing and uninstalling programs, such as author information, installation directory, compression mode, and whether to uninstall programs. [Types] section: defines the type of the installation component, such as "full installation", "minimum installation", and "Select installation ". [Components] section: defines all components available for installation [Tasks] section: defines all tasks customized by users during installation. [Dirs] segment: defines the directory to be created. [Files] section: defines the files to be packaged into the installer. [Icons] section: defines shortcuts and icons to be created in the Start Menu, desktop, or taskbar. [INI] section: defines the new entries added to the. ini file in the user system. [Installdelete] section: defines the files or folders to be deleted before installation. [Languages]: defines the languages available in the installation program (for the multi-language edition ). [Registry] section: defines the registry key to be read, created, or deleted during installation. [Run] section: defines the program to run at the end of the installation. [Uninstalldelete] section: defines other files or folders to be deleted during uninstallation. [Uninstallrun] section: defines the program to be run before the uninstallation starts.

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.