Inno Setup Introduction (10)--operation Registry & self-starter program

Source: Internet
Author: User
Tags compact

http://379910987.blog.163.com/blog/static/3352379720110259414788/

Some programs need to boot with the system, or need to establish some file associations, which are the result of operating the registry in the Setup program. The operation of the registry is implemented in Inno Setup through the [Registry] segment.

Description of this paragraph:

Parameter list:

Parameters

Description

root

Root key. Must be one of the following

HKCR (HKEY_CLASSES_ROOT)

HKCU (HKEY_CURRENT_USER)

HKLM (HKEY_LOCAL_MACHINE)

hku (HKEY_USERS)

HKCC (hkey_current_config)

Subkey

subkey name, which can contain constants

ValueType

Value type, which must be one of the following :

None

String

Expandsz

MultiSZ

DWord

Binary

If none is specified (the default setting), Setup creates a key without a key value, in which case theValueName and valuedata parameters are ignored.

ValueName

The name of the value to be created, which can contain constants, if blank, to be written to the "default" value

Valuedata

Value of the data

Permissions

Specifies additional permissions for the login registry key ACL (Access control list ), which is valid only in Windows version A or later, and the available parameters are full ,Modify, and read

Flags

is an additional option setting. Multiple options can be separated with spaces. The following options are supported:

Createvalueifdoesntexist

DeleteKey

DeleteValue

Dontcreatekey

NoError

Preservestringtype

Uninsclearvalue

Uninsdeletekey

Uninsdeletekeyifempty

Uninsdeletevalue

The following example will cause the installer to run automatically after the operating system starts.

[Setup]

; Global settings, this section must be

Appname=test

Appvername=test

Defaultdirname= "E:\TEST"

appversion=1.0

Compression=lzma2/max

Showlanguagedialog=yes

[Components]

Name:main; Description: " Main program ( required )"; Types:full Compact Custom; Flags:fixed

Name:data; Description: " data file "; Types:full

name:help;description: " Help file "; Types:full Compact

[Files]

Source: "F:\desktop\test\ipmsg.exe"; DestDir: "{app}"; Components:main

Source: "F:\desktop\test\bin.dat"; DestDir: "{app}"; Components:data

Source: "F:\desktop\test\help.chm"; DestDir: "{app}"; Components:help

Source: "F:\desktop\test\readme.txt"; DestDir: "{app}"; components:help; Flags:isreadme

[Registry]

; Key values in the registry for this segment of the handler

ROOT:HKLM; Subkey:software\microsoft\windows\currentversion\run; valuetype:string; Valuename:test; Valuedata:{app}\ipmsg.exe; Flags: uninsdeletevalue

Next to the end, after the installation is complete, you can check the registry:

Indeed added to the registry to go, through the Jinshan Guardian also confirmed this point:

Since the flag bit used is uninsdeletevalue, uninstalling the software will automatically delete the value, and if you use Uninsdeletekey , the other values under that key will be deleted. This is not a good method unless you are sure to use your own private key, otherwise it is not recommended.

Some programs need to boot with the system, or need to establish some file associations, which are the result of operating the registry in the Setup program. The operation of the registry is implemented in Inno Setup through the [Registry] segment.

Description of this paragraph:

Parameter list:

Parameters

Description

root

Root key. Must be one of the following

HKCR (HKEY_CLASSES_ROOT)

HKCU (HKEY_CURRENT_USER)

HKLM (HKEY_LOCAL_MACHINE)

hku (HKEY_USERS)

HKCC (hkey_current_config)

Subkey

subkey name, which can contain constants

ValueType

Value type, which must be one of the following :

None

String

Expandsz

MultiSZ

DWord

Binary

If none is specified (the default setting), Setup creates a key without a key value, in which case theValueName and valuedata parameters are ignored.

ValueName

The name of the value to be created, which can contain constants, if blank, to be written to the "default" value

Valuedata

Value of the data

Permissions

Specifies additional permissions for the login registry key ACL (Access control list ), which is valid only in Windows version A or later, and the available parameters are full ,Modify, and read

Flags

is an additional option setting. Multiple options can be separated with spaces. The following options are supported:

Createvalueifdoesntexist

DeleteKey

DeleteValue

Dontcreatekey

NoError

Preservestringtype

Uninsclearvalue

Uninsdeletekey

Uninsdeletekeyifempty

Uninsdeletevalue

The following example will cause the installer to run automatically after the operating system starts.

[Setup]

; Global settings, this section must be

Appname=test

Appvername=test

Defaultdirname= "E:\TEST"

appversion=1.0

Compression=lzma2/max

Showlanguagedialog=yes

[Components]

Name:main; Description: " Main program ( required )"; Types:full Compact Custom; Flags:fixed

Name:data; Description: " data file "; Types:full

name:help;description: " Help file "; Types:full Compact

[Files]

Source: "F:\desktop\test\ipmsg.exe"; DestDir: "{app}"; Components:main

Source: "F:\desktop\test\bin.dat"; DestDir: "{app}"; Components:data

Source: "F:\desktop\test\help.chm"; DestDir: "{app}"; Components:help

Source: "F:\desktop\test\readme.txt"; DestDir: "{app}"; components:help; Flags:isreadme

[Registry]

; Key values in the registry for this segment of the handler

ROOT:HKLM; Subkey:software\microsoft\windows\currentversion\run; valuetype:string; Valuename:test; Valuedata:{app}\ipmsg.exe; Flags: uninsdeletevalue

Next to the end, after the installation is complete, you can check the registry:

Indeed added to the registry to go, through the Jinshan Guardian also confirmed this point:

Since the flag bit used is uninsdeletevalue, uninstalling the software will automatically delete the value, and if you use Uninsdeletekey , the other values under that key will be deleted. This is not a good method unless you are sure to use your own private key, otherwise it is not recommended.

Inno Setup Introduction (10)--operation Registry & self-starter program

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.