📄 15290.html
字号:
<html>
<head>
<title>Thanks</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Thanks</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:winntuser@hotmail.com">Windows NT user</a> on July 06, 1999 at 16:11:14:<p>
In Reply to: <a href="15282.html">Re: File Operation</a> posted by Booker Hsu on July 06, 1999 at 13:14:50:<p>
: : 请问如何将EXE本身COPY到其他地方?<br>: : (P.S 最好用Windows API, 因为要移植到VC++);<p>: >>>>>>>>>>>>>>>>>>><br>: VerInstallFile<p>: VB Declaration<p>: Declare Function VerInstallFile& Lib "version.dll" Alias " VerInstallFileA" _<br>: (ByVal uFlags As Long, ByVal szSrcFileName As String, ByVal szDestFileName As _<br>: String, ByVal szSrcDir As String, ByVal szDestDir As String, ByVal szCurDir As _<br>: String, ByVal szTmpFile As String, lpuTmpFileLen As Long)<p>: Description<p>: This function is used to install a file. It uses the information provided by the VerFindFile function to determine where a file should be installed. The function works by first comparing the version stamps of the two files. If the source file is a newer and compatible version, the source file is copied to a temporary file in the destination directory, decompressing the file if it is compressed. Then the existing version of the file is deleted and the temporary file is renamed to match the destination file name.<p>: Use with VB<p>: Refer to □ersion Stamping,?earlier in this chapter.<p>: Parameter Type/Description<br>: uFlags Long□ combination of the following constant values:VIFF_FORCEINSTALL: Forces installation of the source file without version checking.VIFF_DONTDELETEOLD: Does not delete the existing version of the file if it is not in the destination directory. If it is in the destination directory, it will be overwritten by the new file.<br>: szSrcFileName String□he name of the file to install. This should not include the path name for the file.<br>: szDestFileName String□he name that should be given to the file once it is installed. This is usually the same as szSrcFileName.<br>: szSrcDir String□he source directory from which the new version of the file is copied.<br>: szDestDir String□he directory in which to install the new version of the file. The DestDir buffer returned by the VerFindFile function is typically used for this parameter.<br>: szCurDir String□he directory that contains the current version of the file. The CurrDir buffer returned by the VerFindFile function is typically used for this parameter. If the string is empty, no previous version of the file exists on the system.<br>: szTmpFile String□ buffer to load with the name of a temporary copy of the source file. Must be allocated to be at least MAX_PATH characters long.<br>: lpuTmpFileLen Long□he length of the TmpFile buffer. This variable will be set to the actual number of characters loaded to the buffer including the terminating NULL character. If VIFF_FORCEINSTALL is specified and TmpFileLen is not zero, the temporary file will be renamed to the name specified in the SrcFile parameter.<br>: Return Value<p>: Long□n integer that contains a combination of one or more of the constants listed in Table 13.19.<br>: Table 13.19 VerInstallFile Result Constants<p>: Constant Description<br>: VIF_TEMPFILE A temporary file that is a copy of the new file is present in the destination directory and needs to be deleted.<br>: VIF_MISMATCH The existing file differs from the new file in one or more version attributes. Can be overridden by specifying VIFF_FORCEINSTALL in the uFlags parameter.<br>: VIF_SRCOLD The new version of the file is older than the existing file based on the version stamping of the files. Can be overridden by specifying VIFF_FORCEINSTALL in the uFlags parameter.<br>: VIF_DIFFLANG The new version of the file has a different language or code page value from the existing file. Can be overridden by specifying VIFF_FORCEINSTALL in the uFlags parameter.<br>: VIF_DIFFCODEPG The new version of the file needs a code page that is not present on the version of Windows now running. Can be overridden by specifying VIFF_FORCEINSTALL in the uFlags parameter.<br>: VIF_DIFFTYPE The new version of the file differs in type, subtype, or target operating system from the existing version. Can be overridden by specifying VIFF_FORCEINSTALL in the uFlags parameter.<br>: VIF_WRITEPROT The preexisting file is write-protected.<br>: VIF_FILEINUSE The existing file is in use.<br>: VIF_OUTOFSPACE There is insufficient disk space on the destination drive.<br>: VIF_ACCESSVIOLATION Operation failed due to an access violation.<br>: VIF_SHARINGVIOLATION Operation failed due to a sharing violation.<br>: VIF_CANNOTCREATE The temporary file could not be created.<br>: VIF_CANNOTDELETE The existing version of the file could not be deleted.<br>: VIF_CANNOTDELETECUR The existing version of the file could not be deleted and VIFF_DONTDELETEOLD was not specified in the uFlags parameter.<br>: VIF_CANNOTRENAME The temporary file could not be renamed to the name of the existing file. The existing file has already been deleted.<br>: VIF_OUTOFMEMORY Operation failed due to lack of memory. <br>: VIF_CANNOTREADSRC The source file could not be read.<br>: VIF_CANNOTREADDEST The existing destination file cannot be read (thus version information can not be checked).<br>: VIF_BUFFTOOSMALL The TmpFileLen parameter is too small to hold the name of the temporary file.<br>: Platform<p>: Windows 95, Windows NT, Win16<p>: All of the material presented here is copyrighted by either Desaware or Macmillan. No part of this material may be used or reproduced in any fashion (except in brief quotations used in critical articles and reviews) without prior consent.<p>////////////////////////////////////////<br>Thanks a lot!<br>Your help is very useful!<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 15290-->
</ul><!--end: 15290-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -