InstallShield internal library function complete works ten - long file name function (Chinese version)

zhaozj2021-02-11  158

10 long file name function

The following functions create long file names from the short message name, convert the short file name to the long text name, and enclose the long file name to enable the processing long file name to identify them.

Longpathfromshortpath

Create a long file name from a short file name.

Longpathtoquote

Insert or delete dual quotes around a long text name.

Longpathtoshortpath

Create a short message name from a long file name.

10.1 longpathfromshortpath

Grammar: longpathfromshortpath (svpath);

Description: Convert a short message name to its equivalence file name using the longpathfromshortpath function.

parameter:

svpath

Specify a short message name and return its related long text name.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function is not successful.

annotation:

For the explanation of the long text name, please see below:

Windows 95 and its subsequent versions and Windows NT 4.0 support long file names. Long file names allow users to give directory and file more meaningful names. "Long File Name" item points to long file names and long paths.

InstallShield provides long file name functions to facilitate the installation of 16-bit applications that do not identify long files and 32-bit applications. You have a responsibility to determine your application's request. InstallShield provides tools to help you install any type of application.

10.2 longpathtoquote

Syntax: longpathtoquote (svpath, nparameter);

Description: The longpathtoquote function places double quotes around a long text name or delete double quotes from a long file name.

Add double quotes to the long text name containing spaces before passing long file names. You must delete double quotes from the long file name in front of the long file name to the short file name. If you don't do this, you have hosted the long text name remains invalid.

This function will add quotation only when there is an empty character in the file name. For example, quotes will not be added to C: // thisismyapp because it is a long text name without spaces.

parameter:

svpath

Specify a long file name and return to the name containing or does not include quotation marks, depending on the value passed to the parameter nParameter.

NParameter

Specifies whether the quotation is to be added to the long path or delete from the long path. One of the following predefined constants in this parameter location:

True: Add quicker to long path.

FALSE: Delete quotes from the long path.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function is not successful.

annotation:

See the annotations of longpathfromshortpath.

10.3 longpathtoshortpath

Syntax: longpathtoshortpath (svpath);

Description: The longpathtoshortpath function converts a long text name to its equivalent short message name. Short file names and 16-bit programs are compatible, such as NotePad.exe or Mviewer2.exe. 16-bit programs do not accept long file names. Parameters SVPATH can be an absolute path or a relative path, and it can include a file name; but it specifies the folder or file must exist in the target system.

parameter:

svpath

Specify a long text name and return it to the short message name.

Longpathtoshortpath removes the end with the backslash from the long file name.

return value:

0: Indicates that the function is successful.

<0: Indicates that the function is not successful.

annotation:

· Please refer to LongpathfromshortPath.

· Because when only the specified folder or file can be found on the target system, the longpathtoshortpath can be successful, you usually have to set the current folder before specifying a relative path. For example, if SVPath contains relative path "InstallShield / InstallShield5 Professional Edition", it exists in folder "C: / Program Files", the installation will not find it unless the current folder is "C: / Program Files". If you need to use the ChangeDirectory function before calling longpathtoshortpath, you can modify the current folder, so the target folder or path can be found. · Use ChangeDirectory to specify a new directory.

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

New Post(0)