InstallShield internal library function 15 registry function

zhaozj2021-02-17  55

InstallShield internal library function 15 registry function

The following functions allow you to access the registry, read, create, and delete the registry key, and establish a registry related parameters for uninstalling.

CreateCreateInstallationInfo

Create an application information entry and one per application path.

CreateRegistrySet

Create a group or all groups of the registry entry in the registry entry folder in the resource pane.

DeinstallSetReference

Specifies the reference file to be detected before the uninstall process begins.

DeinstallStart

Create an application unloading and setting the [UninstallString] value under this item.

InstallationInfo

Create a registry key in accordance with the company name, product name and product version number.

MaintenanceStart

The uninstall function is activated by creating a registry key.

Regdbconnectregistry

Open the connection to a remote registry.

RegdbcreateKeyex

Create an item in the registry. Also allow you to link a class object and a registry key (only for advanced users).

Regdbdeletekey

Remove the specified item from the registry.

Regdbdeletevalue

Delete a value from a specified registry key.

RegdbdisconnectRegistry

Close to a connection to a remote registry.

RegdbgetAppinfo

Retrieve a value under an application information item.

RegdbgetItem

Retrieve values ​​under each application path or application unloading.

RegdbgetKeyValueex

Retrieve a value from one of the registry.

RegdbKeyexist

Detect the existence of the registry key.

RegdbQueryKey

A child and value name are queued.

RegdbsetAppinfo

Set a value under the application information item.

RegdbsetDefaultroot

Set the key.

RegdbsetItem

Assign each application path or application unloading.

RegdbsetKeyValueex

Set the registry entry.

SetInstallationInfo

Specify companies and product information used by CreateInstallationInfo.

15.1 CreateRegistrySet

Syntax: CreateREGISTRYSET (SzregistrySet);

Description: The CreateRegistrySet function creates the registry information specified by one or all registry groups in the current media. The name of the current media is saved in the system variable Media. A registry group can be associated with a file group, so the registry group is created only if the file group has been installed on the target system. If you are using an event-based script, any registry group (using the registry group with file group attribute) when you install any one of the file groups when you install any one of the file groups, and any one of the file groups is installed.

parameter:

SzregistrySet

Specifies the registry group name on the current media. To create a registry group defined on the current media, pass an empty string to this parameter.

return value:

0: Indicates that the function is successful.

-7: Create a failure.

-8: You cannot set the value of a registry key.

-9: Text replacement failed.

-10: Memory overflow.

-11: A value cannot be obtained from a string table.

-12: This function is called before calling ComponentTransferData on the current media. Note that COMPONENTTRANSFERDATA is automatically called in a installation running an event-based script.

--13: Unknown error.

annotation:

• The value of system variable Media is set to 'Data' during installation initialization. If you modify the value of this variable to point to the component group created by a script, you must modify the value back to 'data' before calling createRegistrySet.

· This function can only be called only after CoMPONENTTRANSFERDATA has been called. 15.2 CREATEINSTALLATIONINFO

CREATEINSTALLATIONINFO ();

Note: In an event-based script, the CreateInstallationInfo function is automatically called after the First UI Before event. It uses information specified by SetInstallationInfo to create an application information item for the program you are installing and each application path. The application information item is created immediately as the result of the call installationinfo. Each application path item is then created until a [PATH] or [DEFAULTPATH] value under this item is then called later.

CreatinStallationInfo provides a product name displayed in the Welcome Dialog, and provides MaintenanceStart to initialize company names, product names, and version numbers that uninstall log files. If CREATEINSTALLATIONINFO is called before the maintenanceStart in MaintAncestart, MaintenanceStart will fail. CreateInstallationInfo can only be called once in a installation. If you run multiple installations using DoinsTall, each installation can of course have its own call to CreateInstallationInfo. CREATEINSTALLATIONINFO is a special registry related function designed to handle specific predefined registry entries.

parameter:

no.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function failed to create one or more registry items.

annotation:

· You must call CreateInstallationInfo, RegdbGetAppinfo, RegdbSetItAppinfo, RegdbSetItAppinfo, RegdbSetItAppinfo, RegdbSetITETAPPINFO, RegdBSetItAppinfo, RegdbSetItAppinfo, RegdbSetItem, RegdbgetItem. MORE INFORMATION You can view the description of these functions.

• It is really created by each application path that is specified by the value that passes to the value of SetInstallationInfo.

DeinstallSetReference

Syntax: DeinstallSetReference (szreferencefile);

Note: Specifies the reference file to be detected before the start of the uninstall process. If the file is being used, uninstall is not executed. End users must turn off the process of using the file and start uninstall. You must call DEINSTALLSTART before calling DeinstallSetReference.

Because of the specific restrictions in Windows and Windows applications, the file specified by DeinstallSetReference can appear to be locked.

parameter:

szreferencefile

Specifies the full qualification of the file to be detected before the start of the uninstall process. This file is a program or a DLL that is only used by the application to be uninstalled.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function failed.

annotation:

· To specify multiple files to be detected, you can call the function for each file. Do not specify a file that is being used by an operating system or other application; if you do this, the end user will not continue to uninstall.

15.4 DeinstallStart

Syntax: DeinstallStart (Szobsolete, Svobsolete, Szobsolete, Lreete);

Note: The deInstallStart function supports only scripts created by installshield's previous versions. We recommend that you use the MaintenanceStart function instead.

DEINSTALLSTART functions activate uninstall functions by creating the following values ​​under the registry key_local_machine / software / microsoft / windows / currentversion / uninstall / : UninstallString system variable uninst value

DisplayName passed to the value of the second parameter of InstallationInfo

Logfile /setup.ilg

DeinstallStart must only be executed once in a installation script. However, if you run multiple scripts using doinstall, you can call DeinstallStart multiple times in a installation, because each single script can call DeinstallStart once.

parameter:

Szobsolete

The value of this parameter is ignored.

Svobsolete

You must pass a string value to this parameter. Do not return useful information.

Szobsolete

The value of this parameter is ignored.

LRESERVED

Transfer 0 to this parameter. Other values ​​are not allowed.

return value:

0: Indicates that the function successfully creates the registry key value.

<0: Indicates that the function failed to create one or more registry key values.

annotation:

· RegdbSetItem and RegdbgetItem function settings and retrieve the uninstall icon name under application uninion ([DisplayName]), which is created by calling the deinstallStart function. Therefore, the RegdBSetItem and RegdBGetItem requirements are required to call DeinstallStart before they are used as they are set or retrieved.

· Before calling any functions using the SharedFile or LockedFile option, the application information item must be created with installationinfo before calling SDFINISHREBOOT, and the application unloading must be created with the DeinstallStart function.

· Enable (logging) activates the record uninstall information. It is activated by default; you need to call Enable (logging) only correct the impact of previous disable (logging) calls.

15.5 InstallationInfo

Syntax: InstallationInfo (Szcompany, Szproduct, Szversion, SzproductKey);

Description: The InstallationInfo function specifies a company name, a product name, a product version number, and a program executable file name. The information you specified is used to create an application information item and a per-application path entry for the program you install. The application information item is created immediately as the result of the call installationinfo. Each application path item is then created until a [PATH] or [DEFAULTPATH] value under this item is then called later.

InstallationInfo provides a product name displayed in the welcome dialog. InstallationInfo provides DEINSTALLSTART use to initialize company names, product names, and version numbers that uninstall log files. If INSTALLATIONINFO is called before DeinstallStart, DeinstallStart will fail.

INSTALLATIONINFO can only be called once in a installation. If you run multiple installations that use DoinsTall, each installation can of course have its own call to InstallationInfo.

InstallationInfo is a special registry related function, designed to handle specific predefined registry entries.

parameter:

Szcompany

Specify the company name. InstallShield uses SZCompony to create a / entry under the [HKEY_LOCAL_MACHINE] / Software in the registry. SZProduct

Specifies the name of the product to be installed. InstallShield uses SzProduct to create a / item under [HKEY_LOCAL_ MACHINE] / Software / item in the registry. The value of SZProduct is also inserted into the first paragraph of the message text in the welcome dialog.

Szversion

Specify the version number of the product. InstallShield uses SzversionT to create a / item under [HKEY_LOCAL_MACHINE] / Software / / item in the registry. Together, the / item (Szversion) is assigned to an application information item. The application information is created immediately when the InstallationInfo is called.

SZProductKey

The file name of the primary executable of the application. If you use several executables, specify the executable of the most representative of the product. INSTALLSHIELD uses SzProductKey to create an application path entry under the item [HKEY_LOCAL_MACHINE] / Software / Microsoft / Windows / CurrentVersion / App Paths. Each application path item knows that you call RegdBSetItem Creating a numerical name and numerical number of values ​​under this item to be created in the registry.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function is not using parameters as settings. Confirm that you use the correct syntax. Any parameter of this function does not allow empty strings.

annotation:

· You must call InstallationInfo before calling the following function because they use the information provided by InstallationInfo: RegdBSetAppinfo, RegdbGetAppinfo, RegdbSetItem, RegdbgetItem. For more information, please see the instructions for these functions.

• Each application path is specified by the value passed to the value of InstallationInfo until the value of the RegdbSetItem is set to the value under this item.

15.6 MaintenanceStart

Syntax: maintenancestart ();

Description: The maintenanceStart function creates a registry key and the corresponding value used during the initialization of the installation or uninstall, and provides application information for the Add / Remove Programs dialog box. If you use an event-based script, MaintenanceStart is automatically called after the First UI Before event.

MAINTENANCESTART Creates the following value under the registry key_local_machine / software / microsoft / windows / currentversion / uninstall / :

Uninstallstring system variables Uninstall_String value.

DisplayName passes the value of the second parameter of the SetInstallationInfo or InstallationInfo.

(SetInstallationInfo function is automatically called before the Begin event, its second parameter is equal to the product_name string table entry.)

Logfile /setup.ilg

parameter:

no.

return value:

0: Indicates that the function successfully creates a registry key and its corresponding value.

<0: Indicates that the function failed to create a registry key and its corresponding value. 15.7 RegdbConnectRegistry

Syntax: Regdbconnectregistry (SzremoteSystem, Nkeytype, NRESERVED);

Description: The RegdbConnectRegistry function creates a connection to a remote registry. If you try to open a registry of a remote Windows NT system, you must have administrator's privileges. If you try to open a registry of a remote Windows 95 and a higher system, you must have activated remote management. This function is to use the system administrator to install network installation.

Once you have already opened the connection, you can create, delete or retrieve registry entries, numeric names, and value pairs like a remote registry as a local registry. RegdbConnectRegistry allows you to edit only one registration opening key each time you open a remote registration, you can only edit the items and values ​​under HKEY_LOCAL_MACHINE or HKEY_USERS. When you call RegdbConnectRegistry, you must specify which key you want to edit. If you want to edit another key or one of its children, you must turn off and reopen the connection.

To edit a remote registry, you must use only common registry related functions (listed below), they are designed to process all registry keys:

RegdbcreateKeyex, RegdbDeleteKey, RegdbDeletevalue, RegdbgetKeyValueex

RegdbKeyexist, RegdbQueryKey, RegdbsetKeyValueex

parameter:

SzremoteSystem

Specifies the system name to connect, such as "RemoteSys".

nkeytype

Specify one of the following constants:

HKEY_LOCAL_MACHINE or HKEY_USERS.

NRESERVED

Transfer 0 to this parameter. Other values ​​are not allowed.

return value:

0: Indicates that the function successfully creates a connection to the system registry.

Regdb_err_connectionexists (-6): A connection to a remote registry has already existed. Before you call RegdbConnectRegistry again, you must use RegDBDisconnectregistry to close it.

Regdb_err_corruptedregistry (-4): Indicates that the remote registry is destroyed and cannot be accessed.

Regdb_err_initialization (-2): Indicates that the registry service cannot be initialized. Confirm that remote management has been activated and you have an appropriate privilege to write registry.

Regdb_err_invalidhandle (-5): The item name provided to the remote registry is not allowed.

Regdb_err_invalidname (-3): Indicates that the system in szremotesystem cannot be found. Check the name and try again.

-1: Other errors.

annotation:

· Since you set the key by calling RegdbConnectregistry, once you have established a connection to the remote registry, you cannot call RegdBsetDefaultroot. Once you have called RegDBDisconnectRegistry, all calls to registry related functions affect the local registry, and then you can call RegdBsetDefault to modify the key.

• In an uninstallation, InstallShield will uninstall all items that are deposited in any of the uninstall records. The items automatically created by InstallShield will be stored in uninstall. When you call RegdBsetKeyValueEx creation items, you don't have access to uninstall records above these items, and your item will not be unloaded, regardless of whether to activate (you can enable and disable). However, when you call RegdbCreateKeyex to create an item, when deposited is activated, you do not deposit the recorded item, and your item will deposit. When the memory is deleted, all items you create under this will be uninstalled. MORE INFORMATION You can query the description of each function. 15.8 RegdbcreateKeyex

Syntax: RegdbcreateKeyex (Szkey, Szclass);

Description: The RegdbcreateKeyEx function creates one of the registry. You can also link a class object to the newly created item (only for advanced users). The newly created item does not have a value associated with it. Unless you additionally specify, InstallShield creates the item as a child of HKEY_CLASSES_ROOT. You can use regDbsetDefaultRoot to specify a different key.

Different layers are separated by a doubles in one item-child expression. If they don't exist, installshield will immediately create all layers.

When the storage feature is activated, the items created by RegdbCreateKeyex are deposited in the uninstall record. However, remember that in a multi-item expression such as Key1 / Key2 / Key3, RegDbcreateKeyEx identifies that Key3 is the relationship that the function calls the relationship. Such as DOS command DIR C: / Windows / system lists files in the Windows system folder instead of the Windows folder. Therefore, Key3 will be stored in unloading records, but Key1 and Key2 will not. For information on the Windows system folder, review the documentation of the InstallShield system variable Winsysdir.

Make sure to store uninstall records correctly when you create one item and child in RegdbcreateKeyex, first create the parent (when the feature is activated). When the parent or high-level item in the chain of the item is created, then create the child under the parent. All subtersites of the parents created are also uninstalled when the parent is uninstalled.

For example, in order to ensure that KEY1 and all its sub-items will be uninstalled, KEY1 is created with RegdbCreateKeyex when deposited is activated. Then you can create key2, key3, etc. in a separate function call or in your respective function calls. When Key1 is uninstalled, all submersides below will be uninstalled.

Remember When an item is uninstalled, all of its subtries are also uninstalled. Therefore, if you use RegdbCreateKeyex to create an item under the item that has been deposited in uninstall, the item you created is also uninstalled when the higher level item is uninstalled, no matter where you create your items. Whether it is activated, no matter what you create your items.

If you are using the item created with RegDbcreateKeye already existing and you do not disable the storage, the items used by other applications will be deposited in uninstall records. During an uninstallation process, this item will be uninstalled, which causes problems with applications that use this item. To avoid this problem, use regDbkeyexist before creating an item to detect its existence. If the item already exists, use RegDbCreateKeyex to create a unique child for your application. Then, when the unload occurs, only the child is deleted. If you don't want the existence of the test, you can use the Disable function to disable the storage feature when you create this item. The deposited function is activated after the item is created. However, remember that this item will not be uninstalled with your application.

RegdbcreateKeyex is a universal registry related function, designed to work in all registry entries, including items that are processed by special registry related functions.

parameter:

SZKey

Specifies the name of the item to be created under one of the four on-key. Use a double-reverse slope to separate the different layers in the subkey.

Szclass

Specifies the class name that is associated with the item.

return value:

0: Indicates that the function successfully created the child.

<0: Indicates that the function failed to create the child.

annotation:

· Windows NT 4.0 does not allow you to create one item directly under HKEY_LOCAL_MACHINE.

15.9 RegdbdeleteKey

Syntax: regdbdeletekey (szsubkey);

Note: The RegdbDeleteKey function removes a specific item from the registry and the value associated with it. All children deleted and the values ​​associated with them are also deleted.

InstallShield assumes that the item specified by SZSubkey is a child of HKEY_CLASSES_ROOT. You can use RegdBsetDefaultroot to specify another key.

RegdbdeleteKey is a universal registry related function, designed to work in all registry entries, including those processed by special registry related functions.

parameter:

Szsubkey

Specifies the name of the item to be deleted. Use a double-reverse slope to separate the different layers in the subkey.

return value:

0: Indicates that the function successfully deletes the item.

<0: Indicates that the function failed to delete the item.

15.10 Regdbdeletevalue

Grammar: regdbdeletevalue (szsubkey, szvalue);

Description: The regdbdeleteValue function removes a value from a specific item of a registry. InstallShield assumes that the item specified by SZSubkey is a child of HKEY_CLASSES_ROOT. You can use RegdBsetDefaultroot to specify another key.

parameter:

Szsubkey

Specifies the name of the registry key, which contains the value you want to delete. Use a double-reverse slope to separate the different layers in the subkey.

SzValue

Specify the name of the value you want to delete.

return value:

0: Indicates that the function successfully deletes the value.

<0: Indicates that the function failed to delete this value.

15.11 RegdbdisconnectRegistry

Grammar: regdbdisconnectregistry (NRESERVED);

Note: The RegdbDisconnectRegistry function turns off a connection to a remote registry established by calling RegdbConnectRegistry.

After calling RegdbDisConnectregistry, all calls to the installation script registry associated function will affect the local system registry. For more information, please review the special registry related functions.

parameter:

NRESERVED

Transfer 0 to this parameter. Other values ​​are not allowed.

return value:

0: Indicates that the function successfully closes a connection to the registry on the remote system.

<0: Indicates that the function failed to close the registry connection.

15.12 RegdBGetAppinfo

Grammar: RegdBgetAppinfo (Szname, NVTYPE, SVVALUE, NVSIZE);

Description: The RegdBGetAppinfo function retrieves the value of a particular value name under the application information of your primary application from the registry. The application information item is created by InstallShield as the result of calling InstallationInfo. Before calling RegdBGetAppinfo, you must call InstallationInfo to create an application information item.

RegdBGetAppinfo is a special registry related function, designed to handle specific predefined registry entries.

Parameters: SZNAME

Specifies the value name of the value to retrieve.

NVTYPE

Returns one of the following predefined constants that identifies the type of data returned in svValue:

Regdb_string: string variable, no newline character is allowed.

Regdb_string_expand: String variable Maintains an expandable environment variable expression, such as "% mypath%".

Regdb_string_multi: String variable, allows newline.

Regdb_number: It is a digital expression that is a string and can be passed to a string variable.

Regdb_binary: Save binary data in a string.

svvalue

Returns the value of the numerical name specified by SZNAME.

NVSIZE

Returns the size of the return value with bytes.

return value:

0: Indicates that the function successfully retrieves this value.

<0: Indicates that the function failed to retrieve this value.

15.13 RegdbgetItem

Grammar: regdbgetitem (nitem, svvalue);

Note: The RegdBgetItem function retrieves the value per application path or application uninstall according to the NITEM value. These INSTALLSHIELDs are created as the result of calling installationInfo. Before calling RegdBGetItem, you must call InstallationInfo to create an application information item.

RegdbgetItem is a special registry related function that is designed to handle a specific predefined registry key.

parameter:

NITEM

Specify the item to retrieve. One of the following predefined constants in this parameter location:

Regdb_appp_: The value of [PATH] per application path entry.

Regdb_appppath_default: The value of [DefaultPath] under the application path entry.

Regdb_uninstall_name: The value of [DisplayName] under uninstall. When the constant is used, SzValue specifies that the application name that is displayed in the control panel can uninstall the application list.

svvalue

Returns the value of this item.

return value:

0: Indicates that the function successfully retrieves the value of the project.

<0: Indicates that the function failed to retrieve the value of the project. Confirm that you use the InstallationInfo function before using the function.

annotation:

• Before calling the RegdBGetItem function (NITEM as the regdb_apppa_default option), you must create the INSTALLATIONINFO function to create each application path. Before calling the RegdBgetItem function (NITEM is regbd_uninstall_name), you must call the DeinstallStart function to create a unloading and assign a value to [DisplayName] under the application uninion.

15.14 RegdbgetKeyValueex

Syntax: RegdbgetKeyValueex (Szkey, Szname, NVTYPE, SVVALUE, NVSIZE);

Description: RegdbgetKeyValueex function Retrieves the value of a specific value name next to a specified item in the registry. When the default, INSTALLSHIELD assumes that the item is a child under HKEY_CLASSES_ROOT. You can use regdbsetDefaultRoot to specify another key.

RegdbgetKeyValueex is a universal registry related function, designed to work in all registry entries, including items that are processed by special registry related functions.

parameter:

SZKey

Specify the name of the item to be retrieved. Use a double-reverse slope to separate the different layers in the subkey. Szname

Specifies the numerical name of the value to be retrieved under Szkey. To search the default value of the item, pass an empty string.

NVTYPE

Returns one of the following predefined constants that identifies the type of data returned in svValue:

See the description of this section in 15.12.

svvalue

Returns the value specified by SZKEY and SVNAME. Note that a numeric value is returned by a string.

NVSIZE

Returns the size of the value returned in SvValue with bytes.

return value:

0: Indicates that the function successfully retrieves this value.

<0: Indicates that the function failed to retrieve this value.

annotation:

On a Windows NT platform, when retrieving the regdb_string_multi data type, the empty string calls strGetToKens to the parameter to analyze a string of string to a string of strings with a null string. That is, if SvValue has multiple result strings after calling RegdBgetKeyValueex, strGetToKens (ListID, SvValue, "") can be used to analyze strings and put them on a list of strings by ListID.

15.15 regdbkeyexist

Grammar: regdbkeyexist (szsubkey);

Description: RegdbKeyexist function detects the existence of a particular item in the registry. When the default, INSTALLSHIELD assumes that the item is a child under HKEY_CLASSES_ROOT. You can use regdbsetDefaultRoot to specify another key.

RegdbKeyExist is a universal registry associated function, designed to work in all registry entries, including items that are processed by special registry related functions.

parameter:

Szsubkey

Specifies the name of the item to find. You don't have to include the HKEY_CLASSES_ROOT item (or other item you specify). The different layers of the sub-item are separated by a double-reverse slope.

return value:

1: Indicates that the function successfully found items in the registry.

<0: Indicates that the function failed to find items in the registry.

15.16 RegdbQueryKey

Grammar: RegdbQueryKey (SzsubKey, NItem, ListResults);

Description: The RegdbQueryKey function allows the user to queue a child and value name of an item. Use this function to actually enumerate these items during runtime.

RegdbQueryKey is a universal registry related function, designed to work in all registry entries, including items that are processed by special registry related functions.

parameter:

Szsubkey

Specifies the child of one of the previously called RegdBSETDEFAULTROOT settings. Use a backslash to specify a deeper layer of child. In order to search the key, pass an empty string.

NITEM

Specifies items that must be placed in the list. One of the following predefined constants in this parameter location:

Regdb_keys: The string list returned at ListResult will contain a list of all children under this item.

Regdb_names: The string list returned at ListResult will contain the name of all named values ​​of the item.

ListResults

Returns the result of queuing in a string list. The list of ListResult identified must have been initialized by calling ListCreat.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function failed.

15.17 RegdbSetAppinfo

Syntax: RegdbSetAppinfo (Szname, NTYPE, SZVALUE, NSIZE);

Description: RegdbSetAppinfo Function Sets the value of a particular value name under the application information item in the registry. You must call InstallationInfo before calling RegdBSetAppinfo to create an application information item. RegdBSetAppinfo is a special registry related function, designed to handle specific predefined registry entries.

parameter:

Szname

Specify the value name to be set.

NTYPE

Specify the type of the data you want to set, one of the following predefined constants in this parameter:

See the description of this section in 15.12.

SzValue

Specifies the value set to the value name.

nsize

Returns the size of the data passed to RegdbSetAppinfo by byte number. Transfering this parameter -1 to indicate that installshield should determine the size of the data.

return value:

0: Indicates that the function is successfully assigned to the numeric name.

<0: Indicates that the function failed to assign.

15.18 RegdbsetDefaultroot

Syntax: regdbsetdefaultroot (nrootKey);

Description: The RegdbSetDefault function sets a key to use by other registry functions. Most InstallShield registry functions work in the default root of the registered tree with HKEY_CLASSES_ROOT. With this function, you can specify another item, such as HKEY_LOCAL_MACHINE or HKEY_URENT_USER or HKEY_USERS as the key.

RegdbgetKeyValueex is a universal registry related function, designed to work in all registry entries, including items that are processed by special registry related functions.

You can use RegDBSETDEFAULTROOT to modify the key to create or process the item with special registry related functions.

parameter:

NRootkey

Specifies the name of the item set to the key.

return value:

0: Indicates that the function is successfully set.

<0: Indicates that the function is not set.

annotation:

· Windows NT 4.0 does not allow you to create one item directly under HKEY_LOCAL_MACHINE.

15.19 RegdbSetItem

Grammar: regdbsetitem (nitem, szvalue);

Description: The regdbsetitem function assigns each application path or application unloading to the value of the NITEM. Call the RegdbSetItem as a regdb_appppp_appath_APPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPSETITEM Create each application path. Note You must call InstallationInfo before calling RegdBSetItem to create these items.

RegdbSetItem is a special registry related function, designed to handle specific predefined registry entries.

parameter:

NITEM

Specify the item to set (entry). One of the following predefined constants in this parameter location:

Regdb_appp_: [PATH] value under each application path item.

Regdb_apppath_default: The [DefaultPath] value under each application path item.

Regdb_uninstall_name: The [DisplayName] value under the uninstall. When this constant is used, SzValue specifies the application name of the displayed display in the application list in the control panel.

SzValue

Specifies the value assigned to the specified item.

return value:

0: Indicates that the function is successfully set.

<0: Indicates that the function failed. The most common failed reason is that the installationinfo function is not called. This function can only be executed after you call InstallationInfo.

annotation:

· In the use of the regdb_apppa_appath_default option (they will affect the creation of each application path ", you also affect the INSTALLATIONINFO function before you write a value), you must call the InstallationInfo function to provide information. · When you call the MaintenanceStart or DeinstallStart function, the [UninstallString] value is created.

15.20 RegdbsetKeyValueex

Syntax: RegdbsetKeyValueex (Szkey, Szname, NTYPE, SZVALUE, NSIZE);

Description: RegdbsetKeyValueex Function Sets the value of the value specified under one item in the registry. If the item does not exist, RegdBsetKeyValueex will create it for you. However, the newly created items do not deposit into uninstall records unless it is a child that has already been stored in the unloading record. The following cases will be deposited in the uninstallation record:

It is created when they use RegDbCreateKeyex.

When the storage function is activated.

When they are automatically created by InstallShield in the installation process.

It is created as a result of calling a special registry related function.

If the value name does not exist, RegdBsetKeyValueex creates it. If the number of values ​​already exists, RegdBsetKeyValueex rewrite it. InstallShield assumes that the value in SZKEY is a child of the HKEY_CLASSES_ROOT item. If you want to use a different main item, use the RegdbSetDefault function to set the main switch.

RegdbsetKeyValueex is a universal registry related function, designed to work in all registry entries, including items that are processed by special registry related functions.

parameter:

SZKey

Specifies the name of the item to be set; this item must have been created by RegdbCreateKeyex. You don't have to include the HKEY_CLASSES_ROOT item (or other item you specify). The different layers of the sub-item are separated by a double-reverse slope.

Szname

Specifies the numerical name of the number of values ​​to be set. To set the default value of the item specified in SZKey, pass an empty string to this parameter.

NTYPE

Specify the type of the data you want to set, one of the following predefined constants in this parameter:

See the description of this section in 15.12.

SzValue

Specify the value associated with the numeric name. All values ​​must be passed on string variables. The numbers must be represented as strings (INSTALLSHIELD converts them to numbers).

nsize

Specify the size of the data to be set by byte number. When NTYPE is regdb_string, regdb_string_expand, or regdb_number, you can specify this parameter as -1, and installshield sets its size. However, when NTYPE is regdb_binary and regdb_string_multi, you must always specify the number of bytes you saved in the binary data.

return value:

0: Indicates that the function is successfully set.

<0: Indicates that the function failed to set it.

15.21 SetInstallationInfo

Syntax: SetInstallationInfo (Szcompany, Szproduct, Szversion, SzproductKey);

Note: In an event-based script, the SetInstallationInfo function is automatically called before the Begin event, with string table company_name, product_name, product_version, and product_key as its parameters. SetInstallationInfo Specifies that the information is used by CreateInstallationInfo (it in an event script is automatically called after the First UI Before event is automatically invited to create an application information item that you are installing, and each application path entry. SetInstallationInfo is a special registry-related function designed to work in a particular predefined registry key.

parameter:

Szcompany

Specify the company name. CREATEINSTALLATIONINFO uses Szcompany to create the / item under the [HKEY_LOCAL_ MACHINE] / Software item in the registry.

SZProduct

Specifies the name of the installed product. CREATEINSTALLATIONINFO uses SzProduct to create the / item under the [HKEY_LOCAL_MACHINE] / Software / item in the registry. The value of SzProduct is also inserted into the first paragraph of the message text in the welcome dialog.

Szversion

Specify the version number of the product. InstallShield uses SzversionT to create a / item under [HKEY_LOCAL_MACHINE] / Software / / item in the registry. Together, the / item (Szversion) is assigned to an application information item. The application information is created immediately when the InstallationInfo is called.

SZProductKey

The file name of the primary executable of the application. If you use several executables, specify the executable of the most representative of the product. INSTALLSHIELD uses SzProductKey to create an application path entry under the item [HKEY_LOCAL_MACHINE] / Software / Microsoft / Windows / CurrentVersion / App Paths. Each application path item knows that you call RegdBSetItem Creating a numerical name and numerical number of values ​​under this item to be created in the registry.

return value:

This function always returns 0.

转载请注明原文地址:https://www.9cbs.com/read-30512.html

New Post(0)