Installation deployment project

xiaoxiao2021-03-06  70

'=============================== In the deployment project, add their own file class' ========= ===================== When publishing software, add their own file type, allow users to open the program by double-clicking this type of files without having to open it. This is a need to find it in the open file dialog. Here's how to add a file type: Open the File Type editor in your deployment project, you can add your own file type. The following figure is an example: In this example, after the program is installed, a ". HYD" file is added in the system. When double-hit. Hyd file, the system runs the main output program of this deployment project (that is, the main EXE file), and the file of the file is full name (including path) as the first parameter. So your program is able to receive the first parameter! '=============================== Deploy Oracle client in .NET installer' ======== =====================================================================================================================================================

The main thing is to do three work: package file, write a registry, registration environment variable Description: My Oracle version is 9, test the pass on 2000 Advanced Server, you can create a database connection normally 1. The package file directory results are as follows The following is the file directory in my packaging program, bin: The most important of course is a bin directory, in my package program, you need 29 files:

-------------------- oci.dlloraclient9.dlloracommon9.dllORACORE9.DLLorageneric9.dlloraldapclnt9.dlloran9.dllORANCDS9.DLLorancrypt9.dlloranhost9.dlloranl9.dlloranldap9.dllORANLS9.DLLoranms.dlloranmsp. dllorannts9.dllorannzsbb9.dlloranoname9.dlloranro9.dllorantcp9.dllorantns9.dllORAPLS9.DLLORASLAX9.DLLORASNLS9.DLLORASQL9.DLLoratrace9.dllORAUNLS9.DLLoravsn9.dllorawtc9.dll -------------------- network / admin: tnsnames.ora tnsnames.ora file content is as follows: (Service_name = server connection) ORCL = (deScription = (address = (protocol = tcp) (host = xxx.xxx.xxx.xxx) (port = 1521))) ("service_name = orcl)) OCOMMON / NLS / Admin / Data: Original Oracle installation directory All files ORACORE / ZONEINFO: Timezone.dat2. Write Registry HKEY_LOCAL_MACHINE / SOFTWARE / ORACLE " Oracle_home "=" c: / oracle / ora90 "I found that the Oracle_home value under the HKEY_LOCAL_MACHINE / SOFTWARE / ORACAL_MACHINE / SOFTWARE / ORACLE / HOME0 is not required. 3. Register Environment Variable HKEY_LOCAL_MACHINE / SYSTEM / Controlset001 / Control / Session Manager / Environment "Path" = "D: / Oracle / O Ra90 / bin; "Here you need to pay attention to it is best to set the PATH directly into this value, which overrides the original PATH, so it is best to add it on the original PATH. But .NET installer Setting the registration table can not be done, this time can be done in the program by adding a custom installation operation. One problem is not immediately taken up immediately after setting the PATH, so after installing the program, the system can't find the bin directory, cannot Create a database connection. My current practice is to copy 29 files under the bin directory to the system's [System Directory] (in the .NET deployment program, the file system -> special folder). A bit vicious, but temporary Let's live :) Who finds a solution to the solution to tell me that Active code is as follows: #Region Check the Oracle client settings

///

// / Check the Oracle client settings

///

Private void checkoracleClient () {

String [] Keys = {"System", "Controlset001", "Control", "session manager", "environment"}

THIS.SETREGISTRYKEY (Registry, "Path", @ "c: / oracle / ora90 / bin", true);

Keys = new string [] {"Software", "Oracle"}; this.setRegistryKey (registry.localmachine, keys, "oracle_home", @ "c: / oracle / ora90", false;

}

///

/// Write the specified value to the registry

///

/// Initial registry key

/// Registration form item array, indicating the path of the specified value

/// Name of the value

/// Value to write

/// Does it add before the current value, if not, override the current value

Private void setRegistryKey (RegistryKey Startkey, String "RegistryKeys, String Valuename, String Value, Bool append) {

RegistryKey rk = startKey;

RegistryKey Subkey = NULL;

For (int i = 0; i

Subkey = rk.opensubkey (registryKeys [i], true);

IF (Subkey == Null) {

Subkey = rk.createSubkey (registryKeys [i]);

}

RK = Subkey;

}

IF (append) {

IF (rk.getValue (Valuename) == NULL) {

RK.SetValue (Valuename, Value);

} else {

String OldValue = rk.getValue (Valuename) .tostring ();

IF (OldValue.indexOf (Value)> 0) {

RK.SetValue (Valuename, Value ";" OldValue);

}

}

} else {

IF (rk.getValue (Valuename) == NULL) {

RK.SetValue (Valuename, Value);

Rk.flush ();

}

}

IF (Subkey! = NULL) {

Subkey.close ();

}

Rk.flush ();

RK.Close ();

}

#ENDREGION Check Oracle Client Settings

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

New Post(0)