Several questions on the use of Inno Setup

Source: Internet
Author: User

several questions on the use of Inno setupCategory: Install Setup 2013-02-02 15:48 1781 people read comments (0) favorite reports Inno Setup uses a few questions:

"Question one: Inno Setup executes the reg file code?" 】
[Run]
Filename: "{Win}\regedit.exe"; Parameters: "/s {tmp}\reg.reg" //Silent parameter/s

"Problem two: When installing, if you already have a file with the same name, do not update the file?" 】
[Files]
Source: "Test.tmp"; DestDir: "{app}"; Flags:onlyifdoesntexist //onlyifdoesntexist Indicates that this file will be installed only if the file does not exist.

"Issue three: Do not unload a file when uninstalling?" 】
[Files]
Source: "Ctl3dv2. DLL "; DestDir: "{sys}"; Flags:uninsneveruninstall //uninsneveruninstall Uninstall, do not delete

"Question four: Inno Setup registration OCX"
[Files]
Source: "Xxx\xxx.ocx"; DestDir: "{app}"; Flags:onlyifdoesntexist regserver //Register RegServer

"Question five: How do I set an option in Inno Setup by default?" 】
[Tasks]
Name: "Desktopicon"; Description: "{Cm:createdesktopicon}"; Groupdescription: "{cm:additionalicons}"; Flags:checkedonce //parameter flags containing checkedonce can be

"Question six: Inno Setup to uninstall the old version before installing a new version?" 】
[Code]
If Regquerystringvalue (HKLM, ' software\microsoft\windows\currentversion\uninstall\my_program_is1 ', ' UninstallString ', resultstr) then
Begin
ResultStr: = Removequotes (RESULTSTR);
Exec (ResultStr, ",", SW_SHOWNORMAL, ewwaituntilterminated, ErrorCode)
End

Replace the My_program with your own app name!

Flags: This parameter is an additional option that can be separated by a space with multiple options. The following are the options supported by this parameter:
createvalueifdoesntexist: When you specify this tag, Setup creates the key value only if the key value does not exist. The tag does not take effect if the data type is none or if the DeleteValue tag is specified.
DeleteKey: When the tag is specified, the installer will first delete the entire key (if one exists), including all of its key values and subkeys. If ValueType is none, it creates a new key and key value.
DeleteValue: When the tag is specified, the installer will first remove the key value (if any). If ValueType is none and does not exist, it creates a new key value.
Dontcreatekey: When the tag is specified, Setup does not attempt to create the specified key or key value if the specified key does not exist in the user's system. If the specified key already exists, the error message is not displayed. The typical example is that the tag is combined with the uninsdeletekey tag to remove the key at unload time and not create them at installation time.
NoError: No error message is displayed for any reason that the Setup program created the key.
Preservestringtype: This is only used when the valuetype parameter is string or EXPANDSZ. When the token is specified, if the key value does not exist and it is a string type, it is replaced with the same type as the previous value.
Uninsclearvalue: Clears the key value data (REG_SZ type) when the program is uninstalled. The tag cannot be combined with the uninsdeletekey tag.
Uninsdeletekey: When uninstalling a program, delete the entire key, including all of its key values and subkeys. Obviously, this is not a good idea when it's inside the keys of Windows itself. You should only use it in the private key of your software.
Uninsdeletekeyifempty: When the program is uninstalled, it is deleted if the key does not have a key value or child key. This tag can be used in combination with the uninsdeletevalue tag.
Uninsdeletevalue: Remove the key value when uninstalling the program. This tag can be used in combination with the uninsdeletekeyifempty tag.

Several questions on the use of Inno Setup

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.