52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#include "windows.h"
|
|
|
|
__cdecl main(int argc, char **argv)
|
|
{
|
|
char szSystemPath[_MAX_PATH];
|
|
|
|
char szFilename[_MAX_PATH];
|
|
char szCurPath[_MAX_PATH];
|
|
|
|
int len;
|
|
UINT dwFilename = _MAX_PATH;
|
|
DWORD dwstatus;
|
|
|
|
if (GetSystemDirectory(szSystemPath, _MAX_PATH) == 0)
|
|
{
|
|
return (dwstatus = GetLastError());
|
|
}
|
|
|
|
|
|
//Get the path to the install source directory
|
|
if ((len = GetModuleFileName(NULL, szCurPath, _MAX_PATH)) == 0)
|
|
{
|
|
return (dwstatus =GetLastError());
|
|
}
|
|
|
|
while (szCurPath[--len] != '\\')
|
|
continue;
|
|
szCurPath[len+1] = '\0';
|
|
|
|
// install the file to the system directory
|
|
dwstatus = VerInstallFile(0,"DFLAYOUT.DLL", "DFLAYOUT.DLL",
|
|
szCurPath, szSystemPath, szSystemPath,
|
|
szFilename, &dwFilename);
|
|
if (dwstatus)
|
|
{
|
|
return dwstatus;
|
|
}
|
|
|
|
|
|
// install the file to the system directory
|
|
dwFilename = _MAX_PATH;
|
|
dwstatus = VerInstallFile(0,"DFLAYOUT.EXE", "DFLAYOUT.EXE",
|
|
szCurPath, szSystemPath, szSystemPath,
|
|
szFilename, &dwFilename);
|
|
|
|
|
|
return dwstatus;
|
|
|
|
|
|
}
|
|
|