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